/* ===== GROVERS QUANTUM SEARCH — Game Styles ===== */

/* Color palette — light theme: white base, blue primary, yellow accent */
:root {
  --gs-bg:         #ffffff;
  --gs-surface:    #f6f9fd;  /* cards / panels */
  --gs-surface2:   #eaf1fb;  /* recessed / hover fills */
  --gs-border:     #cddcef;
  --gs-accent:     #1f6fd0;  /* primary blue */
  --gs-accent2:    #14508f;  /* darker blue — readable as text on light */
  --gs-yes:        #15803d;
  --gs-no:         #c62828;
  --gs-text:       #14213a;
  --gs-muted:      #5d6d88;
  --gs-quantum:    #f5b301;  /* yellow — fills, borders, highlights */
  --gs-quantum-ink:#8a6100;  /* yellow used as text needs a darker ink on white */
}
.gs-teaser-storyboard.is-playing { display: flex; }

body {
  background: var(--gs-bg);
  color: var(--gs-text);
  font-family: 'Inter', system-ui, sans-serif;
  margin: 0;
  overflow-x: hidden;
}

/* ===== MARKETING / CREATE-GAME SCREEN (shared creategame.template.html) =====
   hub.css supplies only the bare layout skeleton for these shared classes; each
   game is expected to supply the container chrome, hero sizing, and theming.
   Without this block the page renders as unstyled full-bleed text. */
#lobby {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: calc(100vh - 44px);
  overflow-y: auto;
  padding: 0 20px 56px;
  background:
    radial-gradient(ellipse 1100px 600px at 50% 0%, rgba(31, 111, 208, 0.10) 0%, rgba(255, 255, 255, 0) 70%),
    var(--gs-bg);
}

#lobby h1 {
  font-size: 38px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: .7px;
  margin: 0;
  color: var(--gs-accent2);
  text-shadow: none;
  text-decoration-line: underline;
  text-decoration-color: var(--gs-quantum);
  text-decoration-thickness: 4px;
  text-underline-offset: 8px;
}

#lobby .subtitle {
  font-size: 15px;
  line-height: 1.6;
  color: var(--gs-muted);
  margin: 0;
  max-width: 620px;
}

