:root {
  --bg: #000000;
  --panel: #1b1e23;
  --panel-strong: #272c33;
  --panel-soft: #111417;
  --text: #ffffff;
  --muted: #aeb6c2;
  --soft: #e5e9f0;
  --accent: #4dd8ff;
  --accent-2: #8affc1;
  --warn: #f7c948;
  --danger: #ff6b6b;
  --rock: #8d949d;
  --rock-light: #c8d0d8;
  --rock-dark: #4a525b;
  --paper: #7bdcff;
  --scissors: #c89bff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

button {
  font: inherit;
}

.app {
  width: min(600px, 100vw);
  height: min(600px, 100vh);
  margin: 0 auto;
  padding: 12px 14px 10px;
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
  gap: 8px;
}

.top-bar {
  min-height: 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

.eyebrow,
.strip-label,
.score-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.1;
}

h1 {
  margin: 2px 0 0;
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0;
}

.status-pill,
.board-week {
  min-width: 86px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(77, 216, 255, 0.42);
  background: rgba(77, 216, 255, 0.12);
  color: var(--accent);
  font-size: 13px;
  text-align: center;
}

.screen {
  min-height: 0;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.menu-screen {
  display: grid;
  grid-template-rows: 50px 116px 58px minmax(0, 1fr);
  gap: 8px;
}

.player-strip,
.board-head {
  min-height: 50px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.strip-value {
  margin: 4px 0 0;
  color: var(--soft);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.hero-icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.hero-icon {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.16), transparent 46%),
    var(--panel-soft);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-icon svg {
  width: 72px;
  height: 72px;
}

.rock-art svg path:first-child,
.move-card[data-move="rock"] svg path:first-child {
  fill: var(--rock);
}

.rock-art svg path:last-child,
.move-card[data-move="rock"] svg path:last-child {
  fill: var(--rock-light);
  opacity: 0.68;
}

.paper-art svg path:first-child,
.move-card[data-move="paper"] svg path:first-child {
  fill: var(--paper);
}

.paper-art svg path,
.move-card[data-move="paper"] svg path {
  stroke: #0b4358;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.paper-art svg path:first-child,
.move-card[data-move="paper"] svg path:first-child {
  stroke-width: 0;
}

.scissors-art svg,
.move-card[data-move="scissors"] svg {
  fill: none;
  stroke: var(--scissors);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scissors-art svg circle,
.move-card[data-move="scissors"] svg circle {
  fill: rgba(200, 155, 255, 0.16);
}

.menu-copy {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.screen-title {
  margin: 0;
  color: var(--text);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.screen-message {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.2;
}

.menu-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.focusable {
  border: 0;
  border-radius: 8px;
  color: var(--text);
  font-size: 21px;
  font-weight: 850;
  letter-spacing: 0;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.menu-option {
  min-height: 54px;
  background: var(--panel-strong);
}

.focusable:focus,
.focusable.is-focused {
  outline: none;
  transform: scale(1.025);
  box-shadow:
    0 0 0 3px var(--accent),
    0 0 25px rgba(77, 216, 255, 0.42);
}

.game-screen {
  display: grid;
  grid-template-rows: 62px 132px 134px 58px;
  gap: 8px;
}

.scoreboard {
  display: grid;
  grid-template-columns: 1fr 128px 1fr;
  align-items: center;
  gap: 8px;
}

.scoreboard > div {
  min-height: 60px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.scoreboard > .round-chip {
  min-height: 58px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid rgba(77, 216, 255, 0.38);
  background: rgba(77, 216, 255, 0.1);
  color: var(--accent);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.score-value {
  margin: 2px 0 0;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.arena {
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 12px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 30%, rgba(77, 216, 255, 0.16), transparent 44%),
    var(--panel-soft);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.phase {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.12;
}

.timer {
  min-height: 48px;
  margin: 2px 0;
  color: var(--text);
  font-size: 45px;
  font-weight: 950;
  line-height: 1;
}

.message {
  width: 100%;
  min-height: 34px;
  margin: 0;
  color: var(--soft);
  font-size: 16px;
  line-height: 1.15;
}

.moves {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.move-card {
  min-width: 0;
  min-height: 134px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: var(--panel);
  color: var(--text);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.move-card svg {
  width: 70px;
  height: 70px;
}

.move-card span {
  max-width: 100%;
  padding: 0 2px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.move-card.is-picked {
  transform: scale(1.04);
  border-color: var(--accent);
  box-shadow: 0 0 22px rgba(77, 216, 255, 0.42);
  background: #12303a;
}

.move-card.is-opponent {
  border-color: var(--warn);
  box-shadow: 0 0 18px rgba(247, 201, 72, 0.34);
}

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
}

.game-action,
.board-action {
  min-height: 58px;
}

.primary {
  background: linear-gradient(180deg, #189fc7, #095a72);
}

.secondary {
  background: var(--panel-strong);
  color: var(--soft);
}

.danger {
  background: linear-gradient(180deg, #b33a49, #6b1722);
}

.leaderboard-screen {
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr) 58px;
  gap: 8px;
}

.board-list {
  margin: 0;
  padding: 0 3px 0 0;
  list-style: none;
  display: grid;
  grid-auto-rows: 50px;
  gap: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.board-row {
  min-height: 50px;
  display: grid;
  grid-template-columns: 34px 1fr 64px 64px;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.board-rank {
  color: var(--accent);
  font-size: 18px;
  font-weight: 900;
}

.board-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 16px;
  font-weight: 850;
}

.board-stat {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.board-stat strong {
  display: block;
  color: var(--soft);
  font-size: 18px;
  line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
  .move-card,
  .focusable {
    transition: none;
  }
}
