:root {
  --sky: #0b1020;
  --panel: #111830;
  --panel-alt: #182342;
  --bezel: #151d34;
  --border: #2c3e6b;
  --border-hi: #4b6cb7;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --amber: #f59e0b;
  --emerald: #10b981;
  --teal: #2dd4bf;
  --mono: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--mono);
  background: var(--sky);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
}

.sky-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 15%, rgba(45, 212, 191, 0.08), transparent 40%),
    radial-gradient(circle at 80% 10%, rgba(245, 158, 11, 0.08), transparent 36%),
    linear-gradient(180deg, #070b17 0%, var(--sky) 60%, #090e1c 100%);
}

.console-shell {
  max-width: 1060px;
  margin: 0 auto;
  padding: 16px 14px 42px;
}

/* HUD Bar */
.hud-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--panel);
  border: 2px solid var(--border);
  box-shadow: inset 0 0 0 2px #090f20, 0 4px 0 #050811;
}

.hud-left,
.hud-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hud-brand {
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--amber);
}

.hud-status {
  font-size: 12px;
  color: var(--emerald);
  letter-spacing: 0.06em;
}

.hud-btn {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--teal);
  background: #0a1124;
  border: 2px solid var(--border);
  padding: 5px 10px;
  cursor: pointer;
}

.hud-btn[aria-pressed="true"] {
  color: #051613;
  background: var(--emerald);
  border-color: var(--emerald);
}

.cart-tag {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 3px 8px;
  background: #0b1225;
}

.led {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.led-green {
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.led-amber {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.75);
}

/* RPG Box */
.rpg-box {
  background: rgba(17, 24, 48, 0.94);
  border: 2px solid var(--border-hi);
  box-shadow:
    inset 0 0 0 2px #090f22,
    0 6px 0 #060913;
}

/* Handheld Hero Frame */
.handheld-frame {
  background: linear-gradient(180deg, #1a2442 0%, var(--bezel) 100%);
  border: 3px solid #35497a;
  border-radius: 16px;
  padding: 12px 14px 16px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.09),
    0 10px 0 #060913;
  margin-bottom: 24px;
}

.bezel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.speaker-vents {
  display: flex;
  gap: 4px;
}

.speaker-vents span {
  display: block;
  width: 14px;
  height: 4px;
  background: #0b1020;
  border-bottom: 1px solid #2c3e6b;
}

.bezel-leds {
  display: flex;
  gap: 12px;
}

.led-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.crt-viewport {
  position: relative;
  border: 3px solid #070b16;
  border-radius: 8px;
  overflow: hidden;
  min-height: 470px;
  background: #080d1b;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  image-rendering: pixelated;
  opacity: 0.24;
  filter: blur(1px);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 12, 26, 0.78) 0%, rgba(8, 12, 26, 0.56) 50%, rgba(8, 12, 26, 0.92) 100%),
    linear-gradient(90deg, rgba(8, 12, 26, 0.88) 0%, rgba(8, 12, 26, 0.45) 65%, rgba(8, 12, 26, 0.8) 100%);
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.025) 0px,
    rgba(255, 255, 255, 0.025) 1px,
    rgba(0, 0, 0, 0.14) 2px,
    rgba(0, 0, 0, 0.14) 4px
  );
}

.viewport-content {
  position: relative;
  z-index: 2;
  padding: 22px 20px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  align-items: center;
  gap: 22px;
}

.hero-left {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.hero-portrait-card {
  padding: 10px;
  background: rgba(11, 16, 32, 0.94);
  border: 2px solid var(--teal);
  box-shadow:
    inset 0 0 0 2px #090f22,
    0 0 24px rgba(45, 212, 191, 0.2),
    0 6px 0 #050811;
}

.portrait-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--teal);
  padding-bottom: 7px;
}

.portrait-lv {
  color: var(--amber);
}

.portrait-frame {
  border: 2px solid var(--amber);
  background: #070b16;
  overflow: hidden;
  box-shadow: inset 0 0 18px rgba(45, 212, 191, 0.18);
}

.mira-portrait {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.portrait-nameplate {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 7px 9px;
  background: #0a1022;
  border: 1px solid var(--border);
}

.hero-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--amber);
  line-height: 1.1;
}

.hero-role {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.portrait-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--emerald);
  letter-spacing: 0.06em;
}

.hero-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.cover-icon {
  width: 84px;
  height: 84px;
  image-rendering: pixelated;
  border: 2px solid var(--teal);
  box-shadow: 0 4px 0 #070b16;
  background: var(--sky);
}

.title-plaque {
  max-width: 650px;
}

.domain-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  background: rgba(11, 16, 32, 0.85);
  border: 1px solid rgba(45, 212, 191, 0.45);
  padding: 2px 8px;
  margin-bottom: 6px;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4.5vw, 44px);
  letter-spacing: 0.12em;
  color: var(--amber);
  text-shadow: 3px 3px 0 #050811;
  line-height: 1.1;
}

.tagline {
  margin: 6px 0 10px;
  font-size: 14px;
  color: #e2e8f0;
  text-shadow: 1px 1px 0 #050811;
}

