:root {
  --bg: #1a1020;
  --bg2: #2b1a3a;
  --ink: #f6ead2;
  --gold: #ffd23f;
  --red: #d8322f;
  --orange: #f6a85a;
  --green: #7fc35b;
  --mono: "Courier New", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -10%, #5a2a55 0%, transparent 60%),
    linear-gradient(180deg, var(--bg2), var(--bg) 60%);
  color: var(--ink);
  font-family: var(--mono);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.crt {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 50;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.lang {
  position: absolute; top: 14px; right: 16px; z-index: 60;
  display: flex; border: 3px solid #000; border-radius: 8px; overflow: hidden;
  box-shadow: 0 0 0 2px #5b3a6b;
}
.lang button {
  font: bold 13px var(--mono);
  padding: 5px 10px;
  border: 0;
  background: #2b1a3a;
  color: #cdb9e0;
  cursor: pointer;
  letter-spacing: .08em;
}
.lang button + button { border-left: 2px solid #000; }
.lang button[aria-pressed="true"] { background: var(--gold); color: #1a1020; }
.lang button:hover:not([aria-pressed="true"]) { background: #3f2852; color: #fff; }
.lang button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.hero { text-align: center; padding: 56px 16px 24px; }
.eyebrow { color: var(--orange); letter-spacing: .3em; font-size: 13px; margin: 0 0 12px; font-weight: bold; }
.name {
  margin: 0;
  font-size: clamp(40px, 9vw, 92px);
  line-height: .95;
  letter-spacing: .04em;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 4px 4px 0 var(--red), 8px 8px 0 #000;
}
.name span { display: inline-block; }
.tag { margin: 20px 0 0; letter-spacing: .25em; font-size: 14px; color: #cdb9e0; }
.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

main { max-width: 980px; margin: 0 auto; padding: 0 16px 40px; }

.cabinet {
  background: linear-gradient(180deg, #3a2347, #24152e);
  border: 4px solid #000;
  box-shadow: 0 0 0 4px #5b3a6b, 0 20px 60px rgba(0,0,0,.6);
  border-radius: 14px;
  padding: 14px 14px 18px;
}
.marquee {
  text-align: center;
  font-weight: 900;
  font-size: clamp(18px, 4vw, 30px);
  letter-spacing: .25em;
  color: #fff;
  background: linear-gradient(90deg, var(--red), var(--orange), var(--red));
  border: 3px solid #000;
  border-radius: 6px;
  padding: 6px 0;
  margin-bottom: 12px;
  text-shadow: 2px 2px 0 #000;
}
.screen {
  background: #000;
  border: 6px solid #000;
  border-radius: 10px;
  box-shadow: inset 0 0 30px rgba(0,0,0,.9);
  overflow: hidden;
}
#game {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 384 / 216;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  outline: none;
}
.controls {
  list-style: none;
  margin: 14px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center;
  font-size: 13px; color: #d9c8ea;
}
kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  margin-right: 3px;
  border: 2px solid #000;
  border-bottom-width: 4px;
  border-radius: 5px;
  background: #efe3c8;
  color: #1a1020;
  font: bold 12px var(--mono);
  text-align: center;
}

/* touch controls */
.touch { display: none; position: relative; margin-top: 14px; height: 150px; user-select: none; -webkit-user-select: none; touch-action: none; }
.touch button {
  position: absolute;
  border: 3px solid #000;
  border-radius: 50%;
  font: bold 13px var(--mono);
  color: #1a1020;
  background: #efe3c8;
  box-shadow: 0 4px 0 #000;
  touch-action: none;
}
.touch button.on { transform: translateY(3px); box-shadow: 0 1px 0 #000; filter: brightness(.85); }
.dpad { position: absolute; left: 8px; top: 0; width: 150px; height: 150px; }
.dpad button { width: 50px; height: 50px; border-radius: 10px; font-size: 18px; }
.dpad .up { left: 50px; top: 0; }
.dpad .down { left: 50px; top: 100px; }
.dpad .left { left: 0; top: 50px; }
.dpad .right { left: 100px; top: 50px; }
.abtns { position: absolute; right: 8px; top: 0; width: 190px; height: 150px; }
.abtns button { width: 62px; height: 62px; }
.abtns .b1 { right: 0; top: 52px; background: var(--red); color: #fff; }
.abtns .b2 { right: 66px; top: 84px; background: var(--gold); }
.abtns .b3 { right: 92px; top: 6px; background: var(--green); font-size: 11px; }
.startbtn { left: 50%; top: 110px; transform: translateX(-50%); width: 72px; height: 30px; border-radius: 15px !important; font-size: 11px !important; }
.startbtn.on { transform: translateX(-50%) translateY(3px); }
@media (pointer: coarse) {
  .touch { display: block; }
  .controls { display: none; }
}

.about {
  margin-top: 28px;
  background: rgba(0,0,0,.25);
  border: 3px solid #000;
  box-shadow: 0 0 0 3px #5b3a6b;
  border-radius: 10px;
  padding: 18px 22px;
}
.about h2 { margin: 0 0 8px; color: var(--green); letter-spacing: .2em; font-size: 18px; }
.about p { margin: 8px 0; max-width: 70ch; }
.about strong { color: var(--gold); }
.hint { color: var(--orange); font-size: 14px; }

footer { text-align: center; padding: 18px 16px 30px; font-size: 13px; color: #a893bd; letter-spacing: .08em; }
