/* Universidle, in a concept-art style: flat colour shapes, paper-grain texture, layered golden-hour silhouettes
   and film-title type. Rules written for that look are scoped to :root[data-style="concept"], which every page sets
   on <html>. Layout: establishing-shot scene across the page top, then a game column and a sticky globe column. */

/* FONTS:START */
@font-face { font-family: "Big Shoulders Display"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../assets/fonts/big-shoulders-display-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Big Shoulders Display"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../assets/fonts/big-shoulders-display-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("../assets/fonts/figtree-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("../assets/fonts/figtree-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* FONTS:END */

/* ===================================================================== TOKENS
   Light values on bare :root; the two dark blocks redefine them (system dark mode, or the night toggle). */
:root {
  --font-display: "Big Shoulders Display", "Oswald", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-ui: "Figtree", "Segoe UI", system-ui, sans-serif;
  --display-weight: 800;
  --display-case: uppercase;
  --display-track: .035em;
  --btn-font: 800 .95rem/1 var(--font-ui);
  --btn-case: uppercase;
  --btn-track: .08em;
  --outline: #1f2d3a;
  --text: #1f2d3a;
  --text-soft: #56626c;
  --on-page: #f3ecdf;
  --paper: #f3ece0;
  --paper-2: #e9dfcd;
  --paper-3: #ded0b8;
  --accent: #efb34a;
  --accent-shade: #efb34a;
  --on-accent: #1f2d3a;
  --accent-ink: #b4553a;
  --teal: #3b8f88;
  --teal-shade: #3b8f88;
  --gold: #efb34a;
  --gold-shade: #efb34a;
  --link: #1d6a84;
  --good: #76b386;
  --good-shade: #76b386;
  --near: #e8c35f;
  --near-shade: #e8c35f;
  --bad: #de7163;
  --bad-shade: #de7163;
  --on-tile: #1b2833;
  --fringe: transparent;
  --hatch: rgba(31, 45, 58, .06);
  --rim: transparent;
  --pat: rgba(27, 40, 51, .075);
  --pat-dot: rgba(27, 40, 51, .10);
  --backdrop: rgba(14, 24, 33, .6);
  --bw: 1.5px;
  --bw-sm: 1.5px;
  --bc: rgba(31, 45, 58, .16);
  --sh-1: 0 2px 0 rgba(20, 34, 44, .16);
  --sh-2: 0 3px 0 rgba(20, 34, 44, .18);
  --sh-3: 0 4px 0 rgba(20, 34, 44, .2);
  --sh-card: 0 8px 0 rgba(12, 28, 38, .28);
  --sh-press: 0 0 0 transparent;
  --gloss: 0;
  --cel: 100%;
  --lift: -1px;
  --r-xl: 16px;
  --r-lg: 12px;
  --r-md: 10px;
  --r-sm: 8px;
  --grain: .5;
  --sky-top: #9fc2cc;
  --sky-bottom: #f3c38f;
  --sea: #28495a;
  --sea-deep: #173240;
  --horizon: 250px;
  --bg-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='180' viewBox='0 0 520 180'%3E%3Cg stroke='%23f6c77c' stroke-width='2' stroke-linecap='round' opacity='.09'%3E%3Cpath d='M18 22h58M150 16h24M300 30h84M442 12h36M84 70h30M210 64h62M356 80h22M470 58h32M30 118h44M170 126h92M318 110h30M420 136h64M100 162h26M250 170h40M380 158h58'/%3E%3C/g%3E%3C/svg%3E");
  --sun-o: 1;
  --moon-o: 0;
  --stars-o: 0;
  --c-sky1: #9fc2cc;
  --c-sky2: #c4d0c5;
  --c-sky3: #ead3ae;
  --c-sky4: #f3c38f;
  --c-sun: #fbe7c2;
  --c-cloud: #f6e5cb;
  --c-far: #b9a2b6;
  --c-mid: #8e87a7;
  --c-city: #525c7e;
  --c-fore: #2d4955;
  --c-win: #f6c77c;
  --win-o: .5;
  --globe-line: .42;
  --globe-ocean: #5f96a8;
  --globe-ocean-line: rgba(255, 255, 255, .16);
  --globe-land: #ecdcb8;
  --globe-shadow: rgba(24, 40, 70, .2);
  --globe-rim: rgba(255, 246, 226, .5);
  --bar: #3b8f88;
  --bar-me: #de7163;
  --grid: rgba(31, 45, 58, .14);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --outline: #0c1520;
    --text: #ece5d8;
    --text-soft: #a8b3bc;
    --paper: #1c2a38;
    --paper-2: #243546;
    --paper-3: #2d4053;
    --on-accent: #172330;
    --accent-ink: #f0a07f;
    --teal: #4aa39b;
    --teal-shade: #4aa39b;
    --link: #8fc8dc;
    --good: #6aa97a;
    --good-shade: #6aa97a;
    --near: #e2bd58;
    --near-shade: #e2bd58;
    --bad: #d8695c;
    --bad-shade: #d8695c;
    --on-tile: #132029;
    --pat: rgba(0, 0, 0, .1);
    --pat-dot: rgba(0, 0, 0, .13);
    --backdrop: rgba(3, 8, 14, .7);
    --bc: rgba(236, 229, 216, .12);
    --sh-1: 0 2px 0 rgba(0, 0, 0, .3);
    --sh-2: 0 3px 0 rgba(0, 0, 0, .32);
    --sh-3: 0 4px 0 rgba(0, 0, 0, .34);
    --sh-card: 0 8px 0 rgba(0, 0, 0, .38);
    --sky-top: #121b33;
    --sky-bottom: #4a4468;
    --sea: #13253a;
    --sea-deep: #0b1727;
    --sun-o: 0;
    --moon-o: 1;
    --stars-o: 1;
    --c-sky1: #111a31;
    --c-sky2: #1a2642;
    --c-sky3: #29325a;
    --c-sky4: #4a4468;
    --c-sun: #efe3c8;
    --c-cloud: #2e3858;
    --c-far: #2f3857;
    --c-mid: #232b46;
    --c-city: #171f35;
    --c-fore: #0e1625;
    --c-win: #ffcd78;
    --win-o: 1;
    --globe-ocean: #2f5a74;
    --globe-ocean-line: rgba(255, 255, 255, .1);
    --globe-land: #c9b98f;
    --globe-shadow: rgba(0, 0, 0, .33);
    --globe-rim: rgba(255, 240, 210, .22);
    --bar: #4aa39b;
    --bar-me: #e07a6c;
    --grid: rgba(236, 229, 216, .14);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --outline: #0c1520;
  --text: #ece5d8;
  --text-soft: #a8b3bc;
  --paper: #1c2a38;
  --paper-2: #243546;
  --paper-3: #2d4053;
  --on-accent: #172330;
  --accent-ink: #f0a07f;
  --teal: #4aa39b;
  --teal-shade: #4aa39b;
  --link: #8fc8dc;
  --good: #6aa97a;
  --good-shade: #6aa97a;
  --near: #e2bd58;
  --near-shade: #e2bd58;
  --bad: #d8695c;
  --bad-shade: #d8695c;
  --on-tile: #132029;
  --pat: rgba(0, 0, 0, .1);
  --pat-dot: rgba(0, 0, 0, .13);
  --backdrop: rgba(3, 8, 14, .7);
  --bc: rgba(236, 229, 216, .12);
  --sh-1: 0 2px 0 rgba(0, 0, 0, .3);
  --sh-2: 0 3px 0 rgba(0, 0, 0, .32);
  --sh-3: 0 4px 0 rgba(0, 0, 0, .34);
  --sh-card: 0 8px 0 rgba(0, 0, 0, .38);
  --sky-top: #121b33;
  --sky-bottom: #4a4468;
  --sea: #13253a;
  --sea-deep: #0b1727;
  --sun-o: 0;
  --moon-o: 1;
  --stars-o: 1;
  --c-sky1: #111a31;
  --c-sky2: #1a2642;
  --c-sky3: #29325a;
  --c-sky4: #4a4468;
  --c-sun: #efe3c8;
  --c-cloud: #2e3858;
  --c-far: #2f3857;
  --c-mid: #232b46;
  --c-city: #171f35;
  --c-fore: #0e1625;
  --c-win: #ffcd78;
  --win-o: 1;
  --globe-ocean: #2f5a74;
  --globe-ocean-line: rgba(255, 255, 255, .1);
  --globe-land: #c9b98f;
  --globe-shadow: rgba(0, 0, 0, .33);
  --globe-rim: rgba(255, 240, 210, .22);
  --bar: #4aa39b;
  --bar-me: #e07a6c;
  --grid: rgba(236, 229, 216, .14);
  color-scheme: dark;
}

/* ===================================================================== BASE */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 500 16px/1.45 var(--font-ui);
  color: var(--text);
  background-color: var(--sea-deep);
  background-image: var(--bg-pattern), linear-gradient(180deg, var(--sky-top) 0, var(--sky-bottom) var(--horizon), var(--sea) var(--horizon), var(--sea-deep) 1400px);
  background-repeat: repeat, no-repeat;
  background-position: 0 var(--horizon), 0 0;
  overflow-x: hidden;
}
/* flat paper grain over everything (concept style) */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: var(--grain); mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, svg { max-width: 100%; }
a { color: var(--link); font-weight: 700; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 50; background: var(--paper); padding: 8px 14px; border: var(--bw) solid var(--bc); border-radius: 12px; }
.skip:focus { top: 12px; }

/* ===================================================================== SCENES */
.scene { position: absolute; inset: 0 0 auto 0; height: 290px; z-index: 0; pointer-events: none; overflow: hidden; }
.scene svg { position: absolute; left: 50%; bottom: 0; width: max(1440px, 100%); height: 290px; transform: translateX(-50%); }
.scene .sun { opacity: var(--sun-o); }
.scene .moon { opacity: var(--moon-o); }
.scene .stars { opacity: var(--stars-o); }
/* scene paint: flat layers, atmospheric perspective */
.c-sky1 { fill: var(--c-sky1); } .c-sky2 { fill: var(--c-sky2); } .c-sky3 { fill: var(--c-sky3); } .c-sky4 { fill: var(--c-sky4); }
.c-sun { fill: var(--c-sun); }
.c-halo { fill: var(--c-sun); opacity: .22; }
.c-halo2 { fill: var(--c-sun); opacity: .12; }
.c-cloud { fill: var(--c-cloud); opacity: .75; }
.c-far { fill: var(--c-far); }
.c-mid { fill: var(--c-mid); }
.c-city { fill: var(--c-city); }
.c-fore { fill: var(--c-fore); }
.c-win { fill: var(--c-win); opacity: var(--win-o); }
.c-star { fill: var(--c-sun); }
.c-bird { fill: none; stroke: var(--c-city); stroke-width: 2.2; stroke-linecap: round; }

/* ===================================================================== TOP BAR */
.shell { position: relative; z-index: 1; width: min(1240px, 100%); margin-inline: auto; padding-inline: 16px; }
.topbar { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; padding-block: 14px 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; margin-right: auto; }
.brand__emblem { width: 44px; height: 44px; flex: none; color: var(--text); }
.brand__word {
  font: var(--display-weight) clamp(1.85rem, 1.2rem + 2.6vw, 2.9rem)/1 var(--font-display);
  color: var(--accent);
  letter-spacing: .01em;
  text-shadow:
    3px 0 0 var(--outline), -3px 0 0 var(--outline), 0 3px 0 var(--outline), 0 -3px 0 var(--outline),
    2px 2px 0 var(--outline), -2px 2px 0 var(--outline), 2px -2px 0 var(--outline), -2px -2px 0 var(--outline),
    0 7px 0 var(--outline), 3px 7px 0 var(--outline), -3px 7px 0 var(--outline), 0 16px 18px var(--fringe);
}
.brand__word b { color: var(--gold); font-weight: inherit; }
:root[data-style="concept"] .brand__word {
  color: var(--text); text-shadow: none; text-transform: uppercase; letter-spacing: .09em; font-size: clamp(1.7rem, 1.1rem + 2.2vw, 2.55rem);
}
:root[data-style="concept"] .brand__word b { color: var(--accent-ink); }
.tools { display: flex; gap: 10px; }
.icon-btn {
  width: 46px; height: 46px; display: grid; place-items: center;
  border: var(--bw) solid var(--bc); border-radius: 16px; cursor: pointer;
  background: linear-gradient(180deg, var(--paper) 0 58%, var(--paper-3) 58%);
  box-shadow: var(--sh-1); color: var(--text);
  transition: transform .12s ease, box-shadow .12s ease;
}
:root[data-style="concept"] .icon-btn { background: var(--paper); border-radius: 12px; }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:hover { transform: translateY(var(--lift)); }
.icon-btn:active { transform: translateY(2px); box-shadow: var(--sh-press); }

.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: min(560px, 100%); order: 3; }
.mode {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  min-height: 58px; padding: 6px 8px; cursor: pointer;
  border: var(--bw) solid var(--bc); border-radius: 18px;
  background: linear-gradient(180deg, var(--paper) 0 var(--cel), var(--paper-2) var(--cel));
  box-shadow: var(--sh-2); color: var(--text);
  transition: transform .15s cubic-bezier(.3,1.7,.5,1), box-shadow .15s ease, background-color .15s ease;
}
.mode__name { font: 800 1.05rem/1.1 var(--font-ui); }
.mode__sub { font-size: .74rem; color: var(--text-soft); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mode:hover { transform: translateY(var(--lift)); }
.mode[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--accent) 0 var(--cel), var(--accent-shade) var(--cel));
  color: var(--on-accent); transform: translateY(3px); box-shadow: var(--sh-press);
}
.mode[aria-pressed="true"] .mode__sub { color: var(--on-accent); opacity: .8; }
:root[data-style="concept"] .mode { border-radius: 12px; }
:root[data-style="concept"] .mode__name { font: var(--display-weight) 1.3rem/1 var(--font-display); text-transform: uppercase; letter-spacing: .06em; }
:root[data-style="concept"] .mode[aria-pressed="true"] { background: var(--text); color: var(--paper); transform: none; }
:root[data-style="concept"] .mode[aria-pressed="true"] .mode__sub { color: var(--paper); opacity: .75; }
.mode__done { position: absolute; top: -9px; right: -7px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--good); border: var(--bw-sm) solid var(--bc); color: var(--on-tile); }
.mode__done svg { width: 14px; height: 14px; stroke-width: 3.4; }

