@font-face {
  font-family: "D3 System";
  src: local("Trebuchet MS"), local("Verdana"), local("Arial");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --void: #000000;
  --ink: #fff8ef;
  --muted: #b7b7b7;
  --panel: rgba(0, 0, 0, 0.9);
  --panel-solid: #070607;
  --line: #905f35;
  --copper-dark: #2a200f;
  --copper: #905f35;
  --copper-bright: #bf7a4a;
  --peach: #ffb080;
  --peach-light: #ffd5bf;
  --steel-dark: #3b3b3b;
  --steel: #737373;
  --steel-light: #b7b7b7;
  --steel-shine: #d3d3d3;
  --cobalt-dark: #0000a7;
  --cobalt: #0000d7;
  --cobalt-light: #4040ff;
  --cyan: #00cccc;
  --violet: #9a00e5;
  --lime: #07a700;
  --gold-dark: #585400;
  --gold-mid: #b4ac00;
  --gold: #fcf400;
  --danger: #ff0000;
  --radius: 7px;
  font-family: "D3 System", "Trebuchet MS", Verdana, Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--void);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--void) url("assets/images/vga-cabinet-backdrop.png") center top / cover fixed no-repeat;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.16;
  background-image: repeating-linear-gradient(to bottom, rgba(255,255,255,.08) 0 1px, transparent 1px 4px);
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
  content: "";
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:focus-visible,
canvas:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.sitebar,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.sitebar {
  min-height: 54px;
  margin-bottom: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(84, 234, 255, 0.44);
  border-radius: 13px;
  color: #061016;
  background: linear-gradient(135deg, var(--cyan), #8c7cff);
  box-shadow: 0 0 22px rgba(84, 234, 255, 0.18);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: -0.08em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.brand small {
  margin-top: 1px;
  color: var(--cyan);
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.19em;
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.icon-button,
.language-switch,
.text-button,
.hud-button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  backdrop-filter: blur(16px);
}

.icon-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 12px;
  color: #dce6ff;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
}

.icon-button:hover,
.hud-button:hover,
.text-button:hover {
  border-color: rgba(84, 234, 255, 0.52);
  background: rgba(84, 234, 255, 0.09);
}

.sound-glyph {
  color: var(--cyan);
}

.language-switch {
  display: grid;
  grid-template-columns: repeat(2, 34px);
  overflow: hidden;
  border-radius: 12px;
}

.language-switch button {
  min-height: 38px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 900;
}

.language-switch button + button {
  border-left: 1px solid var(--line);
}

.language-switch button[aria-pressed="true"] {
  color: #041014;
  background: var(--cyan);
}

.game-frame {
  position: relative;
  width: min(960px, 100%);
  margin-inline: auto;
  touch-action: manipulation;
}

.canvas-shell {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 8 / 5;
  border: 1px solid rgba(166, 191, 255, 0.28);
  border-radius: var(--radius);
  background: #04040b;
  box-shadow:
    0 40px 100px rgba(0,0,0,.52),
    0 0 0 7px rgba(255,255,255,.025),
    inset 0 0 0 1px rgba(255,255,255,.06);
  isolation: isolate;
}

.canvas-shell::after {
  position: absolute;
  inset: 0;
  z-index: 20;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: inherit;
  box-shadow: inset 0 0 60px rgba(0,0,0,.25);
  pointer-events: none;
  content: "";
}

#game {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.glass-effects {
  position: absolute;
  inset: 0;
  z-index: 4;
  opacity: 0.08;
  background:
    linear-gradient(115deg, rgba(255,255,255,.11), transparent 18%, transparent 73%, rgba(255,255,255,.04)),
    repeating-linear-gradient(to bottom, transparent 0 3px, rgba(0,0,0,.18) 3px 4px);
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.screen-panel,
.modal-panel {
  position: absolute;
  inset: 0;
  z-index: 6;
}

.screen-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(26px, 5vw, 72px);
  transition: opacity 380ms ease, transform 520ms cubic-bezier(.2,.75,.18,1);
}

.screen-panel:not(.is-active) {
  opacity: 0;
  transform: scale(1.025);
  pointer-events: none;
}

.screen-eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", monospace;
  font-size: clamp(0.55rem, 0.8vw, 0.7rem);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.intro-panel {
  align-items: center;
  text-align: center;
  background: radial-gradient(circle at center, rgba(11, 9, 38, .15), rgba(4, 4, 14, .38));
}

.intro-content {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(690px, 84%);
  align-items: center;
  flex-direction: column;
}

.legacy-seal {
  display: grid;
  width: clamp(56px, 7vw, 84px);
  height: clamp(56px, 7vw, 84px);
  margin-bottom: clamp(10px, 1.4vw, 20px);
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(84,234,255,.3);
  border-radius: 50%;
  background: rgba(8,9,26,.7);
  box-shadow: 0 0 42px rgba(84,234,255,.14);
}

.legacy-seal img {
  width: 74%;
  height: 74%;
  object-fit: contain;
  image-rendering: pixelated;
}

.intro-content h1 {
  margin: 0;
  font-size: clamp(3.2rem, 9vw, 7.7rem);
  font-weight: 950;
  line-height: 0.82;
  letter-spacing: -0.095em;
  text-shadow: 0 14px 40px rgba(0,0,0,.48);
}

.intro-content h1 span {
  display: inline-block;
  margin-left: .03em;
  color: transparent;
  background: linear-gradient(145deg, var(--cyan), var(--violet) 58%, #ff6eb8);
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 0 24px rgba(101, 204, 255, .26));
}

.intro-lead {
  margin: clamp(14px, 2vw, 22px) 0 6px;
  color: #fff;
  font-size: clamp(0.95rem, 1.7vw, 1.35rem);
  font-weight: 750;
  letter-spacing: -0.025em;
}

.intro-copy {
  max-width: 610px;
  margin: 0 0 clamp(18px, 2.5vw, 30px);
  color: #aab6d4;
  font-size: clamp(0.7rem, 1.12vw, 0.9rem);
  line-height: 1.55;
}

