/* ═══════════════════════════════════════════════════════════════════
   Chess App — Dark Tech-Demo Theme
   ═══════════════════════════════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  --bg:          #0d0d0f;
  --surface:     #16161a;
  --surface-2:   #1e1e24;
  --surface-3:   #27272f;
  --border:      #2e2e38;
  --text:        #e4e4ed;
  --text-muted:  #6b6b80;
  --text-dim:    #3a3a48;
  --accent:      #7c8fff;
  --accent-dim:  rgba(124, 143, 255, 0.12);
  --accent-glow: rgba(124, 143, 255, 0.25);
  --success:     #4dcc88;
  --danger:      #ff5555;
  --warning:     #ffb347;

  --sq-light:    #e8d5b4;
  --sq-dark:     #9b6b4e;
  --sq-selected: rgba(80, 220, 120, 0.55);
  --sq-valid:    rgba(80, 220, 120, 0.35);
  --sq-last:     rgba(255, 200, 60, 0.38);
  --sq-check:    rgba(255, 55, 55, 0.55);

  --radius:      8px;
  --radius-lg:   14px;
  --shadow:      0 4px 24px rgba(0,0,0,0.45);
  --shadow-sm:   0 2px 8px  rgba(0,0,0,0.3);

  --font-mono:   'JetBrains Mono', 'Fira Mono', ui-monospace, monospace;
  --font-sans:   -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }

/* ════════════════════════════════════════════════════════════════════
   BOARD
   ════════════════════════════════════════════════════════════════════ */

.board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow), 0 0 0 2px var(--border);
  user-select: none;
}

.sq {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: background 0.12s ease;
}

.sq--light { background: var(--sq-light); }
.sq--dark  { background: var(--sq-dark);  }

.sq--selected { background: var(--sq-selected) !important; }
.sq--last-move { background: var(--sq-last) !important; }
.sq--check    { background: var(--sq-check) !important; }

.sq[data-on\:click] { cursor: pointer; }
.sq[data-on\:click]:hover { filter: brightness(1.1); }

/* Valid move dot — hidden by default, shown when parent has sq--valid (applied via data-class) */
.valid-dot {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

.sq--valid .valid-dot { display: flex; }

.valid-dot::after {
  content: '';
  display: block;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: rgba(30, 200, 80, 0.65);
  box-shadow: 0 0 6px rgba(30, 200, 80, 0.5);
  animation: pulse 1.8s ease-in-out infinite;
}

/* Valid move on occupied square — ring instead of dot */
.sq--valid .piece + .valid-dot::after,
.sq--valid:has(.piece) .valid-dot::after {
  width: 88%;
  height: 88%;
  border-radius: 50%;
  background: transparent;
  border: 3px solid rgba(30, 200, 80, 0.6);
  box-shadow: none;
  animation: none;
}

@keyframes pulse {
  0%, 100% { transform: scale(1);    opacity: 0.8; }
  50%       { transform: scale(1.25); opacity: 1;   }
}

/* Piece image */
.piece {
  position: relative;
  z-index: 2;
  width: 88%;
  height: 88%;
  object-fit: contain;
  pointer-events: none;
  transition: transform 0.1s ease;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
}

.sq[data-on\:click]:hover .piece { transform: scale(1.06); }

/* Mini board (lobby thumbnail) */
.board--mini {
  width: 100px;
  height: 100px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.board--mini .sq { cursor: default; }
.board--mini .piece { width: 80%; height: 80%; filter: none; }

/* ════════════════════════════════════════════════════════════════════
   RESULT OVERLAY
   ════════════════════════════════════════════════════════════════════ */

.result-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  cursor: pointer;
  animation: overlay-in 0.35s ease-out;
}

.result-overlay--hidden { display: none; }

@keyframes overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.result-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 56px 36px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow), 0 0 60px rgba(0,0,0,0.5);
  animation: card-in 0.4s cubic-bezier(0.34,1.56,0.64,1);
  text-align: center;
  min-width: 280px;
}

@keyframes card-in {
  from { opacity: 0; transform: scale(0.7) translateY(30px); }
  to   { opacity: 1; transform: none; }
}

.result-card__icon {
  font-size: 3.5rem;
  line-height: 1;
  animation: icon-bounce 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.15s both;
}

@keyframes icon-bounce {
  from { transform: scale(0) rotate(-20deg); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.result-card__title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
}

.result-card__reason {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.result-card__hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 8px;
}

/* Win */
.result-overlay--win .result-card {
  border-color: var(--success);
  box-shadow: var(--shadow), 0 0 60px rgba(0,0,0,0.5), 0 0 40px rgba(77,204,136,0.2);
}
.result-overlay--win .result-card__title { color: var(--success); }
.result-overlay--win .result-card__particles::before,
.result-overlay--win .result-card__particles::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: particles 1.2s ease-out 0.3s both;
}
.result-overlay--win .result-card__particles::before {
  top: 20%; left: 15%;
}
.result-overlay--win .result-card__particles::after {
  top: 25%; right: 18%;
  animation-delay: 0.45s;
}

