/* =========================================================================
   Mysterix · design system
   Night surfaces drawn from the Anemona indigo, the Anemona palette as the
   one accent (violet → magenta → coral → orange → gold: it rises in
   lightness, so it also works as a scale), Outfit throughout.
   ========================================================================= */

:root {
  color-scheme: dark;
  /* The Anemona palette */
  --indigo: #1D1981;
  --violet: #4F269C;
  --purple: #7D2F9F;
  --magenta: #A43E85;
  --coral: #C3646A;
  --orange: #DD8D57;
  --gold: #EDBE4F;
  --paper: #E9E6DF;

  /* Night, a shade before full dark */
  --bg: #0f0d2b;
  --bg-2: #15123a;
  --surface: #1c1942;
  --surface-2: #242050;
  --surface-3: #302b66;
  --glass: rgba(18, 16, 46, 0.68);
  --line: rgba(233, 230, 223, 0.08);
  --line-2: rgba(233, 230, 223, 0.15);
  --line-3: rgba(233, 230, 223, 0.26);
  --ink: #f6f3ec;
  --ink-2: #cbc6de;
  --muted: #9893b8;
  --faint: #6a6590;
  --miss: #e8868b;

  --grad: linear-gradient(90deg, #4F269C, #7D2F9F 20%, #A43E85 40%, #C3646A 60%, #DD8D57 80%, #EDBE4F);
  --grad-text: linear-gradient(100deg, #F3CD66, #DD8D57 48%, #C3646A);
  --grad-lifted: linear-gradient(90deg, #9d83f0, #c86fb0 35%, #e3937a 70%, #f0c660);

  --r-xl: 24px;
  --r-lg: 20px;
  --r: 14px;
  --r-sm: 10px;
  --shadow-1: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 34px -16px rgba(0, 0, 0, 0.75);
  --shadow-2: 0 28px 70px -24px rgba(0, 0, 0, 0.9);
  --font: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0.75, 0.2, 1);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  position: relative; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
/* Dawn over the night: fixed, so it stays put while the page scrolls (and costs nothing on phones). */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1000px 520px at 88% -14%, rgba(164, 62, 133, 0.22), transparent 62%),
    radial-gradient(900px 520px at -8% -12%, rgba(79, 38, 156, 0.34), transparent 60%),
    radial-gradient(1400px 700px at 50% 125%, rgba(29, 25, 129, 0.45), transparent 70%),
    var(--bg);
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 650; letter-spacing: -0.015em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(237, 190, 79, 0.35); }
* { scrollbar-width: thin; scrollbar-color: rgba(233, 230, 223, 0.18) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(233, 230, 223, 0.16); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(233, 230, 223, 0.28); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ico { width: 18px; height: 18px; flex: none; }

.kicker {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.kicker .ico { width: 15px; height: 15px; }
.gold { color: var(--gold) !important; }

/* ---------- buttons and fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 12px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.05); color: var(--ink);
  font-size: 14.5px; font-weight: 550; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.09); border-color: var(--line-3); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.42; cursor: default; }
.btn.primary {
  background: var(--gold); color: #1a1460; border-color: transparent; font-weight: 650;
  box-shadow: 0 8px 22px -12px rgba(237, 190, 79, 0.7);
}
.btn.primary:hover:not(:disabled) { background: #f4ca63; box-shadow: 0 10px 26px -12px rgba(237, 190, 79, 0.85); }
.btn.primary:disabled { opacity: 0.45; box-shadow: none; }
.btn.linkedin { background: #0a66c2; border-color: transparent; color: #fff; font-weight: 650; box-shadow: 0 8px 22px -10px rgba(10, 102, 194, 0.8); }
.btn.linkedin:hover:not(:disabled) { background: #0b74dc; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); color: var(--ink); border-color: transparent; }
.btn.sm { padding: 6px 11px; font-size: 13.5px; border-radius: 10px; gap: 6px; }
.btn.sm .ico { width: 16px; height: 16px; }
.btn.lg { padding: 12px 20px; font-size: 15.5px; border-radius: 14px; }
.btn.wide { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--ink-2);
  cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.icon-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.09); color: var(--ink); border-color: var(--line-2); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 10px; }
.icon-btn .ico { width: 19px; height: 19px; }

select {
  appearance: none; -webkit-appearance: none;
  padding: 8px 32px 8px 12px; border-radius: 10px; border: 1px solid var(--line-2); cursor: pointer;
  background: rgba(255, 255, 255, 0.05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e88ad' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center / 15px;
  color: var(--ink); font-size: 14px;
}
select option, select optgroup { background: var(--surface); color: var(--ink); }
input[type="text"], input[type="search"], textarea {
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 13px; color: var(--ink); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]:focus, input[type="search"]:focus, textarea:focus { border-color: rgba(237, 190, 79, 0.6); box-shadow: 0 0 0 4px rgba(237, 190, 79, 0.12); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--gold); }

input[type="range"] {
  -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px; background: var(--line-2); outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--gold);
}
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--gold); }
input[type="range"]:disabled { opacity: 0.45; cursor: default; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04);
}
.chip.gold { color: #1a1460 !important; background: var(--gold); border-color: transparent; }
.cc {
  flex: none; font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 5px; line-height: 1.4;
}

/* ---------- brand ---------- */
.mark { display: inline-block; width: 38px; height: 38px; flex: none; }
.mark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.mark .rotor { transform-origin: 16px 16px; }
.mark.spin .rotor { animation: spin 24s linear infinite; }
.mark:hover .rotor { animation-duration: 3s; }
.mark.big { width: 72px; height: 72px; }
.loading .mark.spin .rotor { animation-duration: 2.4s; }
/* The Anemona wordmark, filled with the palette lifted for the night. */
.anemona {
  display: inline-block; height: 0.68em; aspect-ratio: 9 / 1; vertical-align: baseline;
  background: var(--grad-lifted);
  -webkit-mask: url(img/anemona-wordmark.svg) no-repeat center / contain;
  mask: url(img/anemona-wordmark.svg) no-repeat center / contain;
}

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap;
  max-width: 1600px; margin: 0 auto; padding: 14px 24px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-text { display: grid; line-height: 1.1; }
.wordmark { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; }
.byline { display: inline-flex; align-items: baseline; gap: 5px; font-size: 11.5px; color: var(--muted); text-decoration: none; margin-top: 3px; }
.byline .anemona { height: 8.5px; }
.byline:hover { color: var(--ink-2); }
.modes {
  display: inline-flex; padding: 4px; gap: 2px; margin-left: 6px;
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); border-radius: 999px;
}
.modes a {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 15px; border-radius: 999px;
  color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 550; transition: color 0.15s, background 0.15s;
}
.modes a .ico { width: 16px; height: 16px; }
.modes a:hover { color: var(--ink); }
.modes a[aria-current="page"] { background: var(--surface-3); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 14px -6px rgba(0, 0, 0, 0.6); }
.modes a[aria-current="page"] .ico { color: var(--gold); }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.daynav {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.03);
}
.daynav .icon-btn { border-color: transparent; background: transparent; }
.daynav select { border-color: transparent; background-color: transparent; font-weight: 550; font-variant-numeric: tabular-nums; padding-top: 6px; padding-bottom: 6px; }
.streak-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 13px 0 9px; cursor: pointer;
  border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--muted);
  font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; transition: border-color 0.2s, box-shadow 0.2s;
}
.streak-chip .ico { width: 22px; height: 22px; filter: grayscale(1) opacity(0.45); transition: filter 0.3s; }
.streak-chip.lit { color: var(--ink); border-color: rgba(237, 190, 79, 0.4); box-shadow: 0 0 22px -8px rgba(237, 190, 79, 0.7); }
.streak-chip.lit .ico { filter: none; }
.streak-chip.at-risk { animation: risk 2.2s ease-in-out infinite; }

