/* Starmaker – old star atlas at night */
:root {
  --night: #070B1A;
  --night-2: #0E1430;
  --panel: rgba(14, 20, 48, .82);
  --line: rgba(242, 196, 109, .22);
  --gold: #F2C46D;
  --gold-2: #FFDFA0;
  --text: #EEF0F8;
  --text-2: #BCC3DC;
  --muted: #98A0BE;
  --radius: 20px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--night); color: var(--text); font: 400 1.02rem/1.6 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2 { font-family: var(--serif); font-weight: 700; margin: 0; line-height: 1.05; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--gold); text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 10px; }
[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-link { position: absolute; left: 16px; top: -60px; z-index: 10; background: var(--gold); color: #1A1200; padding: 10px 16px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 16px; }
.small { font-size: .92rem; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.sky-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }

.top, main, .foot { width: min(100% - 32px, 1080px); margin-inline: auto; }
.top { padding-top: 16px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 8px; }
.crumbs a { color: var(--text-2); text-decoration: none; display: inline-flex; min-height: 44px; align-items: center; }
.crumbs a:hover { text-decoration: underline; }

.hero { text-align: center; padding: clamp(24px, 6vw, 60px) 0 28px; display: grid; gap: 14px; justify-items: center; }
.eyebrow { font-size: .82rem; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.8rem); color: #fff; }
.hero h1 em { color: var(--gold); font-style: italic; font-weight: 600; }
.lead { max-width: 56ch; color: var(--text-2); font-size: clamp(1.05rem, 1.8vw, 1.2rem); }

/* Stage */
.stage { border-radius: 28px; background: var(--panel); border: 1px solid var(--line); padding: clamp(16px, 3vw, 32px); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.stage:focus { outline: none; }
.step { display: grid; gap: 16px; justify-items: center; }
.board-head { width: min(100%, 560px); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.idea { color: var(--text-2); }
.idea strong { color: #fff; }
.link { background: none; border: 0; padding: 0 4px; min-height: 44px; color: var(--gold); text-decoration: underline; cursor: pointer; font-weight: 600; }
.timer { font-family: var(--serif); font-size: 2.4rem; font-weight: 700; color: var(--gold); line-height: 1; font-variant-numeric: tabular-nums; }
.timer small { font-size: 1rem; margin-left: 2px; color: var(--muted); }
.timer.low { color: #FF8F7A; }

.canvas-wrap { position: relative; width: min(100%, 560px); aspect-ratio: 1; }
.pad { width: 100%; height: 100%; display: block; border-radius: 22px; background: radial-gradient(circle at 50% 40%, #121A40, #0A0F26 70%); border: 1px dashed rgba(242, 196, 109, .45); cursor: crosshair; touch-action: none; }
.pad.locked { cursor: not-allowed; opacity: .85; }
.pad-hint { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-family: var(--serif); font-style: italic; font-size: 2rem; color: rgba(242, 196, 109, .4); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px; border-radius: 999px; font-weight: 700; cursor: pointer; border: 1px solid var(--gold); background: transparent; color: var(--text); text-decoration: none; transition: transform .15s, background .2s, color .2s; }
.btn:hover:not([disabled]) { transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: #1A1200; }
.btn-gold:hover:not([disabled]) { background: var(--gold-2); }
.btn-ghost:hover:not([disabled]) { background: rgba(242, 196, 109, .1); }
.btn-link { border: 0; text-decoration: underline; padding: 0 10px; min-height: 44px; color: var(--text-2); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }

/* Name step */
.step-name { width: min(100%, 520px); margin-inline: auto; justify-items: stretch; }
.step-name h2 { font-size: 2.2rem; text-align: center; }
.step-name .small { text-align: center; }
label { font-weight: 600; color: var(--text-2); font-size: .95rem; }
input[type="text"] { width: 100%; min-height: 52px; padding: 0 16px; border-radius: 14px; border: 1px solid rgba(242, 196, 109, .4); background: var(--night); color: #fff; font-size: 1.1rem; }
input[type="text"]:focus-visible { outline-offset: 1px; border-color: var(--gold); }
input[aria-invalid="true"] { border-color: #FF8F7A; }
.error { color: #FF9C8A; font-weight: 600; }
.error:empty { display: none; }
.step-name .row { justify-content: center; margin-top: 6px; }

/* Sky result */
.sky-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: center; width: 100%; }
.sky { width: 100%; aspect-ratio: 1; display: block; border-radius: 22px; background: #050815; border: 1px solid var(--line); }
.chart { display: grid; gap: 16px; }
.chart-kicker { font-size: .8rem; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.chart h2 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); font-style: italic; font-weight: 600; color: #fff; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts dt { font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Guess mode */
.clue { color: var(--text-2); }
.guess-form { display: grid; gap: 8px; }
.guess-form input { flex: 1 1 180px; width: auto; }
.tries { font-weight: 600; color: var(--gold); }
.reveal { display: grid; gap: 14px; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: rgba(5, 8, 21, .6); }
.reveal-title { font-family: var(--serif); font-size: 1.8rem; font-weight: 700; color: #fff; }

/* Gallery */
.gallery-wrap { margin-top: 64px; display: grid; gap: 16px; }
.gallery-wrap h2 { font-size: 2.2rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gallery button { width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: #050815; cursor: pointer; overflow: hidden; display: grid; text-align: left; }
.gallery button:hover { border-color: var(--gold); }
.gallery canvas { width: 100%; aspect-ratio: 1; display: block; }
.gallery span { padding: 8px 10px; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.05rem; color: var(--text); }
.gallery-wrap .btn-link { justify-self: start; }

/* FAQ */
.faq { margin-top: 64px; display: grid; gap: 10px; }
.faq h2 { font-size: 2.2rem; margin-bottom: 6px; }
.faq details { border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 600; min-height: 44px; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "✦"; color: var(--gold); transition: transform .3s; }
.faq details[open] summary::after { transform: rotate(90deg); }
.faq details p { padding: 0 18px 16px; color: var(--text-2); }
.foot { padding: 56px 0 32px; color: var(--muted); font-size: .92rem; text-align: center; }

.fade { animation: fade .6s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 860px) {
  .sky-layout { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .btn { width: 100%; }
  .btn-link { width: auto; }
  .facts dd { font-size: 1.1rem; }
  .board-head { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