@keyframes particles {
  from { transform: scale(0); opacity: 1; }
  to   { transform: scale(8); opacity: 0; }
}

/* Loss */
.result-overlay--loss .result-card {
  border-color: var(--danger);
  box-shadow: var(--shadow), 0 0 60px rgba(0,0,0,0.5), 0 0 30px rgba(255,85,85,0.15);
}
.result-overlay--loss .result-card__title { color: var(--danger); }

/* Draw */
.result-overlay--draw .result-card {
  border-color: var(--text-muted);
}
.result-overlay--draw .result-card__title { color: var(--text-muted); }

/* Spectator */
.result-overlay--spectate .result-card__title { color: var(--accent); }

/* ════════════════════════════════════════════════════════════════════
   GAME LAYOUT
   ════════════════════════════════════════════════════════════════════ */

.game-layout {
  display: grid;
  grid-template-columns: 1fr min(580px, 100%) 320px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    ". back   .       ."
    ". board  sidebar .";
  gap: 0 24px;
  min-height: 100vh;
  padding: 20px 0 40px;
  align-items: start;
}

.back-link {
  grid-area: back;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 14px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--text); text-decoration: none; }

.game-board {
  grid-area: board;
  width: 100%;
}

/* ════════════════════════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════════════════════════ */

.sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Player strip */
.player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.player--on-move {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow), 0 0 16px var(--accent-glow);
  animation: your-turn-pulse 2s ease-in-out infinite;
}

@keyframes your-turn-pulse {
  0%, 100% { box-shadow: 0 0 0 1px var(--accent-glow), 0 0 12px var(--accent-glow); }
  50%       { box-shadow: 0 0 0 2px var(--accent-glow), 0 0 24px rgba(124,143,255,0.35); }
}

.player__name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Clocks */
.clock {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.clock--active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.clock--danger {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px rgba(255, 85, 85, 0.25);
  animation: clock-pulse 1s ease-in-out infinite;
}

@keyframes clock-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 85, 85, 0.25); }
  50%       { box-shadow: 0 0 0 3px rgba(255, 85, 85, 0.4); }
}

.clock__time {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.05em;
  min-width: 4.5ch;
  text-align: right;
}

.clock--danger .clock__time { color: var(--danger); }

/* Move history */
.moves {
  flex: 1;
  min-height: 160px;
  max-height: 360px;
  overflow-y: auto;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.moves__empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  margin: auto;
  text-align: center;
}

.move-pair {
  display: grid;
  grid-template-columns: 28px 1fr 1fr;
  gap: 4px;
  align-items: center;
  padding: 3px 4px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  transition: background 0.1s;
  animation: slide-in 0.15s ease-out;
}
.move-pair:hover { background: var(--surface-2); }
.move-pair:last-child { background: var(--accent-dim); }

.move-pair__num { color: var(--text-muted); font-size: 0.75rem; }
.move-pair__w, .move-pair__b { color: var(--text); }
.move-pair__b { color: var(--text-muted); }

@keyframes slide-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* Status line */
.status {
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status__waiting { color: var(--text-muted); }
.status__turn    { color: var(--text); }
.status__result  { color: var(--text); font-weight: 600; flex-wrap: wrap; }
.status__reason  { color: var(--text-muted); font-weight: 400; }

/* Draw offer */
.draw-offer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 0.88rem;
}

/* Controls */
.controls {
  display: flex;
  gap: 8px;
}

/* ════════════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  text-decoration: none;
}

.btn:hover {
  background: var(--surface-3);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0d0d0f;
  font-weight: 600;
}
.btn--primary:hover {
  background: #9aaaff;
  border-color: #9aaaff;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}
.btn--ghost:hover {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
  box-shadow: none;
}

.btn--join    { color: var(--success); border-color: var(--success); }
.btn--join:hover { background: rgba(77, 204, 136, 0.12); box-shadow: 0 0 0 1px rgba(77,204,136,0.3); }

.btn--play    { color: var(--accent); }
.btn--watch   { color: var(--text-muted); }
.btn--review  { color: var(--text-dim); border-color: var(--border); }

.btn--accept  { background: rgba(77,204,136,0.15); border-color: var(--success); color: var(--success); }
.btn--decline { background: rgba(255,85,85,0.12);  border-color: var(--danger);  color: var(--danger);  }
.btn--resign  { border-color: var(--danger); color: var(--danger); }
.btn--resign:hover { background: rgba(255,85,85,0.12); }
.btn--draw    { color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════════════
   LOBBY
   ════════════════════════════════════════════════════════════════════ */

.lobby {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header__icon {
  font-size: 1.6rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(124,143,255,0.4));
}