/* Hero video — hub.css leaves this unsized, so it blows out to full width. */
.hero-video-wrap { width: 420px; max-width: 100%; position: relative; display: flex; flex-direction: column; gap: 10px; }
.hero-video-frame { position: relative; width: 100%; height: 0; padding-top: 56.25%; overflow: hidden; border-radius: 16px; }
.hero-video-frame:has(.gs-teaser-captions) {
  background: linear-gradient(135deg, #071a38, #123e75);
}
.hero-video-frame video {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  object-fit: contain; background: #0d1b2e; border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.55), 0 0 0 1px rgba(31, 111, 208,0.22);
}
.hero-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  object-fit: contain; background: #0d1b2e; border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.55), 0 0 0 1px rgba(31, 111, 208,0.22);
}
.hero-poster.is-hidden { display: none; }
.gs-teaser-storyboard {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: linear-gradient(135deg, #071a38, #123e75);
  color: #fff;
}
.gs-teaser-scene { display: none; width: 100%; text-align: center; }
.gs-teaser-scene.is-active { display: block; }
.gs-teaser-scene h2 { margin: 0 0 8px; font-size: 22px; line-height: 1.1; }
.gs-teaser-scene p { margin: 0 auto 14px; max-width: 330px; color: #dbeafe; font-size: 12px; line-height: 1.4; }
.gs-teaser-slots { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin: 14px auto; max-width: 360px; }
.gs-teaser-slot { height: 28px; border: 1px dashed #8db8ee; border-radius: 4px; color: #b8d5f7; font-size: 9px; display: grid; place-items: center; }
.gs-teaser-slot.filled { background: #f5b301; border-style: solid; color: #14213a; font-weight: 800; }
.gs-teaser-number { display: inline-block; padding: 10px 18px; border: 2px solid #f5b301; border-radius: 10px; color: #ffd75a; font-size: 28px; font-weight: 900; }
.gs-teaser-token-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.gs-teaser-token { padding: 7px 10px; border-radius: 7px; background: rgba(255,255,255,.12); border: 1px solid #8db8ee; font-size: 11px; }
.gs-teaser-token.unlocked { background: #f5b301; border-color: #ffd75a; color: #14213a; font-weight: 800; }
.gs-teaser-votes { display: flex; justify-content: center; gap: 12px; margin: 14px 0; }
.gs-teaser-vote { padding: 9px 20px; border-radius: 8px; font-weight: 900; }
.gs-teaser-vote.yes { background: #15803d; }
.gs-teaser-vote.no { background: #c62828; }
.gs-teaser-lead { margin-top: 12px; color: #ffd75a; font-size: 12px; font-weight: 800; }
.gs-teaser-captions { z-index: 4; }
.gs-teaser-captions {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  padding: 18px 16px 48px;
  pointer-events: none;
  background: linear-gradient(to top, rgba(7, 20, 42, .86), transparent 62%);
}
.gs-teaser-caption {
  display: none;
  max-width: 92%;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.8);
}
.gs-teaser-caption.is-active { display: flex; flex-direction: column; gap: 4px; }
.gs-teaser-caption strong { font-size: 20px; line-height: 1.15; }
.gs-teaser-caption span { font-size: 12px; line-height: 1.35; color: #dbeafe; }
.gs-teaser-storyboard .gs-teaser-scene {
  animation: gs-teaser-scene-in .45s ease both;
}
@keyframes gs-teaser-scene-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-controls {
  position: absolute; left: 0; right: 0; bottom: 0; height: 38px; z-index: 2;
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
  border-radius: 0 0 16px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0));
}
.hero-play-btn, .hero-fullscreen-btn {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.95); color: #0d1b2e;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; cursor: pointer; padding: 0;
}
.hero-play-btn:hover, .hero-fullscreen-btn:hover { background: #fff; }
.hero-fullscreen-btn svg { width: 14px; height: 14px; }
.hero-video-frame:fullscreen { padding-top: 0; height: 100%; border-radius: 0; background: #0d1b2e; }
.hero-video-frame:fullscreen video, .hero-video-frame:fullscreen .hero-poster { border-radius: 0; }
.hero-video-frame:fullscreen .hero-controls { border-radius: 0; height: 48px; }

/* Hero meta pills + Beta badge */
.lobby-meta { gap: 12px; }
.lobby-meta-item {
  background: rgba(31, 111, 208, 0.10);
  border: 1px solid rgba(31, 111, 208, 0.28);
  color: var(--gs-accent2);
}
.lobby-hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin-top: 8px; }
.lobby-tutorial-cta {
  background: #e8f1fd;
  border: 2px solid var(--gs-accent);
  border-radius: 10px;
  color: var(--gs-accent2);
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(31, 111, 208, 0.16);
}
.lobby-tutorial-cta:hover {
  background: var(--gs-accent);
  border-color: var(--gs-accent2);
  color: #fff;
  box-shadow: 0 5px 16px rgba(31, 111, 208, 0.28);
}
.lobby-buy-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 18px; border-radius: 999px;
  background: rgba(245, 179, 1, 0.10);
  border: 1px solid rgba(245, 179, 1, 0.45);
  color: var(--gs-quantum-ink); text-decoration: none;
}
.lobby-buy-label { font-size: 12px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; line-height: 1; }

/* Match the shared game-lobby composition used by ClusterFlick: a wide
   desktop hero with the game visual beside the title and play controls. */
@media (min-width: 781px) {
  .lobby-hero {
    flex-direction: row;
    align-items: stretch;
    text-align: left;
    gap: 32px;
  }
  .lobby-hero-text {
    align-items: flex-start;
    flex: 1;
  }
  .hero-video-wrap {
    align-self: stretch;
    flex-shrink: 0;
    min-height: 0;
  }
  .hero-video-frame {
    height: 100%;
    min-height: 0;
    padding-top: 0;
  }
  .lobby-hero-ctas {
    margin-top: auto;
    flex-direction: column;
    align-items: stretch;
  }
  .lobby-tutorial-cta,
  .lobby-buy-btn {
    justify-content: center;
    min-height: 46px;
  }
}

/* Section headings */
.lobby-section-head::before, .lobby-section-head::after {
  background: linear-gradient(to right, transparent, rgba(31, 111, 208,0.28), transparent);
}
.lobby-section-label { color: var(--gs-accent2); }

/* "What you'll learn" strip — hub.css hardcodes 4 columns; Grover's has 3. */
.lo-strip {
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid rgba(31, 111, 208, 0.20);
  background: var(--gs-surface);
}
.lo-item { background: var(--gs-surface); border-right: 1px solid rgba(31, 111, 208, 0.14); }
.lo-item-icon { background: rgba(31, 111, 208, 0.12); border: 1px solid rgba(31, 111, 208, 0.32); color: var(--gs-accent2); }
.lo-item-icon svg { width: 22px; height: 22px; }
.lo-item-title { color: var(--gs-text); letter-spacing: 0.2px; }
.lo-item-desc { color: var(--gs-muted); }

/* Play-now notice */
#play-now-mobile-notice { font-size: 13px; color: var(--gs-muted); text-align: center; margin: 0; }

/* Create / Join cards */
.lobby-card {
  background: var(--gs-surface);
  border: 1px solid rgba(31, 111, 208, 0.22);
  box-shadow: 0 2px 14px rgba(0,0,0,0.45);
}
.lobby-card h3 { color: var(--gs-accent2); margin-bottom: 10px; }
.card-desc { font-size: 12px; color: var(--gs-muted); line-height: 1.45; }
.lobby-card.lobby-card-focus {
  border-color: var(--gs-accent);
  background: linear-gradient(180deg, #e8f1fd 0%, var(--gs-surface) 100%);
}
.lobby-card.lobby-card-focus h3 { color: var(--gs-quantum-ink); }
.lobby-card.lobby-card-focus::before { background: var(--gs-accent); color: #fff; box-shadow: 0 4px 12px rgba(31, 111, 208,0.5); }

/* Invited banner */
.invited-banner {
  background: linear-gradient(135deg, rgba(31, 111, 208,0.18) 0%, rgba(245, 179, 1,0.08) 100%);
  border: 1px solid rgba(31, 111, 208, 0.45);
  box-shadow: 0 4px 20px rgba(31, 111, 208, 0.18);
}
.invited-banner-icon { background: rgba(31, 111, 208,0.18); border: 1px solid rgba(31, 111, 208,0.5); color: var(--gs-quantum-ink); }
.invited-banner-title { color: var(--gs-text); }
.invited-banner-sub { color: var(--gs-muted); }
.invited-banner-code { color: var(--gs-quantum-ink); }
.invited-banner-arrow { color: var(--gs-accent2); }

/* Inputs */
.lobby-input {
  background: #fff;
  border-color: rgba(31, 111, 208, 0.30);
  color: var(--gs-text);
}
.lobby-input::placeholder { color: #93a3ba; }
.lobby-input:focus { border-color: var(--gs-accent); }
.lobby-input.name-input { font-size: 15px; letter-spacing: 0.5px; text-transform: none; }
.lobby-input.name-input::placeholder { letter-spacing: 0.5px; font-size: 14px; }

/* Role pickers */
.role-section-label { color: var(--gs-muted); }
.role-section-label::after { background: var(--gs-border); }
.player-role-box { border-color: var(--gs-border); }
.player-role-box.active { border-color: var(--gs-accent); background: rgba(31, 111, 208, 0.07); }
.role-title { font-size: 13px; font-weight: 700; color: var(--gs-text); }
.color-btn { width: 48px; height: 48px; font-size: 10px; text-shadow: 0 1px 3px rgba(0,0,0,0.55); }
.color-btn.selected { border-color: var(--gs-quantum); box-shadow: 0 0 0 3px rgba(245, 179, 1, 0.28); }

.observer-role-btn { background: #fff; border-color: var(--gs-border); color: var(--gs-muted); }
.observer-role-btn:hover:not(:disabled) { border-color: var(--gs-accent); color: var(--gs-accent2); background: rgba(31, 111, 208,0.08); }
.observer-role-btn.selected {
  border-color: var(--gs-accent); background: rgba(31, 111, 208,0.10); color: var(--gs-accent2);
  box-shadow: 0 0 0 1px rgba(31, 111, 208,0.3), inset 0 0 12px rgba(31, 111, 208,0.10);
}
.obs-role-sub { color: var(--gs-muted); }
.observer-role-btn.selected .obs-role-sub { color: var(--gs-accent2); }
.obs-role-check { border-color: var(--gs-border); }
.obs-role-check svg { opacity: 0; transition: opacity 0.15s; }
.observer-role-btn.selected .obs-role-check svg { opacity: 1; }
.observer-role-btn.selected .obs-role-check { border-color: var(--gs-accent); background: var(--gs-accent); }
.obs-eye-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.obs-eye-lg { width: 20px; height: 20px; }
.obs-eye-sm { width: 14px; height: 14px; }

/* Create / Join buttons */
.btn-create { background: var(--gs-accent); color: #fff; }
.btn-join { background: var(--gs-surface2); color: var(--gs-text); border: 1px solid var(--gs-border); }
.btn-join:hover:not(:disabled) { background: #dbe7f7; }

@media (max-width: 820px) {
  .lobby-hero { text-align: center; gap: 20px; }
  .lobby-hero-text { align-items: center; }
  .hero-video-wrap { margin: 0 auto; }
  #lobby h1 { font-size: 32px; }
  .lo-strip { grid-template-columns: 1fr; }
  .lo-item { border-right: none; border-bottom: 1px solid rgba(31, 111, 208,0.14); }
  .lo-item:last-child { border-bottom: none; }
  .lobby-play-grid { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  #play-now-section .invited-banner,
  #play-now-section .lobby-play-grid { display: none; }
  #play-now-mobile-notice {
    display: block;
    text-align: center;
    background: rgba(31, 111, 208, 0.08);
    border: 1px solid rgba(31, 111, 208, 0.25);
    border-radius: 10px;
    padding: 16px 20px;
    line-height: 1.5;
    max-width: 480px;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  #lobby h1 { font-size: 28px; }
}

/* ===== WAITING ROOM (shared lobby.template.html fragment) =====
   The shared template is injected into every game page, but its styling is
   per-game. Without these rules #waiting inherits only `display:flex` from
   hub.css and collapses every child into a single squished row. */
#waiting {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 20px;
  background: var(--gs-bg);
  padding: 40px 20px;
  box-sizing: border-box;
}
#waiting h2 { font-size: 24px; font-weight: 800; color: var(--gs-accent2); }

.room-code-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gs-muted);
}
.room-code-display {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: 12px;
  color: var(--gs-accent2);
  background: var(--gs-surface);
  padding: 14px 32px;
  border-radius: 14px;
  border: 2px solid var(--gs-quantum);
  user-select: all;
  font-family: 'Share Tech Mono', ui-monospace, monospace;
}
.room-share { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.copy-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--gs-border);
  border-radius: 8px;
  background: var(--gs-surface);
  color: var(--gs-accent2);
  cursor: pointer;
  transition: all 0.15s;
}
.copy-btn:hover { background: var(--gs-surface2); }
.copy-btn.copied { background: var(--gs-accent); color: #fff; border-color: var(--gs-accent); }
.room-hint { font-size: 13px; color: var(--gs-muted); margin-bottom: 8px; }

.player-list { display: flex; flex-direction: column; gap: 8px; min-width: 280px; }
.waiting-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--gs-surface);
  border-radius: 10px;
  border: 1px solid var(--gs-border);
}
.waiting-player-me { border-color: var(--gs-accent) !important; background: #e8f1fd !important; }
.waiting-player-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.waiting-player-name { font-weight: 700; font-size: 15px; }
.you-tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gs-accent2);
  background: rgba(31, 111, 208, 0.15);
  border: 1px solid rgba(31, 111, 208, 0.35);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
}
.host-badge {
  font-size: 11px;
  background: var(--gs-quantum);
  color: #1a1a2e;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
  margin-left: auto;
}

.waiting-observer-section { width: 100%; max-width: 320px; margin-top: 4px; }
.waiting-observer-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gs-accent2);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.waiting-observer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  background: var(--gs-surface2);
  border-radius: 8px;
  border: 1px solid rgba(31, 111, 208, 0.25);
  margin-bottom: 5px;
}
.waiting-observer-row .obs-name { font-size: 13px; color: var(--gs-accent2); flex: 1; }

.bot-toggle {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border: 2px dashed var(--gs-border);
  border-radius: 8px;
  background: transparent;
  color: var(--gs-muted);
  cursor: pointer;
  transition: all 0.15s;
  min-width: 240px;
}
.bot-toggle:hover { border-color: var(--gs-accent); color: var(--gs-accent2); background: rgba(31, 111, 208, 0.08); }
.bot-toggle.active { border-color: var(--gs-accent); border-style: solid; color: var(--gs-accent2); background: rgba(31, 111, 208, 0.12); }

.waiting-actions { display: flex; gap: 10px; }
.waiting-actions button {
  padding: 14px 40px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  transition: all 0.15s;
}
#btn-start-game { background: var(--gs-accent); color: #fff; }
#btn-start-game:hover:not(:disabled) { filter: brightness(1.12); transform: scale(1.02); }
#btn-start-game:disabled { opacity: 0.4; cursor: not-allowed; }
#btn-leave { background: var(--gs-surface); color: var(--gs-muted); border: 1px solid var(--gs-border); }
#btn-leave:hover { background: var(--gs-surface2); color: var(--gs-text); }

.error-msg { color: #f87171; font-size: 14px; min-height: 18px; text-align: center; }

/* ===== GAME LAYOUT ===== */
.gs-screen { display: none; }
.gs-screen.active { display: block; }

.gs-game-layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  height: calc(100vh - 68px);
  gap: 0;
}

/* ===== PLAYERS BAR ===== */
.gs-players-bar-row {
  grid-column: 1 / -1;
  background: var(--gs-surface2);
  border-bottom: 1px solid var(--gs-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  flex-wrap: wrap;
}

.gs-players-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 32px;
}

.gs-players-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gs-players-bar-btn {
  white-space: nowrap;
  font-size: 12px;
  padding: 6px 12px;
}

.gs-player-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--gs-surface);
  border: 1.5px solid var(--gs-border);
  font-size: 13px;
  font-weight: 500;
  position: relative;
}
.gs-player-chip.gs-player-active {
  border-color: var(--gs-accent);
  background: rgba(31, 111, 208, 0.15);
}
.gs-player-chip.gs-player-me { font-weight: 700; }

.gs-player-swatch {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.gs-quantum-badge {
  font-size: 11px;
  background: var(--gs-quantum);
  color: #000;
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 700;
}

.gs-player-dc {
  color: var(--gs-no);
  font-size: 8px;
}

/* ===== MAIN AREA ===== */
.gs-main {
  grid-column: 1;
  overflow: hidden;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(0, 2fr);
  gap: 16px;
  min-height: 0;
}

.gs-main-left,
.gs-main-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.gs-main-left { overflow-x: hidden; }
.gs-main-right { overflow-x: hidden; }

.gs-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gs-muted);
  margin-bottom: 10px;
}

/* ===== TURN STATUS ===== */
.gs-turn-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 5px;
}
.gs-turn-swatch {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gs-round-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(31, 111, 208,.2);
  border: 1px solid var(--gs-accent);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--gs-accent2);
  margin-bottom: 5px;
}

/* ===== BUTTONS ===== */
.gs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--gs-border);
  background: var(--gs-surface2);
  color: var(--gs-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.gs-btn:hover { background: rgba(20,33,58,.06); border-color: var(--gs-accent); }
.gs-btn:disabled { opacity: .45; cursor: default; }
.gs-btn-yes  { background: rgba(21, 128, 61,.15); border-color: var(--gs-yes); color: var(--gs-yes); }
.gs-btn-yes:hover  { background: rgba(21, 128, 61,.25); }
.gs-btn-no   { background: rgba(198, 40, 40,.15);  border-color: var(--gs-no);  color: var(--gs-no);  }
.gs-btn-no:hover   { background: rgba(198, 40, 40,.25); }
.gs-btn-accent { background: rgba(31, 111, 208,.2); border-color: var(--gs-accent); color: var(--gs-accent2); }
.gs-btn-accent:hover { background: rgba(31, 111, 208,.3); }
.gs-btn-measure { background: rgba(245, 179, 1,.15); border-color: var(--gs-quantum); color: var(--gs-quantum-ink); }
.gs-btn-measure:hover { background: rgba(245, 179, 1,.25); }

/* ===== CLUE SECTION ===== */
.gs-clue-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 1fr);
  gap: 12px;
  align-items: start;
}
.gs-clue-box {
  background: rgba(31, 111, 208,.1);
  border: 1.5px solid var(--gs-accent);
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 100px;
}
.gs-clue-main-box {
  min-height: 130px;
}
.gs-clue-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gs-accent2);
  margin-bottom: 6px;
}
.gs-clue-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--gs-text);
}
.gs-clue-notes-box {
  background: rgba(245, 179, 1, .08);
  border: 1.5px solid var(--gs-quantum);
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 130px;
}
.gs-clue-notes {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--gs-border);
  border-radius: 8px;
  background: rgba(255,255,255,.7);
  color: var(--gs-text);
  font: inherit;
  padding: 8px 10px;
  box-sizing: border-box;
}
.gs-clue-notes:focus {
  outline: 2px solid rgba(31, 111, 208,.35);
  border-color: var(--gs-accent);
}
@media (max-width: 780px) {
  .gs-clue-layout {
    grid-template-columns: 1fr;
  }
}