/* ===================================================================== ADS */
.ad { position: relative; z-index: 1; width: min(1240px, 100%); margin: 10px auto; padding-inline: 16px; display: grid; place-items: center; gap: 4px; }
.ad__label { font: 700 .66rem/1 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--text-soft); background: var(--paper); border: var(--bw-sm) solid var(--bc); border-radius: 99px; padding: 3px 9px 2px; }
.ad--bottom ins { min-height: 90px; width: 100%; }
.ad--side ins { min-height: 250px; width: 100%; }
.ad--placeholder > .ad__size {
  display: grid; place-items: center; width: 100%; min-height: 90px; padding: 10px; text-align: center;
  border: 2px dashed color-mix(in srgb, var(--text) 35%, transparent); border-radius: var(--r-md);
  background: var(--paper-2); color: var(--text-soft); font-weight: 700; font-size: .85rem;
}
.ad--side.ad--placeholder > .ad__size { min-height: 250px; }
.ad--side { padding-inline: 0; margin: 18px 0 0; }

/* ===================================================================== LAYOUT */
.layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr); gap: 26px; align-items: start; padding-block: 12px 36px; }
.play, .side { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.side { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 14px); }
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .ad--side { display: none; }
}

/* ===================================================================== CARDS & CHIPS */
.card { position: relative; background: var(--paper); border: var(--bw) solid var(--bc); border-radius: var(--r-xl); box-shadow: var(--sh-card); }
.card::before { content: ""; position: absolute; inset: 5px 14px auto; height: 5px; border-radius: 99px; background: var(--rim); opacity: calc(.7 * var(--gloss)); pointer-events: none; }
.puzzle-bar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; color: var(--text); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 3px; border-radius: 99px; font-weight: 800; font-size: .92rem;
  background: var(--paper); border: var(--bw-sm) solid var(--bc); box-shadow: var(--sh-1); color: var(--text);
}
.chip svg { width: 17px; height: 17px; }
.chip--practice { background: linear-gradient(180deg, var(--teal) 0 var(--cel), var(--teal-shade) var(--cel)); color: var(--on-tile); }
.puzzle-bar__date { font-weight: 700; color: var(--text); background: color-mix(in srgb, var(--paper) 72%, transparent); padding: 2px 10px; border-radius: 99px; }
.found { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.found b { font-variant-numeric: tabular-nums; }
.puzzle-bar .spacer { flex: 1; }
.text-btn {
  display: inline-flex; align-items: center; gap: 6px; border: var(--bw-sm) solid var(--bc); border-radius: 99px; cursor: pointer;
  background: var(--paper); padding: 5px 13px 4px; font-weight: 800; font-size: .9rem; box-shadow: var(--sh-1); color: var(--text);
}
.text-btn svg { width: 18px; height: 18px; }
.text-btn:active { transform: translateY(2px); box-shadow: var(--sh-press); }

/* clue card */
.clue { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; padding: 22px 22px 20px; }
.avatar {
  --hue: 260;
  width: 104px; height: 104px; border-radius: 50%; position: relative; flex: none;
  border: var(--bw) solid var(--bc);
  background:
    radial-gradient(circle at 34% 30%, rgba(255,255,255,.55) 0 9%, transparent 10%),
    linear-gradient(160deg, hsl(var(--hue) 85% 72%) 0 55%, hsl(var(--hue) 70% 58%) 55%);
  box-shadow: var(--sh-2);
  display: grid; place-items: center;
}
.avatar__initials { font: var(--display-weight) 2.3rem/1 var(--font-display); color: #fff; text-shadow: 2px 0 0 var(--outline), -2px 0 0 var(--outline), 0 2px 0 var(--outline), 0 -2px 0 var(--outline), 0 5px 0 var(--outline); }
.avatar__badge { position: absolute; right: -6px; bottom: -4px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(180deg, var(--gold) 0 58%, var(--gold-shade) 58%); border: var(--bw) solid var(--bc); color: #2a1f47; box-shadow: var(--sh-1); }
.avatar__badge svg { width: 22px; height: 22px; }
.avatar__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; border-radius: inherit; }
.avatar.has-photo .avatar__initials { visibility: hidden; }
.avatar__badge { z-index: 1; }
.clue__credit { margin: 8px 0 0; font-size: .7rem; line-height: 1.3; font-weight: 600; color: var(--text-soft); overflow-wrap: anywhere; }
.clue__credit a { color: inherit; font-weight: inherit; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.alumni__credit { margin: 8px 0 0; font-size: .7rem; line-height: 1.3; font-weight: 600; color: var(--text-soft); }
:root[data-style="concept"] .avatar { background: hsl(var(--hue) 26% 52%); border: 0; box-shadow: none; }
:root[data-style="concept"] .avatar__initials { text-shadow: none; color: #f6efe3; font-size: 2.7rem; letter-spacing: .04em; }
:root[data-style="concept"] .avatar__badge { background: var(--accent); border: 3px solid var(--paper); box-shadow: none; color: #1f2d3a; }
.eyebrow { margin: 0 0 2px; font-weight: 800; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-soft); }
.clue__name { margin: 0; font: var(--display-weight) clamp(1.6rem, 1.1rem + 2vw, 2.3rem)/1.05 var(--font-display); text-transform: var(--display-case); letter-spacing: var(--display-track); text-wrap: balance; color: var(--text); }
:root[data-style="concept"] .clue__name { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); line-height: .95; }
.clue__desc { margin: 6px 0 0; font-weight: 600; color: var(--text-soft); text-wrap: pretty; }
.clue__meta { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .82rem; padding: 3px 10px 2px; border-radius: 99px; background: var(--paper-2); border: var(--bw-sm) solid var(--bc); color: var(--text); }
.tag svg { width: 15px; height: 15px; }

/* degree slots */
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.slot {
  display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 14px; min-height: 86px; cursor: pointer;
  border: var(--bw) solid var(--bc); border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--paper) 0 var(--cel), var(--paper-2) var(--cel)); box-shadow: var(--sh-2); color: var(--text);
  transition: transform .18s cubic-bezier(.3,1.7,.5,1);
}
.slot__label { font-weight: 800; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-soft); }
.slot__value { font: var(--display-weight) 1.2rem/1.15 var(--font-display); letter-spacing: var(--display-track); overflow-wrap: anywhere; }
.slot__hint { font-size: .8rem; font-weight: 700; color: var(--text-soft); }
.slot--active { background: linear-gradient(180deg, var(--accent) 0 var(--cel), var(--accent-shade) var(--cel)); color: var(--on-accent); transform: translateY(-3px); box-shadow: var(--sh-3); }
.slot--active .slot__label, .slot--active .slot__hint { color: var(--on-accent); opacity: .85; }
.slot--solved { background: linear-gradient(180deg, var(--good) 0 var(--cel), var(--good-shade) var(--cel)); color: var(--on-tile); cursor: default; }
.slot--solved .slot__label, .slot--solved .slot__hint { color: var(--on-tile); opacity: .8; }
.slot--solved .slot__value { font-size: 1rem; }
.slot--na { cursor: default; opacity: .8; background: repeating-linear-gradient(135deg, transparent 0 8px, var(--hatch) 8px 10px), var(--paper-2); }
.slot--na .slot__value { font-size: 1rem; color: var(--text-soft); }
:root[data-style="concept"] .slot--active { transform: none; }
:root[data-style="concept"] .slot__value { font-size: 1.35rem; }
:root[data-style="concept"] .slot--solved .slot__value, :root[data-style="concept"] .slot--na .slot__value { font-size: 1.15rem; }

