:root {
  color-scheme: dark;
  --bg: #111f1a;
  --panel: #1b2e26;
  --line: #40594a;
  --text: #f5ebd7;
  --muted: #c4cbbd;
  --mint: #afc8af;
  --gold: #f9cd89;
  font: 16px/1.53 system-ui, sans-serif;
  scroll-behavior: smooth;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: var(--bg); }
a { color: inherit; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.top { background: #192b23; border-bottom: 1px solid #40564a; }
.top-inner, .top nav, .brand, .actions, .account-head {
  display: flex; align-items: center;
}
.top-inner { min-height: 67px; justify-content: space-between; gap: 20px; }
.top nav { gap: clamp(12px, 3vw, 36px); }
.top nav a, .brand { text-decoration: none; }
.top nav a { min-height: 44px; display: grid; align-items: center; }
.top nav a:hover, .footer a:hover { color: var(--gold); }
.brand { gap: 9px; font-size: 1.07rem; font-weight: 800; white-space: nowrap; }
.nav-account { color: var(--gold); }
.hero {
  background: linear-gradient(90deg, #102018d9 0%, #14241990 38%, transparent 76%),
    linear-gradient(0deg, #111f1a 0%, transparent 37%), url('/assets/frontier.webp') center 55% / cover no-repeat, #294135;
}
.hero-inner { min-height: clamp(520px, 66vh, 750px); display: grid; align-content: center; padding: 45px 0 90px; }
.hero-copy { max-width: 555px; }
h1, h2, h3, p { margin: 0; }
.hero h1, .account h1 { font: 800 clamp(3rem, 8vw, 6.35rem)/.97 Georgia, serif; letter-spacing: -.055em; }
.hero p { max-width: 505px; margin: 24px 0 27px; color: #fff1db; font-size: clamp(1.05rem, 2vw, 1.3rem); }
.actions { flex-wrap: wrap; gap: 11px; }
.button {
  appearance: none; border: 1px solid transparent; border-radius: 6px; min-height: 46px; padding: 10px 20px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--text); background: #294435; text-decoration: none; font-weight: 700;
}
.primary { background: var(--gold); color: #242214; }
.primary:hover { background: #ffdfa9; }
.subtle, .download { background: #15291ee3; border-color: #708375; }
.subtle:hover, .download:hover { background: #2a4739; }
button:disabled { opacity: .6; cursor: wait; }
.online-label { min-height: 1.4em; margin-top: 15px; color: #deedcf; font-size: .92rem; }
.world { padding: 42px 0 95px; scroll-margin-top: 15px; }
.world-heading { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; align-items: end; margin-bottom: 25px; }
h2 { font: 700 clamp(1.5rem, 4vw, 2.45rem)/1.08 Georgia, serif; letter-spacing: -.025em; }
.world-heading p, .features p, .account-card p, .hint, .footer span { color: var(--muted); }
.world-grid { display: grid; grid-template-columns: 1.26fr 1fr; gap: 24px; }
.world-grid img { display: block; width: 100%; height: 100%; min-height: 300px; object-fit: cover; border-radius: 10px; }
.features { display: grid; gap: 16px; }
.features article { border-bottom: 1px solid var(--line); padding: 9px 0 14px; }
.features h3 { font-size: 1.15rem; color: var(--gold); margin-bottom: 4px; }
.footer { display: flex; flex-wrap: wrap; gap: 15px; align-items: center; justify-content: space-between; padding: 21px 0 35px; border-top: 1px solid var(--line); }
.account { min-height: 68vh; padding: 44px 0 70px; }
.account-head { justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.account h1 { font-size: clamp(2.4rem, 6vw, 4rem); overflow-wrap: anywhere; }
.kicker { color: var(--mint); margin-bottom: 7px; }
.account-grid, .stats { display: grid; gap: 13px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 15px 0; }
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.account-card, .stat { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: clamp(15px, 3vw, 24px); }
.account-card h2 { font-size: 1.65rem; margin-bottom: 9px; }
.stat strong { display: block; color: var(--gold); font-size: 1.7rem; }
.stat span { color: var(--muted); }
.code-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.code-card > div:first-child { flex: 1 1 360px; }
.issued { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; width: 100%; }
.issued output { background: #15251d; padding: 10px 15px; color: var(--gold); border-radius: 5px; font: 700 1.2rem/1.4 ui-monospace, monospace; }
.ledger { padding: 0; margin: 0; list-style: none; }
.ledger li { padding: 9px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: space-between; }
.ledger small { color: var(--muted); font-size: .9rem; }
dialog { width: min(450px, calc(100% - 28px)); max-height: calc(100% - 24px); padding: 0; border: 1px solid #65816e; border-radius: 13px; color: var(--text); background: #1a2e24; }
dialog::backdrop { background: #07140cbb; }
.dialog-body { padding: 28px; position: relative; }
.dialog-body h2 { margin: 0 34px 18px 0; }
.close { position: absolute; top: 10px; right: 12px; background: #2a4435; border: 1px solid var(--line); border-radius: 7px; width: 44px; height: 44px; color: var(--text); font-size: 1.4rem; cursor: pointer; }
form { display: grid; gap: 13px; }
label { display: grid; gap: 5px; }
input { width: 100%; border: 1px solid #587362; border-radius: 6px; background: #14251d; color: var(--text); min-height: 46px; padding: 8px 11px; }
.notice { color: #ffcf95; }
.notice:empty { display: none; }
.hint { font-size: .88rem; }
#auth-switch { display: inline-block; margin-top: 16px; color: var(--mint); }
@media (max-width: 740px) {
  .wrap { width: calc(100% - 34px); }
  .hero { background-position: 64% center; }
  .hero-inner { min-height: 500px; padding-top: 70px; }
  .hero-copy { max-width: 390px; }
  .world-heading, .world-grid, .account-grid { grid-template-columns: 1fr; }
  .world-grid img { min-height: 200px; }
  .world { padding-bottom: 55px; }
}
@media (max-width: 390px) {
  .top-inner { gap: 8px; }
  .brand { font-size: .97rem; }
  .top nav { gap: 11px; font-size: .9rem; }
  .stat { padding: 10px; }
}
@media (prefers-reduced-motion) { :root { scroll-behavior: auto; } }