/* ===== HERO (turn status + You + clue + notes) ===== */
.gs-hero {
  background: var(--gs-surface);
  border: 2px solid var(--gs-accent);
  border-radius: 14px;
  padding: 12px 14px;
}
.gs-hero-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.gs-hero-phase {
  font-size: 11px;
  color: var(--gs-muted);
  font-weight: 600;
}
.gs-hero-turn-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--gs-text);
  margin-bottom: 4px;
}
.gs-hero-turn-status .gs-turn-swatch {
  width: 13px; height: 13px;
}
.gs-hero-turn-actions {
  margin-bottom: 8px;
}
.gs-hero-turn-actions .gs-turn-tip {
  font-size: 12px;
}
.gs-hero-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gs-hero-you {
  background: rgba(31, 111, 208,.1);
  border: 1.5px solid var(--gs-accent);
  border-radius: 10px;
  padding: 8px 10px;
}
.gs-hero-you-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.gs-hero-you-swatch {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #888;
  border: 2px solid rgba(255,255,255,.6);
  box-shadow: 0 0 0 1.5px var(--gs-accent);
}
.gs-hero-you-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--gs-accent2);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.gs-hero-you-clue {
  font-size: 13px;
  line-height: 1.35;
  color: var(--gs-text);
  font-weight: 600;
}
.gs-hero-notes {
  background: rgba(245, 179, 1, .08);
  border: 1.5px solid var(--gs-quantum);
  border-radius: 10px;
  padding: 8px 10px;
}

