/* ==========================================================================
   SpellBee Duel - "honey on midnight". Dark-only. Honey gold is you (and the
   center letter); your opponent is a neutral silver. Components only use the
   tokens below.
   ========================================================================== */

* { box-sizing: border-box; }

:root {
  /* Surfaces */
  --bg: #06070b;
  --card-bg: #0d1017;
  --card-alt: #151925;
  --surface-3: #1c2131;
  --modal-bg: #0d1017;

  /* Text */
  --text-primary: #f3f5fa;
  --text-secondary: #98a2b8;
  --text-muted: #5b6478;

  /* Lines */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.18);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --overlay-hover: rgba(255, 255, 255, 0.05);

  /* You: honey */
  --me: #ffb21e;
  --me-light: #ffd760;
  --me-soft: rgba(255, 178, 30, 0.12);
  --me-glow: rgba(255, 178, 30, 0.38);
  --honey: #ffb21e;
  --honey-text: var(--honey); /* solid gold used for headline text */
  --on-honey: #1a1205;

  /* Opponent: neutral silver */
  --opp: #c9d0dc;
  --opp-soft: rgba(255, 255, 255, 0.07);
  --on-opp: #0b0d12;

  /* Status */
  --online: #34d399;
  --danger: #ff5c6c;
  --danger-text: #ffd3d8;

  /* Theme-specific bits that aren't plain surfaces */
  color-scheme: dark;
  --glow-top: rgba(255, 178, 30, 0.11);
  --glow-corner: rgba(140, 150, 180, 0.05);
  --navbar-bg: rgba(14, 17, 25, 0.94);
  --backdrop: rgba(3, 4, 8, 0.7);
  --track: rgba(255, 255, 255, 0.07);
  --track-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
  --hex-fill: url(#hex-cell);
  --hex-stroke: rgba(255, 255, 255, 0.08);
  --tooltip-bg: #1c2131;

  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 7px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.55);
  --shadow-modal: 0 30px 90px rgba(0, 0, 0, 0.75);

  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font);
  --navbar-height: 3.6rem;
  --content-width: 500px;
}


html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-primary);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 480px at 50% -140px, var(--glow-top), transparent 70%),
    radial-gradient(700px 520px at 105% 110%, var(--glow-corner), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}


a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
html, button, a, svg { touch-action: manipulation; } /* no double-tap zoom */
::selection { background: var(--me); color: var(--on-honey); }
:focus-visible { outline: 2px solid var(--me); outline-offset: 2px; }

/* Scrollbars: thin, rounded, quiet until hovered - page and inner lists alike */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border: 3px solid transparent; /* inset the thumb so it reads as a slim pill */
  border-radius: 999px;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.28); }
::-webkit-scrollbar-corner { background: transparent; }
html { scrollbar-color: rgba(255, 255, 255, 0.18) var(--bg); }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------------------------------------------------------------------- */
/* Shared bits                                                             */
/* ---------------------------------------------------------------------- */

