:root {
  color-scheme: dark;
  --bg: #070b14;
  --panel: #0e1624;
  --panel-2: #111c2d;
  --line: #27344a;
  --line-bright: #3d4d67;
  --text: #edf4ff;
  --muted: #94a3b9;
  --dim: #687892;
  --accent: #f2a65a;
  --accent-soft: rgba(242, 166, 90, .13);
  --blue: #8eb9ee;
  --good: #71d7a1;
  --bad: #ee8176;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; overflow-x: hidden; color: var(--text); background: radial-gradient(circle at 28% -20%, #172640 0, var(--bg) 44%); font: 16px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.app-shell { width: min(1540px, 100%); margin: 0 auto; padding: 0 clamp(16px, 3vw, 44px) 38px; }
.topbar { min-height: 92px; display: grid; grid-template-columns: 1fr minmax(220px, 360px) 1fr; align-items: center; gap: 30px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; width: fit-content; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: #201207; background: var(--accent); border-radius: 50%; font-size: 1.1rem; }
.brand strong, .brand small { display: block; }
.brand strong { font: 600 1rem/1.2 Georgia, serif; letter-spacing: .015em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.round-meter { display: grid; gap: 9px; justify-self: center; width: min(100%, 360px); color: var(--muted); font-size: .76rem; letter-spacing: .1em; text-align: center; text-transform: uppercase; }
.meter-track { height: 2px; overflow: hidden; background: var(--line); }
.meter-track span { display: block; width: 10%; height: 100%; background: var(--accent); transition: width .35s ease; }
.score-box { justify-self: end; display: flex; align-items: baseline; gap: 10px; }
.score-box small { color: var(--muted); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.score-box strong { font: 500 2rem/1 Georgia, serif; font-variant-numeric: tabular-nums; }

.game-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, .75fr); min-height: calc(100vh - 132px); border-bottom: 1px solid var(--line); }
.sky-panel { display: grid; grid-template-rows: 44px minmax(480px, 1fr) 44px; min-width: 0; padding-right: clamp(20px, 3vw, 46px); border-right: 1px solid var(--line); }
.sky-toolbar, .sky-footer { display: flex; align-items: center; justify-content: space-between; color: var(--dim); font: 650 .69rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.status { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.status i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.canvas-wrap { position: relative; min-height: 480px; overflow: hidden; border: 1px solid #25334a; border-radius: 3px; background: #000; box-shadow: 0 24px 80px rgba(0,0,0,.24); }
.canvas-wrap:fullscreen { width: 100vw; height: 100vh; min-height: 100vh; border: 0; }
#skyCanvas { display: block; width: 100%; height: 100%; touch-action: none; }
.canvas-wrap::after { content: none; }
.reticle { position: absolute; inset: 50% auto auto 50%; width: 20px; height: 20px; opacity: .22; transform: translate(-50%, -50%); pointer-events: none; }
.reticle span { position:absolute; background: var(--blue); }
.reticle span:nth-child(1), .reticle span:nth-child(2) { width: 6px; height: 1px; top: 50%; }
.reticle span:nth-child(1) { left: 0; } .reticle span:nth-child(2) { right: 0; }
.reticle span:nth-child(3), .reticle span:nth-child(4) { width: 1px; height: 6px; left: 50%; }
.reticle span:nth-child(3) { top: 0; } .reticle span:nth-child(4) { bottom: 0; }
.loading-state, .error-state { position: absolute; inset: 0; z-index: 4; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 30px; color: var(--muted); background: #050a13; text-align: center; }
.loading-state p, .error-state p { margin: 0; }
.loader { width: 28px; height: 28px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.error-state strong { color: var(--text); font-size: 1.05rem; }
.error-state code { color: var(--accent); }
[hidden] { display: none !important; }
.feedback-card { position: absolute; z-index: 3; left: 22px; bottom: 22px; max-width: min(360px, calc(100% - 44px)); padding: 18px 20px; border: 1px solid rgba(142,185,238,.36); background: rgba(8,14,25,.9); box-shadow: 0 16px 50px rgba(0,0,0,.35); backdrop-filter: blur(12px); }
.feedback-card span { display: block; margin-bottom: 4px; color: var(--good); font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.feedback-card.incorrect span { color: var(--bad); }
.feedback-card strong { display: block; font: 500 1.65rem/1.15 Georgia, serif; }
.feedback-card p { margin: 5px 0 0; color: var(--muted); font-size: .85rem; }
.icon-button { width: 32px; height: 32px; padding: 0; color: var(--muted); border: 0; background: transparent; cursor: pointer; font-size: 1.1rem; }
.icon-button:hover { color: var(--text); }

.control-panel { padding: clamp(28px, 4vw, 56px) 0 28px clamp(24px, 4vw, 56px); }
.control-panel section + section { margin-top: 48px; padding-top: 42px; border-top: 1px solid var(--line); }
.section-index { color: var(--accent); font: 750 .68rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .14em; }
h1, h2 { margin: 13px 0 22px; font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.025em; }
h1 { max-width: 380px; font-size: clamp(1.65rem, 2.5vw, 2.35rem); line-height: 1.12; }
h2 { font-size: clamp(1.4rem, 2.1vw, 1.9rem); }
.mode-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode { min-width: 0; padding: 13px 9px 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 2px; background: rgba(15,24,39,.64); cursor: pointer; text-align: left; transition: color .18s,border-color .18s,background .18s; }
.mode:hover { border-color: var(--line-bright); }
.mode.active { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.mode span, .mode small { display: block; overflow: hidden; text-overflow: ellipsis; }
.mode span { font-size: .82rem; font-weight: 700; }
.mode small { margin-top: 3px; color: var(--dim); font-size: .66rem; white-space: nowrap; }
.mode.active small { color: #cda77e; }
.answers { display: grid; gap: 10px; }
.instructions { color: var(--muted); margin: 0 0 28px; font-size: 1rem; }
.answer { position: relative; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; width: 100%; min-height: 55px; padding: 10px 14px; color: var(--text); border: 1px solid var(--line); border-radius: 2px; background: rgba(15,24,39,.66); cursor: pointer; text-align: left; transition: transform .15s,border-color .15s,background .15s; }
.answer:hover:not(:disabled), .answer:focus-visible { transform: translateX(3px); border-color: #60708c; outline: none; }
.answer .key { display: grid; place-items: center; width: 25px; height: 25px; color: var(--muted); border: 1px solid var(--line); font: 700 .7rem/1 ui-monospace, monospace; }
.answer .name { font-weight: 650; }
.answer .mark { color: transparent; font-size: 1.1rem; }
.answer.correct { border-color: var(--good); background: rgba(113,215,161,.08); }
.answer.correct .mark { color: var(--good); }
.answer.wrong { border-color: var(--bad); background: rgba(238,129,118,.08); }
.answer.wrong .mark { color: var(--bad); }
.answer:disabled { cursor: default; }
.next-button, .result-panel button { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 16px; padding: 15px 17px; color: #211306; border: 1px solid var(--accent); border-radius: 2px; background: var(--accent); cursor: pointer; font-weight: 800; }
.next-button:hover, .result-panel button:hover { background: #ffc17b; }
.key-hint { margin: 18px 0 0; color: var(--dim); font-size: .72rem; }
kbd { display: inline-grid; place-items: center; min-width: 20px; min-height: 20px; padding: 0 4px; border: 1px solid var(--line); border-radius: 3px; background: #101827; font: 700 .65rem/1 ui-monospace, monospace; }

.result-overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(3,6,12,.82); backdrop-filter: blur(13px); }
.result-panel { width: min(430px,100%); padding: 42px; border: 1px solid var(--line-bright); background: linear-gradient(145deg,#111b2b,#0b111d); box-shadow: 0 28px 100px rgba(0,0,0,.55); text-align: center; }
.result-label { margin: 28px 0 0; color: var(--muted); }
.result-score { display: flex; justify-content: center; align-items: baseline; gap: 8px; margin: 4px 0 18px; font: 500 6rem/1 Georgia, serif; }
.result-score small { color: var(--muted); font: 500 1.5rem/1 Georgia, serif; }
.result-panel > p:last-of-type { color: var(--muted); }
.result-panel button { margin-top: 28px; }
.result-panel a { display: inline-block; margin-top: 22px; color: var(--muted); font-size: .85rem; }

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr auto; }
  .round-meter { grid-column: 1 / -1; grid-row: 2; width: 100%; padding-bottom: 17px; }
  .game-layout { grid-template-columns: 1fr; }
  .sky-panel { min-height: min(72vh, 700px); padding-right: 0; border-right: 0; }
  .control-panel { padding-left: 0; }
  .control-panel section + section { margin-top: 34px; padding-top: 34px; }
}

@media (max-width: 600px) {
  .app-shell { padding-inline: 12px; }
  .topbar { min-height: 78px; gap: 16px; }
  .brand small { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .sky-panel { grid-template-rows: 38px minmax(410px, 58vh) 38px; min-height: 0; }
  .canvas-wrap { min-height: 410px; }
  .sky-toolbar span:last-child { display: none; }
  .mode-switch { grid-template-columns: 1fr; }
  .mode { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .mode small { margin: 0; }
  .feedback-card { left: 12px; bottom: 12px; max-width: calc(100% - 24px); }
  .key-hint { display: none; }
}

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


/* ===== Player, timer, points and leaderboard ===== */

.hud-stats {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 26px;
}

.timer-box,
.score-box {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.timer-box small,
.score-box small {
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.timer-box strong,
.score-box strong {
  font: 500 2rem/1 Georgia, serif;
  font-variant-numeric: tabular-nums;
}

.timer-unit {
  margin-left: 2px;
  color: var(--dim);
  font: 600 .72rem/1 ui-sans-serif, system-ui, sans-serif;
}

.timer-box.warning strong { color: var(--accent); }
.timer-box.danger strong { color: var(--bad); }

.leaderboard-section {
  margin-top: 48px;
  padding-top: 42px;
  border-top: 1px solid var(--line);
}

.leaderboard-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.leaderboard-heading h2 {
  margin: 7px 0 0;
}

.leaderboard-heading > span,
.leaderboard-heading.compact span {
  color: var(--dim);
  font-size: .72rem;
  text-align: right;
}

.leaderboard-heading.compact {
  align-items: baseline;
  margin-bottom: 10px;
}

.leaderboard-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  border-bottom: 1px solid rgba(39,52,74,.72);
}

.leaderboard-rank {
  color: var(--dim);
  font: 700 .7rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.leaderboard-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-points {
  font-variant-numeric: tabular-nums;
}

.leaderboard-list li.current-player {
  color: var(--accent);
}

.leaderboard-empty {
  display: block !important;
  padding: 9px 0;
  color: var(--muted);
  font-size: .85rem;
}

.result-leaderboard {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.result-leaderboard .leaderboard-list {
  max-height: 185px;
  overflow-y: auto;
}

.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3,6,12,.9);
  backdrop-filter: blur(13px);
}

.player-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: clamp(28px, 5vw, 44px);
  border: 1px solid var(--line-bright);
  background: linear-gradient(145deg,#111b2b,#0b111d);
  box-shadow: 0 28px 100px rgba(0,0,0,.55);
}

.player-card h1 {
  max-width: none;
  margin-bottom: 12px;
}

.player-card > p {
  margin: 0 0 26px;
  color: var(--muted);
}

.player-card label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.player-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.player-form-row input,
.player-form-row button {
  min-height: 48px;
  border-radius: 2px;
  font: inherit;
}

.player-form-row input {
  min-width: 0;
  padding: 0 14px;
  color: var(--text);
  border: 1px solid var(--line-bright);
  background: #080e19;
  outline: none;
}

.player-form-row input:focus {
  border-color: var(--accent);
}

.player-form-row button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  color: #211306;
  border: 1px solid var(--accent);
  background: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

.player-form-row button:hover {
  background: #ffc17b;
}

.form-error {
  margin: 8px 0 0 !important;
  color: var(--bad) !important;
  font-size: .82rem;
}

.start-leaderboard {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

@media (max-width: 980px) {
  .hud-stats { grid-column: 2; grid-row: 1; }
}

@media (max-width: 600px) {
  .hud-stats { gap: 14px; }
  .timer-box, .score-box { display: grid; gap: 1px; text-align: right; }
  .timer-box small, .score-box small { display: block; font-size: .62rem; }
  .timer-box strong, .score-box strong { font-size: 1.42rem; }
  .player-form-row { grid-template-columns: 1fr; }
  .leaderboard-heading { align-items: baseline; }
}


/* ===== Persian / RTL version ===== */
html[dir="rtl"] body {
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
}

html[dir="rtl"] .brand strong,
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] .feedback-card strong,
html[dir="rtl"] .result-score,
html[dir="rtl"] .timer-box strong,
html[dir="rtl"] .score-box strong {
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
}

html[dir="rtl"] .sky-panel {
  padding-right: 0;
  padding-left: clamp(20px, 3vw, 46px);
  border-right: 0;
  border-left: 1px solid var(--line);
}

html[dir="rtl"] .control-panel {
  padding: clamp(28px, 4vw, 56px) clamp(24px, 4vw, 56px) 28px 0;
}

html[dir="rtl"] .answer { text-align: right; }
html[dir="rtl"] .feedback-card { left: auto; right: 22px; }
html[dir="rtl"] .player-card { text-align: right; }
html[dir="rtl"] .player-form-row input { direction: rtl; text-align: right; }
html[dir="rtl"] .leaderboard-heading > span,
html[dir="rtl"] .leaderboard-heading.compact span { text-align: left; }

.language-link {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 32px;
  padding: 0 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 2px;
  text-decoration: none;
  font: 700 .72rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .06em;
}
.language-link:hover, .language-link:focus-visible { color: var(--text); border-color: var(--line-bright); outline: none; }

@media (max-width: 980px) {
  html[dir="rtl"] .sky-panel { padding-left: 0; border-left: 0; }
  html[dir="rtl"] .control-panel { padding-right: 0; }
}

@media (max-width: 600px) {
  html[dir="rtl"] .feedback-card { right: 12px; left: auto; }
  .language-link { min-width: 34px; height: 30px; padding-inline: 7px; }
}


/* ===== Persian typography: Vazirmatn ===== */

html[lang="fa"],
html[lang="fa"] body,
html[lang="fa"] button,
html[lang="fa"] input {
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
}

html[lang="fa"] body {
  font-size: 16px;
  line-height: 1.7;
}

html[lang="fa"] h1,
html[lang="fa"] h2,
html[lang="fa"] .brand strong,
html[lang="fa"] .feedback-card strong,
html[lang="fa"] .result-score,
html[lang="fa"] .result-score small,
html[lang="fa"] .timer-box strong,
html[lang="fa"] .score-box strong {
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
}

html[lang="fa"] h1 {
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
}

html[lang="fa"] h2 {
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
}

html[lang="fa"] .brand strong {
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0;
}

html[lang="fa"] .brand small,
html[lang="fa"] .round-meter,
html[lang="fa"] .section-index,
html[lang="fa"] .timer-box small,
html[lang="fa"] .score-box small,
html[lang="fa"] .feedback-card span {
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

html[lang="fa"] .section-index {
  font-weight: 700;
  line-height: 1.5;
}

html[lang="fa"] .round-meter {
  font-weight: 500;
  line-height: 1.5;
}

html[lang="fa"] .instructions,
html[lang="fa"] .feedback-card p,
html[lang="fa"] .result-panel p,
html[lang="fa"] .leaderboard-name,
html[lang="fa"] .leaderboard-heading,
html[lang="fa"] .player-card,
html[lang="fa"] .answer .name {
  line-height: 1.8;
}

html[lang="fa"] .answer .name {
  font-weight: 600;
}

html[lang="fa"] .timer-box strong,
html[lang="fa"] .score-box strong,
html[lang="fa"] .result-score {
  font-weight: 600;
  letter-spacing: 0;
}

html[lang="fa"] .timer-unit {
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
}

html[lang="fa"] .sky-toolbar,
html[lang="fa"] .sky-footer {
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.5;
}

/* Keep keyboard hints and the English language switch visually technical. */
html[lang="fa"] kbd,
html[lang="fa"] .answer .key,
html[lang="fa"] .leaderboard-rank,
html[lang="fa"] .language-link {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}


/* ===== Compact desktop sky layout ===== */

@media (min-width: 981px) {
  .game-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, .8fr);
    align-items: start;
    min-height: 0;
    border-bottom: 1px solid var(--line);
  }

  .sky-panel {
    display: grid;
    grid-template-rows: 44px clamp(420px, 48vw, 560px) 44px;
    min-width: 0;
    min-height: 0;
    padding-right: clamp(20px, 3vw, 46px);
    border-right: 1px solid var(--line);
  }

  .canvas-wrap {
    position: relative;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #25334a;
    border-radius: 3px;
    background: #000;
    box-shadow: 0 24px 80px rgba(0,0,0,.24);
  }

  #skyCanvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
  }
}

/* Preserve the full-screen canvas behavior. */
.canvas-wrap:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border: 0;
}


/* Sky-region selector on the opening panel */
.sky-mode-selector {
  display: grid;
  gap: 9px;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.sky-mode-selector legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.sky-mode-option {
  display: grid !important;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  margin: 0 !important;
  padding: 13px 14px;
  border: 1px solid var(--line);
  background: #080e19;
  cursor: pointer;
  text-transform: none !important;
  letter-spacing: normal !important;
}

.sky-mode-option:hover {
  border-color: var(--line-bright);
}

.sky-mode-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.sky-mode-option input {
  margin: 4px 0 0;
  accent-color: var(--accent);
}

.sky-mode-option span {
  display: grid;
  gap: 4px;
}

.sky-mode-option strong {
  color: var(--text);
  font-size: .92rem;
  letter-spacing: 0;
  text-transform: none;
}

.sky-mode-option small {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
}


/* Stellarium artwork attribution link */
.art-credit-link {
  color: var(--muted);
  font: 600 .66rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .07em;
  text-decoration: none;
  text-transform: uppercase;
}

.art-credit-link:hover,
.art-credit-link:focus-visible {
  color: var(--text);
  text-decoration: underline;
}


/* Mobile-friendly no-scroll gameplay */
@media (max-width: 720px) {
  html, body {
    height: 100%;
  }

  body {
    overflow: hidden;
  }

  .app-shell {
    min-height: 100svh;
    display: grid;
    grid-template-rows: auto 1fr;
    padding: 0 10px 10px;
  }

  .topbar {
    min-height: 76px;
    gap: 12px;
  }

  .brand strong {
    font-size: .95rem;
  }

  .brand small {
    display: none;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .round-meter {
    width: 100%;
    padding-bottom: 12px;
  }

  .hud-stats {
    gap: 14px;
  }

  .timer-box strong,
  .score-box strong {
    font-size: 1.45rem;
  }

  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
    height: calc(100svh - 100px);
    overflow: hidden;
    border-bottom: 0;
    gap: 10px;
  }

  .sky-panel {
    grid-template-rows: 34px minmax(0, 1fr) 34px;
    min-height: 0;
    padding-right: 0;
    border-right: 0;
  }

  .sky-toolbar,
  .sky-footer {
    font-size: .58rem;
    letter-spacing: .05em;
  }

  .sky-toolbar span:last-child {
    display: none;
  }

  .canvas-wrap {
    height: 100%;
    min-height: 0;
  }

  .control-panel {
    padding: 0 0 4px;
  }

  .control-panel section + section {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .leaderboard-section {
    display: none;
  }

  .question-section .section-index {
    font-size: .62rem;
  }

  .question-section h1 {
    margin: 8px 0 10px;
    max-width: none;
    font-size: 1.28rem;
    line-height: 1.08;
  }

  .instructions {
    margin: 0 0 12px;
    font-size: .88rem;
    line-height: 1.35;
  }

  .answers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .answer {
    min-height: 48px;
    padding: 8px 10px;
    grid-template-columns: 18px 1fr auto;
    gap: 7px;
  }

  .answer:hover:not(:disabled),
  .answer:focus-visible {
    transform: none;
  }

  .answer .key {
    width: 18px;
    height: 18px;
    font-size: .56rem;
  }

  .answer .name {
    font-size: .84rem;
    line-height: 1.2;
  }

  .answer .mark {
    font-size: .95rem;
  }

  .next-button,
  .result-panel button {
    margin-top: 10px;
    padding: 12px 14px;
  }

  .key-hint {
    display: none;
  }

  .feedback-card {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: none;
  }

  .player-overlay {
    padding: 0;
  }

  .player-card {
    width: 100%;
    min-height: 100svh;
    max-height: 100svh;
    overflow-y: auto;
    padding: 16px 14px 14px;
    border: 0;
    box-shadow: none;
  }

  .player-card h1 {
    margin: 10px 0 8px;
    font-size: 1.35rem;
    line-height: 1.1;
  }

  .player-card > p {
    margin: 0 0 12px;
    font-size: .88rem;
    line-height: 1.35;
  }

  .player-topline {
    gap: 10px;
  }

  .sky-mode-selector {
    gap: 6px;
    margin-bottom: 14px;
  }

  .sky-mode-option {
    padding: 8px 10px;
    gap: 8px;
  }

  .sky-mode-option strong {
    font-size: .84rem;
  }

  .sky-mode-option small {
    font-size: .68rem;
    line-height: 1.25;
  }

  .player-form-row {
    gap: 8px;
  }

  .player-form-row input,
  .player-form-row button {
    min-height: 44px;
  }

  .start-leaderboard {
    display: none;
  }

  .result-overlay {
    padding: 10px;
  }

  .result-panel {
    width: 100%;
    max-height: calc(100svh - 20px);
    overflow-y: auto;
    padding: 22px 16px;
  }

  .result-score {
    font-size: 4rem;
  }

  .result-score small {
    font-size: 1.1rem;
  }
}

@media (max-width: 420px) {
  .answer .name {
    font-size: .8rem;
  }

  .timer-box strong,
  .score-box strong {
    font-size: 1.3rem;
  }

  .hud-stats {
    gap: 10px;
  }
}


/* Compact in-canvas answer indicator */
.feedback-card {
  max-width: min(300px, calc(100% - 32px));
  padding: 14px 16px;
}

.feedback-card span {
  margin-bottom: 3px;
  font-size: .62rem;
  letter-spacing: .12em;
}

.feedback-card strong {
  font-size: 1.35rem;
}

.feedback-card p {
  margin-top: 4px;
  font-size: .78rem;
  line-height: 1.3;
}

@media (max-width: 720px) {
  .feedback-card {
    left: 10px;
    right: auto;
    bottom: 10px;
    width: auto;
    max-width: min(230px, calc(100% - 20px));
    padding: 10px 12px;
    backdrop-filter: blur(8px);
  }

  .feedback-card span {
    margin-bottom: 2px;
    font-size: .56rem;
    letter-spacing: .1em;
  }

  .feedback-card strong {
    font-size: 1.08rem;
    line-height: 1.1;
  }

  .feedback-card p {
    margin-top: 3px;
    font-size: .7rem;
    line-height: 1.25;
  }
}
