/* ---------------------------------------------------------------- tokens */
:root {
  --bg: #0b1526;
  --bg-2: #101d33;
  --panel: #152441;
  --panel-2: #1b2d50;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef2f8;
  --muted: #8fa0bd;
  --coral: #ff6b57;
  --coral-2: #ff8a6b;
  --teal: #2ee6c5;
  --gold: #ffd166;
  --late: #d4943a;      /* a day caught up later: the gold of a day played on time, one shade deeper */
  --ink: #18181c;
  --radius: 18px;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body {
  font-family: var(--body);
  background: radial-gradient(1200px 700px at 50% -10%, #1b2f55 0%, var(--bg) 60%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* ---------------------------------------------------------------- screens */
.screen { display: none; min-height: 100vh; min-height: 100dvh; }
.screen.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- home background globe */
#screen-home { position: relative; overflow: hidden; }
.globe-layer { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.globe-glow {
  position: absolute; left: var(--gx); top: var(--gy); width: 40vw; height: 40vw;
  max-width: 420px; max-height: 420px; min-width: 220px; min-height: 220px;
  background: var(--gc); opacity: var(--go); border-radius: 50%; filter: blur(60px);
  transform: translate(-50%, -50%);
}
.globe-wrap {
  --gd: clamp(680px, 150vw, 1900px);
  position: absolute; left: 50%; bottom: 0; width: var(--gd); height: var(--gd);
  transform: translate(-50%, 73.75%);
}
.globe-wrap svg { display: block; width: 100%; height: 100%; }

h1, h2, h3, .country-name, .big-score, .mode-title { font-family: var(--display); }

/* ---------------------------------------------------------------- buttons */
.btn {
  font: 700 15px/1 var(--body); letter-spacing: .02em; text-transform: uppercase;
  border: 0; border-radius: 999px; padding: 16px 28px; cursor: pointer; color: var(--text);
  background: var(--panel-2); transition: transform .12s ease, box-shadow .12s ease, background .12s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--coral), #ff4f8b); color: #fff; box-shadow: 0 8px 24px rgba(255, 107, 87, 0.35); }
.btn.primary:hover { box-shadow: 0 12px 30px rgba(255, 107, 87, 0.45); }
.btn.primary:disabled { background: var(--panel-2); color: var(--muted); box-shadow: none; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; border: 2px solid var(--line); color: var(--muted); }
.btn.ghost:hover { border-color: var(--muted); color: var(--text); }
.icon-btn { background: var(--panel); border: 1px solid var(--line); color: var(--text); width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--panel-2); }
.link-btn { background: none; border: 0; color: var(--teal); font: 600 14px var(--body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; margin-top: 8px; }

/* ---------------------------------------------------------------- home */
.home-wrap { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: 6vh 24px 40px; min-height: 100vh; min-height: 100dvh; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.logo { display: flex; align-items: center; gap: 22px; }
.logo-flag { width: 92px; height: 69px; border-radius: 10px; overflow: hidden; display: block; box-shadow: var(--shadow); transform: rotate(-6deg); background: var(--panel-2); }
.logo-flag img { width: 100%; height: 100%; object-fit: cover; display: block; }
h1 { font-size: clamp(48px, 9vw, 92px); line-height: .9; margin: 0; letter-spacing: -.02em; font-weight: 800; text-align: left; }
.tagline { color: var(--muted); font-size: clamp(15px, 2vw, 18px); line-height: 1.5; margin: 26px 0 36px; }
.tagline em { color: var(--gold); font-style: normal; }
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: 100%; }
.mode-card {
  text-align: left; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 26px 28px; cursor: pointer;
  background: linear-gradient(160deg, var(--panel), var(--bg-2)); color: var(--text); display: flex; flex-direction: column; gap: 8px;
  transition: transform .15s ease, border-color .15s, box-shadow .15s; position: relative; overflow: hidden;
}
.mode-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; filter: blur(30px); opacity: .5; }
.mode-card.daily::after { background: var(--gold); }
.mode-card.quick::after { background: var(--teal); }
.mode-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.2); box-shadow: var(--shadow); }
.mode-kicker { font: 700 12px var(--body); letter-spacing: .14em; text-transform: uppercase; }
.daily .mode-kicker { color: var(--gold); }
.quick .mode-kicker { color: var(--teal); }
.mode-title { font-size: 30px; font-weight: 800; line-height: 1.05; }
.mode-desc { color: var(--muted); font-size: 14px; line-height: 1.5; }
.credits { color: var(--muted); font-size: 12px; margin-top: 40px; opacity: .8; }
.credits a { color: inherit; }

/* ---------------------------------------------------------------- play */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; max-width: 1180px; margin: 0 auto; }
.round-label { font: 700 13px var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.score-chip { display: flex; align-items: baseline; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; }
.score-chip-label { font: 700 11px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
#score-total { font: 800 20px var(--display); color: var(--gold); }
.play-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; max-width: 1180px; margin: 0 auto; padding: 8px 20px 40px; align-items: start; }
.country-name { text-align: center; font-size: clamp(26px, 4vw, 44px); font-weight: 800; letter-spacing: .04em; margin: 4px 0 16px; line-height: 1.05; }
.country-name.small { font-size: clamp(22px, 3vw, 32px); }
.flag-frame { position: relative; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); background: var(--panel); aspect-ratio: 4 / 3; }
#flag-canvas { display: block; width: 100%; height: 100%; touch-action: manipulation; image-rendering: auto; }
.flag-loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--panel); }
.spinner { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--coral); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.prefill-note, .archive-note { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--gold); font-size: 13px; margin: 12px 0 0; line-height: 1.4; }
.archive-note { padding: 9px 12px; border: 1px solid rgba(255, 209, 102, .28); border-radius: 12px; background: rgba(255, 209, 102, .07); justify-content: flex-start; text-align: left; }
.archive-note svg { flex: none; }
.progress-row { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.progress-text { color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.progress-bar { flex: 1; height: 8px; background: var(--panel); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--gold)); border-radius: 999px; transition: width .25s ease; }