.banner {
  max-width: 1552px; margin: 0 auto 10px; padding: 9px 10px 9px 16px; width: calc(100% - 48px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-radius: 14px; border: 1px solid rgba(237, 190, 79, 0.28);
  background: linear-gradient(90deg, rgba(237, 190, 79, 0.1), rgba(164, 62, 133, 0.08)); font-size: 14px; color: var(--ink-2);
}

/* ---------- loading ---------- */
.loading { display: grid; place-items: center; gap: 18px; padding: 20vh 24px; text-align: center; color: var(--ink-2); }

/* ---------- layout ---------- */
main.play {
  display: grid; grid-template-columns: minmax(0, 1fr) 412px; gap: 20px; align-items: start;
  max-width: 1600px; margin: 0 auto; padding: 6px 24px 40px;
}
.stage { min-width: 0; }
.side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
@media (min-width: 981px) and (min-height: 760px) {
  .stage { position: sticky; top: 14px; }
}
.panel {
  position: relative; padding: 18px 18px 16px; border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(36, 32, 80, 0.82), rgba(24, 21, 58, 0.82));
  border: 1px solid var(--line); box-shadow: var(--shadow-1);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.panel-note { font-size: 12.5px; color: var(--muted); }
.panel-title { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 2px 0 14px; }

/* ---------- the stage: field, overlays ---------- */
.map {
  position: relative; height: clamp(440px, calc(100vh - 236px), 860px); min-height: 420px;
  border-radius: var(--r-lg); overflow: hidden; background: var(--bg);
  border: 1px solid var(--line-2);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 40px 90px -40px rgba(79, 38, 156, 0.6);
}
.map::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07); z-index: 6; }
.map canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; }
.backdrop { position: absolute; inset: 0; z-index: 0; isolation: isolate; background: var(--bg); }
.map .overlay { cursor: grab; touch-action: none; }
.map .overlay.dragging { cursor: grabbing; }
.map-corner { position: absolute; z-index: 2; pointer-events: none; }
.map-corner > * , .map-corner.glass { pointer-events: auto; }
.tl { top: 12px; left: 12px; }
.tr { top: 12px; right: 12px; }
.bl { bottom: 12px; left: 12px; }
.br { bottom: 12px; right: 12px; }
.glass {
  background: var(--glass); border: 1px solid var(--line-2); border-radius: var(--r);
  -webkit-backdrop-filter: blur(12px) saturate(1.25); backdrop-filter: blur(12px) saturate(1.25);
}
.viewtabs { position: absolute; top: 12px; left: 12px; z-index: 5; }
.viewtabs.seg { background: var(--glass); border-color: var(--line-2); }

