:root {
  --bg: #0f0c07;
  --panel: #1e180f;
  --line: #3d3119;
  --ink: #f6efe0;
  --muted: #b0a180;
  --accent: #f5c542;
  --accent-ink: #1a1405;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #41330f 0%, var(--bg) 60%);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.city-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: rgba(15, 12, 7, 0.85);
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.city-link { color: var(--accent); text-decoration: none; }
.city-link:hover { text-decoration: underline; }
.biz-name { color: var(--muted); }
.practice-badge {
  margin-left: auto;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.75rem;
}

.table {
  flex: 1;
  width: min(94vw, 38rem);
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
  text-align: center;
}
h1 { margin: 0.5rem 0 0.25rem; font-size: 1.8rem; }
.sub { color: var(--muted); margin: 0 0 1.25rem; font-size: 0.95rem; }
.sub code { background: var(--panel); padding: 0 0.3rem; border-radius: 0.3rem; }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  color: var(--muted);
}
legend { padding: 0 0.3rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
label { margin: 0 0.5rem 0 0; color: var(--ink); cursor: pointer; }

button {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 0.5rem;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.5; cursor: default; }

.status { min-height: 1.4rem; font-weight: 600; margin: 0.75rem 0; }

.scores {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.player {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.4rem 1rem;
  display: flex;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.player.active { border-color: var(--accent); color: var(--ink); }
.player .points { font-weight: 700; color: var(--ink); }

.dice {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin: 1.25rem 0;
  flex-wrap: wrap;
  min-height: 3.5rem;
}
.die {
  width: clamp(2.8rem, 10vw, 3.8rem);
  aspect-ratio: 1;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 0.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  padding: 0;
}
.die .face { font-size: 1.5rem; line-height: 1; }
.die .value { font-size: 0.7rem; color: var(--muted); }
.die.held { border-color: #6ee7a0; opacity: 0.75; cursor: default; }
.die.chosen { border-color: var(--accent); background: #2c2410; }
.die:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.fresh { color: var(--muted); align-self: center; }

.actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.turn { color: var(--muted); font-size: 0.95rem; }

.rules {
  color: var(--muted);
  font-size: 0.82rem;
  max-width: 30rem;
  margin: 1.5rem auto 0;
  line-height: 1.5;
}

.api-note {
  margin-top: 2rem;
  text-align: left;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}
.api-note pre {
  background: #0c0906;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.75rem;
  overflow-x: auto;
  color: var(--ink);
}
.api-note a { color: var(--accent); }

.footer {
  border-top: 1px solid var(--line);
  padding: 0.9rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}
.footer a { color: var(--accent); }

.pvp-link {
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