/* "What We Know" — public entanglement clue, folded into the You box */
.gs-hero-known-divider {
  margin-top: 2px;
  padding-top: 6px;
  border-top: 1px dashed rgba(245, 179, 1, .5);
}
.gs-hero-known-icon {
  font-size: 12px;
}

/* Per-player collapsible notes */
.gs-player-notes-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.gs-player-note-row {
  border: 1px solid var(--gs-border);
  border-radius: 7px;
  background: rgba(255,255,255,.6);
  overflow: hidden;
}
.gs-player-note-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  cursor: pointer;
  user-select: none;
}
.gs-player-note-header:hover {
  background: rgba(31, 111, 208,.06);
}
.gs-player-note-caret {
  font-size: 10px;
  color: var(--gs-muted);
  width: 10px;
  flex-shrink: 0;
}
.gs-player-note-swatch {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,.6);
}
.gs-player-note-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--gs-text);
}
.gs-player-note-row .gs-clue-notes {
  display: block;
  min-height: 50px;
  margin: 0 8px 8px;
  width: calc(100% - 16px);
}
.gs-player-note-row.gs-note-collapsed .gs-clue-notes {
  display: none;
}

/* ===== GATE CARD PLAYED AREA ===== */
.gs-cards-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.gs-cards-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--gs-accent2);
}

