:root {
  --blue-900: #0a1647;
  --blue-800: #12267a;
  --blue-700: #1b3fa8;
  --blue-500: #2f6bff;
  --sky: #5fb4ff;
  --gold: #ffd400;
  --gold-deep: #f59e0b;
  --red: #e4002b;
  --green: #22c55e;
  --ink: #0b1020;
  --paper: #ffffff;
  --muted: #b8c4ff;
  --card: rgba(10, 22, 71, 0.78);
  --card-border: rgba(255, 255, 255, 0.16);
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 20, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--paper);
  background: var(--blue-900);
  overflow-x: hidden;
}

#backdrop {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  image-rendering: pixelated;
  z-index: 0;
}

#app { position: relative; z-index: 1; min-height: 100vh; }

.screen {
  display: none;
  min-height: 100vh;
  padding: 24px 16px 48px;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.screen.active { display: flex; animation: rise .45s cubic-bezier(.2,.9,.3,1.2); }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } }

/* ---------- Logo ---------- */
.logo { position: relative; margin-top: 4vh; text-align: center; user-select: none; }
.logo-emblem {
  position: absolute; left: 50%; top: 50%; width: 300px; height: 300px;
  transform: translate(-50%, -54%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.35), rgba(255,255,255,0) 60%);
  pointer-events: none;
}
.logo-emblem span {
  position: absolute; inset: 0; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,212,0,.28) 0 10deg, transparent 10deg 20deg);
  mask: radial-gradient(circle, transparent 30%, #000 31%, #000 68%, transparent 70%);
  -webkit-mask: radial-gradient(circle, transparent 30%, #000 31%, #000 68%, transparent 70%);
  animation: spin 24s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.logo-text {
  position: relative; margin: 0; line-height: .9;
  font-family: 'Bungee', sans-serif; font-weight: 400;
  font-size: clamp(56px, 12vw, 128px);
  letter-spacing: .02em;
  transform: skewX(-8deg);
  display: flex; align-items: flex-end; justify-content: center; gap: .08em;
}
.logo-sonic {
  color: var(--blue-500);
  -webkit-text-stroke: 3px #fff;
  paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--blue-800), 0 8px 0 var(--ink), 0 14px 22px rgba(0,0,0,.45);
}
.logo-two {
  font-family: 'Bungee Shade', 'Bungee', sans-serif;
  color: var(--gold);
  font-size: 1.25em;
  text-shadow: 0 5px 0 var(--red), 0 10px 0 var(--ink), 0 16px 26px rgba(0,0,0,.5);
  animation: bob 2.6s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }
.logo-ribbon {
  position: relative; display: inline-block; margin-top: 10px;
  padding: 6px 34px 8px;
  font-family: 'Bungee', sans-serif; font-size: clamp(18px, 3.4vw, 30px); letter-spacing: .3em;
  color: #fff; background: linear-gradient(180deg, #ff3d5a, var(--red) 60%, #a1001e);
  border: 3px solid #fff; border-radius: 6px;
  box-shadow: 0 6px 0 var(--ink), 0 10px 24px rgba(0,0,0,.4);
  transform: skewX(-8deg);
}

/* ---------- Cards & controls ---------- */
.card {
  width: min(560px, 100%);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 22px;
}
.card.narrow { width: min(400px, 100%); margin-top: 8vh; }

.btn {
  appearance: none; border: 0; cursor: pointer;
  font: 900 18px/1 'Nunito', sans-serif; letter-spacing: .02em;
  color: var(--ink);
  background: linear-gradient(180deg, #fff27a, var(--gold) 55%, var(--gold-deep));
  padding: 14px 26px; border-radius: 999px;
  box-shadow: 0 5px 0 #a26100, 0 10px 18px rgba(0,0,0,.3);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:hover:not(:disabled) { filter: brightness(1.06); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #a26100, 0 4px 10px rgba(0,0,0,.3); }
.btn:disabled { filter: grayscale(1) brightness(.7); cursor: not-allowed; }
.btn.ghost { color: #fff; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 2px rgba(255,255,255,.3); }
.btn:focus-visible, .link:focus-visible, .tab:focus-visible, .dropzone:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.btn-start {
  width: 100%; margin-top: 16px; font-family: 'Bungee', sans-serif; font-weight: 400; font-size: 22px; letter-spacing: .12em;
}
.btn-start:not(:disabled) { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { filter: brightness(1.15); transform: scale(1.02); } }

.link { background: none; border: 0; color: var(--gold); font: 800 15px 'Nunito', sans-serif; cursor: pointer; padding: 4px; text-decoration: underline; text-underline-offset: 3px; }
.link.back { align-self: flex-start; }

label { display: block; font-weight: 800; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
input:not([type=color]):not([type=file]):not([type=checkbox]) {
  display: block; width: 100%; margin-top: 6px;
  font: 700 17px 'Nunito', sans-serif; color: #fff;
  background: rgba(0,0,30,.45); border: 2px solid rgba(255,255,255,.18); border-radius: 12px;
  padding: 12px 14px;
}
input:focus { border-color: var(--gold); outline: none; }

.error { color: #ffb4b4; background: rgba(228,0,43,.18); border: 1px solid rgba(255,90,110,.5); border-radius: 10px; padding: 10px 12px; margin: 12px 0 0; font-weight: 700; }
.fineprint { color: var(--muted); font-size: 12.5px; text-align: center; margin: 14px 0 0; line-height: 1.5; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.4; }
label .hint { display: block; font-weight: 600; margin-top: 4px; }

/* ---------- Cartridge drop ---------- */
.dropzone {
  display: flex; align-items: center; gap: 20px;
  padding: 18px; border-radius: 14px; cursor: pointer;
  border: 3px dashed rgba(255,255,255,.35);
  background: rgba(255,255,255,.05);
  transition: border-color .15s, background .15s, transform .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--gold); background: rgba(255,212,0,.09); }
.dropzone.over { transform: scale(1.02); }
.drop-text { display: flex; flex-direction: column; gap: 4px; }
.drop-text strong { font-family: 'Bungee', sans-serif; font-weight: 400; font-size: 20px; letter-spacing: .02em; }
.drop-text span { color: var(--muted); line-height: 1.45; }
.drop-text small { display: block; opacity: .8; margin-top: 2px; }
.cart {
  flex: none; width: 92px; height: 104px; position: relative;
  background: linear-gradient(180deg, #2b2f3a, #14161d);
  border-radius: 10px 10px 4px 4px;
  box-shadow: inset 0 -10px 0 rgba(0,0,0,.35), 0 6px 0 #000;
  transition: transform .3s cubic-bezier(.2,.9,.3,1.4);
}
.dropzone:hover .cart, .dropzone.over .cart { transform: translateY(-6px) rotate(-3deg); }
.cart::before { content: ''; position: absolute; left: 10px; right: 10px; bottom: 6px; height: 8px; background: repeating-linear-gradient(90deg, #c9a227 0 4px, transparent 4px 7px); border-radius: 2px; }
.cart-label {
  position: absolute; left: 9px; right: 9px; top: 9px; height: 64px; border-radius: 4px;
  background: linear-gradient(160deg, var(--blue-500), var(--blue-800));
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  border: 2px solid #fff; overflow: hidden;
}
.cart-label span { font-size: 9px; font-weight: 900; letter-spacing: .14em; color: var(--gold); }
.cart-label b { font-family: 'Bungee', sans-serif; font-weight: 400; font-size: 13px; color: #fff; text-shadow: 0 2px 0 var(--ink); }
.dropzone.loaded .cart-label { background: linear-gradient(160deg, var(--green), #116b33); }

.rom-status {
  display: flex; align-items: center; gap: 12px; margin-top: 14px;
  padding: 12px 14px; border-radius: 12px; background: rgba(34,197,94,.14); border: 1px solid rgba(34,197,94,.45);
}
.rom-status.warn { background: rgba(255,212,0,.12); border-color: rgba(255,212,0,.45); }
.rom-status div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rom-status small { color: var(--muted); }
.led { width: 12px; height: 12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); flex: none; }
.rom-status.warn .led { background: var(--gold); box-shadow: 0 0 12px var(--gold); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; padding: 5px; background: rgba(0,0,30,.4); border-radius: 999px; margin-bottom: 18px; }
.tab { flex: 1; border: 0; background: none; color: var(--muted); font: 800 15px 'Nunito', sans-serif; padding: 10px; border-radius: 999px; cursor: pointer; }
.tab.active { background: var(--blue-500); color: #fff; box-shadow: 0 3px 0 var(--blue-800); }
#auth-submit { width: 100%; margin-top: 6px; }

/* ---------- Headers ---------- */
.screen-head { width: min(1080px, 100%); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.screen-head h2 { margin: 0; flex: 1; font-family: 'Bungee', sans-serif; font-weight: 400; font-size: clamp(22px, 4vw, 34px); text-shadow: 0 3px 0 var(--ink); }
.who { display: flex; align-items: center; gap: 10px; font-weight: 800; background: var(--card); border: 1px solid var(--card-border); padding: 6px 14px; border-radius: 999px; }
.who canvas { image-rendering: pixelated; width: 36px; height: 36px; }

/* ---------- Characters ---------- */
.char-grid { width: min(1080px, 100%); display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.char-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 12px 16px; border-radius: var(--radius); cursor: pointer;
  background: var(--card); border: 2px solid var(--card-border); color: #fff; font: inherit;
  box-shadow: var(--shadow); transition: transform .15s, border-color .15s;
}
.char-card:hover, .char-card:focus-visible { transform: translateY(-4px); border-color: var(--gold); outline: none; }
.char-card canvas { width: 128px; height: 128px; image-rendering: pixelated; }
.char-card .name { font-family: 'Bungee', sans-serif; font-weight: 400; font-size: 18px; }
.char-card .meta { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: capitalize; }
.char-card .swatches { display: flex; gap: 4px; }
.char-card .swatches i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(255,255,255,.4); }
.char-card .del { position: absolute; top: 8px; right: 8px; border: 0; background: rgba(0,0,0,.3); color: #fff; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; opacity: .6; }
.char-card .del:hover { opacity: 1; background: var(--red); }
.char-card.new { border-style: dashed; justify-content: center; min-height: 230px; font-weight: 900; font-size: 18px; color: var(--gold); }
.char-card.new span { font-size: 54px; line-height: 1; }

.creator { width: min(760px, 100%); display: flex; gap: 24px; flex-wrap: wrap; }
.creator-preview { flex: 1 1 220px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.creator-preview canvas { width: 192px; height: 192px; image-rendering: pixelated; background: radial-gradient(circle, rgba(95,180,255,.35), transparent 70%); border-radius: 50%; }
.creator-form { flex: 2 1 300px; }
.species { display: flex; gap: 6px; background: rgba(0,0,30,.4); padding: 5px; border-radius: 999px; }
.species button { border: 0; background: none; color: var(--muted); font: 800 15px 'Nunito', sans-serif; padding: 8px 18px; border-radius: 999px; cursor: pointer; }
.species button.active { background: var(--gold); color: var(--ink); }
.color-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-weight: 800; color: var(--muted); }
.color-row span { width: 70px; text-transform: capitalize; }
.color-row input[type=color] { width: 54px; height: 36px; border: 2px solid rgba(255,255,255,.3); border-radius: 10px; background: none; padding: 2px; cursor: pointer; }
.color-row .quick { display: flex; gap: 5px; flex-wrap: wrap; }
.color-row .quick button { width: 22px; height: 22px; border-radius: 6px; border: 2px solid rgba(255,255,255,.35); cursor: pointer; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 4px; }
.presets button { border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.07); color: #fff; border-radius: 999px; padding: 6px 12px; font: 700 13px 'Nunito', sans-serif; cursor: pointer; }
.presets button:hover { border-color: var(--gold); }
.row { display: flex; gap: 12px; justify-content: flex-end; margin-top: 16px; }

/* ---------- Stage select ---------- */
.stage-grid { width: min(1080px, 100%); display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.zone {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 16px; min-height: 150px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  background: var(--zone-bg, var(--blue-700)); box-shadow: var(--shadow);
  border: 2px solid rgba(255,255,255,.2);
}
.zone::after { content: ''; position: absolute; inset: auto -20% -40% -20%; height: 70%; background: var(--zone-ground, rgba(0,0,0,.2)); transform: rotate(-4deg); pointer-events: none; }
.zone h3 { position: relative; z-index: 1; margin: 0; font-family: 'Bungee', sans-serif; font-weight: 400; font-size: 21px; line-height: 1.05; text-shadow: 0 3px 0 rgba(0,0,0,.45); }
.zone h3 small { display: block; font-size: 12px; letter-spacing: .3em; opacity: .85; }
.acts { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; }
.act {
  flex: 1; min-width: 70px; border: 0; cursor: pointer; border-radius: 12px; padding: 10px 8px;
  background: rgba(255,255,255,.92); color: var(--ink); font: 900 15px 'Nunito', sans-serif;
  box-shadow: 0 4px 0 rgba(0,0,0,.35); transition: transform .08s;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.act:hover { transform: translateY(-2px); background: #fff; }
.act:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.act .online { font-size: 11px; font-weight: 800; color: #0c7a39; }
.act .online.none { color: #667; }

/* ---------- Game ---------- */
.game { position: fixed; inset: 0; z-index: 5; background: #000; display: flex; flex-direction: column; }
.game[hidden] { display: none; }
.game-top { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: linear-gradient(180deg, rgba(10,22,71,.95), rgba(10,22,71,.6)); z-index: 3; flex-wrap: wrap; }
.spacer { flex: 1; }
.pill { border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; font: 800 14px 'Nunito', sans-serif; border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
button.pill { cursor: pointer; }
button.pill:hover { border-color: var(--gold); }
.stage-pill { font-family: 'Bungee', sans-serif; font-weight: 400; letter-spacing: .02em; }
.stage-wrap { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#screen { image-rendering: pixelated; background: #000; }
#overlay { position: absolute; pointer-events: none; }
.loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: radial-gradient(circle, var(--blue-700), var(--blue-900)); z-index: 2; }
.loading[hidden] { display: none; }
.loading p { font-family: 'Bungee', sans-serif; font-size: 18px; margin: 0; text-align: center; padding: 0 16px; }
.ring-spinner { width: 64px; height: 64px; border-radius: 50%; border: 10px solid var(--gold); border-left-color: #fff27a; border-right-color: var(--gold-deep); animation: ringspin .9s linear infinite; box-shadow: 0 0 24px rgba(255,212,0,.6); }
@keyframes ringspin { 0% { transform: rotateY(0) } 100% { transform: rotateY(360deg) } }

.notices { position: absolute; right: 12px; bottom: 64px; width: min(380px, calc(100% - 24px)); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; pointer-events: none; z-index: 3; }
.notices div { background: rgba(0,0,20,.6); padding: 5px 10px; border-radius: 10px; font-weight: 700; font-size: 14px; width: fit-content; max-width: 100%; overflow-wrap: anywhere; transition: opacity 1s; }
.notices div b { color: var(--gold); }
.notices div.sys { color: var(--muted); font-style: italic; }
.notices div.notice { color: #d6f0ff; border-left: 3px solid var(--sky); }
.notices div.alert { color: #fff; background: rgba(160,0,30,.85); border-left-color: var(--gold); }
.notices div.old { opacity: 0; }
.chat-form { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); z-index: 4; }
.chat-form input { border-color: var(--gold) !important; background: rgba(0,0,30,.85) !important; }
.help { position: absolute; right: 12px; top: 56px; width: min(320px, calc(100% - 24px)); z-index: 4; }
.help h3 { margin: 0 0 10px; font-family: 'Bungee', sans-serif; font-weight: 400; }
.help dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.help dt { font-weight: 900; color: var(--gold); }
.help dd { margin: 0; color: #fff; }
.help code { font-size: 13px; color: var(--gold); }
.help p { color: var(--muted); margin: 12px 0 0; }

/* ---- moderation panel (mod.html) ---- */
body.mod { background: var(--blue-900) radial-gradient(circle at 50% -20%, var(--blue-700), var(--blue-900) 60%) fixed; }
.mod-page { width: min(1080px, 100%); margin: 0 auto; padding: 24px 16px 60px; display: flex; flex-direction: column; gap: 18px; }
.mod-page .screen-head { width: 100%; }
#panel { display: flex; flex-direction: column; gap: 14px; }
.mod-page a.btn { display: inline-block; text-decoration: none; }
#denied p { margin: 0 0 16px; }
.mod-tabs { max-width: 520px; }
.mod-tabs .count { background: var(--red); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.mod-tab { display: flex; flex-direction: column; gap: 14px; }
.mod-tab[hidden] { display: none; }
.mod-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mod-bar input:not([type=color]):not([type=file]) { flex: 1 1 200px; width: auto; margin: 0; }
.mod-bar input.short { flex: 0 1 150px; }
.mod-bar .btn { padding: 10px 18px; font-size: 15px; }
.mod-bar .species button { padding: 6px 14px; }
.mod-page select { background: rgba(0,0,30,.5); color: #fff; border: 2px solid rgba(255,255,255,.2); border-radius: 12px; padding: 10px; font: 700 15px 'Nunito', sans-serif; }
.mod-list { display: flex; flex-direction: column; gap: 14px; }
.mod-page .card:not(.narrow) { width: 100%; padding: 18px 20px; }
.mod-page h3 { margin: 18px 0 8px; font-size: 16px; color: var(--gold); }
.mod-page .card > h3:first-child { margin-top: 0; }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.report-head strong { font-family: 'Bungee', sans-serif; font-weight: 400; font-size: 18px; }
.report-head strong.big { font-size: 22px; }
.report .reason { font-size: 17px; font-weight: 700; margin: 10px 0; overflow-wrap: anywhere; }
.mod-page details { margin: 8px 0 12px; }
.mod-page summary { cursor: pointer; color: var(--muted); font-weight: 800; }
.chat-evidence { list-style: none; margin: 8px 0 0; padding: 10px 12px; background: rgba(0,0,20,.45); border-radius: 12px; max-height: 280px; overflow: auto; font-size: 14px; }
.chat-evidence li { padding: 2px 4px; border-radius: 6px; overflow-wrap: anywhere; }
.chat-evidence li.them { background: rgba(228,0,43,.3); }
.chat-evidence time { color: var(--muted); font-size: 12px; }
.chat-evidence b { color: var(--gold); }
.role-tag { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; background: rgba(255,255,255,.14); vertical-align: middle; }
.role-tag.admin, .role-tag.ban { background: var(--red); }
.role-tag.moderator, .role-tag.mute { background: var(--gold-deep); color: var(--ink); }
.role-tag.online, .role-tag.resolved { background: var(--green); color: var(--ink); }
.table-wrap { overflow-x: auto; }
.mod-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mod-table th { text-align: left; color: var(--muted); font-weight: 800; padding: 6px 8px; border-bottom: 1px solid var(--card-border); }
.mod-table td { padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,.07); vertical-align: top; overflow-wrap: break-word; }
.mod-table .link { padding: 0; }
.mod-table .role-tag { white-space: nowrap; }
.mod-table tr.past { opacity: .6; }
#log { background: var(--card); border-radius: var(--radius); }
.plain { margin: 0; padding-left: 18px; line-height: 1.6; }
.people { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.chip { border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; border-radius: 999px; padding: 4px 12px; font: 700 14px 'Nunito', sans-serif; cursor: pointer; }
.chip:hover { border-color: var(--gold); }
.flash { position: sticky; top: 10px; z-index: 5; margin: 0; padding: 10px 14px; border-radius: 12px; font-weight: 800; background: rgba(34,197,94,.9); color: var(--ink); }
.flash.bad { background: rgba(228,0,43,.9); color: #fff; }
.mod-page .check { display: flex; align-items: center; gap: 6px; margin: 0; color: #fff; font-weight: 700; }
.mod-page .check input { width: 18px; height: 18px; }
.role-tag.ip, .role-tag.email { background: var(--blue-500); }

/* ---------- Signup screens ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.signup { position: fixed; inset: 0; z-index: 6; display: flex; flex-direction: column; background: #000; }
.signup[hidden] { display: none; }
.slide { flex: 1; overflow-y: auto; display: flex; padding: 32px 16px 24px; animation: fadein .5s ease-out; }
.slide[hidden] { display: none; }
.slide > div { margin: auto; width: min(680px, 100%); }
@keyframes fadein { from { opacity: 0; } }
.signup-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: rgba(0,0,0,.55); border-top: 1px solid rgba(255,255,255,.12);
}
.signup-nav .btn { min-width: 120px; }
.dots { display: flex; gap: 8px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.25); transition: background .2s, transform .2s; }
.dots i.on { background: var(--gold); transform: scale(1.2); }
.signup a { color: inherit; }
.signup a:focus-visible, .agree input:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* 1. The console's licence screen: black, white pixel text, nothing else */
.slide-legal { background: #000; color: #fff; text-align: center; }
.slide-legal p { font: 400 12px/2 'Press Start 2P', monospace; margin: 0 0 22px; color: #d8d8d8; }
.slide-legal b { color: #fff; }
.slide-legal i { font-style: normal; color: #fff; }
.slide-legal .legal-big { font-size: clamp(14px, 3vw, 22px); line-height: 1.8; color: #fff; letter-spacing: .04em; margin-bottom: 28px; }
.legal-rule { height: 4px; width: 60%; margin: 0 auto 28px; background: repeating-linear-gradient(90deg, #fff 0 8px, transparent 8px 16px); }
.slide-legal .legal-must { color: #5fff7a; }
.signup[data-step="0"] .signup-nav { background: #000; border-top-color: #333; }
.signup[data-step="0"] .signup-nav .btn { font-family: 'Press Start 2P', monospace; font-weight: 400; font-size: 11px; border-radius: 0; box-shadow: none; }
.signup[data-step="0"] .signup-nav .btn:not(.ghost) { background: #fff; color: #000; }
.signup[data-step="0"] .signup-nav .btn.ghost { box-shadow: inset 0 0 0 2px #fff; background: #000; }
.signup[data-step="0"] .dots i { border-radius: 0; }
.signup[data-step="0"] .dots i.on { background: #fff; }

/* 2. End credits: night sky, gold Bungee headings, white credit lines */
.slide-credits {
  color: #fff; text-align: center;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 12%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 38% 64%, #cfe2ff 50%, transparent 51%),
    radial-gradient(1px 1px at 86% 48%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 22% 82%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 58% 36%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 86%, #cfe2ff 50%, transparent 51%),
    radial-gradient(ellipse at 50% 120%, #2f6bff 0, transparent 60%),
    linear-gradient(180deg, #02041a, #0a1647);
}
.credits-kicker { font: 400 clamp(26px, 6vw, 44px)/1 'Bungee', sans-serif; color: var(--gold); margin: 0 0 14px; letter-spacing: .06em; text-shadow: 0 4px 0 var(--red), 0 8px 0 var(--ink); }
.credits-lead { color: var(--muted); font-weight: 700; font-size: 17px; margin: 0 0 26px; }
.credits-list { list-style: none; margin: 0 0 26px; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.credits-list li { display: flex; flex-direction: column; gap: 6px; }
.credits-list a {
  font: 400 clamp(18px, 4vw, 24px)/1.15 'Bungee', sans-serif; color: #fff; text-decoration: none; letter-spacing: .03em;
  align-self: center; border-bottom: 3px solid var(--gold); padding-bottom: 2px; transition: color .15s;
}
.credits-list a::after { content: ' ↗'; font-size: .7em; color: var(--gold); }
.credits-list a:hover { color: var(--gold); }
.credits-list span { color: #cfd8ff; font-weight: 600; line-height: 1.45; }
.credits-list .credits-source { font-size: 13.5px; font-weight: 500; color: var(--muted); }
.credits-list .credits-source a, .credits-note a { font: inherit; letter-spacing: 0; border-bottom: 1px solid currentColor; padding: 0; color: inherit; }
.credits-note { color: var(--muted); font-size: 13.5px; font-style: italic; border-top: 1px solid rgba(255,255,255,.15); padding-top: 16px; margin: 0; }

/* 3. Under construction: hazard tape, yellow sign, chunky type */
.slide-beta {
  color: var(--ink);
  background:
    repeating-linear-gradient(-45deg, var(--gold) 0 26px, #111 26px 52px) top / 100% 28px no-repeat,
    repeating-linear-gradient(-45deg, var(--gold) 0 26px, #111 26px 52px) bottom / 100% 28px no-repeat,
    linear-gradient(180deg, #2a2a2e, #141416);
  padding-top: 56px; padding-bottom: 56px;
}
.beta-inner { background: #ffe14d; border: 5px solid #111; border-radius: 10px; padding: 26px 24px; box-shadow: 10px 10px 0 #000; }
.beta-sign { display: flex; justify-content: center; margin: -54px 0 10px; }
.beta-sign span {
  font: 400 30px/1 'Bungee', sans-serif; letter-spacing: .12em; color: #fff; background: #e86a00;
  padding: 10px 22px 12px; border: 4px solid #111; border-radius: 6px; transform: rotate(-4deg); box-shadow: 4px 4px 0 #111;
}
.beta-inner h3 { font: 400 clamp(22px, 5vw, 32px)/1.1 'Bungee', sans-serif; margin: 0 0 14px; text-align: center; }
.beta-inner p { font-weight: 700; font-size: 16px; line-height: 1.55; margin: 0 0 14px; }
.beta-inner a { font-weight: 900; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.agree { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0 0; padding: 14px; color: var(--ink); background: #fff7c2; border: 3px dashed #111; border-radius: 8px; cursor: pointer; font-size: 15px; }
.agree input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: #e86a00; cursor: pointer; }
.signup[data-step="2"] .signup-nav { background: #111; border-top: 0; }

@media (max-width: 560px) {
  .dropzone { flex-direction: column; text-align: center; }
  .cart { width: 76px; height: 86px; }
  .cart-label { height: 50px; }
  .logo-emblem { width: 220px; height: 220px; }
  .signup-nav .btn { min-width: 0; padding: 12px 16px; font-size: 15px; }
  .slide-legal p { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Terms / rules pages ---------- */
body.doc { background: #050a26 linear-gradient(180deg, var(--blue-900), #050a26) no-repeat; padding: 32px 16px; height: auto; min-height: 100%; }
.doc-card { margin: 0 auto; width: min(760px, 100%); line-height: 1.6; }
.doc-card h1 { font: 400 clamp(24px, 5vw, 34px)/1.1 'Bungee', sans-serif; margin: 0 0 12px; color: var(--gold); }
.doc-card h2 { font: 400 18px 'Bungee', sans-serif; margin: 24px 0 6px; }
.doc-card p, .doc-card li { color: #dfe5ff; }
.doc-card li { margin-bottom: 6px; }
.doc-card a { color: var(--gold); font-weight: 800; }