/* ===================================================================== GUESS FORM */
.guess { display: grid; gap: 8px; }
.guess__label { font-weight: 800; font-size: 1.02rem; padding-left: 4px; color: var(--on-page); }
.guess__row { display: flex; gap: 12px; align-items: stretch; }
.combo { position: relative; flex: 1; min-width: 0; }
.combo input {
  width: 100%; height: 58px; padding: 0 18px; font: 700 1.08rem var(--font-ui); color: var(--text);
  background: var(--paper); border: var(--bw) solid var(--bc); border-radius: 20px;
  box-shadow: var(--sh-2);
}
:root[data-style="concept"] .combo input { border-radius: 12px; border-color: color-mix(in srgb, var(--text) 30%, transparent); }
.combo input::placeholder { color: var(--text-soft); opacity: .85; font-weight: 600; }
.combo input:focus { outline: none; box-shadow: var(--sh-2), 0 0 0 4px color-mix(in srgb, var(--accent) 55%, transparent); }
.suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 20; margin: 0; padding: 6px; list-style: none;
  max-height: min(420px, 60vh); overflow: auto;
  background: var(--paper); border: var(--bw) solid var(--bc); border-radius: var(--r-lg); box-shadow: var(--sh-card);
}
.suggestions li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.suggestions li[aria-selected="true"] { background: var(--paper-3); }
.sugg__name { font-weight: 800; overflow-wrap: anywhere; }
.sugg__place { grid-column: 1; font-size: .84rem; color: var(--text-soft); font-weight: 600; }
.sugg__via { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: .75rem; font-weight: 800; color: var(--text-soft); background: var(--paper-2); border-radius: 99px; padding: 2px 8px; }
.suggestions li.is-guessed { opacity: .5; cursor: not-allowed; }
.suggestions .sugg__empty { cursor: default; color: var(--text-soft); font-weight: 700; display: block; }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 58px; padding: 0 26px; border: var(--bw) solid var(--bc); border-radius: 20px; cursor: pointer;
  font: var(--btn-font); text-transform: var(--btn-case); letter-spacing: var(--btn-track); color: var(--on-accent);
  background: linear-gradient(180deg, var(--accent) 0 58%, var(--accent-shade) 58%);
  box-shadow: var(--sh-2); transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn::after { content: ""; position: absolute; left: 14px; top: 7px; width: 20px; height: 6px; border-radius: 99px; background: rgba(255,255,255,.65); pointer-events: none; opacity: var(--gloss); }