.btn {
  display: inline-block;
  text-decoration: none;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  padding: 0.72rem 1.5rem;
  border: none;
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn--primary {
  background: var(--honey);
  color: var(--on-honey);
  box-shadow: 0 8px 24px -10px var(--me-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn--primary:hover { filter: brightness(1.06); box-shadow: 0 10px 28px -8px var(--me-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn--secondary {
  background: var(--card-alt);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--highlight);
}
.btn--secondary:hover { border-color: var(--border-strong); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(1.08); }
.btn--wide { width: 100%; display: block; text-align: center; margin-top: 0.75rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--me);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-error { color: var(--danger); font-size: 0.85rem; font-weight: 600; margin: 0.5rem 0 0; }

/* ---------------------------------------------------------------------- */
/* Navbar                                                                  */
/* ---------------------------------------------------------------------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  background: var(--navbar-bg);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}
.navbar-container {
  max-width: var(--content-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 0.75rem;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.navbar-brand em {
  font-style: normal;
  background: var(--honey-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-hex { display: inline-flex; }
.brand-hex img { display: block; width: 28px; height: 28px; filter: drop-shadow(0 0 8px var(--me-glow)); }

.navbar-actions { display: flex; align-items: center; gap: 0.15rem; }
.nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: none;
  border: none;
  color: var(--text-secondary);
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-icon-btn svg { width: 22px; height: 22px; flex: none; }
.nav-icon-btn:hover { background: var(--overlay-hover); color: var(--text-primary); }

/* ---------------------------------------------------------------------- */
/* Page shell. Mobile-first: one container and no ad space. Only desktops   */
/* (wide screen + mouse pointer) get the three-column layout with ad slots. */
/* ---------------------------------------------------------------------- */

.three-columns {
  display: block;
  width: 100%;
  /* min-height: calc(100vh - var(--navbar-height)); */
}
.side-container { display: none; }
.center-container { width: 100%; max-width: var(--content-width); margin: 0 auto; padding: 0.75rem 0.75rem 1rem; }
.ad-slot {
  min-height: 250px;
  margin: 1rem;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
}

@media (min-width: 1100px) and (hover: hover) and (pointer: fine) {
  .three-columns {
    display: grid;
    grid-template-columns: 1fr minmax(0, var(--content-width)) 1fr;
    gap: 1rem;
    align-items: start;
  }
  .side-container {
    display: block;
    grid-column: 1;
    position: sticky;
    top: calc(var(--navbar-height) + 1rem);
  }
  .side-container.side-container--right { grid-column: 3; }
  .center-container { grid-column: 2; max-width: none; margin: 0; }
}

/* ---------------------------------------------------------------------- */
/* Lobby (home)                                                            */
/* ---------------------------------------------------------------------- */

.lobby {
  min-height: calc(100vh - var(--navbar-height) - 2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1.1rem;
  padding: 0.75rem 0.25rem 1.5rem;
}

.lobby-hero { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-hive { width: 84px; height: 84px; margin-bottom: 0.7rem; overflow: visible; }
.hero-cell {
  transform-box: fill-box;
  transform-origin: center;
  animation: hero-pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.hero-cell:nth-child(2) { animation-delay: 0.05s; }
.hero-cell:nth-child(3) { animation-delay: 0.1s; }
.hero-cell:nth-child(4) { animation-delay: 0.15s; }
.hero-cell:nth-child(5) { animation-delay: 0.2s; }
.hero-cell:nth-child(6) { animation-delay: 0.25s; }
.hero-cell--center { animation-delay: 0.35s; }
@keyframes hero-pop {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}
.hero-cell polygon { fill: var(--card-alt); stroke: rgba(255, 255, 255, 0.1); stroke-width: 0.6; }
.hero-cell text {
  font-family: var(--font);
  font-size: 8.5px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: central;
  fill: var(--text-primary);
}
.hero-cell--center polygon { fill: url(#honey); stroke: none; }
.hero-cell--center text { fill: var(--on-honey); }
.hero-eyebrow { margin: 0 0 0.35rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--me); }
.hero-title { margin: 0 0 0.45rem; font-size: clamp(1.6rem, 4.5vw, 2rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.hero-sub { max-width: 40ch; margin: 0; font-size: 0.92rem; font-weight: 500; line-height: 1.55; color: var(--text-secondary); }

.online-now {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: -0.4rem 0 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.online-now strong { font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--online); }

.hero-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  width: 100%;
  max-width: 440px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hero-features li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.85rem 0.5rem;
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.hero-features svg { width: 20px; height: 20px; margin-bottom: 0.15rem; color: var(--me); }
.hero-features strong { font-size: 0.82rem; font-weight: 700; }
.hero-features span { font-size: 0.7rem; font-weight: 500; color: var(--text-muted); }

.lobby-card {
  position: relative;
  width: 100%;
  max-width: 390px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 40%), var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--highlight), var(--shadow-lg);
  padding: 1.15rem 1.15rem 1.1rem;
}
/* thin honey edge along the top of the card */
.lobby-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--me), transparent);
  opacity: 0.8;
}


.lobby-name-input {
  width: 100%;
  background: var(--card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.8rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-primary);
  margin-bottom: 0.7rem;
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lobby-name-input::placeholder { color: var(--text-muted); font-weight: 500; }
.lobby-name-input:focus { outline: none; border-color: var(--me); box-shadow: 0 0 0 3px var(--me-soft); }
.lobby-name-input:disabled { opacity: 0.6; }

.lobby-option {
  display: block;
  width: 100%;
  text-align: center;
  border-radius: var(--radius-md);
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.55rem;
  border: 1px solid transparent;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}
.lobby-option:last-child { margin-bottom: 0; }
.lobby-option:hover:not(:disabled) { transform: translateY(-1px); }
.lobby-option:active:not(:disabled) { transform: scale(0.98); }
.lobby-option-title { display: block; font-weight: 700; font-size: 0.95rem; }
.lobby-option-sub { display: block; font-weight: 500; font-size: 0.72rem; margin-top: 0.1rem; }

.lobby-option--primary {
  background: var(--honey);
  color: var(--on-honey);
  box-shadow: 0 10px 26px -12px var(--me-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.lobby-option--primary .lobby-option-sub { color: rgba(26, 18, 5, 0.65); }
.lobby-option--primary:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 12px 30px -10px var(--me-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35); }

.lobby-option--alt { background: var(--card-alt); color: var(--text-primary); border-color: var(--border-subtle); box-shadow: var(--highlight); }
.lobby-option--alt .lobby-option-sub { color: var(--text-secondary); }
.lobby-option--alt:hover:not(:disabled) { border-color: var(--border-strong); }

.lobby-join-toggle {
  display: block;
  width: 100%;
  margin-top: 0.85rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lobby-join-toggle:hover { color: var(--text-primary); }

.lobby-join-box { margin-top: 0.7rem; }
.lobby-join-box input {
  width: 100%;
  background: var(--card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.8rem;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: 0.25rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.95rem;
}
.lobby-join-box input:focus { outline: none; border-color: var(--me); box-shadow: 0 0 0 3px var(--me-soft); }

/* Matchmaking: one-line notices + the "searching" panel */
.lobby-notice {
  margin: 0 0 0.8rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--me-soft);
  border: 1px solid rgba(255, 178, 30, 0.25);
  color: var(--me-light);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.search-box { text-align: center; padding: 0.5rem 0 0; }
.search-loader { display: inline-block; }
.search-title { margin: 0.75rem 0 0.2rem; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.search-meta { margin: 0; color: var(--text-secondary); font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.search-hint { margin: 0.85rem 0 0; color: var(--text-secondary); font-size: 0.78rem; font-weight: 500; }
.search-hint-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--me);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Loader: the 7-letter hive, outer cells lighting up clockwise */
.hive-loader { display: block; width: 56px; height: 56px; margin: 0 auto; }
.hive-loader-center { fill: var(--me); }
.hive-loader-cell { fill: rgba(255, 255, 255, 0.14); animation: hive-loader-cell 1.2s linear infinite; }
.hive-loader-cell:nth-of-type(3) { animation-delay: 0.2s; }
.hive-loader-cell:nth-of-type(4) { animation-delay: 0.4s; }
.hive-loader-cell:nth-of-type(5) { animation-delay: 0.6s; }
.hive-loader-cell:nth-of-type(6) { animation-delay: 0.8s; }
.hive-loader-cell:nth-of-type(7) { animation-delay: 1s; }
@keyframes hive-loader-cell {
  0%, 40%, 100% { fill: rgba(255, 255, 255, 0.14); }
  12% { fill: var(--me); }
}

/* ---------------------------------------------------------------------- */
/* Room: scoreboard                                                        */
/* ---------------------------------------------------------------------- */

.scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.85rem;
  margin-bottom: 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--card-bg);
}

.player { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.player--opp { justify-content: flex-end; } /* same [avatar][name / score] order, pushed to the outer edge */

.avatar { position: relative; width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; }
.avatar-hex { position: absolute; inset: 0; width: 100%; height: 100%; }
.avatar-hex polygon { fill: var(--me-soft); transition: fill 0.25s ease; }
.player--opp .avatar-hex polygon { fill: var(--opp-soft); }
.avatar-initial { position: relative; font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--me); transition: color 0.25s ease; }
.player--opp .avatar-initial { color: var(--opp); }
/* Whoever is ahead gets a solid avatar - a plain, flat cue instead of a glow */
.player.is-leading .avatar-hex polygon { fill: var(--me); }
.player.is-leading .avatar-initial { color: var(--on-honey); }
.player--opp.is-leading .avatar-hex polygon { fill: var(--opp); }
.player--opp.is-leading .avatar-initial { color: var(--on-opp); }

.presence-dot {
  position: absolute;
  right: -1px;
  bottom: 3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid var(--card-bg);
}
.presence-dot.online { background: var(--online); }

.player-info { display: flex; flex-direction: column; justify-content: center; gap: 0.2rem; min-width: 0; }
.player-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-primary);
}
/* "12 pts" on both sides - number first, unit on the same baseline */
.player-score { display: flex; align-items: baseline; gap: 0.3rem; line-height: 1; }
.player-points {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--me);
  font-variant-numeric: tabular-nums;
}
.player--opp .player-points { color: var(--opp); }
.player-unit { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); }
.player-points.bump { animation: score-bump 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes score-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Countdown ring */
.timer-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 80px;
  padding: 0 0.85rem;
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
}
.timer-ring { position: relative; width: 60px; height: 60px; display: grid; place-items: center; }
.timer-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: var(--track); stroke-width: 7; }
.ring-progress {
  fill: none;
  stroke: var(--me);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 326.73; /* 2πr for r=52 - keep in sync with room.js */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.25s linear;
}
.timer {
  position: relative;
  font-family: var(--font-display);
  font-size: 0.86rem; /* "10:00" must fit comfortably inside the ring */
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.timer-label {
  max-width: 120px;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-muted);
}
.timer-block.low .ring-progress { stroke: var(--danger); }
.timer-block.low .timer { color: var(--danger); }

/* ---------------------------------------------------------------------- */
/* Room: shared progress bar                                               */
/* ---------------------------------------------------------------------- */

.progress-card {
  position: relative;
  padding: 0.55rem 0.9rem 0.7rem;
  margin-bottom: 0.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--highlight);
}
.progress-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.4rem; }
.progress-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.info { display: inline-flex; }
.info-btn {
  display: flex;
  padding: 2px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text-muted);
  cursor: help;
  transition: color 0.15s ease;
}
.info-btn:hover, .info-btn:focus { color: var(--text-primary); outline: none; }
.tooltip {
  position: absolute;
  top: 2rem;
  left: 0.75rem;
  right: 0.75rem;
  z-index: 20;
  max-width: 330px;
  padding: 0.65rem 0.8rem;
  background: var(--tooltip-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text-primary);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.info:hover .tooltip,
.info-btn:focus + .tooltip { opacity: 1; visibility: visible; transform: translateY(0); }

.progress-total { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress-total strong { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.progress-track {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--track);
  box-shadow: var(--track-shadow);
}
.progress-fill { height: 100%; width: 0; background: var(--me); transition: width 0.45s ease; }

/* ---------------------------------------------------------------------- */
/* Room: play area + hive                                                  */
/* ---------------------------------------------------------------------- */

.play-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.55rem 1rem 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--highlight);
  background:
    radial-gradient(55% 45% at 50% 58%, rgba(255, 178, 30, 0.08), transparent 70%),
    var(--card-bg);
}

