:root {
  --bg: #07080d; --bg2: #0c0f18; --panel: rgba(16, 19, 30, .72); --edge: rgba(255, 255, 255, .08); --edge2: rgba(201, 162, 74, .35);
  --text: #ece8df; --muted: #9b9caa; --gold: #c9a24a; --gold2: #e6c47a; --ink: #17120a; --danger: #e5767e; --ok: #8fc49a;
  --display: "Cinzel", "Trajan Pro", Georgia, serif; --body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 16px/1.6 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Night sky (pure CSS, no images) */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(120% 80% at 70% -10%, #18203a 0%, #0b0e19 45%, var(--bg) 75%); }
.stars { position: absolute; inset: 0; opacity: .55;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 28% 64%, #cfd6ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 32%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 61% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 82% 46%, #dfe4ff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 91% 78%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 7% 88%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 53% 84%, #cfd6ff 50%, transparent 51%),
    radial-gradient(1px 1px at 36% 8%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 71% 58%, #fff 50%, transparent 51%);
  background-size: 420px 420px; }
.moon { position: absolute; width: 520px; height: 520px; right: -120px; top: -160px; border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, #f3ecd9 0%, #cfc6ad 35%, #8c8572 62%, transparent 63%);
  box-shadow: 0 0 120px 40px rgba(230, 210, 160, .12); opacity: .22; filter: blur(.5px); }
.haze { position: absolute; inset: auto 0 0 0; height: 45vh; background: linear-gradient(to top, var(--bg) 10%, transparent); }

/* Nav */
.nav { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px clamp(16px, 4vw, 48px); background: rgba(7, 8, 13, .6); backdrop-filter: blur(12px); border-bottom: 1px solid var(--edge); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font: 600 17px/1 var(--display); letter-spacing: .32em; }
.sigil { display: inline-block; width: 24px; height: 24px; flex: none; border-radius: 50%; border: 1.5px solid var(--gold); box-shadow: inset -7px -2px 0 0 var(--gold); }
.sigil.lg { width: 40px; height: 40px; box-shadow: inset -11px -3px 0 0 var(--gold); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.who { color: var(--muted); font-size: 14px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Buttons */
.btn { white-space: nowrap; font: 600 14px/1 var(--body); letter-spacing: .02em; border-radius: 10px; padding: 11px 18px; cursor: pointer; border: 1px solid var(--edge); background: transparent; color: var(--text);
  transition: background .18s, border-color .18s, transform .18s, box-shadow .18s; }
.btn:hover { border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .04); }
.btn.primary { background: linear-gradient(180deg, var(--gold2), var(--gold)); border-color: transparent; color: var(--ink); box-shadow: 0 6px 24px -8px rgba(201, 162, 74, .6); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px -8px rgba(201, 162, 74, .7); }
.btn.lg { padding: 15px 26px; font-size: 15px; }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn:focus-visible, input:focus-visible, .tabs button:focus-visible { outline: 2px solid var(--gold2); outline-offset: 2px; }

/* Layout */
main { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); flex: 1; }
.hero { padding: clamp(64px, 14vh, 140px) 0 56px; max-width: 720px; }
.eyebrow { margin: 0 0 14px; color: var(--gold); font: 600 12px/1 var(--body); letter-spacing: .28em; text-transform: uppercase; }
h1 { margin: 0; font: 700 clamp(48px, 9vw, 96px)/1 var(--display); letter-spacing: .08em;
  background: linear-gradient(180deg, #fff 20%, #b9b2a0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: #c3c2cc; font-size: clamp(17px, 2vw, 19px); max-width: 600px; margin: 22px 0 0; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 34px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0 56px; }
.feature, .panel { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius); backdrop-filter: blur(6px); }
.feature { padding: 26px; }
.feature .icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--gold2); background: rgba(201, 162, 74, .1); border: 1px solid var(--edge2); font-size: 18px; }
.feature h2 { font: 600 18px/1.3 var(--display); letter-spacing: .04em; margin: 18px 0 6px; }
.feature p { color: var(--muted); margin: 0; font-size: 15px; }

.steps { list-style: none; padding: 0; margin: 0 0 80px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: s; }
.steps li { display: flex; gap: 14px; padding: 20px 4px; border-top: 1px solid var(--edge2); }
.steps span { flex: none; font: 600 22px/1 var(--display); color: var(--gold); }
.steps strong { display: block; font-weight: 600; }
.steps p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* Account */
.welcome { padding: clamp(48px, 10vh, 96px) 0 32px; }
.welcome h1 { font-size: clamp(36px, 6vw, 60px); }
#account .panel { padding: 28px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 16px; }
#panel-download { border-color: var(--edge2); }
#panel-download .btn { align-self: flex-start; }
.panel h2 { margin: 0; font: 600 22px/1.3 var(--display); letter-spacing: .04em; }
.panel h3 { margin: 8px 0 0; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lobby-title { margin: 0; font-weight: 600; }
.muted { color: var(--muted); margin: 0; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row-form { display: flex; gap: 10px; }
.row-form input { flex: 1; min-width: 0; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--edge); border-radius: 10px; background: rgba(255, 255, 255, .02); }
.list li .acts { display: flex; gap: 8px; }
.list li.empty { color: var(--muted); border-style: dashed; font-size: 14px; }

/* Forms */
label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 500; color: var(--muted); }
input { font: 16px var(--body); color: var(--text); background: rgba(0, 0, 0, .35); border: 1px solid var(--edge); border-radius: 10px; padding: 13px 14px; transition: border-color .18s; }
input:hover { border-color: rgba(255, 255, 255, .18); }

/* Sign-in dialog */
dialog { width: min(440px, calc(100vw - 32px)); padding: 36px 32px 28px; border: 1px solid var(--edge2); border-radius: 18px; color: var(--text);
  background: linear-gradient(180deg, #121624, #0b0d16); box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .8); }
dialog::backdrop { background: rgba(3, 4, 8, .7); backdrop-filter: blur(4px); }
dialog h2 { margin: 18px 0 4px; font: 600 26px/1.2 var(--display); letter-spacing: .04em; }
dialog form#form-auth { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
dialog form#form-auth .btn { width: 100%; margin-top: 4px; }
.close-form { position: absolute; top: 12px; right: 12px; margin: 0; }
.close { background: none; border: 0; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; padding: 6px 10px; border-radius: 8px; }
.close:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-top: 20px; border-radius: 12px; background: rgba(0, 0, 0, .35); border: 1px solid var(--edge); }
.tabs button { font: 600 14px var(--body); padding: 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: rgba(201, 162, 74, .14); color: var(--gold2); }
.auth-msg { min-height: 20px; margin: 0; font-size: 14px; }
.auth-msg.error, .message.error { color: var(--danger); }
.auth-msg.info, .message.info { color: var(--ok); }
.message { min-height: 24px; margin: 0 0 32px; }

.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; padding: 22px clamp(16px, 4vw, 48px); border-top: 1px solid var(--edge); }

/* Simple confirmation pages */
.simple { max-width: 520px; padding: clamp(64px, 14vh, 140px) 0; }
.simple h1 { font-size: clamp(34px, 6vw, 52px); }
.simple .btn { display: inline-block; text-decoration: none; margin-top: 28px; }

@media (max-width: 860px) {
  .features { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  #nav-signin, .who { display: none; }
  .steps { grid-template-columns: 1fr; }
  .moon { width: 340px; height: 340px; right: -140px; top: -120px; }
  .row-form { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