.btn:hover { transform: translateY(var(--lift)); filter: brightness(1.04); }
.btn:active { transform: translateY(3px); box-shadow: var(--sh-press); }
.btn:disabled { cursor: not-allowed; filter: saturate(.3); opacity: .7; transform: none; }
.btn svg { width: 22px; height: 22px; }
.btn--teal { background: linear-gradient(180deg, var(--teal) 0 58%, var(--teal-shade) 58%); color: var(--on-tile); }
.btn--paper { background: linear-gradient(180deg, var(--paper) 0 58%, var(--paper-3) 58%); color: var(--text); }
.btn--small { min-height: 44px; padding: 0 16px; font-size: 1rem; border-radius: 16px; }
:root[data-style="concept"] .btn { border-radius: 12px; border-color: transparent; }
:root[data-style="concept"] .btn--small { font-size: .8rem; border-radius: 10px; }
:root[data-style="concept"] .btn--paper { background: var(--paper); border-color: color-mix(in srgb, var(--text) 25%, transparent); }
:root[data-style="concept"] .btn--teal { background: var(--teal); color: #f6efe3; }

/* hints */
.hintbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hint-btn { display: inline-flex; align-items: center; gap: 8px; }
.hint-btn .count { font-variant-numeric: tabular-nums; }
.hint-card {
  display: flex; gap: 10px; align-items: flex-start; padding: 8px 14px 8px 10px; border-radius: var(--r-md); max-width: 100%;
  background: linear-gradient(180deg, #fff6c9 0 var(--cel), #ffe98f var(--cel)); border: var(--bw-sm) solid var(--bc); box-shadow: var(--sh-1); color: #2a1f47;
  animation: pop .55s cubic-bezier(.3,1.8,.5,1);
}
:root[data-style="concept"] .hint-card { background: var(--paper); color: var(--text); border-left: 4px solid var(--accent); animation: fade .4s ease; }
.hint-card svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.hint-card b { display: block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.hint-card span { font-weight: 700; overflow-wrap: anywhere; }
.hint-note { font-weight: 700; font-size: .9rem; color: var(--text); background: color-mix(in srgb, var(--paper) 78%, transparent); border-radius: 99px; padding: 3px 12px; }

/* ===================================================================== GUESS ROWS & TILES */
.guesses { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.row {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; align-items: stretch;
  padding: 10px 10px 12px; border-radius: var(--r-lg); background: var(--paper); border: var(--bw) solid var(--bc); box-shadow: var(--sh-2);
}
.row__name { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0 4px 2px; }
.row__num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .9rem;
  border: var(--bw-sm) solid var(--bc); background: var(--paper-3); color: var(--text); font-variant-numeric: tabular-nums; }
.row__uni { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
.row__uni strong { font-weight: 800; line-height: 1.2; overflow-wrap: break-word; font-size: 1.02rem; }
.row__uni small { font-weight: 700; color: var(--text-soft); font-size: .8rem; }
.row__slot { display: inline-block; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 0 7px; border-radius: 99px; background: var(--paper-2); border: var(--bw-sm) solid var(--bc); }
.row--win { background: linear-gradient(180deg, var(--paper) 0 70%, color-mix(in srgb, var(--good) 30%, var(--paper)) 70%); }
:root[data-style="concept"] .row--win { background: color-mix(in srgb, var(--good) 16%, var(--paper)); }
.row--win .row__num { background: var(--gold); color: #2a1f47; }

.tile {
  --tone: var(--bad); --tone-shade: var(--bad-shade);
  position: relative; min-width: 0; min-height: 66px; padding: 6px 5px 5px; border-radius: var(--r-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1px;
  border: var(--bw-sm) solid var(--bc); color: var(--on-tile);
  background: linear-gradient(180deg, var(--tone) 0 var(--cel), var(--tone-shade) var(--cel));
  box-shadow: var(--sh-1);
}
:root[data-style="concept"] .tile { border: 0; box-shadow: none; border-radius: var(--r-sm); }
.tile::after { content: ""; position: absolute; left: 7px; top: 5px; width: 12px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.6); opacity: var(--gloss); }
.tile__label { font-size: .58rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .72; line-height: 1; }
.tile__value { font-weight: 800; font-size: .86rem; line-height: 1.1; overflow-wrap: break-word; hyphens: auto; max-width: 100%; font-variant-numeric: tabular-nums; }
.tile__arrow { font-weight: 800; font-size: 1rem; line-height: 1; }
.tile--good { --tone: var(--good); --tone-shade: var(--good-shade); }
.tile--near {
  --tone: var(--near); --tone-shade: var(--near-shade);
  background: radial-gradient(var(--pat-dot) 1.3px, transparent 1.7px) 0 0 / 8px 8px, linear-gradient(180deg, var(--tone) 0 var(--cel), var(--tone-shade) var(--cel));
}
.tile--bad { background: repeating-linear-gradient(135deg, transparent 0 7px, var(--pat) 7px 9px), linear-gradient(180deg, var(--tone) 0 var(--cel), var(--tone-shade) var(--cel)); }
.row--new .tile { animation: tile-in .62s cubic-bezier(.3,1.5,.5,1) both; animation-delay: calc(var(--i) * 105ms); }
.row--new .row__name { animation: pop .5s cubic-bezier(.3,1.8,.5,1) both; }
:root[data-style="concept"] .row--new .tile { animation: tile-flat .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 90ms); }
:root[data-style="concept"] .row--new .row__name { animation: fade .4s ease both; }
@keyframes tile-in {
  0% { transform: perspective(420px) rotateX(-100deg) scale(.9); opacity: 0; }
  45% { transform: perspective(420px) rotateX(12deg) scale(.94, 1.1); opacity: 1; }
  70% { transform: perspective(420px) rotateX(-5deg) scale(1.05, .95); }
  100% { transform: none; opacity: 1; }
}
@keyframes tile-flat { 0% { transform: perspective(420px) rotateX(-90deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 55% { transform: scale(1.08, .93); opacity: 1; } 80% { transform: scale(.97, 1.03); } 100% { transform: none; } }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.empty { margin: 0; padding: 16px 18px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--paper) 90%, transparent); border: 2px dashed color-mix(in srgb, var(--text) 30%, transparent); font-weight: 700; color: var(--text-soft); text-align: center; }

@media (max-width: 640px) {
  .row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 8px 8px 10px; }
  .row__name { padding: 2px 2px 4px; }
  .tile { min-height: 58px; }
  .tile__value { font-size: .8rem; }
}

/* ===================================================================== RESULTS */
.result { padding: 20px 22px; display: grid; gap: 14px; }
.result h2 { margin: 0; font: var(--display-weight) 1.6rem/1.1 var(--font-display); text-transform: var(--display-case); letter-spacing: var(--display-track); }
.result h2 small { font: 800 1rem var(--font-ui); letter-spacing: 0; text-transform: none; color: var(--text-soft); }
.answer { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px; border-radius: var(--r-lg); background: var(--paper-2); border: var(--bw-sm) solid var(--bc); }
.answer__star { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; border: var(--bw-sm) solid var(--bc); background: linear-gradient(180deg, var(--gold) 0 58%, var(--gold-shade) 58%); color: #2a1f47; box-shadow: var(--sh-1); }
:root[data-style="concept"] .answer__star { border-radius: 50%; border: 0; box-shadow: none; }
.answer__star svg { width: 30px; height: 30px; }
.answer__name { margin: 0; font: var(--display-weight) 1.3rem/1.1 var(--font-display); letter-spacing: var(--display-track); text-transform: var(--display-case); overflow-wrap: anywhere; }
:root[data-style="concept"] .answer__name { font-size: 1.55rem; }
.answer__facts { margin: 4px 0 0; font-weight: 700; color: var(--text-soft); font-size: .92rem; }
.answer__link { margin: 8px 0 0; font-weight: 700; font-size: .95rem; }
.answer__note { margin: 6px 0 0; font-size: .86rem; color: var(--text-soft); font-weight: 600; }
.answer__list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 12px; }
.answer__list li + li { padding-top: 12px; border-top: 2px dashed color-mix(in srgb, var(--text) 18%, transparent); }
.answer__degree { margin: 4px 0 0; font-weight: 600; font-size: .94rem; }
.answer__degree b { font-weight: 800; }
.answer__list .answer__link { margin-top: 4px; font-size: .86rem; }
.tag--you { padding: 0 8px; font-size: .74rem; vertical-align: 3px; font-family: var(--font-ui); letter-spacing: 0; text-transform: none; background: var(--gold); color: #2a1f47; }
.answer__rank { margin: 6px 0 0; display: flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 800; color: var(--text-soft); }
.answer__rank svg { width: 15px; height: 15px; flex: none; color: var(--gold-shade); }
.alumni { margin: 10px 0 0; padding: 10px 12px; border-radius: var(--r-md); background: color-mix(in srgb, var(--paper) 70%, transparent); border: var(--bw-sm) solid color-mix(in srgb, var(--bc) 35%, transparent); }
.alumni__title { margin: 0 0 6px; font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--text-soft); }
.alumni__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.alumni__list li { display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 10px; align-items: start; font-size: .88rem; line-height: 1.3; }
.alumni__body { display: grid; gap: 1px; min-width: 0; }
.face { position: relative; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; text-decoration: none;
  background: var(--paper-3); color: var(--text-soft); font: 800 .72rem/1 var(--font-ui); border: var(--bw-sm) solid var(--bc); }
.face__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.face.has-photo .face__initials { visibility: hidden; }
:root[data-style="concept"] .face { border: 0; }
.alumni__list li + li { padding-top: 0; border-top: 0; }
.alumni__list a { font-weight: 800; }
.alumni__desc { color: var(--text-soft); font-weight: 600; }
.alumni__what { color: var(--text-soft); font-weight: 600; font-size: .8rem; font-style: italic; }

.rank { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 12px 14px; border-radius: var(--r-lg); border: var(--bw-sm) solid var(--bc); background: var(--paper); box-shadow: var(--sh-1); min-width: 0; }
.stat__value { font: var(--display-weight) 2rem/1 var(--font-display); letter-spacing: var(--display-track); font-variant-numeric: tabular-nums; }
:root[data-style="concept"] .stat__value { font-size: 2.4rem; }
.stat__label { font-weight: 800; font-size: .8rem; color: var(--text-soft); letter-spacing: .03em; }
.stat--hero { background: linear-gradient(180deg, var(--gold) 0 var(--cel), var(--gold-shade) var(--cel)); color: #2a1f47; }
.stat--hero .stat__label { color: #2a1f47; opacity: .8; }
.rank__note { margin: 0; font-weight: 700; color: var(--text-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.countdown { font-weight: 800; }
.countdown b { font-variant-numeric: tabular-nums; }

/* histogram */
.hist { display: grid; gap: 6px; }
.hist__title { margin: 0; font-weight: 800; font-size: .9rem; }
.hist__plot { position: relative; height: 112px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; align-items: end; padding: 16px 0 0; border-bottom: 2px solid var(--grid); }
.hist__bar { position: relative; height: calc(var(--h) * 1%); min-height: 2px; border-radius: 4px 4px 0 0; background: var(--bar); cursor: default; }
.hist__bar--me { background: var(--bar-me); box-shadow: 0 0 0 2px var(--text); }
.hist__bar--me::before { content: attr(data-me); position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); font-size: .68rem; font-weight: 800; color: var(--text); white-space: nowrap; }
.hist__axis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; font-size: .68rem; font-weight: 700; color: var(--text-soft); text-align: center; font-variant-numeric: tabular-nums; }
.hist__tip { position: absolute; z-index: 3; pointer-events: none; transform: translate(-50%, -100%); background: var(--paper); border: var(--bw-sm) solid var(--bc); border-radius: 10px; padding: 3px 8px; font-weight: 800; font-size: .8rem; white-space: nowrap; box-shadow: var(--sh-1); color: var(--text); }

/* ===================================================================== GLOBE */
.globe-card { padding: 16px 16px 14px; display: grid; gap: 10px; }
.globe-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.globe-card h2 { margin: 0; font: var(--display-weight) 1.35rem/1.1 var(--font-display); text-transform: var(--display-case); letter-spacing: var(--display-track); }
:root[data-style="concept"] .globe-card h2 { font-size: 1.6rem; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0; padding: 0; list-style: none; font-size: .78rem; font-weight: 800; color: var(--text-soft); }
.legend li { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 13px; height: 13px; border-radius: 50%; border: var(--bw-sm) solid var(--bc); display: inline-block; }
.globe-wrap { position: relative; aspect-ratio: 1 / 0.93; width: 100%; max-width: 100%; border-radius: var(--r-lg); overflow: hidden;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--paper-2) 70%, transparent), transparent 70%); }
:root[data-style="concept"] .globe-wrap { background: var(--paper-2); }
.globe-wrap canvas { display: block; touch-action: none; cursor: grab; }
.globe-wrap canvas:active { cursor: grabbing; }
.globe-tip { position: absolute; z-index: 2; max-width: 230px; padding: 7px 11px; pointer-events: none; border-radius: 12px; background: var(--paper); border: var(--bw-sm) solid var(--bc); box-shadow: var(--sh-2); font-size: .84rem; font-weight: 700; color: var(--text); }
.globe-tip strong { display: block; font-weight: 800; }
.globe-tip__row { display: block; }
.globe-tip__row + .globe-tip__row { margin-top: 6px; padding-top: 6px; border-top: var(--bw-sm) solid var(--bc); }
.globe-toast { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); padding: 6px 12px; border-radius: 99px; background: var(--text); color: var(--paper); font-weight: 800; font-size: .8rem; white-space: nowrap; pointer-events: none; }
.globe-controls { display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.globe-controls .group { display: flex; gap: 8px; }
.globe-controls .icon-btn { width: 40px; height: 40px; border-radius: 13px; }
.globe-controls .icon-btn svg { width: 20px; height: 20px; }
.globe-caption { margin: 0; font-size: .8rem; font-weight: 700; color: var(--text-soft); }

/* ===================================================================== FOOTER */
.footer { position: relative; z-index: 1; width: min(1240px, 100%); margin: 8px auto 0; padding: 22px 16px 40px; color: #f3efe6; font-weight: 600; font-size: .9rem; display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; }
.footer a { color: #fff; }
.footer p { margin: 0; max-width: 62ch; }
.footer nav { display: flex; gap: 16px; flex-wrap: wrap; }

/* ===================================================================== DIALOGS */
dialog.modal {
  width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; overflow: auto; color: var(--text);
  background: var(--paper); border: var(--bw) solid var(--bc); border-radius: var(--r-xl); box-shadow: var(--sh-card);
}
dialog.modal::backdrop { background: var(--backdrop); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: pop .45s cubic-bezier(.3,1.6,.5,1); }
:root[data-style="concept"] dialog.modal[open] { animation: fade .3s ease; }
.modal__inner { padding: 24px 24px 26px; display: grid; gap: 16px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal h2 { margin: 0; font: var(--display-weight) 1.75rem/1.1 var(--font-display); text-transform: var(--display-case); letter-spacing: var(--display-track); text-wrap: balance; }
:root[data-style="concept"] .modal h2 { font-size: 2.2rem; }
.modal h3 { margin: 6px 0 0; font-size: 1.05rem; font-weight: 800; }
.modal p { margin: 0; }
.modal ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.modal .answer__list { padding-left: 0; gap: 12px; }
.modal .icon-btn { width: 40px; height: 40px; border-radius: 13px; flex: none; }
.modal .icon-btn svg { width: 20px; height: 20px; }
.legend-demo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.legend-demo .tile { min-height: 70px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button { border: var(--bw-sm) solid var(--bc); border-radius: 99px; background: var(--paper); padding: 4px 14px 3px; font-weight: 800; cursor: pointer; box-shadow: var(--sh-1); color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
@media (max-width: 520px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* share dialog: the result picture, its buttons and the text version */
#dlg-share { width: min(760px, calc(100vw - 24px)); }
.share-pic { margin: 0; display: grid; gap: 8px; }
.share-pic img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 675; border-radius: var(--r-md); background: var(--paper-2); box-shadow: var(--sh-2); }
.share-pic img.is-loading { animation: pulse-bg 1.2s ease-in-out infinite alternate; }
@keyframes pulse-bg { from { opacity: .55; } to { opacity: 1; } }
.share-pic figcaption { font-size: .8rem; font-weight: 600; color: var(--text-soft); }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.share-text { margin: 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--paper-2); font: 600 .85rem/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }

/* past puzzles: one month calendar per month, newest first */
.archive__intro, .archive__count { color: var(--text-soft); font-weight: 600; }
.archive__count b { color: var(--text); }
#archive-body { display: grid; gap: 18px; }
.cal h3 { margin: 0 0 8px; font: var(--display-weight) 1.35rem/1 var(--font-display); text-transform: var(--display-case); letter-spacing: var(--display-track); }
.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal__head { text-align: center; font-size: .7rem; font-weight: 900; letter-spacing: .08em; color: var(--text-soft); }
.cal__day { min-height: 50px; display: grid; place-content: center; justify-items: center; gap: 1px; padding: 4px 2px; border-radius: var(--r-sm);
  border: var(--bw-sm) solid var(--bc); background: var(--paper); color: var(--text); font: inherit; line-height: 1.1; }
button.cal__day { cursor: pointer; }
button.cal__day:hover { border-color: var(--text); }
.cal__day b { font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.cal__day small { font-size: .66rem; font-weight: 800; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.cal__day--solved { background: var(--good); border-color: transparent; color: var(--on-tile); }
.cal__day--solved small { color: var(--on-tile); }
.cal__day--started { border-color: var(--near); box-shadow: inset 0 0 0 2px var(--near); }
.cal__day--today { background: var(--text); color: var(--paper); border-color: transparent; }
.cal__day--today small { color: var(--paper); opacity: .8; }
.cal__day--off { opacity: .35; border-style: dashed; }
.archive__legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .78rem; font-weight: 800; color: var(--text-soft); }
.cal__key { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: var(--bw-sm) solid var(--bc); background: var(--paper); vertical-align: -2px; }
.cal__key--solved { background: var(--good); border-color: transparent; }
.cal__key--started { box-shadow: inset 0 0 0 2px var(--near); border-color: var(--near); }
@media (max-width: 520px) { .cal__grid { gap: 4px; } .cal__day { min-height: 44px; } .cal__day small { font-size: .6rem; } }

.win-hero { display: grid; justify-items: center; text-align: center; gap: 4px; }
.win-hero .seal { width: 84px; height: 84px; }
.win-hero p { font-weight: 700; color: var(--text-soft); }
.support { margin: 0; padding-top: 14px; border-top: 2px dashed color-mix(in srgb, var(--text) 22%, transparent); text-align: center; font-weight: 700; color: var(--text-soft); }

/* ===================================================================== TOAST, CONFETTI */
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); transform: translateX(-50%); z-index: 95;
  max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: var(--r-md); background: var(--paper); border: var(--bw) solid var(--bc); box-shadow: var(--sh-card); font-weight: 800; text-align: center; color: var(--text);
  animation: fade .3s ease; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 96; overflow: hidden; }
.confetti i { position: absolute; top: -30px; width: 12px; height: 16px; border: var(--bw-sm) solid var(--bc); border-radius: 3px; animation: fall linear forwards; }
:root[data-style="concept"] .confetti i { border: 0; border-radius: 1px; }
@keyframes fall { to { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--rot)); } }

/* ===================================================================== SMALL SCREENS */
@media (max-width: 720px) {
  :root { --horizon: 220px; }
  .topbar { gap: 10px; }
  .brand { gap: 6px; }
  .brand__emblem { width: 34px; height: 34px; }
  .brand__word { font-size: 1.55rem; }
  :root[data-style="concept"] .brand__word { font-size: 1.5rem; letter-spacing: .07em; }
  .tools { gap: 6px; }
  .tools .icon-btn { width: 40px; height: 40px; border-radius: 13px; }
  .tools .icon-btn svg { width: 21px; height: 21px; }
  .modes { width: 100%; }
  .mode__sub { font-size: .66rem; }
  .clue { padding: 16px; grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; align-items: start; }
  .clue .clue__text { display: contents; }
  .clue .eyebrow { grid-column: 2; align-self: end; }
  .clue__name { grid-column: 2; }
  .clue__desc, .clue__meta, .clue__credit { grid-column: 1 / -1; margin: 0; }
  .clue .avatar { grid-row: 1 / span 2; width: 70px; height: 70px; }
  .avatar__initials, :root[data-style="concept"] .avatar__initials { font-size: 1.6rem; }
  .avatar--mystery .avatar__initials { font-size: 2.2rem; }
  .avatar__badge { width: 30px; height: 30px; right: -8px; bottom: -6px; }
  .avatar__badge svg { width: 17px; height: 17px; }
  :root[data-style="concept"] .clue__name { font-size: 2rem; }
  .slots { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .slot { min-height: 0; display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 2px 10px; padding: 8px 12px; border-radius: var(--r-md); }
  .slot__label { grid-row: 1 / span 2; }
  .slot__value, :root[data-style="concept"] .slot__value { font-size: 1.05rem; }
  .slot--active { transform: none; box-shadow: var(--sh-2); }
  .guess__row .btn { padding: 0 18px; }
  .answer { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .answer__star { display: none; }
  .rank { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 10px; }
  .stat__value, :root[data-style="concept"] .stat__value { font-size: 1.4rem; }
  .stat__label { font-size: .72rem; }
  .scene, .scene svg { height: 250px; }
  .modal__inner { padding: 20px 18px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media (forced-colors: active) {
  .tile { border: 2px solid CanvasText; }
  .tile--good .tile__value::after { content: " ✓"; }
  .tile--near .tile__value::after { content: " ~"; }
  .tile--bad .tile__value::after { content: " ✗"; }
}