.windbox { display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 7px; }
.compass { width: 78px; height: 78px; cursor: grab; touch-action: none; flex: none; }
.compass .ring { fill: rgba(255, 255, 255, 0.025); stroke: var(--line-3); stroke-width: 1.2; }
.compass .ticks line { stroke: var(--muted); stroke-width: 1; }
.compass .cardinal { fill: var(--muted); font-family: var(--font); font-size: 9.5px; font-weight: 600; text-anchor: middle; }
.compass .cardinal.north { fill: var(--gold); }
.compass .shaft { stroke: url(#needle-g); stroke-width: 2.6; stroke-linecap: round; }
.compass .head { fill: var(--gold); }
.compass .handle { fill: var(--ink); stroke: var(--bg); stroke-width: 2; }
.wind-readout { display: grid; font-size: 12.5px; line-height: 1.38; min-width: 124px; }
.wind-readout strong { font-size: 14px; font-weight: 600; }
.wind-readout span:nth-child(2) { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.wind-readout .muted { font-size: 11.5px; }

.zoom { display: grid; overflow: hidden; }
.zoom button { display: grid; place-items: center; width: 36px; height: 34px; background: transparent; color: var(--ink-2); border: 0; cursor: pointer; }
.zoom button + button { border-top: 1px solid var(--line); }
.zoom button:hover { background: rgba(255, 255, 255, 0.08); color: var(--ink); }
.zoom .ico { width: 17px; height: 17px; }

.legend { padding: 9px 12px; display: grid; gap: 6px; font-size: 12px; color: var(--ink-2); }
.legend-row { display: flex; align-items: center; gap: 8px; }
.legend-row.off { opacity: 0.35; }
.ramp { width: 48px; height: 8px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px var(--line); }
.ramp-wake { background: linear-gradient(90deg, var(--bg), #4F269C 18%, #A43E85 48%, #DD8D57 78%, #EDBE4F); }
.legend-row.blk { align-items: center; }
.legend-row.blk .muted { font-size: 11px; line-height: 1.3; }
.legend-row.blk .muted b { font-weight: 600; color: var(--ink-2); }
.blk-swatch { width: 56px; height: 26px; flex: none; overflow: visible; }
.blk-fill { fill: #6e63e0; }
.blk-line { fill: none; stroke: #b3aaff; stroke-width: 1; }
.blk-rotor { stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; }
.blk-wind { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.ramp-out { background: linear-gradient(90deg, rgb(214, 72, 98), rgb(242, 184, 75) 50%, rgb(96, 240, 168)); }
.key { width: 14px; height: 0; border-top: 1.5px solid rgba(233, 230, 223, 0.7); flex: none; position: relative; }
.key::after { content: ""; position: absolute; left: 1px; top: -3.5px; width: 12px; height: 6px; border-radius: 50%; background: rgb(242, 184, 75); box-shadow: 0 0 0 1.5px #fff; }
.key-neigh { margin-left: 8px; }
.key-neigh::after { left: 2px; top: -3px; width: 10px; height: 5px; box-shadow: 0 0 0 1px #07061a; opacity: 0.85; }

.tip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 270px;
  background: rgba(20, 18, 48, 0.96); color: var(--ink); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 8px 11px; font-size: 12.5px; line-height: 1.45; box-shadow: var(--shadow-2);
}
.tip-sub { color: var(--ink-2); }

/* ---------- the wind lab under the stage ---------- */
.labbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 12px 0 10px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); border-radius: 13px; }
.seg button {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--ink-2); font-size: 13.5px; font-weight: 550; transition: background 0.15s, color 0.15s;
}
.seg button .ico { width: 16px; height: 16px; }
.seg button:hover:not(:disabled) { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 3px 10px -4px rgba(0, 0, 0, 0.6); }
.seg button[aria-pressed="true"] .ico { color: var(--gold); }
.seg button:disabled { opacity: 0.4; cursor: not-allowed; }
.slider, .pace { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.slider input { width: 124px; }
.slider output { min-width: 50px; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 550; }
.pace select { padding: 5px 28px 5px 10px; font-size: 13.5px; background-position: right 7px center; }
.layers { position: relative; }
.layers summary { list-style: none; }
.layers summary::-webkit-details-marker { display: none; }
.layers[open] summary { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.layers-menu { position: absolute; z-index: 20; bottom: calc(100% + 8px); left: 0; display: grid; gap: 2px; padding: 8px; min-width: 170px; box-shadow: var(--shadow-2); }
.layers-menu label { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.layers-menu label:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink); }
.layers-menu input:disabled + * , .layers-menu label:has(input:disabled) { opacity: 0.45; cursor: default; }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile {
  display: grid; gap: 1px; padding: 11px 15px; border-radius: var(--r);
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
}
.tile-label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.tile-value { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; min-height: 36px; font-variant-numeric: tabular-nums; }
.tile-sub { font-size: 12px; color: var(--muted); }
.fineprint { font-size: 12px; color: var(--faint); margin-top: 10px; max-width: 90ch; }

/* ---------- the guess box ---------- */
.pips { display: flex; gap: 5px; list-style: none; margin: 0; padding: 0; }
.pips li { width: 22px; height: 6px; border-radius: 3px; background: var(--line-2); transition: background 0.3s; }
.pips li.used { background: var(--c); box-shadow: 0 0 10px -2px var(--c); }
.pips li.used.skip { box-shadow: none; }
.pips li.now { background: transparent; box-shadow: inset 0 0 0 1.5px var(--gold); }

.combo {
  position: relative; display: flex; align-items: center; gap: 6px;
  padding: 5px 5px 5px 42px; border-radius: 15px; border: 1px solid var(--line-2); background: var(--surface-2);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.combo:focus-within { border-color: rgba(237, 190, 79, 0.6); box-shadow: 0 0 0 4px rgba(237, 190, 79, 0.12); }
.combo-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
#guess-input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; box-shadow: none; padding: 10px 4px; font-size: 16px; color: var(--ink); }
#btn-guess { padding: 10px 20px; border-radius: 11px; }
#guess-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 5px; list-style: none;
  background: rgba(22, 20, 54, 0.98); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-2);
  max-height: 320px; overflow: auto;
}
#guess-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 14.5px; }
#guess-list li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#guess-list li[aria-selected="true"], #guess-list li[data-i]:hover { background: rgba(237, 190, 79, 0.14); }
#guess-list li.empty { color: var(--muted); cursor: default; }
.guess-alt { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.feedback { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.4; animation: rise 0.4s var(--ease); }
.feedback:empty { display: none; }
.feedback strong { color: var(--ink); }
.feedback > .ico { color: var(--gold); width: 22px; height: 22px; }
.bft {
  display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%;
  font-size: 12.5px; font-weight: 750; font-style: normal; color: #120f2e; background: var(--c, var(--muted));
  box-shadow: 0 0 14px -3px var(--c, transparent);
}

.guesses { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.guesses:empty { display: none; }
.guess {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; align-items: center; gap: 10px;
  padding: 9px 10px 11px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line);
  font-size: 14px;
}
.guess::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: var(--p, 0%); background: linear-gradient(90deg, rgba(79, 38, 156, 0.4), var(--c)); }
.guess .gi { display: grid; place-items: center; color: var(--muted); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.guess .gi .ico { width: 18px; height: 18px; color: var(--gold); }
.gname { display: flex; align-items: center; gap: 7px; min-width: 0; font-weight: 600; }
.gname > span:not(.cc) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gname .ico { width: 15px; height: 15px; color: var(--gold); }
.gdist { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.guess .bft { width: 24px; height: 24px; font-size: 12px; }
.ghints { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 5px; margin-top: -3px; }
.ghint { font-size: 11.5px; line-height: 1; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.ghint.hit { border-color: rgba(237, 190, 79, 0.55); color: var(--gold); background: rgba(237, 190, 79, 0.08); }
.guess.skip { grid-template-columns: 22px minmax(0, 1fr) auto; }
.guess.skip .gname { color: var(--muted); font-weight: 500; }
.guess.ok { grid-template-columns: 22px minmax(0, 1fr) auto; border-color: rgba(237, 190, 79, 0.5); background: linear-gradient(90deg, rgba(237, 190, 79, 0.16), rgba(221, 141, 87, 0.05)); }
.guess.ok .gdist { color: var(--gold); font-weight: 600; }
.guess.enter { animation: slide-in 0.5s var(--ease); }
.guess.ok.enter { animation: slide-in 0.5s var(--ease), found 1.4s var(--ease) 0.2s; }

/* ---------- the result, in the guess box ---------- */
.guessbox.over .panel-title { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.result {
  display: grid; gap: 8px; padding: 16px; border-radius: 16px; margin-top: 2px;
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); animation: rise 0.5s var(--ease);
}
.result.won { background: radial-gradient(120% 140% at 0% 0%, rgba(237, 190, 79, 0.17), transparent 62%), rgba(255, 255, 255, 0.03); border-color: rgba(237, 190, 79, 0.36); }
.result .kicker .ico { color: var(--gold); }
.result-name { font-size: 29px; font-weight: 750; letter-spacing: -0.025em; line-height: 1.08; }
.result-meta { font-size: 13.5px; color: var(--ink-2); }
.standing { font-size: 14px; color: var(--ink-2); }
.standing b, .rs-standing b { color: var(--gold); font-weight: 700; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.result-actions .btn { flex: 1 1 auto; }
.onward { justify-self: start; }
.countdown { font-size: 13px; color: var(--muted); }
.countdown b, .rs-next b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- clues ---------- */
.clues { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.clue {
  position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-height: 96px; padding: 11px 12px 11px;
  text-align: left; color: var(--ink); background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); border-radius: 14px;
  transition: background 0.15s, border-color 0.15s;
}
.clue-title { display: flex; align-items: center; gap: 7px; margin-bottom: 2px; font-size: 10.5px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.clue-title .ico { width: 16px; height: 16px; color: var(--gold); }
.clue-title > span:not(.num) { min-width: 0; }
.clue-title .num { margin-left: auto; padding-left: 4px; font-variant-numeric: tabular-nums; color: var(--faint); }
.clue.fresh .clue-title .num { visibility: hidden; }
.clue strong { font-size: 15px; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.clue-sub { font-size: 12px; line-height: 1.38; color: var(--ink-2); }
.clue .more { display: inline-flex; align-items: center; gap: 2px; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--gold); }
.clue .more .ico { width: 14px; height: 14px; }
.clue.open { cursor: pointer; font: inherit; }
.clue.open:hover { background: rgba(255, 255, 255, 0.065); border-color: var(--line-2); }
.clue.locked { background: transparent; border-style: dashed; border-color: var(--line-2); }
.clue.locked .clue-title .ico { color: var(--faint); }
.clue.locked .clue-sub { color: var(--faint); }
.skel {
  display: block; height: 11px; width: 78%; margin: 5px 0 4px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04)) 0 0 / 200% 100%;
  animation: shimmer 2.6s linear infinite;
}
.clue.fresh { border-color: rgba(237, 190, 79, 0.5); background: linear-gradient(160deg, rgba(237, 190, 79, 0.1), rgba(255, 255, 255, 0.03)); }
.clue.fresh::before {
  content: "New"; position: absolute; top: 9px; right: 9px; padding: 1px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: #1a1460; background: var(--gold);
}
.clue.unlock { animation: unlock 1s var(--ease); }

/* ---------- the clue sheet (charts) ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(4, 3, 16, 0.66); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet-card {
  width: min(600px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto;
  padding: 22px 24px; border-radius: var(--r-xl); border: 1px solid var(--line-2);
  background: linear-gradient(180deg, #17143a, #0f0d2a); box-shadow: var(--shadow-2); animation: pop 0.35s var(--ease);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sheet-head h2 { font-size: 19px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.facts div { display: grid; }
.facts strong { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.facts span { font-size: 12.5px; color: var(--muted); }
.hero-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.hero { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.figure { margin: 14px 0 0; }
.figure figcaption { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.figure figcaption .muted { font-weight: 400; }
.chart { display: block; width: 100%; height: auto; font-family: var(--font); }
.chart.rose { max-width: 290px; margin: 0 auto; }
.chart.profile { max-width: 300px; margin: 6px auto 0; }
.chart .grid { stroke: var(--line); stroke-width: 1; fill: none; }
.chart .axis { stroke: var(--line-3); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.chart .tick.halo { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.chart .card { fill: var(--ink-2); font-size: 11px; font-weight: 600; }
.chart .seg { stroke: var(--surface); stroke-width: 1.2; }
.chart .seg:hover { filter: brightness(1.2); }
.chart .hit { fill: transparent; }
.chart .bar { transition: opacity 0.12s; }
.chart .bar.dim { opacity: 0.4; }
.chart .tower { fill: var(--ink-2); }
.chart .nacelle { fill: var(--ink); }
.chart .blade { stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; }
.chart .sweep { fill: rgba(237, 190, 79, 0.07); stroke: var(--gold); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dim { fill: var(--ink); font-size: 11.5px; font-weight: 600; }
.chart .dim.muted-ink { fill: var(--muted); font-weight: 400; }
.chart .dimline { stroke: var(--muted); stroke-width: 1; }
.chart-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.chart-pair .figure { margin-top: 14px; }
.legend-inline { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.lg { display: inline-flex; align-items: center; gap: 5px; }
.lg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg i.ln { height: 2px; width: 16px; border-radius: 1px; }
.table-view { margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }
.table-view summary { cursor: pointer; color: var(--muted); }
.table-view table { border-collapse: collapse; width: 100%; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.table-view th, .table-view td { text-align: right; padding: 3px 6px; border-bottom: 1px solid var(--line); font-weight: 400; }
.table-view th:first-child { text-align: left; }
.table-view thead th { color: var(--muted); }

/* ---------- dialogs ---------- */
dialog.dlg {
  position: fixed; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: auto; overflow-x: hidden;
  padding: 28px; border-radius: var(--r-xl); border: 1px solid var(--line-2); color: var(--ink);
  background: radial-gradient(120% 60% at 50% -10%, rgba(164, 62, 133, 0.16), transparent 60%), linear-gradient(180deg, #1f1b4a, #15123a);
  box-shadow: var(--shadow-2);
}
dialog.dlg[open] { animation: pop 0.38s var(--ease); }
dialog.dlg:focus { outline: none; }
dialog::backdrop { background: rgba(4, 3, 16, 0.62); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
.dlg-x { position: absolute; top: 14px; right: 14px; border-color: transparent; background: transparent; }
.dlg form[method="dialog"] { margin: 0; }

.onboard h2 { font-size: 31px; font-weight: 750; letter-spacing: -0.025em; line-height: 1.1; margin: 8px 0 10px; padding-right: 30px; }
.lede { font-size: 15.5px; color: var(--ink-2); }
.lede strong { color: var(--ink); }
.steps-visual { list-style: none; padding: 0; margin: 18px 0 14px; display: grid; gap: 8px; }
.steps-visual li { display: flex; align-items: flex-start; gap: 14px; padding: 12px 14px; border-radius: 15px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); }
.steps-visual li > div { display: grid; gap: 1px; }
.steps-visual strong { font-size: 15px; }
.steps-visual span { font-size: 13.5px; color: var(--ink-2); line-height: 1.42; }
.step-ico { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; color: var(--gold); background: rgba(237, 190, 79, 0.12); border: 1px solid rgba(237, 190, 79, 0.2); }
.step-ico .ico { width: 21px; height: 21px; }
.beaufort-key { display: flex; align-items: center; gap: 10px; margin: 2px 2px 14px; font-size: 12px; color: var(--muted); }
.bft-ramp { flex: 1; height: 6px; border-radius: 3px; background: var(--grad); }
.fine { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.fine a { color: var(--ink-2); }

/* The player's stats */
.level { display: flex; align-items: center; gap: 18px; padding: 2px 34px 20px 0; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.level-ring {
  --p: 0; position: relative; display: grid; place-items: center; width: 86px; height: 86px; flex: none; border-radius: 50%;
  background: conic-gradient(#7D2F9F 0deg, #DD8D57 calc(var(--p) * 300deg), #EDBE4F calc(var(--p) * 360deg), rgba(255, 255, 255, 0.08) calc(var(--p) * 360deg));
}
.level-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #15123a; }
.level-ring span { position: relative; font-size: 32px; font-weight: 800; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.level-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.level-text h3 { font-size: 22px; font-weight: 700; }
.xpbar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin: 8px 0 6px; }
.xpbar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); transition: width 1s var(--ease); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.stat-row div { display: grid; }
.stat-row strong { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-row span { font-size: 12px; color: var(--muted); }
.sub { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 10px; font-size: 12px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.dist { display: grid; gap: 5px; }
.dist-row { display: grid; grid-template-columns: 16px 1fr; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dist-track { height: 22px; border-radius: 6px; background: rgba(255, 255, 255, 0.03); }
.dist-bar { display: flex; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; border-radius: 6px; background: rgba(255, 255, 255, 0.11); transition: width 0.8s var(--ease); }
.dist-bar em { padding: 0 8px; font-style: normal; font-weight: 650; font-size: 12px; }
.dist-row.mine .dist-bar { background: var(--gold); color: #1a1460; }
.dist-row.mine > span { color: var(--gold); font-weight: 700; }
.dist.compact { gap: 4px; }
.dist.compact .dist-row { grid-template-columns: 14px 1fr 34px; gap: 8px; }
.dist.compact .dist-track { height: 12px; }
.dist.compact .dist-bar { padding: 0; border-radius: 4px; }
.dist.compact em { font-style: normal; font-size: 11.5px; text-align: right; color: var(--muted); }
.dist.compact .mine em { color: var(--gold); font-weight: 650; }
.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
.badge { display: grid; gap: 2px; align-content: start; padding: 12px; border-radius: 14px; border: 1px dashed var(--line-2); color: var(--faint); }
.badge-ico { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 6px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); }
.badge strong { font-size: 13.5px; color: var(--muted); }
.badge > span:last-child { font-size: 11.5px; line-height: 1.35; }
.badge.got { border: 1px solid rgba(237, 190, 79, 0.32); background: rgba(237, 190, 79, 0.08); color: var(--ink-2); }
.badge.got .badge-ico { background: var(--gold); color: #1a1460; box-shadow: 0 6px 16px -8px rgba(237, 190, 79, 0.8); }
.badge.got strong { color: var(--ink); }

/* The result sheet */
dialog.result-dlg { width: min(640px, calc(100vw - 24px)); padding: 26px; }
.rs-hero { text-align: center; padding: 6px 10px 20px; }
.rs-title { font-size: 36px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; margin: 8px 0 10px; }
.rs-hero.won .rs-title { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rs-farm { display: grid; gap: 2px; color: var(--ink-2); font-size: 13.5px; }
.rs-farm strong { font-size: 19px; color: var(--ink); font-weight: 650; }
.squares { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.squares i { --i: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; animation: flip 0.55s var(--ease) both; animation-delay: calc(0.25s + var(--i) * 0.09s); }
.squares i .ico { width: 22px; height: 22px; color: #1a1460; stroke-width: 3; }
.squares .found { background: var(--gold); box-shadow: 0 0 24px -4px rgba(237, 190, 79, 0.75); }
.squares .near { background: var(--orange); }
.squares .region { background: var(--coral); }
.squares .warm { background: var(--magenta); }
.squares .far { background: #6A2C9E; }
.squares .skip { background: #2a2650; }
.squares .empty { box-shadow: inset 0 0 0 1.5px var(--line-2); }
.rs-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 10px; }
.rs-card { display: grid; align-content: start; gap: 4px; padding: 16px; border-radius: 16px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); }
.rs-standing { font-size: 15px; margin: 4px 0 10px; line-height: 1.35; }
.rs-streak { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.flame-big .ico { width: 36px; height: 36px; }
.rs-streak b { font-size: 38px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.rs-streak > span:last-child { font-size: 12.5px; line-height: 1.25; color: var(--ink-2); }
.rs-level { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-2); }
.xp-gain { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.rs-card .xpbar { margin-bottom: 0; }
.rs-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.badge-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px 6px 10px; border-radius: 999px; background: var(--gold); color: #1a1460; font-size: 13px; font-weight: 650; animation: pop 0.5s var(--ease) both 0.6s; }
.badge-chip .ico { width: 16px; height: 16px; }
.rs-share { margin-top: 14px; padding: 14px; border-radius: 16px; background: rgba(0, 0, 0, 0.24); border: 1px solid var(--line); }
.share-frame { position: relative; aspect-ratio: 1200 / 630; margin-bottom: 12px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: var(--bg); }
.share-frame::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)) 0 0 / 200% 100%; animation: shimmer 2.4s linear infinite; }
.share-frame img { position: relative; display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 0.4s; }
.share-frame.ready img { opacity: 1; }
.share-frame.ready::before { display: none; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-buttons .btn.lg { flex: 1 1 220px; }
.rs-next { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; font-size: 13.5px; color: var(--muted); }
.rs-next > .ico { width: 16px; height: 16px; }
.rs-next a { display: inline-flex; align-items: center; gap: 2px; margin-left: 10px; color: var(--ink-2); text-decoration: none; font-weight: 550; }
.rs-next a:hover { color: var(--gold); }
.rs-next a .ico { width: 15px; height: 15px; }

/* ---------- toasts and confetti (top layer) ---------- */
.toasts {
  position: fixed; inset: auto 0 22px 0; margin: 0 auto; z-index: 90; width: max-content; max-width: calc(100vw - 24px); height: auto;
  display: grid; justify-items: center; gap: 8px; padding: 0; border: 0; background: transparent; overflow: visible; pointer-events: none;
}
.toasts:popover-open { display: grid; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 520px; padding: 11px 16px; pointer-events: auto;
  border-radius: 14px; border: 1px solid var(--line-2); background: rgba(22, 20, 54, 0.96); color: var(--ink); box-shadow: var(--shadow-2);
  font-size: 14px; line-height: 1.4; animation: toast-in 0.4s var(--ease);
}
.toast .ico { width: 20px; height: 20px; color: var(--ink-2); }
.toast.gold { border-color: rgba(237, 190, 79, 0.5); }
.toast.gold .ico { color: var(--gold); }
.toast b { color: var(--gold); }
.toast.out { animation: toast-out 0.35s var(--ease) forwards; }
.confetti { position: fixed; inset: 0; z-index: 95; width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; pointer-events: none; overflow: visible; }

/* ---------- footer ---------- */
.foot { margin-top: 16px; border-top: 1px solid var(--line); }
.foot-inner {
  max-width: 1600px; margin: 0 auto; padding: 26px 24px 40px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px;
}
.foot-brand { display: inline-flex; align-items: baseline; gap: 8px; font-size: 13.5px; color: var(--muted); text-decoration: none; }
.foot-brand .anemona { height: 11px; }
.foot-brand:hover { color: var(--ink-2); }
.credits { font-size: 12px; color: var(--faint); }
.credits summary { cursor: pointer; color: var(--muted); width: max-content; }
.credits p { margin-top: 8px; max-width: 110ch; }
.credits[open] { flex-basis: 100%; order: 2; }

/* ---------- the geographic map (Leaflet) ---------- */
.geo { position: absolute; inset: 0; display: none; z-index: 3; }
.stage.geo-on .geo { display: block; }
.stage.geo-on .map > canvas, .stage.geo-on .map-corner { display: none; }
.stage.geo-on .labbar, .stage.geo-on .tiles, .stage.geo-on .fineprint { display: none; }
.geo-map { position: absolute; inset: 0; background: var(--bg); font: inherit; }
/* OpenStreetMap's standard tiles, turned into a night map: inverted, hues put back, toned down. */
.tiles-dark { filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.9) saturate(0.45); }
.geo.picking .geo-map { cursor: crosshair; }
.geo-inset {
  position: absolute; left: 12px; bottom: 12px; width: 190px; height: 130px; z-index: 1000; overflow: hidden; pointer-events: none;
  border: 1px solid var(--line-3); border-radius: 12px; background: var(--bg); box-shadow: var(--shadow-2);
}
.geo-bar {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 1000;
  display: flex; align-items: center; gap: 12px; max-width: calc(100% - 24px); padding: 8px 8px 8px 16px;
  background: var(--glass); border: 1px solid var(--line-2); border-radius: 16px; font-size: 13.5px; color: var(--ink-2);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: var(--shadow-2);
}
.geo-bar:not(:has(button)) { padding-right: 16px; }
.geo-bar span { font-variant-numeric: tabular-nums; }
.geo-pin { position: relative; }
.geo-pin::before {
  content: ""; position: absolute; left: 3px; top: 0; width: 20px; height: 20px;
  background: var(--gold); border: 2px solid var(--bg); border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
}
.geo-pin::after { content: ""; position: absolute; left: 9px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--bg); }
.geo-guess {
  display: grid; place-items: center; border-radius: 50%; font: 700 11.5px var(--font);
  background: var(--surface-2); color: var(--ink); border: 1.5px solid var(--ink-2); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
.geo-guess.ok { border-color: var(--gold); background: var(--gold); color: #1a1460; }
.leaflet-container { font-family: var(--font); background: var(--bg); }
.leaflet-container a { color: var(--gold); }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--glass); color: var(--ink-2); border-bottom-color: var(--line); }
.leaflet-bar a:hover { color: var(--ink); background: rgba(37, 33, 86, 0.9); }
.leaflet-bar, .leaflet-touch .leaflet-bar, .leaflet-control-layers, .leaflet-touch .leaflet-control-layers {
  border: 1px solid var(--line-2) !important; border-radius: 12px; overflow: hidden; box-shadow: none;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.leaflet-control-layers { background: var(--glass); color: var(--ink-2); font-size: 13px; }
.leaflet-control-layers-expanded { padding: 8px 12px 8px 10px; }
.leaflet-control-layers label { cursor: pointer; }
.leaflet-control-attribution, .leaflet-container .leaflet-control-attribution { background: rgba(15, 13, 43, 0.72); color: var(--muted); font-size: 10px; border-radius: 8px 0 0 0; }
.leaflet-tooltip {
  background: rgba(22, 20, 54, 0.96); color: var(--ink); border: 1px solid var(--line-2); border-radius: 9px;
  box-shadow: var(--shadow-2); font-size: 12.5px; padding: 4px 9px;
}
.leaflet-tooltip::before { display: none; }
.leaflet-tooltip.geo-name { font-weight: 650; font-size: 13px; }

/* ---------- motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { box-shadow: inset 0 0 0 1.5px rgba(237, 190, 79, 0.3); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-12px); } }
@keyframes found { 0% { box-shadow: 0 0 0 0 rgba(237, 190, 79, 0.7); } 100% { box-shadow: 0 0 0 16px rgba(237, 190, 79, 0); } }
@keyframes unlock {
  0% { transform: scale(0.96); border-color: var(--gold); box-shadow: 0 0 0 0 rgba(237, 190, 79, 0.6); }
  60% { box-shadow: 0 0 0 10px rgba(237, 190, 79, 0); }
  100% { transform: none; }
}
@keyframes flip { from { opacity: 0; transform: rotateX(90deg) scale(0.8); } }
@keyframes risk { 50% { border-color: rgba(237, 190, 79, 0.9); box-shadow: 0 0 26px -6px rgba(237, 190, 79, 0.9); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- tablets and phones ---------- */
@media (max-width: 980px) {
  main.play { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 4px 16px 28px; }
  .top { padding: 12px 16px; }
  .banner { width: calc(100% - 32px); }
  /* The farm, then the guess box and the clues, then the wind lab. */
  .play .stage { display: contents; }
  .play .map { order: 1; height: min(56vh, 520px); min-height: 320px; }
  .play .side { order: 2; }
  .play .labbar { order: 3; margin: 0; }
  .play .tiles { order: 4; }
  .play .stage > .fineprint { order: 5; margin-top: 0; }
  .foot-inner { padding: 22px 16px 34px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .top { gap: 8px 10px; padding: 10px 12px 8px; }
  .brand { gap: 9px; }
  .mark { width: 32px; height: 32px; }
  .wordmark { font-size: 18.5px; }
  .modes { order: 3; margin-left: 0; }
  .modes a { padding: 6px 12px; font-size: 13.5px; }
  .top-actions { gap: 6px; }
  /* Daily: the name and the player's buttons, then the mode switch and the farm picker. */
  body.daily .top-actions { display: contents; }
  body.daily .brand { order: 1; flex: 1; min-width: 0; }
  body.daily .streak-chip { order: 2; }
  body.daily #btn-stats { order: 3; }
  body.daily #btn-help { order: 4; }
  body.daily .top::after { content: ""; order: 5; flex-basis: 100%; height: 0; }
  body.daily .modes { order: 6; }
  body.daily .daynav { order: 7; margin-left: auto; }
  .modes a .ico { display: none; }
  .daynav select { max-width: 132px; font-size: 13.5px; padding-right: 24px; background-position: right 5px center; }
  .icon-btn { width: 36px; height: 36px; }
  .streak-chip { height: 36px; }
  main.play { padding: 2px 10px 24px; }
  .banner { width: calc(100% - 20px); font-size: 13px; }
  .play .map { height: min(52vh, 460px); min-height: 300px; border-radius: 18px; }
  .panel { padding: 15px 14px 14px; border-radius: 18px; }
  .panel-title { font-size: 22px; margin-bottom: 12px; }
  .legend { display: none; }
  /* A phone shows the farm, the guess and the clues: the wind lab and its numbers stay on bigger screens. */
  .labbar, .tiles { display: none; }
  .clues { grid-template-columns: minmax(0, 1fr); }
  .clue.locked { display: none; }
  .windbox { padding: 5px 9px 5px 5px; gap: 6px; }
  .compass { width: 58px; height: 58px; }
  .wind-readout { min-width: 0; font-size: 11.5px; }
  .wind-readout strong { font-size: 12.5px; }
  .wind-readout .muted, .wind-readout .long { display: none; }
  .viewtabs.seg button { padding: 6px 10px; }
  .clue { min-height: 0; padding: 10px 12px; }
  .clue strong { font-size: 14px; }
  .result-name { font-size: 25px; }
  /* 16 px keeps iOS from zooming the page when a field takes the focus. */
  input[type="text"], input[type="search"], select, textarea, #guess-input { font-size: 16px; }
  .chart-pair { grid-template-columns: minmax(0, 1fr); }
  .sheet { padding: 0; place-items: end stretch; }
  .sheet-card { width: 100%; border-radius: 22px 22px 0 0; max-height: 90dvh; padding: 18px 16px 24px; }
  /* Dialogs become bottom sheets. */
  dialog.dlg, dialog.result-dlg {
    width: 100%; max-width: 100%; margin: auto 0 0; max-height: 92dvh; border-radius: 24px 24px 0 0;
    padding: 22px 16px calc(22px + env(safe-area-inset-bottom)); border-bottom: 0;
  }
  dialog.dlg[open] { animation: sheet-up 0.42s var(--ease); }
  .onboard h2 { font-size: 26px; }
  .rs-title { font-size: 30px; }
  .rs-grid { grid-template-columns: minmax(0, 1fr); }
  /* The result sheet leads with the card and the way to share it; the guess chart stays on bigger screens. */
  #result-body { display: flex; flex-direction: column; }
  .rs-share { order: 1; margin: 0 0 12px; }
  .rs-grid, .rs-badges, .rs-next { order: 2; }
  .rs-card .dist { display: none; }
  .share-buttons .btn.lg { flex: 1 1 auto; }
  .squares i { width: 36px; height: 36px; }
  .stat-row strong { font-size: 24px; }
  .level-ring { width: 72px; height: 72px; }
  .level-ring span { font-size: 27px; }
  .badges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0.4; } }

/* =========================================================================
   Quiz arcade
   ========================================================================= */
main.lobby { max-width: 1440px; margin: 0 auto; padding: 6px 24px 40px; }
.lobby-main { min-width: 0; }
.lobby-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.arcade { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 14px; }
.arcade-hero {
  position: relative; overflow: hidden; display: flex; align-items: center; min-height: 260px; padding: 28px 30px;
  background: radial-gradient(90% 120% at 100% 0%, rgba(164, 62, 133, 0.24), transparent 60%), linear-gradient(180deg, rgba(32, 28, 74, 0.9), rgba(20, 17, 50, 0.9));
}
.hero-art {
  position: absolute; inset: 0 0 0 38%; opacity: 0.95; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 38%); mask-image: linear-gradient(90deg, transparent, #000 38%);
}
.hero-art .wake-art { width: 100%; height: 100%; display: block; }
.hero-copy { position: relative; max-width: 560px; }
.arcade-hero h1 { font-size: 38px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.06; margin: 10px 0 12px; max-width: 16ch; }
.arcade-hero .lede { font-size: 15px; max-width: 46ch; color: var(--ink-2); }
.player { display: flex; align-items: center; gap: 12px; margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.player input { flex: 1; max-width: 320px; min-width: 0; }
.together { display: grid; align-content: start; gap: 4px; }
.together h2 { font-size: 20px; margin: 8px 0 2px; }
.together > .muted { font-size: 13.5px; margin-bottom: 12px; }
.join-room { display: flex; gap: 8px; margin-bottom: 8px; }
.code-input { flex: 1; min-width: 0; text-align: center; text-transform: uppercase; letter-spacing: 0.24em; font-weight: 700; }
.code-input::placeholder { letter-spacing: 0.24em; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 30px 0 12px; }
.section-head.first { margin-top: 26px; }
.section-title { font-size: 20px; font-weight: 700; }
.section-sub { font-size: 13.5px; color: var(--muted); margin-top: 2px; max-width: 70ch; }
.decks { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 12px; }
.deck {
  position: relative; display: grid; align-content: start; overflow: hidden; cursor: pointer;
  border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(34, 30, 76, 0.94), rgba(22, 19, 54, 0.94));
  transition: transform 0.25s var(--ease), border-color 0.2s, box-shadow 0.25s;
}
.deck.off { --tint: rgba(79, 38, 156, 0.5); }
.deck.on { --tint: rgba(195, 100, 106, 0.32); }
.deck.custom { --tint: rgba(164, 62, 133, 0.4); }
.deck:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 24px 44px -26px rgba(0, 0, 0, 0.95); }
.deck[aria-current="true"] { border-color: rgba(237, 190, 79, 0.6); box-shadow: inset 0 0 0 1px rgba(237, 190, 79, 0.25), 0 22px 46px -26px rgba(237, 190, 79, 0.55); }
.deck-art {
  position: relative; height: 108px; overflow: hidden; border-bottom: 1px solid var(--line);
  background: radial-gradient(110% 130% at 70% 30%, var(--tint), transparent 70%), var(--bg);
}
.deck-art .wake-art { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform 0.8s var(--ease); }
.deck:hover .deck-art .wake-art { transform: scale(1.07); }
.deck-kind {
  position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 7px;
  border-radius: 999px; border: 1px solid var(--line-2); background: rgba(15, 13, 43, 0.72);
  font-size: 10.5px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.deck-kind .ico { width: 13px; height: 13px; color: var(--gold); }
.deck-body { display: grid; gap: 3px; padding: 13px 15px 15px; }
.deck h3 { font-size: 18px; font-weight: 700; }
.deck-about { font-size: 13px; color: var(--muted); }
.deck-desc { font-size: 13px; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 0; }
.best { display: flex; align-items: center; gap: 7px; min-height: 22px; margin-top: 8px; font-size: 13.5px; min-width: 0; }
.best .ico { width: 16px; height: 16px; color: var(--gold); }
.best strong { font-variant-numeric: tabular-nums; }
.best span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.play-row { display: flex; gap: 6px; margin-top: 12px; }
.play-row .btn { flex: 1; padding: 8px 10px; }
.play-row .ico { width: 16px; height: 16px; }
.owner { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; }
.linklike { padding: 0; border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; }
.linklike:hover { color: var(--ink-2); }
.empty-note { padding: 16px; border: 1px dashed var(--line-2); border-radius: 14px; }

.board-panel { display: grid; gap: 2px; }
@media (min-width: 981px) { .board-panel { position: sticky; top: 14px; } }
.board-title { font-size: 22px; font-weight: 700; margin-top: 6px; }
.board-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 4px; }
.board-list li {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; column-gap: 10px; row-gap: 0; align-items: center;
  padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.03);
}
.board-list .rank { grid-row: 1 / 3; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; font-size: 13px; font-weight: 750; color: var(--muted); background: rgba(255, 255, 255, 0.05); font-variant-numeric: tabular-nums; }
.board-list .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.board-list .pts { font-weight: 750; font-variant-numeric: tabular-nums; }
.board-list .meta { grid-column: 2 / 4; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.board-list .top1 .rank { background: var(--gold); color: #1a1460; box-shadow: 0 6px 16px -8px rgba(237, 190, 79, 0.9); }
.board-list .top2 .rank { background: #d9d4ea; color: #1a1460; }
.board-list .top3 .rank { background: #d78a74; color: #1a1460; }
.board-list li.me { background: rgba(237, 190, 79, 0.12); box-shadow: inset 0 0 0 1px rgba(237, 190, 79, 0.36); }
.board-panel > .btn { margin-top: 6px; }
.board-empty {
  display: grid; justify-items: center; gap: 10px; margin: 12px 0; padding: 22px 12px; text-align: center;
  border: 1px dashed var(--line-2); border-radius: 16px; font-size: 13.5px; color: var(--ink-2);
}
.board-empty strong { color: var(--ink); }
.trophy-ring { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; color: #1a1460; background: var(--gold); box-shadow: 0 12px 30px -10px rgba(237, 190, 79, 0.8); }
.trophy-ring .ico { width: 26px; height: 26px; }

/* A round */
.round-label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.q-score { display: inline-flex; align-items: center; gap: 7px; font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; }
.q-score .ico { width: 18px; height: 18px; color: var(--gold); }
.q-progress { list-style: none; display: flex; gap: 4px; margin: 10px 0 14px; padding: 0; }
.q-progress li { flex: 1; height: 5px; border-radius: 3px; background: var(--line-2); }
.q-progress li.found { background: var(--gold); box-shadow: 0 0 10px -2px var(--gold); }
.q-progress li.near { background: var(--orange); }
.q-progress li.far { background: var(--violet); }
.q-progress li.now { background: transparent; box-shadow: inset 0 0 0 1.5px var(--gold); }
.prompt { margin: -8px 0 14px; font-size: 13.5px; color: var(--muted); }
.name-form { display: flex; gap: 8px; }
.name-form input { flex: 1; min-width: 0; padding: 12px 14px; font-size: 16px; }
#btn-choices { margin-top: 8px; }
.stakes { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.stakes b { color: var(--ink); font-weight: 700; }
.bonus, .clock { display: grid; gap: 6px; margin-top: 14px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.clock { grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.bonus-track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bonus-fill { height: 100%; width: 100%; border-radius: 3px; background: var(--grad); transition: width 0.1s linear; }
.choices { display: grid; gap: 8px; }
.choice {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: left; cursor: pointer;
  border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04); color: var(--ink); font-size: 15px; font-weight: 600;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.choice:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); border-color: var(--line-3); transform: translateX(2px); }
.choice:disabled { cursor: default; }
.choice.idle { color: var(--muted); font-weight: 500; opacity: 0.7; }
.choice.right { border-color: var(--gold); background: rgba(237, 190, 79, 0.14); }
.choice.wrong { border-color: var(--miss); background: rgba(195, 100, 106, 0.14); }
.choice.picked { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.keyhint {
  display: inline-grid; place-items: center; flex: none; min-width: 26px; height: 26px; padding: 0 6px;
  border: 1px solid var(--line-2); border-radius: 8px; font-size: 12px; font-weight: 650; color: var(--ink-2);
}
.keyhint .ico { width: 15px; height: 15px; stroke-width: 3; }
.choice.right .keyhint { background: var(--gold); border-color: transparent; color: #1a1460; }
.choice.wrong .keyhint { background: var(--coral); border-color: transparent; color: #1a1460; }
.btn .keyhint { min-width: 0; height: 21px; padding: 0 6px; border-color: currentColor; font-size: 11px; opacity: 0.65; color: inherit; }
.miss { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; font-size: 13.5px; color: var(--ink-2); }
.miss .ico { color: var(--miss); margin-top: 1px; }
.miss span { overflow-wrap: anywhere; }
.verdict { display: grid; gap: 4px; margin-top: 14px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); animation: rise 0.4s var(--ease); }
.verdict.right { border-color: rgba(237, 190, 79, 0.45); background: radial-gradient(120% 140% at 0% 0%, rgba(237, 190, 79, 0.16), transparent 62%), rgba(255, 255, 255, 0.03); }
.verdict-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.verdict-line strong { color: var(--ink); }
.verdict.right .verdict-line > .ico { color: var(--gold); }
.verdict.wrong .verdict-line > .ico { color: var(--miss); }
.points-pop { margin-left: auto; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; animation: points 0.8s var(--ease); }
.verdict h3 { font-size: 22px; font-weight: 700; line-height: 1.15; }
#btn-next { margin-top: 12px; }
.quit { margin-top: 14px; text-align: center; }
.error { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(195, 100, 106, 0.4); background: rgba(195, 100, 106, 0.16); font-size: 13.5px; color: var(--ink); }
.error .ico { color: var(--miss); }

.q-final { display: grid; gap: 14px; }
.final { display: flex; align-items: baseline; gap: 10px; }
.hero-score { font-size: 66px; font-weight: 800; line-height: 0.95; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.squares.q { justify-content: flex-start; flex-wrap: wrap; gap: 5px; margin: 0; }
.squares.q i { width: 26px; height: 26px; border-radius: 8px; }
.squares.q i .ico { width: 15px; height: 15px; }
.xp-line { font-size: 13.5px; color: var(--ink-2); }
.xp-line b { color: var(--gold); }
.q-final .sub { margin: 8px 0 0; }
.q-final .share-buttons { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; }
.q-final .result-actions .btn { flex: 1; }
.q-final .board-list { margin-top: 0; }
@keyframes points { 0% { opacity: 0; transform: translateY(8px) scale(0.6); } 60% { transform: translateY(-3px) scale(1.12); } }

/* =========================================================================
   Rooms
   ========================================================================= */
main.door { max-width: 580px; margin: 0 auto; padding: 24px 20px 48px; }
.door-card { display: grid; gap: 12px; padding: 26px; }
.door-card h2 { font-size: 24px; }
.roomcode { letter-spacing: 0.16em; font-weight: 800; font-variant-numeric: tabular-nums; }
.roomcode.big { font-size: 60px; line-height: 1; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chip.roomcode { padding: 5px 12px; font-size: 13px; color: var(--ink); border-color: rgba(237, 190, 79, 0.45); background: rgba(237, 190, 79, 0.1); letter-spacing: 0.14em; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-2); }
.roster { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.roster li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); font-size: 14px; min-width: 0; }
.roster li.away { opacity: 0.5; }
.roster .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.roster .tick { margin-left: auto; color: var(--gold); }
.avatar { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; font-size: 12px; font-weight: 750; color: #1a1460; background: var(--c, var(--gold)); }
.pick { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.pick select { width: 100%; }
.waiting { font-size: 13.5px; color: var(--muted); }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; margin: 6px 0 4px; }
.podium div { display: grid; justify-items: center; gap: 6px; padding: 12px 8px 10px; border-radius: 14px 14px 6px 6px; background: rgba(255, 255, 255, 0.05); text-align: center; min-width: 0; }
.podium .p1 { padding-top: 18px; background: linear-gradient(180deg, rgba(237, 190, 79, 0.22), rgba(237, 190, 79, 0.05)); border: 1px solid rgba(237, 190, 79, 0.4); }
.podium strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.podium span { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.podium .medal { font-size: 22px; font-weight: 800; }

/* =========================================================================
   Create a quiz
   ========================================================================= */
main.create { grid-template-columns: minmax(0, 1fr) 420px; max-width: 1440px; margin: 0 auto; padding: 6px 24px 40px; }
main.create > aside { display: grid; gap: 12px; }
@media (min-width: 981px) { main.create > aside { position: sticky; top: 14px; } }
.create-intro h1 { font-size: 30px; font-weight: 750; letter-spacing: -0.025em; margin: 8px 0 6px; }
.tabs { margin: 18px 0 14px; }
.finder { display: flex; gap: 8px; margin-bottom: 8px; }
.finder input[type="search"], .finder input[type="text"], .finder input[type="file"] { flex: 1; min-width: 0; }
.finder input[type="file"] { padding: 8px; border-radius: 12px; border: 1px dashed var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--ink-2); }
.fields { display: grid; gap: 12px; }
.fields label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 6px; font-size: 13px; color: var(--muted); }
.fields input, .fields select { width: 100%; flex-basis: 100%; }
.farmlist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.farmlist li { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.farmlist li.muted, .farmlist li.error { border-style: dashed; background: transparent; }
.farm-main { display: grid; flex: 1; min-width: 0; }
.farm-main strong, .farm-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.farm-main span { font-size: 12.5px; }
.farmlist .chip { flex: none; white-space: nowrap; }
.farmlist .btn { flex: none; padding: 6px 12px; font-size: 13.5px; }
.farmlist .btn .ico { color: var(--gold); }
.farmlist.chosen { max-height: 40vh; overflow: auto; margin-top: 0; }
.farmlist.chosen li { padding: 7px 10px; }
.farmlist.chosen .chip { display: none; }
.steps { display: grid; gap: 22px; margin: 4px 0 0; padding-left: 22px; }
.steps h3 { font-size: 16px; margin-bottom: 4px; }
.steps p { margin-bottom: 8px; }
.steps .fields { max-width: 560px; margin-bottom: 10px; }
.check { display: flex; align-items: flex-start; gap: 9px; margin-top: 10px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.check input { flex: none; margin-top: 3px; }
.check strong { color: var(--ink); }
.visibility { margin: 4px 0 0; padding: 0; border: 0; }
.visibility legend { padding: 0; font-size: 13px; color: var(--muted); }
table.cols { width: 100%; margin: 8px 0; border-collapse: collapse; font-size: 12.5px; }
table.cols th, table.cols td { padding: 5px 8px 5px 0; text-align: left; vertical-align: top; font-weight: 400; border-bottom: 1px solid var(--line); }
table.cols tbody th { color: var(--ink); font-family: ui-monospace, Consolas, monospace; white-space: nowrap; }
table.cols thead th { color: var(--muted); }
.issues { display: grid; gap: 3px; margin: 6px 0 0; padding-left: 20px; font-size: 13.5px; color: var(--ink-2); }
.done { display: flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 13.5px; }
.done .ico { color: var(--gold); }
.created-title { font-size: 24px; line-height: 1.2; }
.board-title.flush, .sub.flush { margin-top: 0; }
.door-card .sub { margin: 10px 0 0; }

@media (max-width: 1060px) {
  .lobby-body { grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
}
@media (max-width: 980px) {
  main.lobby, main.create { padding: 4px 16px 28px; }
  main.create { grid-template-columns: minmax(0, 1fr); }
  .lobby-body { grid-template-columns: minmax(0, 1fr); }
  main.create .farmlist:not(.chosen) { max-height: 55vh; overflow: auto; }
}
@media (max-width: 860px) {
  .arcade { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  main.lobby, main.create { padding: 2px 10px 24px; }
  .arcade-hero { min-height: 0; padding: 22px 18px; }
  .hero-art { inset: 0 0 0 20%; opacity: 0.6; }
  .arcade-hero h1 { font-size: 28px; }
  .decks { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
  .deck { padding: 13px; }
  .play-row { flex-direction: column; }
  .hero-score { font-size: 54px; }
  .roomcode.big { font-size: 46px; }
  main.door { padding: 12px 10px 28px; }
  .door-card { padding: 18px 16px; }
  .finder { flex-wrap: wrap; }
  .finder input[type="search"] { flex: 1 1 100%; }
  .finder select { flex: 1; min-width: 0; }
  .farmlist li { flex-wrap: wrap; gap: 4px 10px; }
  .farmlist .chip { order: 3; }
  .steps { padding-left: 18px; }
  table.cols { display: block; overflow-x: auto; }
}

/* ---------- challenge a friend ---------- */
.banner .ico { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; color: var(--gold); }
.banner b { color: var(--ink); }
.challenge-note { margin: 4px 0 10px; }
.share-buttons.challenge input {
  flex: 1 1 140px; min-width: 0; font: inherit; color: var(--ink); background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px;
}
.share-buttons.challenge .btn.lg { flex: 2 1 220px; }
.rs-versus { display: flex; gap: 8px; align-items: flex-start; justify-content: center; margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.rs-versus .ico { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--gold); }
.rs-versus b { color: var(--ink); }
.q-final .rs-versus { justify-content: flex-start; margin: 4px 0 12px; }
.q-final .share-buttons { grid-template-columns: minmax(0, 1fr) auto; }
body.in-round #challenge { display: none; }
.rs-share .share-frame { margin: 12px 0 0; }

/* ---------- report a problem ---------- */
.rs-report { margin-top: 6px; text-align: center; }
.verdict .rs-report { text-align: left; margin-top: 4px; }
.rs-report .linklike { display: inline-flex; align-items: center; gap: 5px; }
.rs-report .ico { width: 14px; height: 14px; }
.report-title { font-size: 22px; margin: 4px 0 8px; padding-right: 30px; }
#dlg-report .fields { display: grid; gap: 10px; margin-top: 14px; }
#dlg-report textarea { width: 100%; resize: vertical; }
