/*
 * TapVerse brand tokens for server-rendered pages (landing, installer, error pages, wallet link).
 * "Obsidian arcade": deep violet night lit by a gold core and cyan rim light. The Mini App
 * (resources/css/play.css) and the admin theme use the same palette.
 */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 500; font-display: swap; src: url("../fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-display: swap; src: url("../fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }

@font-face { font-family: "Unbounded"; font-weight: 700; font-display: swap; src: url("../fonts/unbounded-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Unbounded"; font-weight: 700; font-display: swap; src: url("../fonts/unbounded-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Unbounded"; font-weight: 700; font-display: swap; src: url("../fonts/unbounded-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }

/* Dark is the default: the game world is night. Light follows the visitor's system setting. */
:root {
  --night: #0d0720;
  --violet: #7c3aed;
  --cyan: #22d3ee;
  --gold: #facc15;
  --success: #22c55e;
  --danger: #e11d48;

  --bg: #0d0720;
  --bg-2: #160c36;
  --surface: #1a1042;
  --surface-2: #241757;
  --text: #f5f3ff;
  --muted: #bcb0e0;
  --border: #382a74;
  --primary: #7c3aed;
  --primary-hover: #8b5cf6;
  --on-primary: #ffffff;
  --link: #67e8f9;
  --focus: #22d3ee;
  --accent: #22d3ee;
  --reward: #facc15;
  --ok-bg: #0f2e1d; --ok-text: #86efac;
  --err-bg: #3b0d1c; --err-text: #fda4af;
  --lattice: rgb(255 255 255 / 5%);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px;
  --shadow: 0 1px 0 rgb(255 255 255 / 9%) inset, 0 2px 4px rgb(0 0 0 / 25%), 0 28px 60px -28px rgb(0 0 0 / 80%);
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-arcade: "Unbounded", "Space Grotesk", "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f3ff;
    --bg-2: #ece6ff;
    --surface: #ffffff;
    --surface-2: #f1ecff;
    --text: #1a1033;
    --muted: #574780;
    --border: #ddd3fa;
    --primary: #6d28d9;
    --primary-hover: #5b21b6;
    --link: #6d28d9;
    --accent: #0e7490;
    --reward: #a16207;
    --ok-bg: #dcfce7; --ok-text: #14532d;
    --err-bg: #ffe4e6; --err-text: #881337;
    --lattice: rgb(18 10 42 / 5%);
    --shadow: 0 1px 0 #fff inset, 0 1px 2px rgb(18 10 42 / 6%), 0 24px 48px -28px rgb(60 30 140 / 40%);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background-color: var(--bg); color: var(--text);
  font: 400 16px/1.55 var(--font-ui);
  background-image:
    radial-gradient(52rem 28rem at 50% -8%, rgb(124 58 237 / 34%), transparent 65%),
    radial-gradient(40rem 24rem at 105% 105%, rgb(34 211 238 / 16%), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 56 98'%3E%3Cpath d='M28 66 0 50V18L28 2l28 16v32z M28 100 0 84' fill='none' stroke='%23808080' stroke-opacity='0.12' stroke-width='1'/%3E%3C/svg%3E");
  background-attachment: fixed;
}
@media (prefers-color-scheme: light) {
  body { background-image: radial-gradient(52rem 28rem at 50% -8%, rgb(124 58 237 / 16%), transparent 65%), radial-gradient(40rem 24rem at 105% 105%, rgb(34 211 238 / 14%), transparent 60%); }
}
a { color: var(--link); text-underline-offset: 3px; }
::selection { background: rgb(124 58 237 / 55%); color: #fff; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 var(--space-3); text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: 1.35rem; }
p { margin: 0 0 var(--space-4); }
.muted { color: var(--muted); }
.skip { position: absolute; left: var(--space-4); top: -100px; }
.skip:focus { top: var(--space-4); background: var(--surface); padding: var(--space-2) var(--space-3); z-index: 10; }

.shell { max-width: 760px; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-7); }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); text-decoration: none; color: inherit; margin-bottom: var(--space-6); }
.brand img { width: 44px; height: 44px; border-radius: 13px; box-shadow: 0 10px 28px -10px rgb(124 58 237 / 90%); }
.brand span { font: 700 1.25rem var(--font-display); }
.brand small { display: block; font: 500 .8rem var(--font-ui); color: var(--muted); }

.card { position: relative; background: linear-gradient(180deg, rgb(255 255 255 / 6%), transparent 40%), var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(20px, 4vw, 36px); box-shadow: var(--shadow); }
@media (prefers-color-scheme: light) { .card { background: var(--surface); } }
.card + .card { margin-top: var(--space-5); }

.steps { display: flex; gap: var(--space-2); list-style: none; padding: 0; margin: 0 0 var(--space-5); flex-wrap: wrap; }
.steps li { font-size: .85rem; padding: 6px 14px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.steps li[aria-current="step"] { background: linear-gradient(180deg, rgb(255 255 255 / 12%), transparent 55%), linear-gradient(135deg, #7c3aed, #6d28d9); color: var(--on-primary); border-color: transparent; font-weight: 600; box-shadow: 0 10px 24px -12px rgb(124 58 237 / 90%); }
.steps li.done { color: var(--text); border-color: color-mix(in oklab, var(--success) 55%, var(--border)); }

.checks { list-style: none; padding: 0; margin: 0 0 var(--space-5); display: grid; gap: var(--space-2); }
.checks li { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3); border-radius: var(--radius-sm); background: var(--surface-2); }
.checks .icon { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; }
.checks .ok .icon { background: #15803d; }
.checks .bad .icon { background: #be123c; }
.checks .warn .icon { background: #b45309; }
.checks small { display: block; color: var(--muted); }

.grid { display: grid; gap: var(--space-4); }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.field .error { font-size: .85rem; color: var(--err-text); margin-top: 4px; font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], select {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 70%, var(--surface)); color: var(--text); font: inherit; caret-color: var(--accent);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover, select:hover { border-color: color-mix(in oklab, var(--primary) 55%, var(--border)); }
input[aria-invalid="true"] { border-color: var(--danger); }
input:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: transparent; }
.check { display: flex; gap: var(--space-3); align-items: flex-start; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--violet); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 46px; padding: 0 24px;
  border-radius: 999px; border: 1px solid transparent; font: 600 1rem var(--font-ui); text-decoration: none; cursor: pointer;
  background: linear-gradient(180deg, rgb(255 255 255 / 12%), transparent 52%), linear-gradient(135deg, #7c3aed, #6d28d9 58%, #0e7490); color: var(--on-primary);
  box-shadow: 0 1px 0 rgb(255 255 255 / 30%) inset, 0 -2px 0 rgb(0 0 0 / 18%) inset, 0 12px 26px -12px rgb(124 58 237 / 85%);
  transition: filter .15s ease, transform .15s var(--ease); }
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px) scale(0.985); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); filter: none; }
.btn-gold { background: linear-gradient(180deg, rgb(255 255 255 / 45%), transparent 55%), linear-gradient(135deg, #fde047, #facc15 50%, #eab308); color: #1a1033; box-shadow: 0 1px 0 rgb(255 255 255 / 60%) inset, 0 -2px 0 rgb(133 77 14 / 30%) inset, 0 14px 30px -12px rgb(250 204 21 / 80%); }
.btn.is-busy, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; cursor: not-allowed; }
.actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-5); align-items: center; }

.alert { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); margin-bottom: var(--space-4); font-weight: 500; }
.alert-ok { background: var(--ok-bg); color: var(--ok-text); }
.alert-err { background: var(--err-bg); color: var(--err-text); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
pre { background: color-mix(in oklab, var(--bg) 75%, var(--surface)); border: 1px solid var(--border); padding: var(--space-3); border-radius: var(--radius-sm); overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

.hero { text-align: center; padding-top: var(--space-6); }
.hero .mark { width: 96px; height: 96px; border-radius: 28px; box-shadow: 0 20px 50px -20px rgb(124 58 237 / 70%); }
/* Error pages: the code sits inside a lit hexagon portal. */
.error-code { position: relative; isolation: isolate; display: grid; place-items: center; width: clamp(9rem, 38vw, 12rem); aspect-ratio: 1 / 1.1547; margin: var(--space-4) auto var(--space-5);
  font: 700 clamp(2.2rem, 9vw, 3.4rem)/1 var(--font-arcade); letter-spacing: -0.02em; color: #fff3c4; text-shadow: 0 6px 24px rgb(250 204 21 / 45%);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(135deg, #a78bfa, #7c3aed 50%, #22d3ee); }
.error-code::before { content: ""; position: absolute; inset: 4px; z-index: -1; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: radial-gradient(circle at 50% 38%, rgb(250 204 21 / 26%), transparent 62%), linear-gradient(160deg, #3b1f7a, #120a2a); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; margin: var(--space-5) 0; padding: 0; list-style: none; }
.chips li { padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .88rem; font-weight: 500; }
footer.site { text-align: center; color: var(--muted); font-size: .85rem; margin-top: var(--space-6); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