.give-up-btn {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.give-up-btn:hover { color: var(--danger); border-color: rgba(255, 92, 108, 0.45); }
.give-up-btn { transition: color 0.15s ease, border-color 0.15s ease, opacity 0.2s ease; }
.give-up-btn:disabled { opacity: 0.5; cursor: default; }

/* A one-line row above the typed word: the latest message shows here, so it
   never covers what you're typing. */
.toast-stack {
  display: grid;
  place-items: center;
  width: 100%;
  height: 2.1rem;
  margin-bottom: 0.3rem;
  pointer-events: none;
}
.toast-stack > .toast { grid-area: 1 / 1; }
.toast {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: 100%;
  padding: 0.3rem 0.35rem 0.3rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: var(--shadow-md);
  animation: toast-in-out 2.1s ease forwards;
}
.toast:not(:has(.pts-tile)) { padding-right: 0.75rem; }
.toast > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Your word: the whole message is one green box */
.toast--me { background: #22c55e; border-color: #22c55e; color: #052e14; }
.toast--me .pts-tile { min-width: 0; padding: 0 0.25rem 0 0; background: none; color: inherit; }
.toast--opp { background: var(--opp); border-color: var(--opp); color: #11151c; }
.toast--opp .pts-tile { min-width: 0; padding: 0 0.25rem 0 0; background: none; color: inherit; }
/* Green "+N" tile for every word found */
.pts-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 1.6rem;
  padding: 0 0.4rem;
  border-radius: 4px;
  background: #22c55e;
  color: #052e14;
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  animation: pts-pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1) 0.08s both;
}
@keyframes pts-pop {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.toast--err { background: rgba(255, 92, 108, 0.16); border: 1px solid rgba(255, 92, 108, 0.45); color: var(--danger-text); }
@keyframes toast-in-out {
  0% { opacity: 0; transform: translateY(-6px) scale(0.96); }
  10% { opacity: 1; transform: translateY(0) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-6px); }
}

.current-word {
  min-height: 2.3rem;
  margin-bottom: 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
}
.current-word.is-live::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1.05em;
  margin-left: 4px;
  vertical-align: -0.14em;
  border-radius: 2px;
  background: var(--me);
  animation: caret-blink 1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }
.current-word .typed-center { color: var(--me); }

.hive-wrap { width: 100%; max-width: min(280px, 34vh); margin-bottom: 0.75rem; }
.hive-svg { width: 100%; height: auto; display: block; overflow: visible; }
.hex-group {
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.1s ease;
}
.hex-group:active { transform: scale(0.93); }
.hex-shape {
  fill: var(--hex-fill);
  stroke: var(--hex-stroke);
  stroke-width: 2;
  transition: stroke 0.15s ease;
}
.hex-group:hover .hex-shape { stroke: rgba(255, 178, 30, 0.55); }
.hex-shape.hex-center { fill: url(#honey); stroke: rgba(255, 215, 96, 0.6); filter: drop-shadow(0 0 16px var(--me-glow)); }
.hex-group:hover .hex-shape.hex-center { stroke: var(--me-light); }
.hex-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  text-anchor: middle;
  dominant-baseline: central;
  fill: var(--text-primary);
  pointer-events: none;
  user-select: none;
}
.hex-label.hex-label-center { fill: var(--on-honey); }

.hive-controls { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.6rem; }
.ctrl-btn {
  padding: 0.62rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--card-alt);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: var(--highlight);
  transition: border-color 0.15s ease, transform 0.1s ease, filter 0.15s ease;
}
.ctrl-btn:hover { border-color: var(--border-strong); }
.ctrl-btn:active { transform: scale(0.95); }
.ctrl-btn--shuffle { display: flex; padding: 0.62rem; }
.ctrl-btn--enter {
  background: var(--honey);
  border-color: transparent;
  color: var(--on-honey);
  font-weight: 700;
  box-shadow: 0 8px 22px -10px var(--me-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.ctrl-btn--enter:hover { border-color: transparent; filter: brightness(1.06); }

.hint-line { max-width: 34ch; margin: 0; text-align: center; font-size: 0.76rem; font-weight: 500; color: var(--text-muted); }

/* Found words: a bar along the bottom of the progress card; the full list
   drops down over the board instead of living at the bottom of the page. */
.feed-card {
  position: relative;
  margin-bottom: 0.6rem;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.feed-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.5rem 0.9rem;
  border: none;
  border-radius: var(--radius-md);
  background: none;
  color: var(--text-primary);
  text-align: left;
}
.feed-toggle:hover { background: var(--overlay-hover); }
.feed-toggle-title { flex-shrink: 0; font-weight: 600; font-size: 0.82rem; }
.feed-count {
  flex-shrink: 0;
  min-width: 1.6em;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}
.feed-preview {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 0.55rem;
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, #000 80%, transparent);
  mask-image: linear-gradient(90deg, #000 80%, transparent);
}
.feed-preview-word { font-family: var(--font-display); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--me); }
.feed-preview-word.opp { color: var(--text-secondary); }
.feed-preview-empty { font-size: 0.75rem; color: var(--text-muted); }
.feed-chevron { flex-shrink: 0; color: var(--text-secondary); transition: transform 0.15s ease; }
.feed-toggle.is-expanded .feed-chevron { transform: rotate(180deg); }
.feed-list {
  position: absolute;
  top: calc(100% + 6px);
  left: -1px;
  right: -1px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: min(340px, 55vh);
  overflow-y: auto;
  margin: 0;
  padding: 0.6rem;
  list-style: none;
  background: var(--modal-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.feed-empty { padding: 1.25rem 0.5rem; text-align: center; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
.feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  background: var(--card-alt);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--me);
  border-radius: var(--radius-sm);
  animation: feed-in 0.25s ease;
}
.feed-item.opp { border-left-color: var(--text-muted); }
.feed-item .word { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.feed-item .word .pangram-star { margin-right: 0.3rem; color: var(--me); }
.feed-item .meta { display: flex; flex-direction: column; align-items: flex-end; font-size: 0.7rem; font-weight: 600; color: var(--text-secondary); }
.feed-item .points { font-family: var(--font-display); font-weight: 700; color: var(--me); }
.feed-item.opp .points { color: var(--opp); }
@keyframes feed-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------------- */
/* Overlays: in-room lobby (invite / join / ready)                         */
/* ---------------------------------------------------------------------- */

.overlay {
  position: fixed;
  inset: var(--navbar-height) 0 0 0; /* the navbar stays visible above dialogs */
  z-index: 2000;
  display: flex;
  align-items: flex-start; /* every dialog starts at the same height */
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  background: var(--backdrop);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.overlay-card {
  width: 100%;
  max-width: 380px;
  padding: 1.5rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%), var(--modal-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--highlight), var(--shadow-modal);
  animation: modal-pop 0.22s ease;
}
.overlay-loader { display: inline-block; }
.overlay-loader .hive-loader { width: 50px; height: 50px; }
.overlay-card h2 { margin: 0.7rem 0 0.35rem; font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; letter-spacing: -0.02em; }
.overlay-sub { margin: 0 0 1.15rem; font-size: 0.9rem; font-weight: 500; line-height: 1.5; color: var(--text-secondary); }
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.room-code-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.75rem;
  margin-bottom: 0.6rem;
  background: var(--card-alt);
  border: 1px dashed rgba(255, 178, 30, 0.35);
  border-radius: var(--radius-md);
}
.room-code-label { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }
.room-code {
  padding-left: 0.22em;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  background: var(--honey-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.invite-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.invite-row input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  background: var(--card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.82rem;
}
.overlay-cancel-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.overlay-cancel-link:hover { color: var(--text-primary); }

#join-box { text-align: left; }
#join-box label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
#join-box input {
  width: 100%;
  margin: 0.35rem 0 0.9rem;
  padding: 0.65rem 0.8rem;
  background: var(--card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--font);
}
#join-box input:focus { outline: none; border-color: var(--me); box-shadow: 0 0 0 3px var(--me-soft); }

/* Start countdown: big 5-4-3-2-1 over a blurred board (just the play area) */
.start-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: rgba(13, 16, 23, 0.55);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.start-card { text-align: center; }
.start-vs { margin: 0 0 0.75rem; font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.start-vs em { margin: 0 0.55rem; font-size: 0.72rem; font-style: normal; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); }
.start-me { color: var(--me); }
.start-count {
  font-size: clamp(5rem, 20vw, 7.5rem);
  font-weight: 800;
  line-height: 1;
  color: var(--me);
  font-variant-numeric: tabular-nums;
}
.start-count.tick { animation: start-tick 0.9s ease-out; }
@keyframes start-tick {
  0% { opacity: 0; transform: scale(1.4); }
  25% { opacity: 1; transform: scale(1); }
  100% { opacity: 1; transform: scale(1); }
}
.start-label { margin: 0.8rem 0 0; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-secondary); }

/* ---------------------------------------------------------------------- */
/* Modals: results, How to play, Statistics                                */
/* ---------------------------------------------------------------------- */

.modal {
  width: 100%;
  max-width: 420px;
  max-height: calc(100dvh - var(--navbar-height) - 2rem);
  overflow-y: auto;
  background: var(--modal-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--highlight), var(--shadow-modal);
  animation: modal-pop 0.22s ease;
}
.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 3.25rem;
  background: linear-gradient(180deg, var(--card-alt), var(--card-bg));
  border-bottom: 1px solid var(--border-subtle);
}
.modal-title { margin: 0; text-align: center; font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; }
.modal-close {
  position: absolute;
  top: 50%;
  right: 0.6rem;
  transform: translateY(-50%);
  display: flex;
  padding: 0.4rem;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-secondary);
}
.modal-close:hover { color: var(--text-primary); background: var(--overlay-hover); }
.modal-body { padding: 1.35rem 1.4rem 1.4rem; }
.modal--small { max-width: 360px; }
.confirm p { margin: 0 0 1.2rem; text-align: center; font-weight: 500; line-height: 1.5; color: var(--text-secondary); }
.confirm-actions { display: flex; gap: 0.6rem; }
.confirm-actions .btn { flex: 1; padding-left: 0.5rem; padding-right: 0.5rem; }

/* Results */
.overlay[data-outcome="win"] .modal-header {
  background: radial-gradient(120% 140% at 50% 0%, rgba(255, 178, 30, 0.22), transparent 70%), var(--card-alt);
}
.overlay[data-outcome="win"] .modal-title {
  font-size: 1.7rem;
  background: var(--honey-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.overlay[data-outcome="loss"] .modal-header {
  background: var(--card-alt);
}
.result { text-align: center; }
.result-reason { margin: 0 0 1.15rem; font-size: 1rem; font-weight: 500; color: var(--text-secondary); }

.final-scores { display: flex; gap: 0.6rem; margin-bottom: 1.3rem; }
.final-score-card {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.9rem 0.6rem;
  background: var(--card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.final-score-card.winner.me { border-color: rgba(255, 178, 30, 0.6); box-shadow: 0 0 24px -8px var(--me-glow); }
.final-score-card.winner.opp { border-color: var(--border-strong); }
.final-score-card .fs-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.final-score-card .fs-score { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.final-score-card.me .fs-score { color: var(--me); }
.final-score-card.opp .fs-score { color: var(--opp); }
.final-score-card .fs-meta { font-size: 0.72rem; font-weight: 500; color: var(--text-muted); }

.result-actions { display: flex; gap: 0.6rem; margin-bottom: 1.25rem; }
.btn--icon { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }
.btn--icon svg { flex-shrink: 0; }
.result-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  cursor: pointer;
}
.result-actions .btn--secondary { background: transparent; border: 1.5px solid var(--border-strong); }
.result-actions .btn--secondary:hover { background: var(--surface-3); color: var(--text-primary); }

/* Word lists on the results screen: You / Opponent / Missed */
.word-review {
  padding: 0.75rem 0.85rem 0.6rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.review-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.25rem;
  padding: 0.25rem;
  margin-bottom: 0.6rem;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.review-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.45rem 0.4rem;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}
.review-tab:hover { color: var(--text-primary); }
.review-tab[aria-selected="true"] { background: var(--surface-3); color: var(--text-primary); }
.review-tab-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-count {
  flex-shrink: 0;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 700;
}
.review-count--me { background: var(--me-soft); color: var(--me); }

.review-list {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.35rem;
  max-height: 188px;
  margin: 0;
  padding: 0.1rem 0.2rem 0.1rem 0;
  overflow-y: auto;
  list-style: none;
}
/* Every word is the same small chip; only your own / their lists carry the pangram accent. */
.review-word {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.7rem;
  line-height: 1.3;
}
.review-word-text { font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-primary); }
.review-word-pts { font-size: 0.62rem; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.review-list--mine .review-word-pts { color: var(--me); }
.review-list--mine .review-word.is-pangram,
.review-list--opp .review-word.is-pangram { border-color: rgba(255, 178, 30, 0.55); background: var(--me-soft); }
.review-list--mine .review-word.is-pangram .review-word-text,
.review-list--opp .review-word.is-pangram .review-word-text { color: var(--me); }
.review-empty { flex: 1 1 100%; padding: 1.2rem 0.5rem; text-align: center; font-size: 0.85rem; color: var(--text-muted); }

/* Statistics */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.9rem 0.4rem;
  text-align: center;
  background: var(--card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--highlight);
}
.stat-value { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat:nth-child(2) .stat-value { color: var(--me); }
.stat-label { font-size: 0.7rem; font-weight: 500; color: var(--text-secondary); }
.stats-note { margin: 1rem 0 0; text-align: center; font-size: 0.75rem; color: var(--text-muted); }

/* How to play */
.help { font-size: 0.9rem; line-height: 1.55; color: var(--text-secondary); }
.help-lead { margin: 0 0 0.4rem; color: var(--text-primary); font-weight: 500; }
.help h3 { margin: 1.15rem 0 0.35rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--me); }
.help ul { margin: 0; padding-left: 1.1rem; }
.help li + li { margin-top: 0.25rem; }
.help li::marker { color: var(--text-muted); }
.help strong { color: var(--text-primary); font-weight: 600; }

/* ---------------------------------------------------------------------- */
/* Below the game: more games, about band, rating, footer links            */
/* ---------------------------------------------------------------------- */

.site-footer { margin-top: 2rem; }

.section-title { margin: 0 0 0.5rem; font-size: clamp(1.35rem, 3vw, 1.85rem); font-weight: 800; letter-spacing: -0.01em; }
.section-sub { margin: 0 0 2rem; font-size: 1rem; font-weight: 500; color: var(--text-secondary); }

.more-games { max-width: 940px; margin: 0 auto; padding: 2.5rem 1.25rem 3rem; text-align: center; }
.games-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; }
.game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.3rem 0.9rem 1.35rem;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.game-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.game-icon { display: block; width: 56px; height: 56px; border-radius: 13px; object-fit: cover; }
.game-name { margin-top: 0.35rem; font-size: 1.05rem; font-weight: 800; }
.game-tagline { font-size: 0.82rem; font-weight: 500; line-height: 1.4; color: var(--text-secondary); }

.about-band {
  background: linear-gradient(180deg, #1a1e2c 0%, #222739 100%);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.about-inner { max-width: 880px; margin: 0 auto; padding: 3rem 1.25rem; text-align: center; }
.about-inner .section-title { margin-bottom: 1rem; }
.about-inner p { margin: 0; font-size: 1.05rem; font-weight: 500; line-height: 1.75; color: var(--text-secondary); }
.about-inner strong { font-weight: 800; color: var(--me); }

/* How to play cards */
.howto { max-width: 940px; margin: 0 auto; padding: 3rem 1.25rem 1rem; }
.howto .section-title, .faq .section-title { margin-bottom: 1.5rem; text-align: center; }
.howto-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.howto-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  box-shadow: var(--highlight);
}
.howto-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}
.howto-body { padding: 1.3rem 1.5rem 1.6rem; }
.howto-body h3 { display: flex; align-items: center; gap: 0.7rem; margin: 0 0 0.6rem; font-size: 1.15rem; font-weight: 800; }
.howto-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--me);
  color: var(--on-honey);
  font-size: 0.85rem;
  font-weight: 800;
}
.howto-body p { margin: 0; font-size: 0.95rem; font-weight: 500; line-height: 1.7; color: var(--text-secondary); }

.mini-hive { position: relative; width: 170px; height: 170px; }
.mini-hex {
  position: absolute;
  left: calc(50% + var(--x) - 28px);
  top: calc(50% + var(--y) - 32px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 64px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--card-alt);
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 700;
}
.mini-hex--center { background: var(--me); color: var(--on-honey); }

.mini-scores { display: flex; flex-direction: column; gap: 0.5rem; width: min(100%, 360px); }
.mini-score {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 1.1rem;
  background: var(--card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}
.mini-score span:last-child { color: var(--text-secondary); }
.mini-score--hot { background: var(--me); border-color: var(--me); color: var(--on-honey); }
.mini-score--hot span:last-child { color: var(--on-honey); }

.mini-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; max-width: 300px; }
.mini-chip {
  padding: 0.4rem 0.9rem;
  background: var(--card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.mini-chip--locked { border-style: dashed; color: var(--danger); text-decoration: line-through; }

.mini-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 130px;
  height: 130px;
  border: 6px solid var(--me);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; padding: 2.5rem 1.25rem 3rem; }
.faq-list { display: flex; flex-direction: column; gap: 0.6rem; }
.faq-item { background: var(--card-bg); border: 1px solid var(--border-subtle); border-radius: 14px; }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; flex: none; font-size: 1.4rem; font-weight: 500; color: var(--me); }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin: 0; padding: 0 1.2rem 1.1rem; font-size: 0.93rem; font-weight: 500; line-height: 1.7; color: var(--text-secondary); }
.faq-item strong { color: var(--text-primary); font-weight: 700; }