.gs-cards-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
}
.gs-gate-slot {
  min-width: 0;
  min-height: 150px;
  border: 2px dotted #b9c4d4;
  border-radius: 8px;
  background: rgba(148,163,184,.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #94a3b8;
}
.gs-gate-slot-number {
  font-size: 10px;
  font-weight: 700;
}
.gs-gate-slot-dots {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #cbd5e1;
}

/* Individual gate card (portrait layout) */
.gs-gate-card {
  background: var(--gs-surface);
  border: 2px solid var(--gs-border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 150px;
  min-width: 0;
}
.gs-gate-card.gs-card-focused {
  border-color: var(--gs-quantum);
  box-shadow: 0 0 0 3px rgba(245, 179, 1, .18);
}
.gs-gate-card.gs-card-pending {
  border-color: var(--gs-accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 208,.25);
}

.gs-card-focus-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 6px 6px;
  border-top: 1px solid var(--gs-border);
  background: rgba(245, 179, 1, .06);
  cursor: pointer;
  transition: background-color .12s;
}
.gs-card-focus-row:hover { background: rgba(245, 179, 1, .14); }
.gs-card-focus-row.gs-focus-mine {
  background: rgba(245, 179, 1, .25);
}
.gs-focus-rows-locked .gs-card-focus-row {
  opacity: .4;
  pointer-events: none;
  filter: grayscale(.5);
}
.gs-card-focus-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--gs-quantum-ink);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.gs-focus-tokens {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px;
  min-height: 14px;
}
.gs-focus-token {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(20,33,58,.22);
  flex-shrink: 0;
}

/* "?" no-focus-set area, mirrors the estimate board's unknown row */
.gs-focus-hint {
  font-size: 11px;
  color: var(--gs-muted);
  margin-bottom: 5px;
}
.gs-focus-locked-note,
.gs-conf-locked-note {
  font-size: 11px;
  color: #9a6b00;
  background: #fff8e6;
  border: 1px solid #f3d78a;
  border-radius: 6px;
  padding: 4px 8px;
  margin-bottom: 6px;
  font-weight: 600;
}
.gs-locked {
  opacity: .45;
  pointer-events: none;
  filter: grayscale(.4);
}
.gs-tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: transparent; /* dimming comes from the highlight's own spotlight shadow below */
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 16px;
  pointer-events: none; /* let page scroll/interaction pass through; card re-enables it */
}
.gs-tutorial-card {
  width: min(380px, 100%);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .35);
  padding: 18px;
  pointer-events: auto;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.gs-tutorial-kicker {
  color: #6d28d9;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.gs-tutorial-card h3 {
  margin: 5px 0 8px;
  color: #17233b;
  font-size: 20px;
}
.gs-tutorial-card p {
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.55;
}
.gs-tutorial-hint {
  margin: 12px 0 0;
  padding: 8px 10px;
  background: #f5f3ff;
  border: 1px dashed #a78bfa;
  border-radius: 8px;
  color: #6d28d9;
  font-size: 13px;
  font-weight: 700;
}
.gs-tutorial-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
}
.gs-tutorial-card.gs-tutorial-complete {
  text-align: center;
}
.gs-tutorial-card.gs-tutorial-complete h3 {
  font-size: 24px;
}
.gs-tutorial-actions #gs-tutorial-back {
  margin-right: auto;
}
.gs-tutorial-highlight {
  position: relative;
  z-index: 1210;
  outline: 3px solid #a78bfa;
  outline-offset: 5px;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, .18), 0 0 24px rgba(124, 58, 237, .45);
}
#gs-tutorial-rotate-notice {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: rgba(248, 250, 252, .98);
  color: var(--gs-accent2);
}
#gs-tutorial-rotate-notice p {
  max-width: 280px;
  margin: 0;
  color: var(--gs-text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}
.gs-rotate-icon {
  font-size: 48px;
  line-height: 1;
  animation: gs-tutorial-rotate-hint 1.6s ease-in-out infinite;
}
@keyframes gs-tutorial-rotate-hint {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-90deg); }
}
.gs-focus-unknown {
  background: var(--gs-surface2);
  border: 1px solid var(--gs-border);
  border-radius: 7px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  color: var(--gs-muted);
  margin-bottom: 8px;
  transition: border-color .12s;
}
.gs-focus-unknown:hover { border-color: var(--gs-quantum); }
.gs-focus-unknown.gs-focus-mine {
  border-color: var(--gs-quantum);
  background: rgba(245, 179, 1, .18);
  color: var(--gs-quantum-ink);
}

/* YES section (top half of card) */
.gs-card-yes {
  flex: 1;
  background: rgba(21, 128, 61,.08);
  border-bottom: 1px solid rgba(21, 128, 61,.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 4px 2px 3px;
  min-height: 42px;
}
.gs-card-yes-label {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--gs-yes);
  text-transform: uppercase;
  margin-bottom: 3px;
}

/* Card center info */
.gs-card-center {
  padding: 4px;
  text-align: center;
  background: var(--gs-surface2);
  border-top: 1px solid var(--gs-border);
  border-bottom: 1px solid var(--gs-border);
}
.gs-card-number {
  font-size: 15px;
  font-weight: 900;
  color: var(--gs-text);
  line-height: 1;
}
.gs-card-binary {
  font-size: 7px;
  font-family: 'Courier New', monospace;
  color: var(--gs-muted);
  letter-spacing: .05em;
  margin-top: 1px;
}

/* NO section (bottom half of card) */
.gs-card-no {
  flex: 1;
  background: rgba(198, 40, 40,.07);
  border-top: 1px solid rgba(198, 40, 40,.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 3px 2px 4px;
  min-height: 42px;
}
.gs-card-no-label {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--gs-no);
  text-transform: uppercase;
  margin-top: 3px;
}

/* Token dots on cards */
.gs-card-tokens {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
  min-height: 16px;
}
.gs-card-token {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(20,33,58,.28);
  display: inline-block;
  flex-shrink: 0;
}

/* Round label on card */
.gs-card-round-badge {
  font-size: 8px;
  color: var(--gs-muted);
  text-align: center;
  padding: 1px 0;
  background: var(--gs-surface);
}