.eq-strip {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  height: 18px;
  padding: 3px 6px;
  background: rgba(8, 12, 26, 0.85);
  border: 1px solid var(--border);
}

.eq-strip span {
  display: block;
  width: 5px;
  height: 6px;
  background: var(--emerald);
  transition: height 110ms linear;
}

.eq-strip span:nth-child(odd) {
  background: var(--amber);
}

.title-menu-box {
  max-width: 540px;
  padding: 12px 14px;
  background: rgba(11, 16, 32, 0.92);
}

.menu-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--teal);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 8px;
  letter-spacing: 0.08em;
}

.menu-hint {
  color: var(--muted);
}

.title-menu {
  display: grid;
  gap: 5px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
}

.menu-item .cursor {
  color: var(--muted);
  white-space: pre;
}

.menu-item .label {
  flex: 1;
}

.menu-item .meta {
  font-size: 11px;
  color: var(--muted);
}

.menu-item.active,
.menu-item:focus-visible {
  background: rgba(245, 158, 11, 0.16);
  border-color: var(--amber);
  outline: none;
}

.menu-item.active .cursor,
.menu-item.active .label {
  color: var(--amber);
}

.menu-item.active .meta {
  color: var(--teal);
}

.prompt-strip {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  padding: 8px 12px;
  background: rgba(7, 11, 22, 0.95);
  border-top: 2px solid var(--border);
  font-size: 11px;
  color: var(--teal);
  letter-spacing: 0.07em;
}

/* Sections */
.section-card {
  padding: 20px;
  margin-bottom: 22px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.quest-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: #051613;
  background: var(--emerald);
  padding: 3px 8px;
}

.quest-badge.amber {
  color: #180e02;
  background: var(--amber);
}

h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0.06em;
  color: var(--amber);
}

h3 {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--teal);
}

.section-lead {
  margin: 0 0 14px;
  color: #cbd5e1;
  font-size: 14px;
}

code {
  background: #080d1d;
  color: var(--amber);
  padding: 2px 5px;
  border: 1px solid #24335a;
  font-variant-ligatures: none;
  letter-spacing: 0.04em;
}

/* Setup Tabs & Panels */
.step-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.step-tab {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: var(--panel-alt);
  border: 2px solid var(--border);
  padding: 8px 12px;
  cursor: pointer;
}

.step-tab.active {
  background: rgba(16, 185, 129, 0.16);
  border-color: var(--emerald);
  color: var(--emerald);
}

.step-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.screen-shot-wrap {
  border: 2px solid var(--border);
  background: #070b16;
  padding: 6px;
}

.screen-shot-wrap img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.rpg-dialog {
  background: #0c1328;
  border: 2px solid var(--border);
  padding: 14px 16px;
}

.rpg-dialog ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: #cbd5e1;
}

.mock-phone-card {
  background: #0a1020;
  border: 2px solid var(--teal);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.phone-head {
  font-size: 12px;
  font-weight: 800;
  color: var(--amber);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.phone-block {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 8px 10px;
  font-size: 12px;
}

.p-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.p-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.p-code {
  margin-top: 6px;
  padding: 4px 6px;
  background: #070b16;
  color: var(--teal);
  border: 1px solid var(--border);
  word-break: break-all;
}

.p-actions {
  margin-top: 6px;
  display: flex;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}

.pill-ok { color: var(--emerald); font-weight: 700; }
.pill-amber { color: var(--amber); font-weight: 700; }
.pill-teal { color: var(--teal); font-weight: 700; }

/* Netplay & Controls */
.netplay-diagram {
  margin: 0 0 16px;
  padding: 14px;
  background: #080d1d;
  border: 2px solid var(--border);
  color: var(--teal);
  font-size: 13px;
  overflow-x: auto;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.ctrl-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: #0b1225;
  border: 1px solid var(--border);
  font-size: 13px;
}

kbd {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--amber);
  background: #17213f;
  border: 1px solid var(--border-hi);
  padding: 3px 7px;
  white-space: nowrap;
}

/* Badges */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.hw-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  background: #0b1225;
  border: 2px solid var(--border);
  color: var(--text);
}

.hw-badge.os {
  border-color: var(--emerald);
  color: var(--emerald);
}

.hw-badge.res {
  border-color: var(--teal);
  color: var(--teal);
}

/* Split Download + Support */
.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.split-grid .section-card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cta-stack {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rpg-btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  background: var(--panel-alt);
  border: 2px solid var(--border-hi);
  padding: 11px 14px;
  box-shadow: 0 3px 0 #050811;
}

.rpg-btn:hover {
  filter: brightness(1.1);
}

.rpg-btn.primary {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #051613;
}

.rpg-btn.amber-btn {
  background: var(--amber);
  border-color: var(--amber);
  color: #180e02;
}

.small-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* Footer */
.site-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 2px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  font-size: 12px;
  color: var(--muted);
}

.site-footer a {
  color: var(--teal);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 820px) {
  .viewport-content,
  .step-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .hero-portrait-card {
    max-width: 360px;
    width: 100%;
    margin: 0 auto;
  }

  .bezel-label {
    display: none;
  }

  .crt-viewport {
    min-height: 420px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .eq-strip span {
    transition: none;
  }
}
