:root {
  color-scheme: dark;
  --ink: #f6f2e8;
  --muted: #b8b2a6;
  --panel: rgba(20, 22, 24, 0.88);
  --line: #3d4244;
  --acid: #d5ff49;
  --cyan: #5ce1e6;
  --bad: #ff806f;
  --good: #8ce99a;
  --bg: #0d0f10;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 5%, rgba(92, 225, 230, 0.15), transparent 28rem),
    linear-gradient(135deg, rgba(213, 255, 73, 0.035) 25%, transparent 25%) 0 0 / 32px 32px,
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, 0.017) 1px, transparent 1px) 0 0 / 100% 4px;
}

.hero, main, footer {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.hero { padding: clamp(48px, 9vw, 108px) 0 42px; }
.eyebrow, .step {
  margin: 0 0 12px;
  color: var(--acid);
  font: 700 0.76rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.16em;
}

h1, h2, h3 { margin: 0; line-height: 1.02; }
h1 { max-width: 900px; font-size: clamp(2.8rem, 8vw, 6.8rem); letter-spacing: -0.065em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.3rem); letter-spacing: -0.035em; }
h3 { font-size: 1.35rem; }
.lede { max-width: 760px; margin: 26px 0 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.25rem); line-height: 1.65; }

main { display: grid; gap: 18px; }
.panel {
  padding: clamp(20px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(14px);
}
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.local-badge { padding: 7px 10px; border: 1px solid var(--acid); border-radius: 999px; color: var(--acid); font: 700 0.68rem ui-monospace, monospace; letter-spacing: 0.1em; white-space: nowrap; }

.field { display: grid; gap: 8px; font-weight: 700; }
.field small { color: var(--muted); font-weight: 400; line-height: 1.45; }
select, button, .picker { font: inherit; }
select {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid #596064;
  border-radius: 10px;
  color: var(--ink);
  background: #15191a;
}
.picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.picker { display: grid; gap: 8px; min-height: 142px; padding: 20px; border: 1px dashed #657074; border-radius: 12px; background: rgba(255, 255, 255, 0.025); cursor: pointer; }
.picker:hover, .picker:focus-within { border-color: var(--cyan); background: rgba(92, 225, 230, 0.06); }
.picker span { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.picker input { margin-top: auto; max-width: 100%; }
.drop-zone {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding: 22px;
  border: 2px dashed #596568;
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  cursor: copy;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}
.drop-zone strong { color: var(--ink); }
.drop-zone:hover, .drop-zone:focus, .drop-zone[data-active="true"] {
  outline: none;
  border-color: var(--acid);
  color: var(--ink);
  background: rgba(213, 255, 73, 0.07);
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
button { padding: 11px 16px; border: 1px solid var(--acid); border-radius: 9px; color: #101310; background: var(--acid); font-weight: 750; cursor: pointer; }
button.secondary { color: var(--ink); border-color: #61696c; background: #24292b; }
button.quiet { color: var(--muted); border-color: transparent; background: transparent; }
button:disabled { cursor: not-allowed; opacity: 0.42; }
.privacy { margin: 22px 0 0; padding: 14px 16px; border-left: 3px solid var(--cyan); color: var(--muted); background: rgba(92, 225, 230, 0.045); line-height: 1.55; }

.identity-summary dl { display: flex; flex-wrap: wrap; gap: 12px 30px; margin: 18px 0; }
.identity-summary dl div { display: grid; gap: 3px; }
dt { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; }
dd { margin: 0; }
.notes { color: var(--muted); line-height: 1.55; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 0.82rem; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--acid); background: #171a1b; font: 700 0.7rem ui-monospace, monospace; letter-spacing: 0.08em; text-transform: uppercase; }
td:nth-child(3) { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; word-break: break-all; }
tbody tr:last-child td { border-bottom: 0; }

#status { margin: 0 0 14px; color: var(--muted); }
#status[data-kind="good"] { color: var(--good); }
#status[data-kind="bad"] { color: var(--bad); }
#status[data-kind="working"] { color: var(--cyan); }
pre { min-height: 116px; max-height: 460px; overflow: auto; margin: 0; padding: 16px; border-radius: 10px; color: #d7ddd8; background: #080a0a; font: 0.78rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.launcher-help { max-width: 820px; color: var(--muted); line-height: 1.6; }
.game-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.game-card {
  display: grid;
  gap: 10px;
  min-height: 148px;
  padding: 18px;
  border-color: #596064;
  color: var(--ink);
  background: #171a1b;
  text-align: left;
}
.game-card strong { font-size: 1.25rem; }
.game-card .card-role { color: var(--cyan); font: 700 0.67rem ui-monospace, monospace; letter-spacing: 0.1em; }
.game-card .card-state { align-self: end; color: var(--good); font-size: 0.78rem; }
.game-card:disabled { filter: grayscale(1); opacity: 0.38; }
.game-card:not(:disabled):hover { border-color: var(--acid); transform: translateY(-1px); }
.game-card[data-selected="true"] { border-color: var(--acid); box-shadow: inset 0 0 0 1px var(--acid); }
.role-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.role-preview div { display: grid; gap: 5px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; }
.role-preview span { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.role-preview div[aria-disabled="true"] { opacity: 0.45; }
.boot { border-color: rgba(213, 255, 73, 0.45); }
.boot p:not(.step) { max-width: 780px; color: var(--muted); line-height: 1.6; }
#boot-status { min-height: 1.5em; }
.game-screen { margin-top: 18px; }
.game-screen canvas {
  display: block;
  width: min(100%, 448px);
  height: auto;
  margin-inline: auto;
  border: 1px solid var(--line);
  background: #000;
  image-rendering: pixelated;
}
.game-screen p { margin: 12px auto 0; text-align: center; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px 0 46px; color: #898f8b; font-size: 0.78rem; }
code { font-family: ui-monospace, monospace; }

@media (max-width: 700px) {
  .hero, main, footer { width: min(100% - 20px, 1120px); }
  .hero { padding-top: 38px; }
  .picker-grid, .game-cards, .role-preview { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; }
  footer { flex-direction: column; }
}
