:root {
  --bg: #07142a;
  --bg-2: #0b1d38;
  --panel: #0f2442;
  --panel-2: #153056;
  --line: rgba(143, 214, 255, 0.14);
  --text: #eaf4ff;
  --muted: #8fa9c9;
  --accent: #ffd84d;
  --accent-ink: #1d1700;
  --truth: #ffd84d;
  --ref: #8fd6ff;
  --great: #5ef0a8;
  --good: #ffd84d;
  --meh: #ffa94d;
  --bad: #ff6b6b;
  --board: #0f2b4c;
  --ground: #0a2140;
  --radius: 18px;
  --font: ui-rounded, 'SF Pro Rounded', 'Nunito', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    linear-gradient(rgba(143, 214, 255, 0.035) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(143, 214, 255, 0.035) 1px, transparent 1px) 0 0 / 40px 40px,
    radial-gradient(1200px 600px at 80% -10%, rgba(143, 214, 255, 0.1), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #ffe68a; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
kbd {
  font: inherit; font-size: 0.85em; padding: 1px 6px; border-radius: 6px;
  background: var(--panel-2); border: 1px solid var(--line); border-bottom-width: 2px;
}
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.wrap { width: min(100% - 32px, 980px); margin-inline: auto; }
.prose { width: min(100% - 32px, 760px); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 99; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; }

/* ── Header ───────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(7, 20, 42, 0.85);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; height: 60px; }
.header-inner > .logo { grid-column: 1; justify-self: start; }
.header-inner > .nav { grid-column: 2; }
.header-inner > .header-tools { grid-column: 3; justify-self: end; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.logo svg { width: 32px; height: 32px; }
.logo b { color: var(--accent); }
.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  padding: 6px 12px; border-radius: 999px;
}
.nav a:hover, .nav a[aria-current='page'] { color: var(--text); background: var(--panel-2); }
.header-tools { display: flex; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  cursor: pointer; font-size: 1rem;
}
.icon-btn:hover { background: var(--panel-2); }
.icon-btn svg { width: 18px; height: 18px; }
.nav-toggle { display: none; }

@media (max-width: 899px) {
  .nav-toggle { display: inline-grid; }
  .nav {
    position: absolute; left: 0; right: 0; top: 60px; flex-direction: column; margin: 0;
    padding: 8px 16px 16px; background: var(--bg-2); border-bottom: 1px solid var(--line); display: none;
  }
  .nav-open .nav { display: flex; }
  .nav a { padding: 10px 12px; }
}

/* ── Hero ─────────────────────────────────────────────── */
.hero { text-align: center; padding: 28px 0 8px; }
.hero h1 { font-size: clamp(1.8rem, 4.6vw, 2.8rem); margin: 0 0 6px; font-weight: 900; }
.hero h1 span { color: var(--accent); }
.hero p { margin: 0 auto; color: var(--muted); max-width: 620px; }
.kicker { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; font-weight: 800; color: var(--accent); margin-bottom: 8px !important; }
.challenge-note {
  margin: 14px auto 0; max-width: 560px; background: rgba(255, 216, 77, 0.1); border: 1px dashed rgba(255, 216, 77, 0.5);
  border-radius: 12px; padding: 10px 14px; font-weight: 700;
}

/* ── Game card ────────────────────────────────────────── */
.game {
  margin: 18px auto 28px;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6);
}
.game-loading { display: grid; place-items: center; min-height: 420px; color: var(--muted); text-align: center; }
.game-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.game-meta { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--muted); font-size: 0.92rem; }
.pill { background: var(--accent); color: var(--accent-ink); padding: 3px 10px; border-radius: 999px; font-weight: 800; font-size: 0.82rem; }
.game-tools { display: flex; align-items: center; gap: 12px; }
.unit-switch { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.unit-switch button {
  min-width: 34px; padding: 4px 8px; border: 0; border-radius: 7px; background: none; cursor: pointer;
  color: var(--muted); font: 700 0.85rem var(--mono);
}
.unit-switch button:hover { color: var(--text); }
.unit-switch button[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); }
.game-score { font-weight: 900; font-size: 1.4rem; font-family: var(--mono); color: var(--accent); }
.game-score small { color: var(--muted); font-size: 0.9rem; font-weight: 700; }
.progress { list-style: none; display: flex; gap: 6px; padding: 0; margin: 10px 0 4px; }
.progress li {
  flex: 1; height: 26px; font-family: var(--mono); letter-spacing: 1px; border-radius: 8px; background: var(--panel-2); display: grid; place-items: center;
  font-size: 0.8rem; border: 1px solid transparent;
}
.progress li.current { border: 1px dashed var(--accent); background: rgba(255, 216, 77, 0.08); }
.progress li.done { color: #07142a; font-weight: 900; font-size: 0.95rem; }
.progress li.s-great { background: var(--great); }
.progress li.s-good { background: var(--good); }
.progress li.s-meh { background: var(--meh); }
.progress li.s-bad { background: var(--bad); }
.prompt-wrap { text-align: center; margin: 10px 0 12px; }
.prompt { margin: 0; font-size: clamp(1.25rem, 3.4vw, 1.75rem); font-weight: 900; }
.prompt-sub { margin: 4px 0 0; color: var(--muted); font-size: 0.95rem; }
.prompt-sub { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 8px; }
.prompt-edge { flex-basis: 100%; font-weight: 800; color: var(--text); }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 800; font-size: 0.88rem; }
.chip-guess { background: transparent; color: #fff; border: 2px dashed #fff; }
.chip-ref { background: var(--ref); color: #07142a; }
.t-truth { color: var(--truth); }

.board {
  position: relative; width: 100%; height: clamp(300px, 52vw, 470px);
  border-radius: 16px; overflow: hidden; touch-action: none; cursor: ew-resize; user-select: none;
  -webkit-user-select: none; outline: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.board:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.board.dragging { cursor: grabbing; }
.board-svg { display: block; width: 100%; height: 100%; }
.board-bg { fill: var(--board); }
.board-ground { fill: var(--ground); }
.board-ground-line { stroke: var(--ref); stroke-width: 1.5; stroke-dasharray: 6 4; opacity: 0.7; }
.board-scale { fill: var(--muted); font: 700 12px var(--mono); }
.obj-ref { color: var(--ref); }
.obj-guess { color: #fff; }
.obj-truth { color: var(--truth); pointer-events: none; }
.obj-name { fill: #cfe6ff; font: 700 13px var(--mono); }
.ruler path { fill: none; stroke-width: 1.5; stroke-linecap: round; }
.ruler text { font: 800 13px var(--mono); paint-order: stroke; stroke: var(--board); stroke-width: 4px; stroke-linejoin: round; }
.ruler-ref path { stroke: var(--ref); }
.ruler-ref text { fill: var(--ref); }
.ruler-guess path { stroke: #fff; stroke-dasharray: 4 3; }
.ruler-guess text { fill: #fff; }
.ruler-truth path { stroke: var(--truth); stroke-width: 2; }
.ruler-truth text { fill: var(--truth); font-size: 15px; }

.controls { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.controls[hidden], .result[hidden], .summary[hidden], .board[hidden], .hint[hidden], .prompt-wrap[hidden] { display: none; }
.size-range { flex: 1; accent-color: var(--accent); height: 28px; min-width: 60px; }
.btn-icon {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--text); font-size: 1.4rem; font-weight: 800; cursor: pointer; flex: none;
}
.btn-icon:active { transform: scale(0.96); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 14px; font: 800 1rem var(--font); cursor: pointer;
  border: 1px solid transparent; text-decoration: none; transition: transform 0.08s, background 0.15s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 0 -2px #b8961c; }
.btn-primary:hover { background: #ffe370; color: var(--accent-ink); }
.btn-ghost { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: #1d3d6b; color: var(--text); }
.btn-lock { min-width: 130px; }
.hint { color: var(--muted); font-size: 0.85rem; text-align: center; margin: 10px 0 0; }

@media (max-width: 560px) {
  .game { padding: 12px; border-radius: 20px; margin-inline: -4px; }
  .controls { flex-wrap: wrap; }
  .btn-lock { width: 100%; order: 5; padding: 14px; }
  .hint { font-size: 0.8rem; }
}

/* ── Result ───────────────────────────────────────────── */
.result {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  margin-top: 14px; padding: 14px 16px; background: var(--panel-2); border-radius: 16px; border: 1px solid var(--line);
  animation: rise 0.35s ease-out;
}
.result-score { text-align: center; min-width: 92px; }
.result-score strong { display: block; font-size: 2.1rem; font-weight: 900; line-height: 1; font-family: var(--mono); }
.result-score .result-stars { display: block; font-size: 1.1rem; letter-spacing: 2px; margin: 2px 0; }
.result-anchor { margin: 0 0 4px; color: var(--ref); font-size: 0.95rem; }
.result-score span { font-weight: 800; font-size: 0.85rem; }
.s-great strong, .s-great span { color: var(--great); }
.s-good strong, .s-good span { color: var(--good); }
.s-meh strong, .s-meh span { color: var(--meh); }
.s-bad strong, .s-bad span { color: var(--bad); }
.result-line { margin: 0 0 4px; }
.result-fact { margin: 0; color: var(--muted); font-size: 0.92rem; }
.result-fact a { font-size: 0.8rem; color: var(--muted); }
@media (max-width: 640px) {
  .result { grid-template-columns: auto 1fr; }
  .result .btn { grid-column: 1 / -1; }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ── Summary ──────────────────────────────────────────── */
.summary { padding: 8px 4px 4px; animation: rise 0.4s ease-out; }
.summary-top { text-align: center; }
.summary-kicker { margin: 10px 0 0; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem; }
.summary-total { margin: 0; font-size: 1.4rem; font-weight: 800; color: var(--muted); }
.summary-total span { font-size: 3.4rem; font-weight: 900; color: var(--accent); font-family: var(--mono); }
.summary-acc { margin: 0 0 4px; color: var(--muted); }
.summary-acc b { color: var(--text); font-family: var(--mono); }
.summary-rank { margin: 0; font-weight: 900; color: var(--ref); font-size: 1.2rem; }
.summary-list { list-style: none; padding: 0; margin: 14px auto; max-width: 560px; }
.summary-list li {
  display: grid; grid-template-columns: 52px 1fr auto 48px; gap: 10px; align-items: center;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.sl-name { font-weight: 800; }
.sl-stars { font-family: var(--mono); letter-spacing: 1px; font-size: 1.05rem; }
.sl-stars.s-great { color: var(--great); }
.sl-stars.s-good { color: var(--good); }
.sl-stars.s-meh { color: var(--meh); }
.sl-stars.s-bad { color: var(--bad); }
.sl-detail { color: var(--muted); font-size: 0.88rem; text-align: right; }
.sl-score { font-weight: 900; text-align: right; font-family: var(--mono); }
@media (max-width: 520px) {
  .summary-list li { grid-template-columns: 48px 1fr 44px; }
  .sl-detail { grid-column: 2; grid-row: 2; text-align: left; }
}
.summary-actions, .summary-links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.summary-extra { text-align: center; margin-top: 8px; }
.next-daily { margin: 14px 0 0; color: var(--muted); }
.next-daily b { color: var(--text); font-variant-numeric: tabular-nums; }
.challenge-verdict { font-weight: 900; font-size: 1.15rem; margin: 10px 0 0; }
.challenge-verdict.win { color: var(--great); }
.challenge-verdict.lose { color: var(--meh); }

/* ── Toast ────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 800; z-index: 60;
  transition: 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Dialogs ──────────────────────────────────────────── */
dialog {
  width: min(100% - 24px, 520px); border: 1px solid var(--line); border-radius: 22px; padding: 0;
  background: var(--panel); color: var(--text); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}
dialog::backdrop { background: rgba(5, 7, 15, 0.7); backdrop-filter: blur(3px); }
dialog[open] { animation: rise 0.25s ease-out; }
.dlg-inner { padding: 22px 24px 24px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dlg-head h2 { margin: 0; font-size: 1.35rem; }
.dlg-inner ol { padding-left: 20px; }
.dlg-inner li { margin-bottom: 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; text-align: center; }
.stat-grid strong { display: block; font-size: 1.6rem; font-weight: 900; }
.stat-grid span { font-size: 0.72rem; color: var(--muted); font-weight: 700; }
.dist-row { display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: center; margin: 6px 0; font-size: 0.82rem; color: var(--muted); }
.dist-bar i { display: block; background: var(--accent); color: var(--accent-ink); font-style: normal; font-weight: 800; text-align: right; padding: 1px 6px; border-radius: 6px; }
.seg { display: inline-flex; background: var(--panel-2); border-radius: 12px; padding: 4px; border: 1px solid var(--line); }
.seg label { padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 700; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--accent); color: var(--accent-ink); }

/* ── Content sections ─────────────────────────────────── */
.section { padding: 34px 0; }
.section h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0 0 12px; }
.section h3 { margin: 20px 0 6px; }
.section p { color: #d5daf2; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.card {
  display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; color: var(--text); text-decoration: none; transition: transform 0.15s, border-color 0.15s;
}
a.card:hover { transform: translateY(-2px); border-color: rgba(143, 214, 255, 0.5); color: var(--text); }
.card h3 { margin: 6px 0 4px; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.card-emoji { font-size: 1.8rem; }
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; counter-increment: step; }
.steps li::before {
  content: counter(step, decimal-leading-zero); display: inline-block; font-weight: 900; color: var(--accent-ink);
  background: var(--accent); border-radius: 8px; padding: 0 8px; margin-bottom: 8px; font-size: 0.85rem;
}
.steps b { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.steps p { margin: 0; color: var(--muted) !important; font-size: 0.95rem; }
.score-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.95rem; }
.score-table th, .score-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.score-table th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; margin: 10px 0; padding: 0 16px; }
.faq summary { cursor: pointer; font-weight: 800; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq details p { margin: 0 0 14px; color: var(--muted); }
.vs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 12px; }
.vs-grid a {
  display: flex; justify-content: space-between; gap: 8px; padding: 12px 14px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 0.92rem;
}
.vs-grid a:hover { border-color: rgba(143, 214, 255, 0.5); }
.vs-grid small { color: var(--muted); font-weight: 600; white-space: nowrap; }
.size-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.size-table td, .size-table th { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.size-table th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.size-table td:nth-child(2), .size-table td:nth-child(3) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.crumbs { font-size: 0.85rem; color: var(--muted); margin: 18px 0 0; }
.crumbs a { color: var(--muted); }
.figure {
  background: var(--board); border-radius: 16px; padding: 0; border: 1px solid var(--line);
  margin: 16px 0; overflow: hidden;
}
.figure svg { display: block; width: 100%; height: auto; }
.figure figcaption { background: var(--ground); color: var(--muted) !important; margin: 0; padding: 8px 14px; font-size: 0.85rem; color: #fff; font-weight: 700; }
.big-stat { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.big-stat div { flex: 1 1 150px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.big-stat strong { display: block; font-size: 1.5rem; font-weight: 900; color: var(--accent); font-family: var(--mono); }
.big-stat span { color: var(--muted); font-size: 0.88rem; }

/* ── Footer ───────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 28px 0 40px; color: var(--muted); font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 20px; }
.footer-grid h4 { color: var(--text); margin: 0 0 8px; font-size: 0.9rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 4px 0; }
.footer-grid a { color: var(--muted); text-decoration: none; }
.footer-grid a:hover { color: var(--text); }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.difficulty { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); font-weight: 700; }

/* ── Share panel ──────────────────────────────────────── */
.dlg-share { width: min(100% - 24px, 640px); max-height: calc(100dvh - 24px); }
.share-preview { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 8px; display: grid; place-items: center; min-height: 160px; }
.share-preview img { display: block; width: 100%; height: auto; max-height: 46vh; object-fit: contain; border-radius: 8px; }
.share-options { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 12px 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-actions .btn { flex: 1 1 140px; }
.share-actions [hidden] { display: none; }
.share-social { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.social { flex: 1 1 90px; text-align: center; padding: 9px 10px; border-radius: 12px; font-weight: 800; font-size: 0.9rem; text-decoration: none; color: #fff; background: var(--panel-2); border: 1px solid var(--line); }
.social:hover { color: #fff; filter: brightness(1.15); }
.social-x { background: #000; }
.social-facebook { background: #1877f2; }
.social-whatsapp { background: #1fa855; }
.social-telegram { background: #229ed9; }
.social-reddit { background: #ff4500; }
.share-link { display: flex; gap: 8px; }
.share-link input { flex: 1; min-width: 0; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; font: 600 0.85rem var(--mono); }
.share-copytext { width: 100%; margin-top: 8px; }
.share-qr { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.share-qr svg { display: block; border-radius: 10px; width: 112px; height: 112px; flex: none; }
.share-qr p { margin: 0; }

/* ── Archive & history ────────────────────────────────── */
.records { padding-top: 12px; }
.archive-summary p { color: var(--muted); }
.archive-month { font-size: 1.15rem; margin: 22px 0 10px; color: var(--muted); }
.archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.archive-day {
  display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; border-left: 5px solid var(--panel-2);
}
.archive-day:hover { color: var(--text); border-color: rgba(143, 214, 255, 0.5); }
.archive-day.is-today { box-shadow: 0 0 0 2px var(--accent); }
.a-no { font-weight: 900; }
.a-date { color: var(--muted); font-size: 0.85rem; }
.a-stars { font-family: var(--mono); font-weight: 900; color: var(--accent); }
.a-progress { font-weight: 800; color: var(--ref); }
.a-play { font-weight: 800; color: var(--accent); }
.archive-day.c-great { border-left-color: var(--great); }
.archive-day.c-good { border-left-color: var(--good); }
.archive-day.c-meh { border-left-color: var(--meh); }
.archive-day.c-bad { border-left-color: var(--bad); }
.archive-day.c-partial { border-left-color: var(--ref); border-left-style: dashed; }
.summary-links.left { justify-content: flex-start; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 16px; }
.panel h2 { font-size: 1.2rem; margin: 0 0 10px; }
.stat-grid-wide { grid-template-columns: repeat(6, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 8px; }
@media (max-width: 640px) { .stat-grid-wide { grid-template-columns: repeat(3, 1fr); row-gap: 14px; } }
.empty-note { text-align: center; color: var(--muted); }
.history-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.history-layout .panel { margin-top: 16px; }
@media (max-width: 800px) { .history-layout { grid-template-columns: 1fr; } }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head h2 { margin: 0; }
.cal-head .icon-btn:disabled { opacity: 0.35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-dow span { text-align: center; font-size: 0.72rem; color: var(--muted); font-weight: 800; padding-bottom: 2px; }
.cal-day {
  aspect-ratio: 1; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  display: grid; place-items: center; align-content: center; gap: 0; font: inherit; padding: 2px; cursor: pointer; line-height: 1.1;
}
.cal-day b { font-size: 0.9rem; }
.cal-day small { font-size: 0.66rem; font-weight: 800; font-family: var(--mono); }
.cal-day.is-off { opacity: 0.3; cursor: default; }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.is-selected { outline: 3px solid var(--ref); outline-offset: 1px; }
.cal-day.c-great, .cal-legend .c-great { background: var(--great); color: #07142a; }
.cal-day.c-good, .cal-legend .c-good { background: var(--good); color: #07142a; }
.cal-day.c-meh, .cal-legend .c-meh { background: var(--meh); color: #07142a; }
.cal-day.c-bad, .cal-legend .c-bad { background: var(--bad); color: #07142a; }
.cal-day.c-partial, .cal-legend .c-partial { background: transparent; border: 2px dashed var(--ref); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 0.78rem; color: var(--muted); margin: 12px 0 0; }
.cal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 3px; vertical-align: -1px; }
.dd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dd-head h2 { margin: 0; }
.dd-head p { margin: 2px 0 0; }
.dd-score { text-align: right; color: var(--muted); font-weight: 800; }
.dd-score b { color: var(--accent); font-size: 1.6rem; font-family: var(--mono); }
.dd-score span { display: block; font-size: 0.85rem; }
.dd-rounds { list-style: none; padding: 0; margin: 12px 0; }
.dd-rounds li { display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dd-rounds li > div:nth-child(2) { display: grid; }
.dd-tile { width: 84px; height: 63px; display: block; }
.dd-stars { font-family: var(--mono); font-weight: 900; text-align: right; }
.dd-stars span { display: block; color: var(--text); font-size: 0.85rem; }
.dd-stars.s-great { color: var(--great); }
.dd-stars.s-good { color: var(--good); }
.dd-stars.s-meh { color: var(--meh); }
.dd-stars.s-bad { color: var(--bad); }
.trend { width: 100%; height: auto; display: block; }
.trend-grid { stroke: var(--line); }
.trend-label { fill: var(--muted); font: 700 11px var(--mono); }
.trend-avg { stroke: var(--ref); stroke-dasharray: 6 5; opacity: 0.7; }
.trend-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.trend-dot { fill: var(--accent); }
.backup .btn input { display: none; }
.import-code { margin-top: 12px; }
.import-code summary { cursor: pointer; font-weight: 800; color: var(--muted); }
.import-code textarea { width: 100%; margin: 10px 0; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 10px; font: 0.8rem var(--mono); }
.challenge-note a { white-space: nowrap; }
@media (max-width: 520px) { .records .size-table th:nth-child(2), .records .size-table td:nth-child(2) { display: none; } }
.dlg-share .btn { padding: 10px 14px; font-size: 0.95rem; }
@media (max-width: 520px) { .dlg-share .dlg-inner { padding: 16px; } .social { flex-basis: 30%; } }