.rate { display: flex; flex-direction: column; align-items: center; padding: 3.25rem 1.25rem 3rem; text-align: center; }
.app-logo img { display: block; width: 150px; height: 150px; filter: drop-shadow(0 10px 36px rgba(255, 178, 30, 0.25)); }
.rate-title { margin: 1.2rem 0 0.9rem; font-size: 1.6rem; font-weight: 800; }
.rate-stars { display: flex; gap: 0.3rem; }
.rate-star {
  display: flex;
  padding: 0.15rem;
  border: none;
  background: none;
  color: #2a3044;
  transition: transform 0.1s ease, color 0.1s ease;
}
.rate-star svg { width: 40px; height: 40px; fill: currentColor; }
.rate-star:hover { transform: scale(1.08); }
.rate-star.is-on { color: var(--me); }
.rate-average { margin: 1rem 0 0.2rem; font-size: 1.5rem; font-weight: 800; }
.rate-count { margin: 0; font-weight: 500; color: var(--text-secondary); }
.rate-thanks { margin: 0.6rem 0 0; font-size: 0.88rem; font-weight: 600; color: var(--online); }

.footer-links { padding: 1.6rem 1rem 2rem; text-align: center; border-top: 1px solid var(--border-subtle); }
.footer-links nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.4rem 0.9rem; }
.footer-links a { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); text-decoration: none; }
.footer-links a:hover { color: var(--text-primary); }
.footer-sep { color: var(--text-muted); }

