/* Generated by scripts/build-home-style.js from style.css. Edit the source sections. */
/* ===== Nova Imperium - holographic space UI ===== */
:root {
  /* Theme colours: the default "Nova" theme. js/theme.js overrides these from the Options page. */
  --accent-rgb: 79, 209, 255;
  --accent2-rgb: 59, 108, 255;
  --highlight-rgb: 167, 139, 250;
  --tint-rgb: 120, 180, 255;
  --deep-rgb: 4, 8, 18;
  --surface-rgb: 10, 16, 30;
  --raised-rgb: 14, 22, 40;
  --btn1: #1fb6ff;
  --btn2: #3b6cff;
  --btn-text: #fff;
  --btn-glow-rgb: 31, 140, 255;
  --bg: #04060c;
  --text: #dbe7ff;
  --muted: #8796b5;
  --dim: #5b6782;

  --accent: rgb(var(--accent-rgb));
  --accent2: rgb(var(--accent2-rgb));
  --text-soft: color-mix(in srgb, var(--text) 65%, var(--muted));
  --panel: rgba(var(--surface-rgb), 0.72);
  --panel-strong: rgba(var(--surface-rgb), 0.9);
  --panel-soft: rgba(var(--raised-rgb), 0.55);
  --line: rgba(var(--tint-rgb), 0.16);
  --line-strong: rgba(var(--tint-rgb), 0.35);
  --cyan: var(--accent);
  --blue: var(--accent2);
  --gold: #ffc65c;
  --green: #6dffa5;
  --red: #ff5468;
  --violet: #a78bfa;
  --metal: #c3ccd9;
  --crystal: #66e3ff;
  --deut: #6dffbf;
  --energy: #ffd35c;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  --glow: 0 0 24px rgba(var(--accent-rgb), 0.25);
  --font: 'Exo 2', 'Segoe UI', system-ui, sans-serif;
  --display: 'Orbitron', 'Exo 2', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 10000; padding: 12px 18px; background: var(--bg); color: var(--text); border: 2px solid var(--cyan); border-radius: 8px; font: inherit; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
body.game :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
@media (forced-colors: active) {
  body.game :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline-color: Highlight; }
}
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: 0.06em; margin: 0 0 0.6em; font-weight: 600; }
h2 { font-size: 18px; text-transform: uppercase; }
h3 { font-size: 14px; text-transform: uppercase; color: var(--muted); }
small { color: var(--muted); }
::selection { background: rgba(var(--accent-rgb), 0.35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--tint-rgb), 0.2); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(var(--tint-rgb), 0.35); }

.stage-canvas { display: block; width: 100%; height: 100%; }
.no-webgl { background: radial-gradient(ellipse at 30% 30%, color-mix(in srgb, var(--accent2) 22%, var(--bg)) 0%, var(--bg) 70%); }

/* ---------- panels ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  padding: 18px;
  position: relative;
}
.panel::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), transparent 30%, transparent 70%, rgba(var(--highlight-rgb), 0.06));
}
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-title h2 { margin: 0; }
.sec-head { display: flex; align-items: center; gap: 8px; }
.sec-ico { width: 28px; height: 28px; object-fit: contain; flex: none; mix-blend-mode: screen; }
.panel-title select { width: auto; max-width: 240px; padding: 6px 10px; }


/* ---------- buttons & inputs ---------- */
.btn {
  --c1: var(--btn1); --c2: var(--btn2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px;
  padding: 10px 18px;
  font-family: var(--display); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--btn-text); cursor: pointer;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 6px 20px rgba(var(--btn-glow-rgb), 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(var(--btn-glow-rgb), 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3); filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { filter: grayscale(1) brightness(0.6); cursor: not-allowed; box-shadow: none; }
.btn.gold { --c1: #ffc65c; --c2: #ff8a3d; box-shadow: 0 6px 20px rgba(255, 150, 60, 0.35); color: #1a1004; }
.btn.green { --c1: #3ce59b; --c2: #12a46d; box-shadow: 0 6px 20px rgba(40, 200, 130, 0.35); color: #fff; }
.btn.red { --c1: #ff5468; --c2: #c2185b; box-shadow: 0 6px 20px rgba(255, 70, 100, 0.35); color: #fff; }
.btn.ghost { background: rgba(var(--tint-rgb), 0.08); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text); }
.btn.ghost:hover:not(:disabled) { background: rgba(var(--tint-rgb), 0.16); box-shadow: inset 0 0 0 1px var(--cyan), var(--glow); }
.btn.small { padding: 6px 11px; font-size: 10.5px; border-radius: 8px; }
.btn.tiny { padding: 3px 8px; font-size: 10px; border-radius: 6px; }
.btn.block { width: 100%; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.tiny svg { width: 14px; height: 14px; }

input[type=text], input[type=password], input[type=email], input[type=number], input[type=search], select, textarea {
  width: 100%;
  background: rgba(var(--deep-rgb), 0.7);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 9px;
  padding: 10px 12px;
  font: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18); }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
select option { background: rgb(var(--surface-rgb)); }
label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px; letter-spacing: 0.04em; }
.field { margin-bottom: 14px; }
.input-ico { position: relative; }
.input-ico svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; pointer-events: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  color: var(--muted);
}
.input-ico input { padding-left: 36px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); font-size: 13px; }
.check input { accent-color: var(--cyan); width: 16px; height: 16px; }
input[type=range] { width: 100%; accent-color: var(--cyan); }

.tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; background: rgba(var(--tint-rgb), 0.12); color: var(--muted); }
.tag.cyan { background: rgba(var(--accent-rgb), 0.15); color: var(--cyan); }
.tag.green { background: rgba(109, 255, 165, 0.13); color: var(--green); }
.tag.red { background: rgba(255, 84, 104, 0.15); color: var(--red); }
.tag.gold { background: rgba(255, 198, 92, 0.15); color: var(--gold); }
.tag.violet { background: rgba(167, 139, 250, 0.15); color: var(--violet); }