/* ===== PENDING CARD (active voting area) ===== */
.gs-pending-area {
  background: rgba(31, 111, 208,.08);
  border: 2px solid var(--gs-accent);
  border-radius: 12px;
  padding: 10px 12px;
}
.gs-pending-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--gs-accent2);
  margin-bottom: 8px;
}
.gs-pending-card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.gs-pending-card-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.gs-pending-number {
  font-size: 30px;
  font-weight: 900;
  color: var(--gs-text);
  line-height: 1;
}
.gs-pending-binary {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: var(--gs-accent2);
  letter-spacing: .08em;
}
.gs-vote-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.gs-auto-vote {
  flex: 1 1 100%;
  border-radius: 8px;
  padding: 6px 10px;
  border: 1px solid var(--gs-border);
  background: var(--gs-surface2);
}
.gs-auto-vote.is-yes { border-color: var(--gs-yes); background: rgba(21, 128, 61,.10); }
.gs-auto-vote.is-no  { border-color: var(--gs-no);  background: rgba(198, 40, 40,.10); }
.gs-auto-vote-verdict {
  font-size: 12px;
  font-weight: 800;
}
.gs-auto-vote.is-yes .gs-auto-vote-verdict { color: var(--gs-yes); }
.gs-auto-vote.is-no  .gs-auto-vote-verdict { color: var(--gs-no); }
.gs-auto-vote-note {
  font-size: 11px;
  color: var(--gs-muted);
  margin-top: 2px;
}

/* ===== HAND ===== */
.gs-hand-area {
  background: var(--gs-surface);
  border: 1px solid var(--gs-border);
  border-radius: 10px;
  padding: 10px 12px;
}
.gs-hand-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gs-muted);
  margin-bottom: 6px;
}
.gs-hand-cards {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.gs-hand-card {
  background: var(--gs-surface2);
  border: 2px solid var(--gs-border);
  border-radius: 8px;
  padding: 6px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color .12s, transform .1s;
  min-width: 56px;
}
.gs-hand-card:hover {
  border-color: var(--gs-accent);
  transform: translateY(-2px);
}
.gs-hand-card.gs-card-selected {
  border-color: var(--gs-accent);
  background: rgba(31, 111, 208,.15);
  transform: translateY(-3px);
}
.gs-hand-card-num {
  font-size: 18px;
  font-weight: 900;
  color: var(--gs-text);
  line-height: 1;
}
.gs-hand-card-bin {
  font-family: 'Courier New', monospace;
  font-size: 8px;
  color: var(--gs-muted);
  letter-spacing: .04em;
  margin-top: 2px;
}
.gs-hand-note {
  font-size: 11px;
  color: var(--gs-muted);
  font-style: italic;
}

/* Clue match indicator on hand card */
.gs-hand-card-match { border-color: var(--gs-yes) !important; }
.gs-hand-card-nomatch { opacity: .6; }
.gs-hand-card-match .gs-hand-card-num { color: var(--gs-yes); }

/* ===== CENTRAL BOARD ===== */
.gs-central-board {
  background: var(--gs-surface);
  border: 1px solid var(--gs-border);
  border-radius: 12px;
  padding: 10px 12px;
}
.gs-board-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--gs-accent2);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .07em;
}

/* Confidence row */
.gs-conf-row {
  margin-bottom: 8px;
}
.gs-conf-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gs-muted);
  margin-bottom: 5px;
}
.gs-conf-sections {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.gs-conf-section {
  background: var(--gs-surface2);
  border: 1.5px solid var(--gs-border);
  border-radius: 7px;
  padding: 4px 4px;
  text-align: center;
  cursor: pointer;
  transition: border-color .12s;
  min-height: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
}
.gs-conf-section:hover { border-color: var(--gs-accent); }
.gs-conf-section.gs-section-mine { border-color: var(--gs-accent); background: rgba(31, 111, 208,.12); }
.gs-conf-section-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gs-muted);
}
.gs-conf-tokens {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  min-height: 13px;
}
.gs-conf-token {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(20,33,58,.22);
}

/* Estimate board */
.gs-estimate-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gs-muted);
  margin-bottom: 5px;
}
.gs-estimate-row {
  margin-bottom: 6px;
}
.gs-estimate-row-label {
  font-size: 9px;
  color: var(--gs-muted);
  margin-bottom: 2px;
}

/* Range group row */
.gs-est-tenths {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}
/* Number row */
.gs-est-numbers {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 1px;
  margin-bottom: 3px;
}

.gs-est-cell {
  background: var(--gs-surface2);
  border: 1px solid var(--gs-border);
  border-radius: 4px;
  padding: 2px 2px;
  text-align: center;
  cursor: pointer;
  font-size: 8px;
  color: var(--gs-muted);
  font-weight: 600;
  min-height: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
  transition: border-color .1s;
}
.gs-est-cell:hover { border-color: var(--gs-accent); }
.gs-est-cell.gs-est-mine { border-color: var(--gs-accent); background: rgba(31, 111, 208,.12); }
.gs-est-tokens {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1px;
}
.gs-est-token {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(20,33,58,.16);
}
.gs-est-q-label { font-size: 8px; color: var(--gs-muted); }

/* "?" start position */
.gs-est-unknown {
  background: var(--gs-surface2);
  border: 1px solid var(--gs-border);
  border-radius: 4px;
  padding: 3px 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  color: var(--gs-muted);
  margin-bottom: 4px;
}
.gs-est-unknown:hover { border-color: var(--gs-accent); }
.gs-est-unknown.gs-est-mine { border-color: var(--gs-accent); background: rgba(31, 111, 208,.12); color: var(--gs-accent2); }

/* ===== LOG ===== */
.gs-log-body {
  max-height: 200px;
  overflow-y: auto;
  font-size: 12px;
  color: var(--gs-muted);
}
.gs-log-entry {
  padding: 3px 0;
  border-bottom: 1px solid rgba(20,33,58,.08);
  line-height: 1.4;
}