.primary-action,
.secondary-action,
.danger-action {
  border-radius: 999px;
  cursor: pointer;
  font-weight: 850;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-action {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 0 24px 0 29px;
  border: 0;
  color: #051014;
  background: linear-gradient(120deg, var(--cyan), #96f6ff 55%, var(--lime));
  box-shadow: 0 12px 34px rgba(84, 234, 255, .22);
}

.primary-action i {
  font-size: 1.2rem;
  font-style: normal;
}

.primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 44px rgba(84, 234, 255, .34);
}

.primary-action:active,
.secondary-action:active,
.round-action:active,
.dpad button:active {
  transform: translateY(1px) scale(.98);
}

.primary-action.compact {
  min-height: 42px;
  gap: 14px;
  padding: 0 19px;
  font-size: .76rem;
}

.intro-footnotes {
  display: flex;
  gap: 8px;
  margin-top: clamp(14px, 2vw, 24px);
  color: #73819f;
  font-family: ui-monospace, monospace;
  font-size: clamp(.48rem, .7vw, .62rem);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.intro-orbit {
  position: absolute;
  z-index: 0;
  width: 48%;
  aspect-ratio: 1;
  border: 1px solid rgba(110, 197, 255, .12);
  border-radius: 50%;
  animation: orbit-turn 22s linear infinite;
  pointer-events: none;
}

.orbit-one::before,
.orbit-two::before {
  position: absolute;
  top: 15%;
  left: 5%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 16px var(--cyan);
  content: "";
}

.orbit-two {
  width: 67%;
  border-style: dashed;
  animation-direction: reverse;
  animation-duration: 34s;
}

@keyframes orbit-turn { to { transform: rotate(360deg); } }

.selection-panel,
.mission-panel {
  justify-content: flex-start;
  padding: clamp(24px, 3.2vw, 46px) clamp(28px, 4.8vw, 68px);
  background: linear-gradient(180deg, rgba(5,6,19,.48), rgba(7,8,23,.76));
}

.panel-heading {
  margin-bottom: clamp(15px, 2vw, 27px);
}

.panel-heading h2,
.modal-card h2,
.app-dialog h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3.4vw, 3rem);
  line-height: 1;
  letter-spacing: -.065em;
}

.panel-heading > p:last-child,
.modal-card > p,
.app-dialog header p:last-child {
  max-width: 640px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: clamp(.67rem, 1.1vw, .9rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(8px, 1.3vw, 16px);
}

.hero-card {
  position: relative;
  min-width: 0;
  padding: clamp(10px, 1.4vw, 16px) 8px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: clamp(14px, 1.8vw, 20px);
  color: var(--ink);
  background: linear-gradient(145deg, rgba(34,40,73,.76), rgba(11,13,32,.9));
  cursor: pointer;
  text-align: center;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.hero-card::before {
  position: absolute;
  inset: auto 10% -38% 10%;
  height: 72%;
  border-radius: 50%;
  background: var(--hero-color, var(--cyan));
  opacity: .13;
  filter: blur(24px);
  content: "";
}

.hero-card:hover {
  z-index: 1;
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--hero-color) 68%, white);
}

.hero-card[aria-pressed="true"] {
  border-color: var(--hero-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--hero-color) 30%, transparent), 0 16px 34px rgba(0,0,0,.3);
  transform: translateY(-5px);
}

.hero-card canvas {
  position: relative;
  display: block;
  width: min(100%, 96px);
  aspect-ratio: 57 / 55;
  margin: 0 auto 7px;
  image-rendering: pixelated;
  mix-blend-mode: screen;
  filter: drop-shadow(0 7px 8px rgba(0,0,0,.5));
}

.hero-card strong,
.hero-card small {
  position: relative;
  display: block;
}

.hero-card strong {
  font-size: clamp(.68rem, 1.25vw, 1rem);
}

.hero-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: clamp(.48rem, .72vw, .62rem);
}

.hero-selected {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #061014;
  background: var(--hero-color);
  font-size: .58rem;
  font-weight: 900;
}

.hero-card[aria-pressed="true"] .hero-selected {
  display: grid;
}

.hero-detail {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(11px, 1.7vw, 20px);
  margin-top: clamp(13px, 2vw, 25px);
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8,10,26,.68);
  backdrop-filter: blur(18px);
}

.ability-glyph {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 12px;
  color: var(--hero-color, var(--cyan));
  background: color-mix(in srgb, var(--hero-color, var(--cyan)) 11%, transparent);
  font-size: 1.2rem;
}

.hero-detail small,
.hero-detail strong {
  display: block;
}

.hero-detail small {
  color: var(--hero-color, var(--cyan));
  font-size: .7rem;
  font-weight: 850;
}

.hero-detail strong {
  margin-top: 2px;
  color: #bac5dc;
  font-size: clamp(.56rem, .85vw, .72rem);
  font-weight: 550;
  line-height: 1.4;
}

.mission-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.text-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 11px;
  color: #d4def5;
  cursor: pointer;
  font-size: .7rem;
}

.mission-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(9px, 1.4vw, 17px);
}