.tools-col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: sticky; top: 16px; }
.tools-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.tool-label { display: flex; align-items: center; gap: 8px; font: 700 13px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--coral-2); }
.hint { color: var(--muted); font-size: 12px; }
.tool-actions { display: flex; gap: 10px; margin-top: 16px; }
.tool-actions .btn { flex: 1; padding: 15px 10px; }

/* ---------------------------------------------------------------- picker */
.pk-sv { position: relative; width: 100%; aspect-ratio: 1.45; border-radius: 12px; cursor: crosshair; touch-action: none; outline: none; }
.pk-sv:focus-visible { box-shadow: 0 0 0 3px var(--teal); }
.pk-cursor { position: absolute; width: 18px; height: 18px; border: 3px solid #fff; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 1.5px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.4); pointer-events: none; }
.pk-hue { position: relative; height: 18px; border-radius: 999px; margin-top: 14px; cursor: pointer; touch-action: none; outline: none;
  background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%); }
.pk-hue:focus-visible { box-shadow: 0 0 0 3px var(--teal); }
.pk-hue-cursor { position: absolute; top: 50%; width: 24px; height: 24px; border: 3px solid #fff; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 2px 8px rgba(0,0,0,.5); pointer-events: none; }
.pk-row { display: grid; grid-template-columns: 44px 1fr; gap: 10px; margin-top: 14px; align-items: stretch; }
.pk-swatch { border-radius: 10px; border: 1px solid rgba(255,255,255,.15); grid-row: span 2; }
.pk-hexwrap { display: flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; }
.pk-hexwrap span { font: 700 11px var(--body); letter-spacing: .1em; color: var(--muted); }
.pk-hex { flex: 1; min-width: 0; background: none; border: 0; color: var(--text); font: 600 15px/38px ui-monospace, Menlo, monospace; outline: none; text-transform: uppercase; }
.pk-hsv { display: flex; gap: 6px; }
.pk-hsv label { flex: 1; display: flex; align-items: center; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 0 6px 0 8px; font: 700 11px var(--body); color: var(--muted); }
.pk-num { width: 100%; min-width: 0; background: none; border: 0; color: var(--text); font: 600 13px/32px var(--body); outline: none; -moz-appearance: textfield; }
.pk-num::-webkit-inner-spin-button, .pk-num::-webkit-outer-spin-button { -webkit-appearance: none; }
.pk-recent { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; min-height: 30px; align-items: center; }
.pk-chip { width: 30px; height: 30px; border-radius: 8px; border: 2px solid rgba(255,255,255,.2); cursor: pointer; padding: 0; transition: transform .1s; }
.pk-chip:hover { transform: scale(1.1); border-color: #fff; }
.pk-recent-empty { color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- results */
.result-wrap { max-width: 860px; margin: 0 auto; padding: 36px 20px 60px; display: flex; flex-direction: column; align-items: center; }
.result-head { text-align: center; }
.kicker { font: 700 12px var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.result-score { text-align: center; margin: 8px 0 24px; }
.big-score { font-size: clamp(64px, 12vw, 110px); font-weight: 800; line-height: 1; letter-spacing: -.03em; color: #fff; }
.big-score .of { font-size: .32em; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.verdict { font: 700 15px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin-top: 8px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: 100%; }
.compare figure { margin: 0; text-align: center; }
.compare canvas { width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow); display: block; background: var(--panel); }
.compare figcaption { margin-top: 10px; font: 700 12px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.breakdown { width: 100%; margin-top: 26px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.bd-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 16px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.bd-row:last-child { border-bottom: 0; }
.bd-swatches { display: flex; align-items: center; gap: 8px; }
.sw { width: 34px; height: 34px; border-radius: 9px; border: 1px solid rgba(255,255,255,.18); display: inline-block; }
.sw-arrow { color: var(--muted); font-size: 14px; }
.bd-name { font-weight: 600; display: flex; flex-direction: column; }
.bd-name small { color: var(--muted); font-weight: 500; font-size: 11px; font-family: ui-monospace, Menlo, monospace; letter-spacing: .02em; }
.bd-verdict { font: 700 11px var(--body); letter-spacing: .1em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; background: var(--bg-2); }
.v-perfect, .v-spoton { color: var(--teal); }
.v-close { color: #9be86b; }
.v-warm { color: var(--gold); }
.v-off { color: var(--coral-2); }
.v-wayoff { color: #ff5c7a; }
.bd-points { font: 800 22px var(--display); min-width: 54px; text-align: right; }
.result-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; justify-content: center; }
.daily-stats { width: 100%; margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ds-item { background: linear-gradient(160deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.ds-num { font: 800 30px var(--display); color: var(--gold); }
.ds-label { color: var(--muted); font-size: 12px; }
.ds-loading { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 13px; padding: 12px; }
.final-title { font-size: 34px; margin: 4px 0 0; }
.rounds-list { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.rl-row { display: grid; grid-template-columns: 28px 1fr 160px 60px; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.rl-row:last-child { border-bottom: 0; }
.rl-n { color: var(--muted); font-weight: 700; }
.rl-name { font-weight: 600; }
.rl-bar { height: 8px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.rl-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold)); }
.rl-pts { text-align: right; font: 800 18px var(--display); }

/* ---------------------------------------------------------------- streaks */
.flame { width: 1em; height: 1em; flex: none; transform-origin: 50% 90%; }
/* home: one pill per mode card */
.streak-pill { align-self: flex-start; margin-top: auto; display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px 7px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--muted); font: 600 12.5px/1.3 var(--body); }
.streak-pill .flame { font-size: 17px; filter: grayscale(1) opacity(.5); }
.streak-pill.on { color: var(--text); border-color: rgba(255, 209, 102, .4); background: rgba(255, 209, 102, .1); }
.quick .streak-pill.on { border-color: rgba(46, 230, 197, .4); background: rgba(46, 230, 197, .1); }
.streak-pill.on .flame { filter: none; }
.streak-pill.risk .flame { animation: flicker 1.8s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.12) rotate(3deg); } }
/* results: the card that lights up under the score */
.streak-card { --accent: var(--gold); --accent-rgb: 255, 209, 102; width: 100%; margin: 0 0 24px; padding: 16px 22px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 18px; background: linear-gradient(160deg, var(--panel), var(--bg-2)); border: 1px solid rgba(var(--accent-rgb), .3); border-radius: var(--radius); box-shadow: 0 0 44px rgba(var(--accent-rgb), .07); }
.streak-card.quick { --accent: var(--teal); --accent-rgb: 46, 230, 197; }
.sc-flame { font-size: 62px; line-height: 0; filter: drop-shadow(0 0 16px rgba(255, 107, 87, .5)); }
.sc-kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font: 700 12px var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.sc-badge { padding: 3px 9px; border-radius: 999px; background: rgba(var(--accent-rgb), .2); font-size: 10px; letter-spacing: .1em; }
.sc-head { display: flex; align-items: center; gap: .32em; margin-top: 3px; font: 700 clamp(18px, 3.6vw, 23px)/1.25 var(--display); }
/* the number is two lines tall while it counts up (old above new), clipped to one; the roll slides the new one into view */
.sc-num { display: inline-block; height: 1.3em; overflow: hidden; color: var(--accent); font-size: 1.4em; font-weight: 800; line-height: 1.3; }
.sc-roll { display: flex; flex-direction: column; }
.sc-roll i { font-style: normal; text-align: center; }
.sc-sub { margin-top: 2px; color: var(--muted); font-size: 14px; }
.sc-sub b { color: var(--text); }
.sc-week { display: flex; gap: 6px; }
.sc-day { width: 26px; height: 26px; padding: 0; border: 0; display: grid; place-items: center; border-radius: 50%; font: 700 10px var(--body); color: var(--muted); background: rgba(255, 255, 255, .05); }
button.sc-day { position: relative; cursor: pointer; transition: transform .12s ease; }
button.sc-day::after { content: ""; position: absolute; inset: -8px -3px; }
button.sc-day:hover { transform: scale(1.14); }
button.sc-day:focus-visible, .cal-day:focus-visible, .dn-btn:focus-visible, .sc-link:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.sc-day.on { color: #1b1304; background: var(--accent); }
.sc-day.late { color: #1b1304; background: var(--late); }
.sc-day.off { opacity: .35; }
.sc-day.today { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px rgba(var(--accent-rgb), .55); }
.sc-day.view { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px rgba(255, 255, 255, .85); }
.sc-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.sc-link { margin-left: auto; background: none; border: 0; padding: 4px 2px; color: var(--accent); font: 700 13px var(--body); cursor: pointer; white-space: nowrap; }
.sc-link:hover { text-decoration: underline; text-underline-offset: 3px; }
/* the card for a past day: a calendar tile instead of the flame, and what a catch-up moves (the all-time average) */
.archive .sc-flame { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; background: rgba(var(--accent-rgb), .12); font-size: 30px; filter: none; }
.cal-ico { width: 1em; height: 1em; color: var(--accent); }
.sc-delta { margin-left: 4px; font-size: 12px; font-weight: 700; }
.sc-delta.up { color: var(--teal); }
.sc-delta.down { color: var(--muted); }
/* just played: the card waits for the score to finish counting, then the flame ignites and the number rolls up */
.streak-card.fresh { animation: sc-in .6s cubic-bezier(.2, 1, .3, 1) 1s both; }
.fresh .sc-flame .flame { animation: ignite .9s cubic-bezier(.2, 1.4, .4, 1) 1.15s both; }
.fresh .sc-roll.rolls { animation: sc-roll .6s cubic-bezier(.3, 1.5, .5, 1) 1.6s both; }
.fresh .sc-day.today { animation: dot-pop .5s cubic-bezier(.2, 1.7, .4, 1) 1.7s both; }
@keyframes sc-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes ignite { 0% { transform: scale(.35); filter: brightness(2.4) saturate(0); } 55% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes sc-roll { from { transform: none; } to { transform: translateY(-50%); } }
@keyframes dot-pop { from { transform: scale(0); } }
@media (prefers-reduced-motion: reduce) {
  .streak-card.fresh, .fresh .sc-flame .flame, .fresh .sc-roll.rolls, .fresh .sc-day.today, .streak-pill.risk .flame { animation: none; }
  .sc-roll i:first-child:not(:last-child) { display: none; }
}
@media (max-width: 640px) {
  .streak-card { grid-template-columns: auto 1fr; padding: 16px 18px; gap: 14px; }
  .sc-flame { font-size: 48px; }
  .sc-kicker { letter-spacing: .12em; }
  .sc-badge { letter-spacing: .06em; }
  .sc-week { grid-column: 1 / -1; justify-content: space-between; }
  .sc-day { width: 30px; height: 30px; }
  .sc-foot { flex-wrap: wrap; }
}

/* ---------------------------------------------------------------- past days */
.day-nav { display: inline-flex; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.dn-btn { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--text); display: grid; place-items: center; cursor: pointer; }
.dn-btn:hover { background: var(--panel-2); }
.dn-btn[data-off] { visibility: hidden; }
.dn-label { padding: 0 8px; font: 700 13px var(--body); letter-spacing: .06em; white-space: nowrap; }
.topbar-gap { width: 42px; height: 42px; }
#result-topbar:not([hidden]) + .result-wrap { padding-top: 12px; }
#screen-result.stale .breakdown, #screen-result.noflag .compare, #screen-result.stale .compare figure:first-child { display: none; }
#screen-result.stale .compare { grid-template-columns: 1fr; max-width: 420px; order: 2; }
#screen-result.stale #daily-stats { order: 1; margin: -8px 0 20px; }       /* say why before showing the flag */
#screen-result.stale .result-actions { order: 3; }
.stale-sw { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.stale-sw i { width: 24px; height: 24px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, .22); }
.archive-wrap { max-width: 640px; margin: 0 auto; padding: 8px 20px 60px; }
.archive-wrap .daily-stats { margin: 6px 0 24px; }
@media (max-width: 860px) {
  .archive-wrap .daily-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .archive-wrap .ds-item { padding: 12px 6px; }
  .archive-wrap .ds-num { font-size: 24px; }
}
.ds-num small { font-size: .5em; color: var(--muted); font-weight: 700; }
.cal-month { margin-bottom: 26px; }
.cal-month h3 { margin: 0 0 10px; font: 800 18px var(--display); }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow i { padding-bottom: 4px; text-align: center; font: 700 10px var(--body); letter-spacing: .1em; color: var(--muted); }
.cal-day { aspect-ratio: 1; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .03); color: var(--muted); font: 700 15px var(--body); cursor: pointer; transition: transform .12s ease, border-color .12s; }
.cal-day small { font: 700 10px var(--body); opacity: .75; }
.cal-day:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, .3); }
.cal-day.on { background: var(--gold); border-color: transparent; color: #1b1304; }
.cal-day.late { background: var(--late); border-color: transparent; color: #1b1304; }
.cal-day.today { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(255, 209, 102, .6); }
.cal-day.view { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(255, 255, 255, .85); }
.cal-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: 4px; color: var(--muted); font-size: 12px; }
.cal-key { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--line); border-radius: 4px; }
.cal-key.on { background: var(--gold); border-color: transparent; }
.cal-key.late { background: var(--late); border-color: transparent; }
.cal-key.none { background: rgba(255, 255, 255, .03); }
.archive-hint { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.nopost-note { margin: 18px 0 0; padding: 6px 14px; border: 1px dashed rgba(255, 209, 102, .5); border-radius: 999px; color: var(--gold); font-size: 12.5px; }

/* ---------------------------------------------------------------- modal/toast */
.modal { position: fixed; inset: 0; background: rgba(5, 10, 20, .7); display: grid; place-items: center; padding: 20px; z-index: 50; backdrop-filter: blur(4px); }
.modal-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 28px 20px; max-width: 520px; width: 100%; line-height: 1.55; font-size: 15px; color: #d6deeb; }
.modal-card h3 { margin: 0 0 12px; font-size: 26px; color: #fff; }
.modal-card b { color: #fff; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--teal); color: #05261f; font-weight: 700; padding: 12px 20px; border-radius: 999px; opacity: 0; transition: all .25s; z-index: 60; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 860px) {
  .play-grid { grid-template-columns: 1fr; gap: 18px; }
  .tools-col { position: static; }
  .mode-cards { grid-template-columns: 1fr; }
  .home-wrap { padding-top: 6vh; }
  .logo { gap: 16px; }
  .logo-flag { width: 64px; height: 48px; }
  .compare { gap: 10px; }
  .bd-row { grid-template-columns: auto 1fr auto; }
  .bd-verdict { display: none; }
  .daily-stats { grid-template-columns: 1fr; }
  .rl-row { grid-template-columns: 24px 1fr 60px; }
  .rl-bar { display: none; }
  .pk-hsv { display: none; }
  .pk-row { grid-template-columns: 44px 1fr; }
  .pk-swatch { grid-row: auto; }
}