.header__title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.header__nav { display: flex; align-items: center; gap: 12px; }
.header__user { font-size: 0.88rem; color: var(--text-muted); }

.lobby__content { display: flex; flex-direction: column; gap: 40px; }

.lobby__section {}

.section-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 16px;
}

/* Game card */
.game-card {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  cursor: default;
}

.game-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--accent-glow);
}

/* Status-based card modifiers */
.game-card--active {
  border-left: 3px solid var(--success);
  box-shadow: inset 0 0 24px rgba(77,204,136,0.04), 0 0 0 1px rgba(77,204,136,0.12);
}
.game-card--active:hover {
  border-left-color: var(--success);
  border-color: rgba(77,204,136,0.45);
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(77,204,136,0.4), 0 0 20px rgba(77,204,136,0.08);
}

.game-card--waiting {
  border-left: 3px solid var(--warning);
}
.game-card--waiting:hover {
  border-left-color: var(--warning);
}

.game-card--ended {
  opacity: 0.55;
}
.game-card--ended:hover {
  transform: none;
  box-shadow: none;
}

.game-card__board { flex-shrink: 0; }

.game-card__players {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
}

.game-card__player {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.game-card__vs { color: var(--text-dim); font-size: 0.75rem; flex-shrink: 0; }

.game-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.game-card__time { font-size: 0.78rem; color: var(--text-muted); }

.expiry-warning {
  font-size: 0.7rem;
  color: var(--warning);
  margin-top: 4px;
  opacity: 0.85;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid;
}

.badge--waiting  { color: var(--warning); border-color: rgba(255,179,71,0.35); background: rgba(255,179,71,0.08); }
.badge--active   { color: var(--success); border-color: rgba(77,204,136,0.35); background: rgba(77,204,136,0.08);
                   box-shadow: 0 0 8px rgba(77,204,136,0.15); animation: live-pulse 2.5s ease-in-out infinite; }
.badge--ended    { color: var(--text-muted); border-color: var(--border); }

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(77,204,136,0.15); }
  50%       { box-shadow: 0 0 16px rgba(77,204,136,0.35); }
}

/* Empty state */
.lobby__empty {
  text-align: center;
  padding: 60px 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ════════════════════════════════════════════════════════════════════
   NAME PROMPT
   ════════════════════════════════════════════════════════════════════ */

.name-prompt {
  max-width: 420px;
  margin: 60px auto;
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  text-align: center;
}

.name-prompt__title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.name-prompt__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ════════════════════════════════════════════════════════════════════
   INPUTS
   ════════════════════════════════════════════════════════════════════ */

.input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.input::placeholder { color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════════════
   MODAL
   ════════════════════════════════════════════════════════════════════ */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal[data-show] { display: flex; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), 0 0 0 1px var(--accent-glow);
  animation: modal-in 0.2s ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.modal__header h3 { font-size: 1rem; font-weight: 600; }
.modal__close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}
.modal__close:hover { color: var(--text); }

.modal__body    { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal__footer  { padding: 14px 20px; border-top: 1px solid var(--border); }

.label { font-size: 0.83rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

.radio-group { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }

.radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color 0.15s;
}
.radio:hover { border-color: var(--accent); }
.radio input[type="radio"] { accent-color: var(--accent); }

/* ════════════════════════════════════════════════════════════════════
   TOAST / ERROR
   ════════════════════════════════════════════════════════════════════ */

.toast {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease-out;
  max-width: 340px;
}

.toast[data-show] { display: block; }

.toast--error {
  background: rgba(255, 85, 85, 0.18);
  border: 1px solid var(--danger);
  color: var(--danger);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

/* ════════════════════════════════════════════════════════════════════
   ERROR PAGE
   ════════════════════════════════════════════════════════════════════ */

.error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 60vh;
  text-align: center;
}

.error h1 { font-size: 1.5rem; color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "back"
      "board"
      "sidebar";
    padding: 12px 16px 40px;
    gap: 16px;
  }

  .sidebar { flex-direction: row; flex-wrap: wrap; }
  .moves   { flex: 1 0 100%; min-height: 120px; max-height: 180px; }
  .status  { flex: 1 0 100%; }
  .controls { flex: 1 0 100%; }
}

@media (max-width: 600px) {
  .lobby { padding: 0 12px 40px; }
  .game-grid { grid-template-columns: 1fr; }
  .game-card { grid-template-columns: 80px 1fr auto; }
  .board--mini { width: 80px; height: 80px; }
  .modal__panel { max-width: 100%; }
}

/* ════════════════════════════════════════════════════════════════════
   SCROLLBAR (webkit)
   ════════════════════════════════════════════════════════════════════ */

::-webkit-scrollbar             { width: 6px; height: 6px; }
::-webkit-scrollbar-track       { background: transparent; }
::-webkit-scrollbar-thumb       { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