@media (max-width: 900px) {
  .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .howto-grid { grid-template-columns: minmax(0, 1fr); }
}

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (max-height: 820px) {
  .hint-line { display: none; }
}

@media (max-width: 520px) {
  .scoreboard { gap: 0.45rem; padding: 0.45rem 0.6rem; }
  .player { gap: 0.45rem; }
  .avatar { width: 34px; height: 34px; }
  .avatar-initial { font-size: 0.88rem; }
  .presence-dot { width: 10px; height: 10px; }
  .player-points { font-size: 1.25rem; }
  .player-name { font-size: 0.74rem; }
  .player-unit { font-size: 0.66rem; }
  .timer-block { min-width: 66px; }
  .timer-ring { width: 54px; height: 54px; }
  .timer { font-size: 0.8rem; }
  .modal-body { padding: 1.1rem 1rem 1.2rem; }
  .games-grid { gap: 0.7rem; }
  .game-card { padding: 1.05rem 0.6rem 1.1rem; border-radius: 15px; }
  .game-icon { width: 48px; height: 48px; border-radius: 11px; }
  .game-name { font-size: 0.98rem; }
  .game-tagline { font-size: 0.76rem; }
  .about-inner p { font-size: 0.95rem; }
  .app-logo img { width: 120px; height: 120px; }
  .rate-star svg { width: 34px; height: 34px; }
  .footer-sep { display: none; } /* links wrap on phones; spacing separates them */
  .footer-links nav { gap: 0.6rem 1.3rem; }
  .stat-value { font-size: 1.4rem; }
}

/* Static content pages (About, Privacy, Terms, Feedback) */
.doc-page { max-width: 720px; margin: 0 auto; padding: 1.5rem 1rem 0; color: var(--text-secondary); line-height: 1.65; }
.doc-page h1 { margin: 0 0 0.3rem; font-size: 1.7rem; color: var(--text-primary); }
.doc-page h2 { margin: 1.6rem 0 0.4rem; font-size: 1.1rem; color: var(--text-primary); }
.doc-page p, .doc-page li { font-size: 0.95rem; }
.doc-page ul { padding-left: 1.2rem; }
.doc-page a { color: var(--me); }
.doc-page .doc-updated { font-size: 0.8rem; color: var(--text-muted); }

/* Content pages: no ad columns, so use the full width */
.page-wide .side-container { display: none; }
@media (min-width: 1100px) and (hover: hover) and (pointer: fine) {
  .page-wide .three-columns { display: block; }
}
.page-wide .center-container { max-width: none; margin: 0; }
.page-wide .doc-page { max-width: none; padding: 2rem clamp(1rem, 5vw, 4rem) 0; }