.mission-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: clamp(112px, 13.2vw, 155px);
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: clamp(11px, 1.5vw, 18px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: clamp(14px, 1.8vw, 20px);
  color: var(--ink);
  background: linear-gradient(145deg, rgba(33,37,69,.79), rgba(8,10,26,.88));
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.mission-card::after {
  position: absolute;
  right: -25%;
  bottom: -48%;
  width: 85%;
  aspect-ratio: 1;
  border: 1px solid var(--mission-color, var(--cyan));
  border-radius: 50%;
  opacity: .28;
  box-shadow: inset 0 0 35px color-mix(in srgb, var(--mission-color, var(--cyan)) 18%, transparent), 0 0 30px color-mix(in srgb, var(--mission-color, var(--cyan)) 13%, transparent);
  content: "";
}

.mission-card:not(:disabled):hover {
  z-index: 1;
  border-color: var(--mission-color, var(--cyan));
  background: linear-gradient(145deg, rgba(45,52,91,.91), rgba(11,14,35,.94));
  transform: translateY(-3px);
}

.mission-card:disabled {
  cursor: not-allowed;
  filter: grayscale(.55);
  opacity: .43;
}

.mission-number {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  color: var(--mission-color, var(--cyan));
  font-family: ui-monospace, monospace;
  font-size: .55rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.mission-card strong,
.mission-card small {
  position: relative;
  z-index: 1;
  display: block;
}

.mission-card strong {
  max-width: 90%;
  font-size: clamp(.68rem, 1.15vw, .96rem);
  line-height: 1.1;
}

.mission-card small {
  margin-top: 4px;
  overflow: hidden;
  color: #8996b2;
  font-size: clamp(.47rem, .65vw, .58rem);
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-complete {
  color: var(--lime);
}

.game-hud {
  position: absolute;
  top: clamp(11px, 1.5vw, 19px);
  right: clamp(11px, 1.5vw, 19px);
  left: clamp(11px, 1.5vw, 19px);
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(120px, .8fr) minmax(320px, 2.3fr) minmax(130px, .75fr);
  gap: 9px;
  pointer-events: none;
}

.hud-character,
.hud-center,
.hud-tools {
  min-width: 0;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(7,9,24,.72);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  backdrop-filter: blur(15px);
}

.hud-character {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 3px 12px 3px 5px;
}

#hud-portrait {
  width: 50px;
  height: 49px;
  image-rendering: pixelated;
  mix-blend-mode: screen;
}

.hud-character small,
.hud-character strong,
.hud-center small,
.hud-center strong {
  display: block;
}

.hud-character small,
.hud-center small {
  color: #8f9bb7;
  font-family: ui-monospace, monospace;
  font-size: clamp(.42rem, .55vw, .52rem);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hud-character strong {
  margin-top: 1px;
  font-size: clamp(.66rem, .9vw, .8rem);
}

.hud-center {
  display: grid;
  grid-template-columns: 1.1fr auto;
  align-items: center;
  gap: 16px;
  padding: 8px 14px;
}

.hud-center strong {
  overflow: hidden;
  font-size: clamp(.63rem, .82vw, .76rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-meters {
  display: flex;
  align-items: center;
  gap: clamp(11px, 1.5vw, 20px);
}

.hud-meters > span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hud-meters b {
  font-family: ui-monospace, monospace;
  font-size: clamp(.58rem, .8vw, .74rem);
}

.hud-meter-math {
  color: var(--cyan);
}

.hud-meter-math small {
  color: var(--gold);
  font-size: .76rem;
  font-weight: 950;
}

.shard-icon {
  width: 9px;
  height: 13px;
  background: var(--gold);
  box-shadow: 0 0 9px rgba(255,230,110,.75);
  clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%);
}

.hud-tools {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 5px;
  pointer-events: auto;
}

.hud-button {
  display: grid;
  place-items: center;
  gap: 1px;
  border-width: 0;
  border-radius: 11px;
  color: #c7d2ea;
  cursor: pointer;
  font-size: .78rem;
}

.hud-button span:last-child {
  color: #8490aa;
  font-size: .46rem;
  font-weight: 700;
}

.modal-panel {
  z-index: 14;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(2,3,12,.64);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(470px, 90%);
  padding: clamp(23px, 3.5vw, 42px);
  border: 1px solid rgba(146,185,255,.22);
  border-radius: 25px;
  background: linear-gradient(145deg, rgba(25,28,57,.96), rgba(8,10,27,.98));
  box-shadow: 0 26px 90px rgba(0,0,0,.55), inset 0 1px rgba(255,255,255,.08);
  text-align: center;
}

.modal-symbol {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  place-items: center;
  border: 1px solid var(--cyan);
  border-radius: 18px;
  color: var(--cyan);
  background: rgba(84,234,255,.08);
  box-shadow: 0 0 30px rgba(84,234,255,.14);
  font-size: 1.5rem;
}

.result-symbol {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(255,230,110,.08);
  box-shadow: 0 0 30px rgba(255,230,110,.16);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.secondary-action,
.danger-action {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  color: #d7e0f3;
  background: rgba(255,255,255,.045);
  font-size: .7rem;
}

.secondary-action:hover {
  border-color: rgba(84,234,255,.5);
  background: rgba(84,234,255,.08);
}

.danger-action {
  color: #ff9fb4;
  border-color: rgba(255,78,120,.32);
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 20px;
}

.result-stats span {
  padding: 11px 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.03);
}

.result-stats small,
.result-stats strong {
  display: block;
}

.result-stats small {
  color: #8793ae;
  font-size: .48rem;
  text-transform: uppercase;
}

.result-stats strong {
  margin-top: 4px;
  color: #fff;
  font-family: ui-monospace, monospace;
  font-size: .8rem;
}

.toast {
  position: absolute;
  bottom: 21px;
  left: 50%;
  z-index: 16;
  width: max-content;
  max-width: min(620px, calc(100% - 36px));
  padding: 10px 15px;
  border: 1px solid rgba(84,234,255,.28);
  border-radius: 999px;
  color: #eefaff;
  background: rgba(5,8,22,.88);
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  font-size: clamp(.57rem, .9vw, .72rem);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 170ms ease, transform 170ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.play-controls {
  display: grid;
  grid-template-columns: 210px 1fr;
  align-items: center;
  gap: 24px;
  padding: 22px clamp(5px, 2vw, 22px) 4px;
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(3, 44px);
  gap: 4px;
}

.dpad button,
.dpad-center {
  display: grid;
  place-items: center;
  border-radius: 13px;
}

.dpad button {
  border: 1px solid var(--line);
  color: #cbd7ef;
  background: linear-gradient(145deg, rgba(38,43,73,.82), rgba(12,14,31,.9));
  box-shadow: inset 0 1px rgba(255,255,255,.06);
  cursor: pointer;
}

.dpad button:hover {
  color: var(--cyan);
  border-color: rgba(84,234,255,.46);
}

.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-center { grid-column: 2; grid-row: 2; color: #66718c; background: rgba(255,255,255,.025); font-size: .52rem; font-weight: 900; }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down { grid-column: 2; grid-row: 3; }

.action-cluster {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(11px, 2vw, 26px);
}

.round-action {
  position: relative;
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #e3ebfb;
  background: linear-gradient(145deg, rgba(38,43,73,.82), rgba(10,12,29,.92));
  box-shadow: 0 10px 24px rgba(0,0,0,.22), inset 0 1px rgba(255,255,255,.08);
  cursor: pointer;
}

.round-action > span {
  align-self: end;
  font-size: 1.05rem;
}

.round-action small {
  align-self: start;
  color: #8d99b4;
  font-size: .48rem;
  font-weight: 700;
}

.power-action {
  width: 98px;
  height: 98px;
  border-color: var(--hero-color, var(--cyan));
  color: #071014;
  background: linear-gradient(145deg, color-mix(in srgb, var(--hero-color, var(--cyan)) 92%, white), color-mix(in srgb, var(--hero-color, var(--cyan)) 68%, #293359));
  box-shadow: 0 12px 34px color-mix(in srgb, var(--hero-color, var(--cyan)) 20%, transparent), inset 0 1px rgba(255,255,255,.5);
  overflow: hidden;
}

.power-action > span {
  font-size: 1.5rem;
}

.power-action small {
  position: relative;
  z-index: 1;
  max-width: 82%;
  color: rgba(4,12,17,.78);
  font-size: .5rem;
  line-height: 1.1;
}

.power-action i {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--charge, 100%);
  background: rgba(1,7,12,.22);
  transform-origin: bottom;
  transition: height 180ms ease;
}

.power-action.is-cooling {
  filter: saturate(.45);
}

.control-hint {
  grid-column: 2;
  margin: -1px 0 0;
  color: #64708b;
  font-family: ui-monospace, monospace;
  font-size: .55rem;
  text-align: right;
}

.control-hint kbd {
  color: #b7c1d7;
  font: inherit;
}

.control-hint span {
  margin: 0 5px;
}

.site-footer {
  margin-top: 19px;
  color: #525c74;
  font-family: ui-monospace, monospace;
  font-size: .52rem;
  font-weight: 700;
  letter-spacing: .1em;
}

.app-dialog {
  width: min(570px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(159,187,255,.24);
  border-radius: 24px;
  color: var(--ink);
  background: linear-gradient(145deg, #1a1d3a, #090b20);
  box-shadow: 0 35px 100px rgba(0,0,0,.7);
}

.app-dialog::backdrop {
  background: rgba(2,3,10,.72);
  backdrop-filter: blur(8px);
}

.app-dialog form {
  padding: clamp(22px, 4vw, 38px);
}

.app-dialog header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.dialog-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: #b6c1d9;
  background: rgba(255,255,255,.04);
  cursor: pointer;
  font-size: 1.2rem;
}

.select-setting,
.range-setting,
.toggle-setting {
  display: block;
  padding: 17px 0;
  border-top: 1px solid var(--line);
}

.select-setting,
.range-setting > span,
.toggle-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.select-setting b,
.select-setting small,
.range-setting b,
.toggle-setting b,
.toggle-setting small {
  display: block;
}

.select-setting b,
.range-setting b,
.toggle-setting b {
  font-size: .78rem;
}

.select-setting small,
.range-setting output,
.toggle-setting small {
  color: #7f8ba6;
  font-family: ui-monospace, monospace;
  font-size: .58rem;
}

.select-setting small {
  max-width: 280px;
  margin-top: 4px;
  line-height: 1.35;
}

.select-setting select {
  min-width: 148px;
  padding: 9px 30px 9px 11px;
  border: 1px solid rgba(84,234,255,.3);
  border-radius: 10px;
  color: var(--ink);
  background: #11162f;
  cursor: pointer;
}

.range-setting input {
  width: 100%;
  margin-top: 13px;
  accent-color: var(--cyan);
}

.toggle-setting input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-setting i {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0,0,0,.26);
  cursor: pointer;
}

.toggle-setting i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #8490a9;
  transition: transform 160ms ease, background 160ms ease;
  content: "";
}

.toggle-setting input:checked + i {
  background: rgba(84,234,255,.15);
  border-color: rgba(84,234,255,.45);
}

.toggle-setting input:checked + i::after {
  background: var(--cyan);
  transform: translateX(20px);
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

.help-grid {
  display: grid;
  gap: 9px;
}

.help-grid section {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.025);
}

.help-grid section > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: var(--cyan);
  background: rgba(84,234,255,.08);
}

.help-grid h3 {
  margin: 0;
  font-size: .76rem;
}

.help-grid p {
  margin: 4px 0 0;
  color: #99a5bf;
  font-size: .66rem;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .wide-label { display: none; }
  .icon-button { width: 40px; justify-content: center; padding: 0; }
  .selection-panel, .mission-panel { padding: 25px 30px; }
  .mission-card { min-height: 115px; }
  .game-hud { top: 6px; right: 6px; left: 6px; grid-template-columns: 112px 1fr 94px; }
  .hud-character, .hud-center, .hud-tools { min-height: 44px; border-radius: 11px; }
  #hud-portrait { width: 38px; height: 37px; }
  .hud-character { padding-top: 2px; padding-bottom: 2px; }
  .hud-center { padding-top: 6px; padding-bottom: 6px; }
  .hud-center { grid-template-columns: 1fr auto; }
  .hud-meter-score { display: none; }
}

@media (max-width: 680px) {
  .app-shell { padding-right: 10px; padding-left: 10px; }
  .sitebar { margin-bottom: 9px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
  .brand strong { font-size: .88rem; }
  .brand small { font-size: .42rem; }
  .language-switch { grid-template-columns: repeat(2, 30px); }
  .canvas-shell { aspect-ratio: 4 / 5; border-radius: 20px; }
  .canvas-shell #game { top: 0; right: auto; bottom: auto; left: 50%; width: auto; min-width: 128%; height: 100%; transform: translateX(-50%); }
  .is-playing .canvas-shell { aspect-ratio: 7 / 6; }
  .is-playing .canvas-shell #game { left: 50%; width: auto; min-width: 0; height: 100%; transform: translateX(-50%); }
  .screen-panel { padding: 21px 17px; }
  .intro-content { width: 92%; }
  .intro-content h1 { font-size: clamp(3.6rem, 23vw, 5.5rem); }
  .intro-lead { font-size: .9rem; }
  .intro-copy { font-size: .67rem; }
  .orbit-one { width: 95%; }
  .orbit-two { width: 135%; }
  .selection-panel, .mission-panel { padding: 24px 15px; }
  .panel-heading { margin-bottom: 14px; }
  .panel-heading h2 { font-size: 1.8rem; }
  .panel-heading > p:last-child { font-size: .62rem; }
  .hero-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .hero-card { padding: 7px 4px 8px; border-radius: 13px; }
  .hero-card:nth-child(4) { grid-column: 1 / 2; margin-left: 50%; }
  .hero-card canvas { width: 63px; margin-bottom: 2px; }
  .hero-card strong { font-size: .65rem; }
  .hero-card small { font-size: .43rem; }
  .hero-detail { grid-template-columns: auto 1fr; margin-top: 9px; padding: 8px; }
  .hero-detail .primary-action { grid-column: 1 / -1; width: 100%; }
  .ability-glyph { width: 34px; height: 34px; }
  .hero-detail small { font-size: .59rem; }
  .hero-detail strong { font-size: .5rem; }
  .mission-heading { margin-bottom: 12px; }
  .mission-map { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .mission-card { min-height: 100px; padding: 10px; border-radius: 13px; }
  .mission-card strong { font-size: .67rem; }
  .game-hud { top: 4px; right: 4px; left: 4px; grid-template-columns: 78px 1fr 66px; gap: 4px; }
  .hud-character, .hud-center, .hud-tools { min-height: 36px; border-radius: 9px; }
  #hud-portrait { width: 31px; height: 30px; }
  .hud-character { gap: 4px; padding: 2px 4px; }
  .hud-character small { display: none; }
  .hud-character strong { font-size: .48rem; }
  .hud-center { grid-template-columns: 1fr auto; gap: 5px; padding: 4px 6px; }
  .hud-center small { font-size: .34rem; }
  .hud-center strong { font-size: .43rem; }
  .hud-meters > span { display: none; }
  .hud-meter-shards, .hud-meter-math:not([hidden]) { display: flex; }
  .hud-meters b { font-size: .43rem; }
  .hud-tools { padding: 2px; }
  .hud-button span:last-child { display: none; }
  .hud-button { font-size: .58rem; }
  .toast { bottom: 8px; padding: 6px 10px; font-size: .48rem; }
  .play-controls { grid-template-columns: 150px 1fr; gap: 8px; padding: 15px 0 0; }
  .dpad { grid-template-columns: repeat(3, 43px); grid-template-rows: repeat(3, 36px); }
  .dpad button, .dpad-center { border-radius: 10px; }
  .round-action { width: 58px; height: 58px; }
  .power-action { width: 76px; height: 76px; }
  .round-action > span { font-size: .86rem; }
  .power-action > span { font-size: 1.15rem; }
  .round-action small { font-size: .4rem; }
  .action-cluster { gap: 7px; }
  .control-hint { display: none; }
  .site-footer { font-size: .42rem; }
  .modal-card { padding: 20px 14px; }
  .modal-symbol { width: 44px; height: 44px; margin-bottom: 10px; }
  .result-stats { gap: 5px; }
  .select-setting { align-items: stretch; flex-direction: column; gap: 10px; }
  .select-setting small { max-width: none; }
  .select-setting select { width: 100%; }
}

@media (max-width: 430px) {
  .site-actions { gap: 4px; }
  .icon-button { width: 35px; min-height: 35px; }
  .language-switch button { min-height: 34px; }
  .play-controls { grid-template-columns: 122px 1fr; gap: 4px; }
  .dpad { grid-template-columns: repeat(3, 38px); grid-template-rows: repeat(3, 33px); }
  .round-action { width: 44px; height: 44px; }
  .power-action { width: 56px; height: 56px; }
  .action-cluster { gap: 4px; }
}

/* Restored 1994 VGA cabinet skin ---------------------------------------- */

.app-shell {
  width: min(1220px, 100%);
}

.sitebar {
  min-height: 58px;
  margin-bottom: 18px;
  padding: 6px 8px;
  border: 2px solid var(--copper-dark);
  border-radius: 4px;
  background: rgba(0, 0, 0, .9);
  box-shadow:
    inset 2px 2px 0 var(--peach),
    inset -2px -2px 0 #5f4020,
    0 3px 0 #000,
    0 5px 0 var(--cobalt-dark);
}

.brand {
  gap: 11px;
}

.brand-mark {
  width: 46px;
  height: 42px;
  padding: 3px;
  overflow: hidden;
  border: 2px solid var(--steel-dark);
  border-radius: 3px;
  background: #000;
  box-shadow:
    inset 2px 2px 0 var(--steel-shine),
    inset -2px -2px 0 var(--steel-dark),
    2px 2px 0 #000;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.brand strong {
  color: var(--peach-light);
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  font-size: 1rem;
  letter-spacing: -.025em;
  text-shadow: 2px 2px 0 #000;
}

.brand small {
  color: var(--gold);
  font-size: .52rem;
  letter-spacing: .16em;
  text-shadow: 1px 1px 0 #000;
}

.icon-button,
.language-switch,
.text-button,
.hud-button {
  border: 2px solid var(--steel-dark);
  border-radius: 3px;
  background: #090909;
  box-shadow:
    inset 1px 1px 0 var(--steel-light),
    inset -1px -1px 0 #252525;
  backdrop-filter: none;
}

.icon-button {
  min-height: 40px;
  color: var(--peach-light);
  font-size: .7rem;
}

.icon-button:hover,
.hud-button:hover,
.text-button:hover {
  border-color: var(--gold-dark);
  color: var(--gold);
  background: #181300;
  box-shadow:
    inset 1px 1px 0 var(--gold),
    inset -1px -1px 0 var(--gold-dark);
}

.sound-glyph {
  color: var(--gold);
}

.language-switch {
  grid-template-columns: repeat(2, 36px);
  overflow: hidden;
}

.language-switch button {
  min-height: 38px;
  color: var(--steel-light);
}

.language-switch button + button {
  border-left: 2px solid var(--steel-dark);
}

.language-switch button[aria-pressed="true"] {
  color: #000;
  background: linear-gradient(to bottom, var(--gold) 0 18%, #e4d800 18% 72%, var(--gold-mid) 72% 100%);
  box-shadow: inset 2px 2px 0 #fff885, inset -2px -2px 0 var(--gold-dark);
}

.canvas-shell {
  overflow: hidden;
  border: 3px solid var(--steel);
  border-radius: 6px;
  background: #000;
  box-shadow:
    0 0 0 2px var(--steel-shine),
    0 0 0 5px var(--steel-dark),
    0 0 0 8px var(--copper-dark),
    0 0 0 10px var(--copper-bright),
    0 28px 80px rgba(0, 0, 0, .74);
}

.canvas-shell::after {
  border: 0;
  border-radius: 2px;
  box-shadow:
    inset 3px 3px 0 rgba(211, 211, 211, .5),
    inset -3px -3px 0 rgba(42, 32, 15, .84);
}

.glass-effects {
  opacity: .035;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(0, 0, 0, .48) 3px 4px);
  mix-blend-mode: normal;
}

.is-playing .glass-effects {
  opacity: .014;
}

.screen-panel {
  padding: clamp(29px, 4vw, 55px);
}

.screen-eyebrow {
  margin-bottom: 9px;
  color: var(--gold);
  font-size: clamp(.6rem, .78vw, .72rem);
  letter-spacing: .14em;
  text-shadow: 1px 1px 0 #000;
}

.intro-panel {
  display: grid;
  grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
  align-items: center;
  justify-content: center;
  gap: clamp(25px, 4.5vw, 56px);
  padding: clamp(35px, 5vw, 70px);
  text-align: left;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, .32) 0 72%, rgba(0, 0, 167, .22) 72% 74%, rgba(0, 0, 0, .52) 74%),
    rgba(0, 0, 0, .48);
}

.intro-orbit {
  display: none;
}

.intro-title-artifact {
  position: relative;
  z-index: 2;
  width: min(100%, 395px);
  justify-self: end;
  padding: clamp(6px, 1vw, 10px);
  border: 2px solid var(--copper-dark);
  border-radius: 3px;
  background: #000;
  box-shadow:
    inset 2px 2px 0 var(--peach-light),
    inset -2px -2px 0 #5f4020,
    0 0 0 2px var(--copper-bright),
    0 0 0 5px var(--copper-dark),
    7px 8px 0 rgba(0, 0, 0, .7);
}

.intro-title-artifact::after {
  position: absolute;
  right: 12px;
  bottom: -4px;
  width: 28%;
  height: 4px;
  background: var(--gold);
  box-shadow: -16px 0 0 var(--cobalt), 4px 0 0 #000;
  content: "";
}

.intro-title-artifact img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  image-rendering: auto;
}

.intro-content {
  width: min(100%, 485px);
  align-items: flex-start;
  text-align: left;
}

.legacy-seal {
  width: 62px;
  height: 50px;
  margin: 0 0 13px;
  border: 2px solid var(--steel-dark);
  border-radius: 3px;
  background: #000;
  box-shadow: inset 2px 2px 0 var(--steel-shine), inset -2px -2px 0 var(--steel-dark), 3px 3px 0 #000;
}

.legacy-seal img {
  width: 86%;
  height: 86%;
}

.intro-content h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.intro-lead {
  margin: 3px 0 8px;
  color: var(--peach-light);
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  font-size: clamp(1rem, 1.65vw, 1.32rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  text-shadow: 2px 2px 0 #000;
}

.intro-copy {
  max-width: 470px;
  margin-bottom: clamp(18px, 2.4vw, 27px);
  color: var(--steel-shine);
  font-size: clamp(.72rem, 1.05vw, .88rem);
}

.primary-action,
.secondary-action,
.danger-action {
  min-height: 44px;
  border-radius: 3px;
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  letter-spacing: .015em;
}

.primary-action {
  min-height: 50px;
  border: 2px solid var(--gold-dark);
  color: #000;
  background: linear-gradient(to bottom, var(--gold) 0 18%, #e4d800 18% 72%, var(--gold-mid) 72% 100%);
  box-shadow:
    inset 2px 2px 0 #fff885,
    inset -3px -3px 0 var(--gold-dark),
    4px 4px 0 #000;
}

.primary-action:hover {
  transform: translate(-1px, -1px);
  background: linear-gradient(to bottom, #fff86a 0 18%, var(--gold) 18% 72%, #ccc400 72% 100%);
  box-shadow:
    inset 2px 2px 0 #fffbc0,
    inset -3px -3px 0 var(--gold-dark),
    6px 6px 0 #000;
}

.primary-action.compact {
  min-height: 44px;
}

.intro-footnotes {
  color: var(--steel);
  font-size: clamp(.52rem, .67vw, .62rem);
}

.selection-panel,
.mission-panel {
  justify-content: flex-start;
  padding: clamp(29px, 3.5vw, 49px) clamp(33px, 5vw, 70px);
  background: rgba(0, 0, 0, .91);
  box-shadow:
    inset 0 0 0 2px var(--copper-dark),
    inset 0 0 0 4px #5f4020,
    inset 0 0 0 6px var(--copper-bright),
    inset 0 0 0 8px var(--peach),
    inset 0 0 0 9px var(--peach-light);
}

.mission-panel {
  background:
    linear-gradient(to bottom, transparent 0 92%, var(--cobalt-dark) 92% 95%, #000 95%),
    rgba(0, 0, 0, .93);
  box-shadow:
    inset 0 0 0 2px var(--steel-dark),
    inset 0 0 0 4px var(--steel),
    inset 0 0 0 6px var(--steel-light),
    inset 0 0 0 8px var(--steel-dark);
}

.panel-heading {
  margin-bottom: clamp(15px, 2vw, 24px);
}

.panel-heading h2,
.modal-card h2,
.app-dialog h2 {
  color: var(--gold);
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  letter-spacing: -.035em;
  text-shadow: 3px 3px 0 #5f4020, 5px 5px 0 #000;
}

.panel-heading > p:last-child,
.modal-card > p,
.app-dialog header p:last-child {
  color: var(--steel-light);
  font-size: clamp(.69rem, 1.05vw, .88rem);
}

.hero-grid {
  gap: clamp(7px, 1.1vw, 13px);
  padding: clamp(8px, 1.3vw, 14px);
  border: 2px solid var(--cobalt-dark);
  border-radius: 2px;
  background: #000;
  box-shadow: inset 0 4px 0 var(--cobalt-light), inset 0 -4px 0 var(--cobalt-dark);
}

.hero-card {
  padding: clamp(10px, 1.35vw, 15px) 7px 11px;
  border: 2px solid var(--copper-dark);
  border-radius: 3px;
  color: var(--peach-light);
  background: #070707;
  box-shadow:
    inset 2px 2px 0 var(--copper-bright),
    inset -2px -2px 0 #5f4020,
    2px 2px 0 #000;
}

.hero-card::before {
  inset: 0 0 auto;
  height: 5px;
  border-radius: 0;
  background: var(--hero-color, var(--cobalt-light));
  opacity: 1;
  filter: none;
}

.hero-card:hover {
  transform: translateY(-2px);
  border-color: var(--peach);
  background: #100d08;
}

.hero-card[aria-pressed="true"] {
  border-color: var(--gold);
  background: #171300;
  box-shadow:
    inset 2px 2px 0 #fff885,
    inset -2px -2px 0 var(--gold-dark),
    0 0 0 2px #000,
    0 0 0 4px var(--gold);
  transform: translateY(-3px);
}

.hero-card canvas {
  margin-bottom: 7px;
  mix-blend-mode: normal;
  filter: drop-shadow(3px 4px 0 rgba(0, 0, 0, .9));
}

.hero-card strong {
  color: var(--gold);
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  text-shadow: 2px 2px 0 #000;
}

.hero-card small {
  color: var(--steel-light);
  font-size: clamp(.53rem, .72vw, .64rem);
}

.hero-selected {
  top: 7px;
  right: 7px;
  width: 20px;
  height: 20px;
  border: 1px solid #000;
  border-radius: 2px;
  color: #000;
  background: var(--gold);
  box-shadow: 2px 2px 0 #000;
}

.hero-detail {
  margin-top: clamp(13px, 1.8vw, 22px);
  padding: 10px 12px;
  border: 2px solid var(--copper-dark);
  border-radius: 3px;
  background: #050505;
  box-shadow: inset 2px 2px 0 var(--peach), inset -2px -2px 0 #5f4020;
  backdrop-filter: none;
}

.ability-glyph {
  border: 2px solid var(--steel-dark);
  border-radius: 3px;
  color: var(--hero-color, var(--gold));
  background: #111;
  box-shadow: inset 2px 2px 0 var(--steel-light), inset -2px -2px 0 #252525;
}

.hero-detail small {
  color: var(--gold);
}

.hero-detail strong {
  color: var(--steel-shine);
}

.text-button {
  min-height: 40px;
  color: var(--peach-light);
}

.mission-map {
  gap: clamp(8px, 1.25vw, 14px);
  min-height: 0;
  flex: 1 1 auto;
  padding: 3px 7px 8px 3px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--copper-bright) #080808;
  scrollbar-width: thin;
}

.mission-card {
  min-height: clamp(116px, 13.2vw, 152px);
  padding: clamp(11px, 1.4vw, 16px);
  border: 2px solid var(--steel-dark);
  border-radius: 3px;
  color: var(--peach-light);
  background:
    linear-gradient(to bottom, #070707 0 76%, #000025 76% 100%);
  box-shadow:
    inset 0 4px 0 var(--mission-color, var(--cobalt-light)),
    inset 2px 2px 0 var(--steel-light),
    inset -2px -2px 0 #252525,
    3px 3px 0 #000;
}

.mission-card::after {
  right: 0;
  bottom: 0;
  width: 100%;
  height: 8px;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  opacity: .9;
  background: repeating-linear-gradient(90deg, var(--cobalt-dark) 0 20px, var(--cobalt-light) 20px 23px, #000 23px 27px);
  box-shadow: none;
}

.mission-card:not(:disabled):hover {
  border-color: var(--gold);
  background: linear-gradient(to bottom, #171300 0 76%, #000047 76% 100%);
  box-shadow:
    inset 0 4px 0 var(--mission-color, var(--cobalt-light)),
    inset 2px 2px 0 #fff885,
    inset -2px -2px 0 var(--gold-dark),
    4px 4px 0 #000;
  transform: translateY(-2px);
}

.mission-card:disabled {
  filter: grayscale(.7);
  opacity: .52;
}

.mission-number {
  color: var(--steel-light);
  font-size: .58rem;
}

.mission-number > span:first-child {
  padding: 3px 5px;
  color: var(--gold);
  background: var(--cobalt-dark);
  box-shadow: 2px 2px 0 #000;
}

.mission-card strong {
  color: var(--peach-light);
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  font-size: clamp(.72rem, 1.12vw, .96rem);
  text-shadow: 2px 2px 0 #000;
}

.mission-card small {
  color: var(--steel-light);
  font-size: clamp(.54rem, .69vw, .62rem);
  white-space: normal;
}

.mission-complete {
  color: #54d84e;
}

.game-hud {
  gap: 6px;
}

.hud-character,
.hud-center,
.hud-tools {
  min-height: 58px;
  border: 2px solid var(--steel-dark);
  border-radius: 3px;
  background: rgba(0, 0, 0, .92);
  box-shadow:
    inset 1px 1px 0 var(--steel-light),
    inset -1px -1px 0 #252525,
    2px 2px 0 #000;
  backdrop-filter: none;
}

#hud-portrait {
  mix-blend-mode: normal;
}

.hud-character small,
.hud-center small {
  color: var(--steel-light);
}

.hud-character strong,
.hud-center strong {
  color: var(--peach-light);
}

.hud-center {
  border-bottom-color: var(--cobalt-light);
}

.hud-meter-shards,
.hud-meter-score b {
  color: var(--gold);
}

.hud-meter-math {
  color: #00fcfc;
}

.hud-meter-gravity {
  color: #8bcfff;
}

.hud-meter-gravity small {
  color: var(--cobalt-light);
  font-weight: 950;
}

.hud-meter-matches {
  color: #ffb080;
}

.hud-meter-matches small {
  color: #ff7a30;
  font-size: .82rem;
}

.hud-meter-depth {
  color: #d7b2ff;
}

.hud-meter-depth small {
  color: #8e6cff;
  font-weight: 950;
}

.shard-icon {
  background: var(--gold);
  box-shadow: 0 0 6px rgba(252, 244, 0, .6);
}

.hud-button {
  border-width: 1px;
  border-radius: 2px;
}

.hud-button span:last-child {
  color: var(--steel-light);
}

.modal-panel {
  background: rgba(0, 0, 0, .78);
  backdrop-filter: none;
}

.modal-card {
  border: 3px solid var(--steel);
  border-radius: 4px;
  background: #050505;
  box-shadow:
    inset 2px 2px 0 var(--steel-shine),
    inset -2px -2px 0 var(--steel-dark),
    0 0 0 3px var(--copper-dark),
    0 0 0 5px var(--copper-bright),
    12px 14px 0 rgba(0, 0, 0, .7);
}

.modal-symbol {
  border: 2px solid var(--steel-dark);
  border-radius: 3px;
  color: var(--gold);
  background: var(--cobalt-dark);
  box-shadow: inset 2px 2px 0 var(--cobalt-light), inset -2px -2px 0 #00005f, 3px 3px 0 #000;
}

.result-symbol {
  color: #000;
  border-color: var(--gold-dark);
  background: var(--gold);
  box-shadow: inset 2px 2px 0 #fff885, inset -2px -2px 0 var(--gold-dark), 3px 3px 0 #000;
}

.secondary-action,
.danger-action {
  border: 2px solid var(--steel-dark);
  color: var(--peach-light);
  background: #111;
  box-shadow: inset 2px 2px 0 var(--steel-light), inset -2px -2px 0 #252525, 2px 2px 0 #000;
}

.secondary-action:hover {
  border-color: var(--gold-dark);
  color: var(--gold);
  background: #181300;
}

.danger-action {
  color: #ffb0b0;
  border-color: #a70000;
  box-shadow: inset 2px 2px 0 #ff5c5c, inset -2px -2px 0 #590000, 2px 2px 0 #000;
}

.result-stats span {
  border: 1px solid var(--steel-dark);
  border-radius: 2px;
  background: #0a0a0a;
  box-shadow: inset 1px 1px 0 var(--steel);
}

.result-stats small {
  color: var(--steel-light);
}

.result-stats strong {
  color: var(--gold);
}

.toast {
  bottom: 18px;
  border: 2px solid var(--copper-dark);
  border-radius: 3px;
  color: var(--peach-light);
  background: #050505;
  box-shadow: inset 2px 2px 0 var(--peach), inset -2px -2px 0 #5f4020, 4px 4px 0 rgba(0, 0, 0, .8);
}

.play-controls {
  padding-top: 25px;
}

.dpad button,
.dpad-center {
  border-radius: 4px;
}

.dpad button {
  border: 2px solid var(--steel-dark);
  color: #111;
  background: linear-gradient(to bottom, var(--steel-shine) 0 18%, var(--steel-light) 18% 72%, var(--steel) 72% 100%);
  box-shadow: inset 2px 2px 0 #f2f2f2, inset -2px -2px 0 var(--steel-dark), 3px 3px 0 #000;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, .5);
}

.dpad button:hover {
  color: #000;
  border-color: var(--gold-dark);
  background: linear-gradient(to bottom, var(--gold) 0 18%, #e4d800 18% 72%, var(--gold-mid) 72% 100%);
}

.dpad-center {
  color: var(--gold);
  background: var(--cobalt-dark);
  box-shadow: inset 2px 2px 0 var(--cobalt-light), inset -2px -2px 0 #00004f;
}

.round-action {
  border: 2px solid var(--steel-dark);
  border-radius: 6px;
  color: #151515;
  background: linear-gradient(to bottom, var(--steel-shine) 0 18%, var(--steel-light) 18% 72%, var(--steel) 72% 100%);
  box-shadow: inset 2px 2px 0 #f2f2f2, inset -3px -3px 0 var(--steel-dark), 4px 4px 0 #000;
}

.round-action small {
  color: #202020;
  font-weight: 900;
}

.power-action {
  border-color: #2a200f;
  border-radius: 50%;
  color: #000;
  background: linear-gradient(to bottom, var(--gold) 0 18%, #e4d800 18% 70%, var(--gold-mid) 70% 100%);
  box-shadow: inset 4px 4px 0 #fff885, inset -5px -5px 0 var(--gold-dark), 6px 7px 0 #000;
}

.power-action small {
  color: #161300;
}

.power-action i {
  background: rgba(0, 0, 0, .24);
}

.control-hint {
  color: var(--steel);
}

.control-hint kbd {
  color: var(--peach-light);
}

.site-footer {
  margin-top: 22px;
  color: var(--steel);
}

.site-footer span:first-child {
  color: var(--peach);
}

.app-dialog {
  border: 3px solid var(--steel);
  border-radius: 4px;
  color: var(--ink);
  background: #050505;
  box-shadow:
    inset 2px 2px 0 var(--steel-shine),
    inset -2px -2px 0 var(--steel-dark),
    0 0 0 3px var(--copper-dark),
    0 0 0 5px var(--copper-bright),
    14px 16px 0 rgba(0, 0, 0, .75);
}

.app-dialog::backdrop {
  background: rgba(0, 0, 0, .82);
  backdrop-filter: none;
}

.app-dialog header {
  padding-bottom: 16px;
  border-bottom: 6px solid var(--cobalt-dark);
}

.dialog-close {
  border: 2px solid var(--steel-dark);
  border-radius: 3px;
  color: #111;
  background: var(--steel-light);
  box-shadow: inset 2px 2px 0 var(--steel-shine), inset -2px -2px 0 var(--steel-dark);
}

.select-setting,
.range-setting,
.toggle-setting {
  border-top-color: var(--steel-dark);
}

.select-setting small,
.range-setting output,
.toggle-setting small {
  color: var(--steel-light);
}

.select-setting select {
  border: 2px solid var(--steel-dark);
  border-radius: 3px;
  color: var(--peach-light);
  background: #0d0d0d;
  box-shadow: inset 1px 1px 0 var(--steel);
}

.range-setting input {
  accent-color: var(--gold);
}

.toggle-setting i {
  width: 48px;
  height: 26px;
  border: 2px solid var(--steel-dark);
  border-radius: 3px;
  background: #080808;
  box-shadow: inset 1px 1px 0 #000;
}

.toggle-setting i::after {
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 2px;
  background: var(--steel);
  box-shadow: inset 1px 1px 0 var(--steel-shine), inset -1px -1px 0 var(--steel-dark);
}

.toggle-setting input:checked + i {
  border-color: var(--gold-dark);
  background: #242000;
}

.toggle-setting input:checked + i::after {
  background: var(--gold);
  transform: translateX(22px);
}

.help-grid {
  gap: 0;
  border: 1px solid var(--steel-dark);
}

.help-grid section {
  padding: 13px;
  border: 0;
  border-bottom: 1px solid var(--steel-dark);
  border-radius: 0;
  background: #080808;
}

.help-grid section:last-child {
  border-bottom: 0;
}

.help-grid section > span {
  border: 1px solid var(--cobalt-light);
  border-radius: 2px;
  color: var(--gold);
  background: var(--cobalt-dark);
}

.help-grid p {
  color: var(--steel-light);
}

@media (max-width: 860px) {
  .selection-panel,
  .mission-panel {
    padding: 27px 31px;
  }

  .hud-character,
  .hud-center,
  .hud-tools {
    border-radius: 3px;
  }
}

@media (max-width: 680px) {
  body {
    background-position: center top;
    background-size: auto 100vh;
  }

  .sitebar {
    min-height: 48px;
    margin-bottom: 14px;
    padding: 5px;
  }

  .brand-mark {
    width: 39px;
    height: 36px;
    border-radius: 2px;
  }

  .canvas-shell {
    border-radius: 4px;
    box-shadow:
      0 0 0 1px var(--steel-shine),
      0 0 0 3px var(--steel-dark),
      0 0 0 5px var(--copper-bright),
      0 18px 50px rgba(0, 0, 0, .72);
  }

  .intro-panel {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 22px;
    padding: 29px 23px;
    text-align: center;
  }

  .intro-title-artifact {
    width: min(83%, 330px);
    justify-self: center;
  }

  .intro-content {
    width: min(94%, 430px);
    justify-self: center;
    align-items: center;
    text-align: center;
  }

  .legacy-seal {
    width: 52px;
    height: 42px;
    margin-bottom: 9px;
  }

  .intro-lead {
    font-size: .91rem;
  }

  .intro-copy {
    max-width: 390px;
    font-size: .66rem;
  }

  .intro-footnotes {
    justify-content: center;
  }

  .selection-panel,
  .mission-panel {
    padding: 26px 17px;
    box-shadow:
      inset 0 0 0 2px var(--copper-dark),
      inset 0 0 0 4px var(--copper-bright),
      inset 0 0 0 5px var(--peach);
  }

  .mission-panel {
    box-shadow: inset 0 0 0 2px var(--steel-dark), inset 0 0 0 4px var(--steel-light);
  }

  .hero-grid {
    gap: 6px;
    padding: 7px;
  }

  .hero-card {
    border-radius: 2px;
  }

  .hero-detail {
    border-radius: 2px;
  }

  .mission-card {
    min-height: 104px;
    border-radius: 2px;
  }

  .game-hud {
    gap: 3px;
  }

  .hud-meter-gravity:not([hidden]),
  .hud-meter-matches:not([hidden]),
  .hud-meter-depth:not([hidden]) {
    display: flex;
  }

  .hud-character,
  .hud-center,
  .hud-tools {
    border-radius: 2px;
  }

  .toast {
    bottom: 8px;
  }

  .dpad button,
  .dpad-center,
  .round-action {
    border-radius: 3px;
  }

  .power-action {
    border-radius: 50%;
  }
}

@media (max-width: 430px) {
  .brand > span:last-child {
    display: none;
  }

  .intro-panel {
    gap: 17px;
    padding: 22px 14px;
  }

  .intro-title-artifact {
    width: min(88%, 290px);
  }

  .legacy-seal {
    display: none;
  }

  .intro-copy {
    margin-bottom: 15px;
  }

  .intro-footnotes {
    margin-top: 13px;
  }

  .selection-panel,
  .mission-panel {
    padding: 19px 11px;
  }

  .panel-heading {
    margin-bottom: 9px;
  }

  .hero-card {
    padding: 6px 3px 7px;
  }

  .hero-card canvas {
    width: 52px;
  }

  .hero-detail {
    margin-top: 7px;
    padding: 6px;
  }

  .mission-heading > div > p:last-child {
    display: none;
  }

  .mission-map {
    gap: 5px;
  }

  .mission-card {
    min-height: 58px;
    padding: 7px;
  }

  .mission-card small {
    display: none;
  }

  .mission-number {
    font-size: .43rem;
  }

  .mission-card strong {
    font-size: .6rem;
  }

  .hud-center > span:first-child {
    display: none;
  }

  .hud-center {
    grid-template-columns: 1fr;
  }

  .hud-meters {
    justify-content: space-around;
    gap: 4px;
  }

  .hud-meter-math:not([hidden]) {
    display: none;
  }
}

@media (max-width: 360px) {
  .intro-title-artifact {
    width: 75%;
  }

  .intro-copy,
  .intro-footnotes {
    display: none;
  }

  .intro-lead {
    margin-bottom: 13px;
  }

  .panel-heading > p:last-child,
  .hero-detail strong {
    display: none;
  }
}

.rotate-action {
  border-color: #11115f;
  color: var(--gold);
  background: linear-gradient(to bottom, var(--cobalt-light) 0 18%, var(--cobalt) 18% 70%, var(--cobalt-dark) 70% 100%);
  box-shadow: inset 3px 3px 0 #7777ff, inset -4px -4px 0 #00005f, 4px 4px 0 #000;
}

.rotate-action > span {
  color: var(--gold);
  text-shadow: 1px 1px 0 #000;
}

.rotate-action small {
  color: var(--peach-light);
}

.rotate-action:hover {
  border-color: var(--gold-dark);
  background: linear-gradient(to bottom, #6868ff 0 18%, #1717e7 18% 70%, #00008f 70% 100%);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