/* ===== MODALS ===== */
.gs-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.gs-modal {
  background: var(--gs-surface);
  border: 1.5px solid var(--gs-border);
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 460px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.gs-modal h3 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
  color: var(--gs-text);
}
.gs-modal p {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--gs-muted);
  line-height: 1.5;
}
.gs-modal-btns {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.gs-modal-icon {
  font-size: 36px;
  text-align: center;
  margin-bottom: 12px;
}

/* ===== GAME OVER ===== */
.gs-gameover-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.gs-gameover-card {
  background: var(--gs-surface);
  border: 2px solid var(--gs-accent);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  max-width: 440px;
  width: 90%;
}
.gs-gameover-icon  { font-size: 52px; margin-bottom: 12px; }
.gs-gameover-title { font-size: 28px; font-weight: 900; color: var(--gs-text); margin-bottom: 8px; }
.gs-gameover-sub   { font-size: 14px; color: var(--gs-muted); margin-bottom: 20px; line-height: 1.5; }
.gs-answer-block   { margin-bottom: 24px; }
.gs-answer-label   { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--gs-muted); margin-bottom: 6px; }
.gs-answer-number  { font-size: 52px; font-weight: 900; color: var(--gs-accent2); line-height: 1; }
.gs-answer-binary  { font-family: 'Courier New', monospace; font-size: 14px; color: var(--gs-muted); letter-spacing: .08em; margin-top: 4px; }

/* ===== HTP (HOW TO PLAY) ===== */
.gs-htp-body { font-size: 13px; line-height: 1.6; max-height: 60vh; overflow-y: auto; }
.gs-htp-body h4 { margin: 14px 0 4px; font-size: 14px; font-weight: 800; color: var(--gs-accent2); }
.gs-htp-body p  { margin: 0 0 10px; color: var(--gs-muted); }
.gs-htp-body ul, .gs-htp-body ol { padding-left: 20px; margin: 0 0 10px; color: var(--gs-muted); }
.gs-htp-body li { margin-bottom: 4px; }
.gs-htp-highlight {
  background: rgba(31, 111, 208,.15);
  border-left: 3px solid var(--gs-accent);
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  margin: 10px 0;
  font-weight: 600;
  color: var(--gs-text);
}

/* ===== VOTING PHASE ===== */
.gs-voting-area {
  background: rgba(245, 179, 1,.08);
  border: 2px solid var(--gs-quantum);
  border-radius: 14px;
  padding: 16px;
}
.gs-voting-header {
  font-size: 15px;
  font-weight: 800;
  color: var(--gs-quantum-ink);
  margin-bottom: 10px;
}
.gs-voting-note {
  font-size: 12px;
  color: var(--gs-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .gs-game-layout { height: auto; min-height: 100vh; }
  .gs-main {
    grid-template-columns: 1fr;
    overflow: visible;
    height: auto;
  }
  .gs-main-left, .gs-main-right {
    overflow-y: visible;
  }
  .gs-cards-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .gs-players-bar-row {
    flex-direction: column;
    align-items: stretch;
  }
  .gs-players-bar-actions {
    justify-content: stretch;
  }
  .gs-players-bar-btn { flex: 1; }
  .gs-main { min-height: 0; }
  .gs-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== TURN TIP ===== */
.gs-turn-tip {
  font-size: 12px;
  color: var(--gs-muted);
  background: rgba(20,33,58,.04);
  border-radius: 6px;
  padding: 8px 10px;
  line-height: 1.5;
  margin-bottom: 8px;
}

/* ===== CANCEL BUTTON (header) ===== */
#nav-game-btns {
  display: flex;
  gap: 8px;
}
#btn-cancel-game {
  background: rgba(198, 40, 40,.15);
  border: 1px solid var(--gs-no);
  color: var(--gs-no);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
#btn-cancel-game:hover { background: rgba(198, 40, 40,.25); }

/* All Possible Clues reference modal � list + expandable examples */
.gs-clueref-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.gs-clueref-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 10px;
}
.gs-clueref-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.gs-clueref-item-text {
  font-size: 12.5px;
  color: #1e293b;
  font-weight: 600;
}
.gs-clueref-more-btn {
  flex-shrink: 0;
  background: #eef4fc;
  border: 1px solid #bcd6f2;
  color: #14508f;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.gs-clueref-more-btn:hover { background: #dcebfb; }
.gs-clueref-item-detail {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
}
.gs-clueref-examples {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gs-clueref-example {
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11.5px;
}
.gs-clueref-example-yes { background: rgba(43,138,62,.08); border: 1px solid rgba(43,138,62,.3); }
.gs-clueref-example-no  { background: rgba(198,40,40,.08); border: 1px solid rgba(198,40,40,.3); }
.gs-clueref-example-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}
.gs-clueref-example-badge {
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .02em;
}
.gs-clueref-example-badge.yes { color: #2b8a3e; }
.gs-clueref-example-badge.no  { color: #c62828; }
.gs-clueref-example-card {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 800;
  font-family: 'Courier New', monospace;
  color: #14508f;
}
.gs-clueref-example-bin {
  font-weight: 600;
  color: #64748b;
  font-size: 10.5px;
}
.gs-clueref-example-why {
  color: #475569;
}

/* =====================================================================
   TUTORIAL PHASE 0 — QUANTUM CONCEPT PRIMER (full-screen, precedes the
   in-game step-by-step tutorial). Mirrors ClusterFlick's cft-intro pattern
   but themed to Grover's light blue/yellow palette.
   ===================================================================== */
#gs-primer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 34, .82);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
body.gs-primer-active #gs-primer { display: flex; }
#gsp-card {
  background: var(--gs-surface);
  border: 1.5px solid var(--gs-border);
  border-radius: 16px;
  padding: 32px 36px 26px;
  max-width: 780px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
.gsp-header { display: flex; flex-direction: column; gap: 8px; }
.gsp-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--gs-accent2);
  text-transform: uppercase;
  letter-spacing: 1.1px;
}
.gsp-progress {
  width: 100%;
  height: 4px;
  background: var(--gs-surface2);
  border-radius: 4px;
  overflow: hidden;
}
#gsp-prog-fill { height: 100%; background: var(--gs-accent); border-radius: 4px; transition: width .35s; }
#gsp-title { font-size: 22px; font-weight: 900; color: var(--gs-text); line-height: 1.2; margin-top: 2px; }
#gsp-body { font-size: 14px; color: var(--gs-muted); line-height: 1.7; }
#gsp-body strong { color: var(--gs-text); }
#gsp-body em { color: var(--gs-accent2); font-style: normal; font-weight: 700; }
#gsp-body p { margin: 0 0 12px; }
#gsp-body p:last-child { margin-bottom: 0; }
.gsp-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 2px; }
#gsp-exit {
  padding: 7px 16px;
  border: 1px solid var(--gs-border);
  border-radius: 7px;
  background: transparent;
  color: var(--gs-muted);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
}
#gsp-exit:hover { color: var(--gs-text); border-color: var(--gs-accent); }
#gsp-next {
  padding: 12px 30px;
  background: var(--gs-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: filter .12s;
  box-shadow: 0 4px 16px rgba(31,111,208,.4);
}
#gsp-next:hover { filter: brightness(1.08); }