.c-metal { color: var(--metal); } .c-crystal { color: var(--crystal); } .c-deut { color: var(--deut); } .c-energy { color: var(--energy); }
.c-red { color: var(--red) !important; } .c-green { color: var(--green) !important; } .c-gold { color: var(--gold) !important; } .c-cyan { color: var(--cyan) !important; } .c-muted { color: var(--muted) !important; }

.ico { width: 18px; height: 18px; display: inline-block; vertical-align: -4px; flex: none; }
.res-img { width: 18px; height: 18px; object-fit: contain; vertical-align: -4px; flex: none; }
.ico .res-img { display: block; width: 100%; height: 100%; }

/* ---------- toasts & modals ---------- */
#toasts { position: fixed; top: 76px; right: 18px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  pointer-events: auto;
  min-width: 260px; max-width: 380px;
  padding: 12px 16px 12px 14px;
  border-radius: 12px;
  background: var(--panel-strong);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--cyan);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: toastIn 0.35s cubic-bezier(.2, 1.2, .4, 1);
  font-size: 13px;
}
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
.toast.out { animation: toastOut 0.3s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

.modal-back { display: contents; }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { overflow: hidden; overscroll-behavior: contain; }
dialog.modal::backdrop {
  background: rgba(var(--deep-rgb), 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s;
}
.modal { width: min(560px, calc(100% - 40px)); max-height: 88dvh; overflow: auto; animation: popIn 0.3s cubic-bezier(.2, 1.2, .4, 1); }
dialog.panel.modal { position: fixed; margin: auto; color: inherit; }
.modal.wide { width: min(900px, calc(100% - 40px)); }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } }

.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(var(--accent-rgb), 0.15); border-top-color: var(--cyan); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== LANDING ===================== */
.landing { min-height: 100vh; height: auto; position: relative; }
.landing #scene { position: fixed; inset: 0 0 52px 0; z-index: 0; overflow: hidden; background: #05070d; }
.landing #scene::before {
  content: "";
  position: absolute; inset: -48px;
  pointer-events: none;
  filter: blur(18px) brightness(0.92) saturate(1.45);
  transform: scale(1.08);
  animation: sideLive 18s ease-in-out infinite;
}
.landing #scene::after {
  content: "";
  position: absolute;
  left: var(--art-x, 0px);
  top: var(--art-y, 0px);
  width: var(--art-w, 100%);
  height: var(--art-h, 100%);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  transform-origin: center 38%;
  animation: artLive 11s ease-in-out infinite;
}
@keyframes artLive {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-7px) scale(1.015); }
}
@keyframes sideLive {
  0%, 100% { transform: scale(1.08) translate3d(0, 0, 0); }
  50% { transform: scale(1.13) translate3d(-14px, 8px, 0); }
}
.art-logo-shine {
  position: fixed;
  z-index: 1;
  left: 50%;
  top: 78%;
  width: min(460px, 40vw);
  height: 74px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 55%, rgba(255, 210, 120, 0.42), rgba(255, 180, 60, 0.08) 46%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 25%, transparent 76%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 25%, transparent 76%);
}
.art-logo-shine::before {
  content: "";
  position: absolute;
  inset: -10% -20%;
  background: linear-gradient(102deg, transparent 36%, rgba(255, 248, 220, 0.15) 46%, rgba(255, 255, 245, 0.95) 50%, rgba(255, 220, 140, 0.2) 55%, transparent 66%);
  animation: logoShine 4.6s ease-in-out infinite;
}
@keyframes logoShine {
  0%, 38% { transform: translateX(-55%); }
  62%, 100% { transform: translateX(55%); }
}
@media (prefers-reduced-motion: reduce) {
  .landing #scene { animation: none; }
  .landing #scene::before { animation: none; transform: scale(1.08); }
  .landing #scene::after { animation: none; }
  .art-logo-shine::before { animation: none; transform: translateX(0); opacity: 0.7; }
}
.landing .vignette { position: fixed; inset: 0 0 52px 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(2, 4, 8, 0.28) 0%, rgba(2, 4, 8, 0.1) 16%, transparent 30%, transparent 72%, rgba(2, 4, 8, 0.16) 100%), linear-gradient(180deg, rgba(2, 4, 8, 0.45) 0%, transparent 14%, transparent 78%, rgba(2, 4, 8, 0.28) 100%); }
.landing .brand { text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.9); }
.landing .brand h1 { text-shadow: none; }
.landing-page { position: relative; z-index: 2; min-height: 100vh; display: flex; flex-direction: column; }
.site-header {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 6vw;
  background: rgba(var(--deep-rgb), 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.beta-tag {
  display: inline-flex; align-items: center; flex: none;
  padding: 3px 8px; border-radius: 999px;
  font-family: var(--display); font-size: 9.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; line-height: 1.2;
  color: var(--gold); background: rgba(255, 198, 92, 0.12); border: 1px solid rgba(255, 198, 92, 0.45);
}
a.beta-tag:hover { text-decoration: none; background: rgba(255, 198, 92, 0.2); }
.beta-bar {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 9px 6vw;
  background: linear-gradient(90deg, rgba(255, 198, 92, 0.1), rgba(255, 138, 61, 0.14), rgba(255, 198, 92, 0.1)), rgba(var(--deep-rgb), 0.9);
  border-bottom: 1px solid rgba(255, 198, 92, 0.28);
  font-size: 12.5px; color: var(--text-soft);
}
.beta-bar p { margin: 0; max-width: 980px; }
.beta-bar b { color: var(--text); font-weight: 600; }
.beta-bar a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
.site-brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--text); text-decoration: none; font-family: var(--display); font-size: 13px; font-weight: 700; letter-spacing: 0.22em; }
.site-brand img, .kb-brand img, .menu-logo { display: block; height: 38px; width: auto; }
.site-brand:hover { text-decoration: none; color: #fff; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a, .footer-nav a {
  color: var(--text-soft); text-decoration: none;
  font-family: var(--display); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 8px 12px; border-radius: 8px;
}
.site-nav a, .footer-nav a { display: inline-flex; align-items: center; gap: 7px; }
.nav-ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0.8; transition: opacity 0.2s; }
.nav-ico.solid { fill: currentColor; stroke: none; }
.site-nav a:hover .nav-ico, .footer-nav a:hover .nav-ico, .site-nav a.active .nav-ico, .site-nav a[href="#play"] .nav-ico { opacity: 1; }
.site-nav a:hover, .footer-nav a:hover, .site-nav a.active { color: #fff; text-decoration: none; background: rgba(var(--tint-rgb), 0.12); }
.site-nav a[href="#play"] { color: #1a1004; background: linear-gradient(135deg, #ffc65c, #ff8a3d); }
.site-nav a[href="#play"]:hover { filter: brightness(1.08); background: linear-gradient(135deg, #ffc65c, #ff8a3d); }
html:has(body.landing) { scroll-behavior: smooth; }
.menu-toggle {
  display: none; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: rgba(var(--tint-rgb), 0.08); cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.menu-toggle span { display: block; width: 16px; height: 2px; border-radius: 2px; background: var(--text); }
.landing-wrap { position: relative; flex: 1; display: grid; grid-template-columns: 1fr minmax(320px, 440px); gap: 40px; padding: 36px 6vw 48px; align-items: center; }
.landing-wrap section { scroll-margin-top: 84px; }
.site-footer {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap;
  padding: 22px 6vw;
  background: rgba(var(--deep-rgb), 0.82);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; }
.footer-copy { position: absolute; right: 6vw; margin: 0; color: var(--muted); font-size: 12px; letter-spacing: 0.04em; }
.brand { font-family: var(--display); }
.brand .logo { display: flex; align-items: center; gap: 14px; font-size: 13px; letter-spacing: 0.4em; color: var(--muted); text-transform: uppercase; }
.brand h1 {
  font-size: clamp(42px, 7vw, 92px);
  line-height: 0.95;
  margin: 18px 0 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #ffffff 0%, color-mix(in srgb, var(--accent) 35%, #fff) 45%, color-mix(in srgb, var(--accent) 60%, var(--accent2)) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgba(var(--accent-rgb), 0.45));
}
.brand h1.seo-h1 {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  font-size: 16px; line-height: 1; letter-spacing: 0; font-weight: 600;
  background: none; color: transparent; filter: none;
}
.brand p.tagline { font-family: var(--font); font-size: 18px; color: var(--text-soft); max-width: 560px; margin: 0 0 22px; }
.open-clock {
  display: inline-flex; flex-direction: column; gap: 8px;
  margin: 0 0 26px; padding: 12px 16px 14px;
  border-radius: 14px;
  background: rgba(var(--surface-rgb), 0.5);
  border: 1px solid rgba(255, 198, 92, 0.35);
  backdrop-filter: blur(8px);
  font-family: var(--font);
}
.open-clock[hidden] { display: none; }
.open-clock-label {
  font-family: var(--display); font-size: 11px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold);
}
.open-clock-digits { display: flex; gap: 14px; }
.open-clock-digits span {
  display: flex; flex-direction: column; min-width: 52px;
  color: var(--muted); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
}
.open-clock-digits b {
  color: var(--text); font-family: var(--display); font-size: 28px; font-weight: 700;
  letter-spacing: 0.04em; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.open-clock.ended { border-color: rgba(255, 90, 90, 0.4); }
.open-clock.ended .open-clock-label { color: #ff8a8a; }
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 12px; }
.feature { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: rgba(var(--surface-rgb), 0.45); border: 1px solid var(--line); backdrop-filter: blur(8px); font-family: var(--font); }
.feature b { display: block; font-size: 13px; letter-spacing: 0.03em; }
.feature span { font-size: 12px; color: var(--muted); }
.feature .fi { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.25), rgba(var(--accent2-rgb), 0.15)); flex: none; }
.stats-line { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 26px; color: var(--muted); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.stats-line b { display: block; color: var(--text); font-family: var(--display); font-size: 22px; letter-spacing: 0.04em; }
.social-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 26px; }
.btn.discord { --c1: #6d78ff; --c2: #4752c4; color: #fff; display: flex; width: fit-content; margin-top: 0; padding: 13px 22px; font-size: 13px; text-decoration: none; box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn.discord:hover { text-decoration: none; box-shadow: 0 10px 28px rgba(88, 101, 242, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn.discord svg, .btn.x svg { width: 20px; height: 20px; }
.btn.x { --c1: #1c1c1c; --c2: #000; color: #fff; display: flex; width: fit-content; margin-top: 0; padding: 13px 22px; font-size: 13px; text-decoration: none; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.btn.x:hover { text-decoration: none; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25); }

.auth { padding: 28px; max-height: calc(100vh - 48px); overflow: auto; }
.uni-pick { display: grid; gap: 8px; margin-bottom: 16px; }
.uni-group { display: grid; gap: 8px; }
.mode-tabs {
  display: flex; gap: 4px; padding: 4px; border-radius: 12px;
  background: rgba(var(--deep-rgb), 0.6); border: 1px solid var(--line);
}
.mode-tabs button {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--muted);
  padding: 10px 6px; border-radius: 9px; cursor: pointer;
  font-family: var(--display); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; transition: all 0.2s;
}
.mode-tabs button.active {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.22), rgba(var(--accent2-rgb), 0.2));
  color: #fff; box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.35);
}
.mode-tabs button:hover { color: #fff; }
.uni-pick-label { font-family: var(--display); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 2px; }
.uni-card {
  display: grid; gap: 2px; text-align: left; width: 100%;
  padding: 10px 12px; border-radius: 12px; cursor: pointer;
  color: var(--text); background: rgba(var(--deep-rgb), 0.45);
  border: 1px solid var(--line); font: inherit;
}
.uni-card b { font-family: var(--display); letter-spacing: 0.12em; font-size: 13px; }
.uni-card span, .uni-card small { color: var(--muted); font-size: 12px; }
.uni-card small.uni-ally { color: var(--gold); font-weight: 600; }
.uni-card.on { border-color: rgba(var(--accent-rgb), 0.7); background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.18), rgba(var(--accent2-rgb), 0.12)); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.25); }
.uni-card:hover { border-color: rgba(var(--accent-rgb), 0.45); }
.uni-pick.public { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 8px 0 22px; }
@media (max-width: 800px) { .uni-pick.public { grid-template-columns: 1fr; } }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(var(--deep-rgb), 0.6); border: 1px solid var(--line); margin-bottom: 22px; }
.tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 10px; border-radius: 9px; cursor: pointer; font-family: var(--display); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; transition: all 0.2s; }
.tabs button.active { background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.22), rgba(var(--accent2-rgb), 0.2)); color: #fff; box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.35); }
.form-error { min-height: 20px; color: var(--red); font-size: 13px; margin: 4px 0 10px; }
.form-hint { font-size: 12px; color: var(--dim); margin-top: 14px; text-align: center; }
.auth-alt { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.or-line { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; margin: 2px 0 4px; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.btn.social { text-decoration: none; }
.btn.social[aria-busy="true"] { filter: brightness(0.75); cursor: progress; }
.btn.social.gmail { --c1: #fff; --c2: #f1f3f4; color: #1f1f1f; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28); }
.btn.social.discord-login { --c1: #5865f2; --c2: #4752c4; color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28); }
.btn.social .social-bonus { display: inline-block; margin: 0 0 0 6px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.22); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 0.02em; text-transform: none; }
.auth-alt .form-error { min-height: 0; margin: 0; }
.name-step h2 { font-family: var(--display); font-size: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 8px; }
.name-step p { font-size: 13px; margin: 0 0 18px; }
.name-step p b { color: var(--text); font-weight: 600; word-break: break-all; }
.name-step .btn + .btn { margin-top: 8px; }
.loader-screen { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--bg); transition: opacity 0.8s; }
.loader-screen.hide { opacity: 0; pointer-events: none; }
.loader-screen .brandmark { font-family: var(--display); letter-spacing: 0.5em; color: var(--muted); margin-top: 18px; font-size: 12px; text-align: center; }

@media (max-width: 1280px) {
  .site-header { padding-left: 24px; padding-right: 24px; }
  .site-nav { gap: 2px; }
  .site-nav a { padding: 8px 9px; gap: 6px; letter-spacing: 0.08em; }
}
@media (min-width: 1025px) and (max-width: 1200px) {
  .landing .site-nav { gap: 0; }
  .landing .site-nav a { padding: 8px 5px; letter-spacing: 0.03em; }
}
@media (max-width: 1024px) {
  .menu-toggle { display: flex; }
  .site-header { flex-wrap: wrap; }
  .site-nav {
    display: none; flex-direction: column; align-items: stretch;
    width: 100%; order: 3;
    padding: 6px 0 4px;
  }
  .site-header.open .site-nav { display: flex; }
  .site-nav a { padding: 12px; gap: 10px; }
}
@media (max-width: 1024px) {
  .site-header, .site-footer, .landing-wrap, .beta-bar {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  .beta-bar { align-items: flex-start; justify-content: flex-start; padding-top: max(9px, env(safe-area-inset-top)); }
  .beta-bar .beta-tag { margin-top: 1px; }
  .beta-bar p { overflow-wrap: break-word; }
  .landing #scene,
  .landing .vignette,
  .art-logo-shine { display: none; }
  .landing { background: var(--bg); }
  .landing-page, .landing-wrap, .brand, .landing .auth, .site-footer, .site-header { min-width: 0; max-width: 100%; }
  .landing-wrap { grid-template-columns: minmax(0, 1fr); padding-top: 20px; padding-bottom: calc(28px + env(safe-area-inset-bottom)); gap: 20px; align-items: start; }
  .landing .auth { max-height: none; overflow: visible; padding: 18px 16px; }
  .brand p.tagline { font-size: 16px; max-width: none; overflow-wrap: break-word; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .open-clock { width: 100%; max-width: 100%; }
  .site-brand { min-width: 0; letter-spacing: 0.08em; }
  .site-brand img { height: 32px; max-width: min(168px, 52vw); }
  .menu-toggle { width: 44px; height: 44px; }
  .site-footer { flex-direction: column; align-items: center; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .footer-nav { width: 100%; }
  .footer-copy { position: static; }
}
@media (max-width: 480px) {
  .stats-line { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
  .open-clock-digits { gap: 10px; }
  .open-clock-digits span { min-width: 42px; }
  .open-clock-digits b { font-size: 22px; }
  .auth { padding: 22px 18px; }
  .auth .btn.block { white-space: normal; text-align: center; }
}

/* Desktop home page stays in the window. The login card scrolls on its own if a form is taller than the screen. */
@media (min-width: 1025px) and (hover: hover) and (pointer: fine) {
  .landing #scene::before {
    background: var(--landing-bg, url("/img/bg-andromeda.jpg?v=1")) center center / cover no-repeat;
  }
  .landing #scene::after {
    background: var(--landing-bg, url("/img/bg-andromeda.jpg?v=1")) center center / contain no-repeat;
  }
}
@media (hover: none) and (pointer: coarse) {
  .landing #scene,
  .landing .vignette,
  .art-logo-shine { display: none; }
  .landing { background: var(--bg); }
}
@media (min-width: 1025px) {
  html:has(body.landing),
  body.landing { height: 100dvh; overflow: hidden; }
  .landing-page { height: 100dvh; min-height: 0; overflow: hidden; }
  .beta-bar { display: none; }
  .landing .nav-ico { width: 15px; height: 15px; }
  .landing .site-nav a, .landing .footer-nav a { gap: 6px; letter-spacing: 0.08em; }
  .site-header { padding-top: 8px; padding-bottom: 8px; background: rgba(4, 8, 16, 0.72); }
  .site-footer { padding-top: 8px; padding-bottom: 8px; background: rgba(4, 8, 16, 0.88); }
  .landing-wrap {
    min-height: 0; overflow: hidden;
    display: flex; justify-content: space-between; align-items: stretch;
    gap: 24px;
    padding: 12px 2.5vw 10px;
  }
  .brand {
    width: min(380px, 32vw); flex: none;
    min-height: 0;
    display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  }
  .brand > * { flex: none; }
  .brand .logo,
  .brand p.tagline,
  .open-clock,
  .features,
  .stats-line,
  .social-row,
  .btn.discord,
  .btn.x { text-shadow: none; }
  .brand .logo { font-size: 11px; gap: 10px; }
  .brand .logo svg { width: 26px; height: 26px; }
  .brand p.tagline { font-size: 15px; line-height: 1.4; margin: 0 0 14px; max-width: 520px; }
  .open-clock {
    width: 100%;
    flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 8px 12px; margin: 0 0 12px; padding: 8px 12px;
  }
  .open-clock-label { flex: none; }
  .open-clock-digits { flex: 1 1 180px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); justify-content: stretch; gap: 4px; min-width: 0; }
  .open-clock-digits span { min-width: 0; }
  .open-clock-digits b { font-size: 18px; }
  .features { width: min(100%, 520px); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .feature { padding: 8px 10px; gap: 8px; }
  .feature .fi { width: 28px; height: 28px; border-radius: 8px; }
  .stats-line {
    width: min(100%, 520px);
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px; margin-top: 12px;
    font-size: 9px; letter-spacing: 0.06em; line-height: 1.15;
  }
  .stats-line > div {
    min-width: 0; padding: 7px 8px 6px; border-radius: 10px;
    background: rgba(8, 12, 22, 0.78); border: 1px solid var(--line);
  }
  .stats-line b { font-size: 16px; letter-spacing: 0.02em; }
  .social-row { margin-top: 12px; gap: 8px; }
  .btn.discord, .btn.x { padding: 10px 12px; font-size: 11px; letter-spacing: 0.05em; }
  .landing .auth {
    width: min(340px, 30vw); flex: none;
    height: 100%; max-height: none; min-height: 0;
    overflow: auto; overscroll-behavior: contain;
    padding: 16px 18px;
    scrollbar-width: thin;
    scrollbar-color: rgba(150, 176, 220, 0.45) transparent;
  }
  .landing .auth::-webkit-scrollbar { width: 8px; }
  .landing .auth::-webkit-scrollbar-thumb {
    background: rgba(150, 176, 220, 0.4); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box;
  }
  .landing .uni-pick { gap: 6px; margin-bottom: 10px; }
  .landing .mode-tabs button { padding: 7px 4px; }
  .landing .uni-card { padding: 6px 10px; gap: 0; }
  .landing .uni-card b { font-size: 12px; line-height: 1.3; }
  .landing .uni-card span, .landing .uni-card small { font-size: 11px; line-height: 1.25; }
  .landing .tabs { margin-bottom: 10px; }
  .landing .tabs button { padding: 8px; }
  .landing .field { margin-bottom: 8px; }
  .landing .auth input[type=text],
  .landing .auth input[type=password],
  .landing .auth input[type=email] { padding: 8px 10px; }
  .landing .auth .input-ico input { padding-left: 34px; }
  .landing .auth .form-error { min-height: 0; margin: 0 0 6px; }
  .landing .auth-alt { margin-top: 8px; gap: 6px; }
  .landing .form-hint { margin-top: 6px; font-size: 11px; line-height: 1.3; }
}
@media (min-width: 1025px) and (max-height: 980px) {
  .brand p.tagline { margin-bottom: 8px; }
  .open-clock { margin-bottom: 8px; }
  .stats-line { margin-top: 8px; }
  .social-row { margin-top: 6px; }
}
@media (min-width: 1025px) and (max-height: 820px) {
  .brand p.tagline { margin-bottom: 8px; font-size: 13px; }
  .feature span { display: none; }
  .feature { align-items: center; }
  .open-clock { margin-bottom: 8px; padding: 6px 10px 8px; }
  .open-clock-digits b { font-size: 18px; }
  .stats-line { margin-top: 8px; }
  .stats-line b { font-size: 16px; }
  .social-row { margin-top: 8px; }
  .landing .uni-pick { gap: 6px; }
  .landing .mode-tabs button { padding: 8px 4px; }
  .landing .uni-card span { display: none; }
  .landing .form-hint { display: none; }
}
@media (min-width: 1025px) and (max-height: 760px) {
  .features { gap: 6px; }
  .feature { padding: 6px 8px; }
  .stats-line > div { padding: 4px 8px 3px; }
}


/* ---------- misc ---------- */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.hide { display: none !important; }
.loading-page { display: grid; place-items: center; min-height: 300px; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.tree-item { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); cursor: pointer; }
.tree-item img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.tree-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.mobile-toggle { display: none; }


.sound-prompt { position: fixed; left: 18px; bottom: 18px; z-index: 950; width: min(380px, calc(100vw - 36px)); padding: 16px 18px; animation: popIn 0.4s cubic-bezier(.2, 1.2, .4, 1); }
.sp-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; margin-right: 12px; background: rgba(var(--accent-rgb, 79, 209, 255), 0.15); color: var(--cyan); }
.sp-icon svg { width: 24px; height: 24px; }
.sound-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.sound-grid .btn { justify-content: flex-start; }
.range-row { display: grid; grid-template-columns: 130px 1fr 44px; gap: 10px; align-items: center; margin-bottom: 10px; font-size: 13px; }
.range-row span:last-child { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 1024px) { .sound-prompt { bottom: 84px; } }.vu { width: 120px; height: 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.vu i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--gold) 70%, var(--red)); transition: width 0.06s linear; }


/* Phones and narrow tablets. Desktop rules above stay in place. */
@media (max-width: 1024px) {
  html { -webkit-text-size-adjust: 100%; }
  body.game, body.landing, body.kb { overflow-x: clip; }
  .shell { width: 100%; min-width: 0; min-height: 100dvh; grid-template-columns: minmax(0, 1fr); }
  .shell > * { min-width: 0; max-width: 100%; }
  .topbar {
    padding-top: max(8px, env(safe-area-inset-top));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .topbar .logo { min-width: 0; letter-spacing: 0.08em; }
  .topbar .logo .menu-logo { width: 156px; height: 36px; max-width: 42vw; }
  .topbar .logo small { letter-spacing: 0.12em; max-width: 100%; }
  .userbox {
    order: 2; flex: 1 1 100%;
    display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between;
    min-width: 0; max-width: 100%; gap: 2px; margin: 2px 0 0;
    padding: 3px; border-radius: 16px;
    background: rgba(8, 12, 22, 0.82); border: 1px solid var(--line);
  }
  .top-label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .aether-pill {
    height: 36px; padding: 0 8px; border-radius: 12px; gap: 4px;
    font-size: 12px; border-color: transparent; background: rgba(155, 120, 255, 0.18);
  }
  .vac-pill, .alert-pill { max-width: 100%; }
  .top-link, .iconbtn, .account-btn {
    width: 36px; height: 36px; min-width: 36px; min-height: 36px; max-width: 36px;
    padding: 0; border: 0; border-radius: 12px; background: transparent; box-shadow: none;
    justify-content: center; gap: 0;
  }
  .top-link svg, .iconbtn svg { width: 18px; height: 18px; }
  .top-link[data-page="shop"] { background: transparent; }
  .top-link[data-page="shop"].ready { animation: none; }
  .account-btn .username, .account-btn .chev, .account-btn .origin .cc { display: none; }
  .account-btn .origin { margin: 0; gap: 0; }
  .account-btn .origin img { width: 22px; height: 16px; }
  .account-drop { width: min(280px, calc(100vw - 24px)); right: 0; }
  #logout { display: none; }
  .resbar { max-width: 100%; -webkit-overflow-scrolling: touch; }
  .res { flex: 1 1 0; min-width: 0; }
  .res .rv { overflow: hidden; text-overflow: ellipsis; }
  .res .tip { min-width: 0; width: min(220px, calc(100vw - 24px)); }
  .nav {
    padding: 4px max(4px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    /* Solid and above every page, so listings or cards never show through the menu. */
    background: rgb(var(--deep-rgb));
    box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.45);
    z-index: 45;
    isolation: isolate;
    /* Swipe to see more; no scrollbar line under the buttons. */
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a, .nav-close { min-width: 64px; min-height: 48px; justify-content: center; }
  .main {
    padding: 12px 12px calc(104px + env(safe-area-inset-bottom));
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.nav-closed .main { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  /* Room for the floating Chat button while the chat is closed. */
  body.chat-closed .main { padding-bottom: calc(var(--nav-h, 64px) + 64px + env(safe-area-inset-bottom)); }
  .planets { overflow: hidden; padding-left: 12px; padding-right: 12px; }
  #planets { max-width: 100%; -webkit-overflow-scrolling: touch; }
  .pl-item { min-width: min(200px, 78vw); }
  .side-chat { height: min(200px, 32vh); }
  .panel-reopen-nav, .panel-reopen-chat { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .panel, .page, .modal, .hero, .detail, .fleet-page { max-width: 100%; min-width: 0; }
  .panel { padding: 14px; }
  .page-head h1, .bonus-head h1, .page-banner h1 { overflow-wrap: anywhere; }
  .page-banner { height: 128px; }
  .page-banner-copy { padding-top: 28px; }
  .page-head h1, .page-banner h1 { font-size: 18px; }
  .panel-title { flex-wrap: wrap; align-items: flex-start; }
  .panel-title select, .panel-title input[type=search], .ach-search { width: 100%; max-width: 100%; min-width: 0; }
  img, video, canvas { max-width: 100%; }
  .pl-item img, .card .thumb img, .dash-card-bg, .ro-art img, .race-art img,
  .of-hero img, .of-thumb img, .sc-figure > img, .stage-canvas, .mission-img { max-width: none; }
  .table-wrap, .emp-wrap, .emp-board, .report, .prod-t { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .guest-bar { flex-wrap: wrap; }
  .hero, .hero .viewport { min-height: 0; }
  .hero .viewport { min-height: min(280px, 46vh); }
  .hero .viewport .title { left: 12px; right: 12px; }
  .hero .viewport .title h1 { font-size: 22px; }
  .system-3d { height: min(340px, 48vh); }
  .detail { min-height: 0; }
  .detail .viewer { min-height: 200px; }
  .grid-2, .grid-3, .layout-2 { grid-template-columns: minmax(0, 1fr); }
  .fleet-meters { flex-wrap: wrap; }
  .fleet-meters .meter { flex: 1 1 120px; min-width: 0; }
  .fleet-page .fleet-grid { grid-template-columns: minmax(0, 1fr); }
  .fleet-page .ship-pick:hover { transform: none; }
  .dest-hud, .coords-input, .gal-nav, .summary { max-width: 100%; }
  .coord-cell { min-width: 0; flex: 1 1 72px; }
  .coord-cell input, .coord-cell select, .coords-input input, .amount input, .gal-nav input {
    width: 100%; max-width: 100%; min-width: 0;
  }
  .coord-cell.kind select { min-width: 0; }
  .missions { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
  .msg-head { grid-template-columns: 22px minmax(0, 1fr); }
  .msg-head .when, .msg-head .from { white-space: normal; }
  .advisor-item { min-width: 0; }
  .advisor-item .body { min-width: 0; flex-basis: 0; }
  .range-row { grid-template-columns: minmax(0, 88px) minmax(0, 1fr) 36px; }
  .of-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .of-card { grid-template-columns: 72px minmax(0, 1fr); }
  .shop-nav { position: static; top: auto; }
  .shop-nav-btn b { white-space: normal; letter-spacing: 0.04em; }
  .shop-balance { font-size: 28px; overflow-wrap: anywhere; }
  .dash-card { min-height: 0; }
  .class-grid, .race-grid { grid-template-columns: minmax(0, 1fr); }
  .race-tabs { flex-wrap: wrap; overflow: visible; }
  .race-tab { flex: 1 1 calc(50% - 8px); min-width: 0; max-width: 100%; }
  .race-tab small { white-space: normal; }
  .sound-prompt {
    left: 12px; right: 12px; width: auto;
    bottom: calc(88px + env(safe-area-inset-bottom));
  }
  #toasts {
    left: 12px; right: 12px; top: auto; max-width: none;
    bottom: calc(88px + env(safe-area-inset-bottom));
  }
  .toast { min-width: 0; max-width: none; width: auto; }
  dialog.panel.modal { margin-bottom: max(12px, env(safe-area-inset-bottom)); }
  .modal, .modal.wide { width: calc(100% - 24px); max-height: min(86dvh, calc(100dvh - 24px)); }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1 1 140px; white-space: normal; text-align: center; }
  .btn.block { white-space: normal; text-align: center; }
  input[type=text], input[type=password], input[type=email], input[type=number], input[type=search], select, textarea { font-size: 16px; }
  .sr-top { padding-top: max(12px, env(safe-area-inset-top)); }
  .sr-info { max-height: min(32vh, 220px); }
  .sr-races { bottom: max(12px, env(safe-area-inset-bottom)); max-width: calc(100vw - 16px); overflow-x: auto; }
  .mv-port b, .al-banner h1, .of-name { overflow-wrap: anywhere; }
  .al-card { grid-template-columns: 24px minmax(0, 1fr); }
  .demo-py { grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr) 42px; gap: 4px; }
  .sc-figure { min-height: 320px; margin-left: 8px; margin-right: 8px; }
  .sc-figure > img { height: 240px; }
  .features { gap: 8px; }
}

@media (min-width: 521px) and (max-width: 1024px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-line { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; }
  .grid-items { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (max-width: 520px) {
  .account-btn .username { display: none; }
  .topbar .logo small { font-size: 8px; letter-spacing: 0.06em; }
  .res { padding: 4px 6px 4px 4px; gap: 4px; }
  .res .rv { font-size: 11px; }
  .res .ri { width: 22px; height: 22px; }
  .nav a, .nav-close { min-width: 56px; padding: 6px; font-size: 8px; }
  .main { padding-left: 10px; padding-right: 10px; }
  .stats-line { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stats-line b { font-size: 18px; }
  .open-clock-digits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; gap: 6px; }
  .open-clock-digits span, .open-clock-digits b { min-width: 0; }
  .brand .logo { letter-spacing: 0.16em; flex-wrap: wrap; }
  .grid-items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pop-cards { grid-template-columns: minmax(0, 1fr); }
  .sc-grid, .sc-inv .sc-frame:first-child .sc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .brief { flex-direction: column; }
  .brief-rail { flex-direction: row; width: 100%; justify-content: flex-start; padding: 10px 12px; }
  .mv-lane { grid-template-columns: 52px minmax(0, 1fr) 52px; gap: 4px; }
  .mv-time { font-size: 16px; }
  .doll-row, .doll-mid { gap: 6px; }
  .slot-btn { min-height: 88px; padding: 6px; }
  .wx-now { align-items: flex-start; }
  .al-station.lg img { height: 150px; }
  .race-tab { flex-basis: 100%; }
  .bonus-head { padding: 14px; }
  .bonus-head h1 { font-size: 20px; }
}

@media (max-width: 380px) {
  .topbar .logo .menu-logo { width: 138px; height: 32px; max-width: 42vw; }
  .aether-pill, .top-link, .iconbtn, .account-btn { height: 32px; min-height: 32px; }
  .top-link, .iconbtn, .account-btn { width: 32px; min-width: 32px; max-width: 32px; }
  .aether-pill { padding: 0 6px; font-size: 11px; }
  .top-link svg, .iconbtn svg { width: 16px; height: 16px; }
  .nav a, .nav-close { min-width: 50px; }
  .open-clock-digits b { font-size: 18px; }
  .feature { padding: 10px; }
  .auth, .landing .auth { padding: 14px 12px; }
  .grid-items { gap: 6px; }
  .card .name { font-size: 11.5px; }
}


.launcher-consent{background:#081420;color:#e5f5ff;border:1px solid #4ed9ef;border-radius:14px;max-width:460px;width:calc(100% - 40px);padding:28px;line-height:1.6}.launcher-consent::backdrop{background:#000b}.launcher-consent strong{display:block;font-size:30px;letter-spacing:5px;color:#ffda84;margin:20px 0}.launcher-consent label{display:block}.launcher-consent input{display:block;width:100%;padding:12px;background:#122537;color:white;border:1px solid #547085;border-radius:6px}.launcher-consent button{margin:12px 8px 0 0}

.skip-link{position:fixed;left:12px;top:-120px;z-index:100001;background:#0b1727;color:#fff;padding:12px;border:2px solid #ffd66a}.skip-link:focus{top:12px}