/* Concept "vs" comparison box (classical vs quantum) */
.gsp-compare-box { display: flex; gap: 14px; margin: 14px 0; }
.gsp-compare-side { flex: 1; border-radius: 10px; padding: 14px 16px; }
.gsp-compare-side.classical { background: var(--gs-surface2); border: 1px solid var(--gs-border); }
.gsp-compare-side.quantum   { background: rgba(245,179,1,.1); border: 1px solid rgba(245,179,1,.4); }
.gsp-compare-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 6px; }
.gsp-compare-side.classical .gsp-compare-label { color: var(--gs-accent2); }
.gsp-compare-side.quantum   .gsp-compare-label { color: var(--gs-quantum-ink); }
.gsp-compare-text { font-size: 12px; color: var(--gs-muted); line-height: 1.6; }
.gsp-compare-text strong { color: var(--gs-text); }

/* Concept chips (topic pills) */
.gsp-concept-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.gsp-concept-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--gs-surface2);
  border: 1px solid var(--gs-border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--gs-accent2);
  font-weight: 700;
}
.gsp-concept-chip.gsp-chip-soon { opacity: .6; }
.gsp-concept-chip .gspi { font-size: 15px; }

/* Game-mapping rows on the final primer slide */
.gsp-map { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.gsp-map-header {
  display: grid; grid-template-columns: minmax(120px,  .7fr) 1.8fr; gap: 12px;
  padding: 0 14px 2px; color: var(--gs-accent2); font-size: 11px;
  font-weight: 800; letter-spacing: .7px; text-transform: uppercase;
}
.gsp-map-row {
  display: grid; grid-template-columns: minmax(120px, .7fr) 1.8fr; gap: 12px;
  padding: 9px 14px;
  background: var(--gs-surface2);
  border: 1px solid var(--gs-border);
  border-radius: 8px;
  font-size: 13px;
}
.gsp-map-concept { color: var(--gs-accent2); }
.gsp-map-right { color: var(--gs-muted); }
.gsp-map-row.gsp-map-soon .gsp-map-right { font-style: italic; }
.gsp-soon-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245,179,1,.18);
  border: 1px solid rgba(245,179,1,.5);
  color: var(--gs-quantum-ink);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* "Before You Play" section checkboxes (reused row styling) */
.gsp-section-row {
  display: flex; align-items: flex-start; gap: 12px;
  border-radius: 10px;
  padding: 11px 14px;
  cursor: pointer;
  user-select: none;
  transition: background .15s, border-color .15s;
}
.gsp-section-row.on  { background: rgba(31,111,208,.08); border: 1.5px solid var(--gs-accent); }
.gsp-section-row.off { background: var(--gs-surface2); border: 1.5px solid var(--gs-border); }
.gsp-section-check {
  flex-shrink: 0; width: 20px; height: 20px;
  border-radius: 5px;
  margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.gsp-section-row.on  .gsp-section-check { border: 2px solid var(--gs-accent); background: var(--gs-accent); }
.gsp-section-row.off .gsp-section-check { border: 2px solid var(--gs-border); background: transparent; }
.gsp-section-title { font-size: 13px; font-weight: 800; color: var(--gs-text); line-height: 1.3; }
.gsp-section-sub   { font-size: 11px; color: var(--gs-muted); margin-top: 3px; line-height: 1.4; }
.gsp-section-error {
  background: rgba(198,40,40,.08);
  border: 1.5px solid var(--gs-no);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--gs-no);
  font-weight: 700;
  display: flex; align-items: center; gap: 7px;
}

@media (max-width: 640px) {
  .gsp-map-header, .gsp-map-row { grid-template-columns: 1fr; gap: 4px; }
  #gsp-card { padding: 22px 18px 18px; }
  #gsp-title { font-size: 18px; }
  .gsp-compare-box { flex-direction: column; }
}

/* Tutorial-only mobile support. Landscape phones need the board and action
   columns visible together; portrait phones get a clear rotate prompt. */
@media (max-width: 900px) {
  body.gs-tutorial-active header { display: none !important; }
  body.gs-tutorial-active #game { height: 100vh; height: 100dvh; }
}
@media (max-height: 500px) {
  body.gs-tutorial-active header { display: none !important; }
  body.gs-tutorial-active #game { height: 100vh; height: 100dvh; }
  body.gs-tutorial-active .gs-game-layout {
    height: 100%;
    min-height: 0;
  }
  body.gs-tutorial-active .gs-main {
    grid-template-columns: minmax(220px, 1fr) minmax(0, 1.35fr);
    gap: 8px;
    padding: 8px;
    overflow: hidden;
  }
  body.gs-tutorial-active .gs-main-left,
  body.gs-tutorial-active .gs-main-right {
    overflow-y: auto;
    gap: 6px;
  }
  body.gs-tutorial-active .gs-players-bar-row {
    min-height: 0;
    padding: 5px 8px;
    gap: 6px;
  }
  body.gs-tutorial-active .gs-player-chip {
    padding: 3px 7px;
    font-size: 11px;
  }
  body.gs-tutorial-active .gs-tutorial-overlay { padding: 8px; }
  body.gs-tutorial-active .gs-tutorial-card {
    width: min(310px, 48vw);
    max-height: calc(100dvh - 16px);
    padding: 12px;
  }
  body.gs-tutorial-active .gs-tutorial-card h3 { font-size: 17px; }
  body.gs-tutorial-active .gs-tutorial-card p { font-size: 12px; line-height: 1.4; }
  body.gs-tutorial-active .gs-tutorial-actions { margin-top: 10px; }
}
@media (max-width: 900px) and (orientation: portrait) {
  body.gs-tutorial-active #gs-tutorial-rotate-notice { display: flex; }
}
