:root {
  --ink: #fff4ff;
  --purple: #bf62b8;
  --purple-dark: #4c265a;
  --yellow: #ffe68b;
  --blue: #8d8cff;
  --cyan: #77d8ee;
  --peach: #ffd084;
  --black: #050307;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 18%, rgba(191, 98, 184, 0.28), transparent 30%),
    radial-gradient(circle at 82% 16%, rgba(119, 216, 238, 0.16), transparent 24%),
    linear-gradient(135deg, #1b1421, #0c0811 58%, #201427);
  font-family: "Courier New", ui-monospace, monospace;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.home-link {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 13px;
  border: 2px solid var(--purple);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(5, 3, 7, 0.82);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 0 0 4px rgba(191, 98, 184, 0.13), 0 14px 34px rgba(0, 0, 0, 0.28);
}

.arcade-shell {
  width: min(1080px, calc(100% - 28px));
  margin: 0 auto;
  padding: 72px 0 28px;
}

.cabinet {
  overflow: hidden;
  border: 14px solid var(--purple);
  border-radius: 12px;
  background: var(--black);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 28px 70px rgba(0, 0, 0, 0.46),
    inset 0 0 0 4px rgba(0, 0, 0, 0.35);
}

.hud,
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  color: var(--yellow);
  background: #080509;
  text-transform: uppercase;
}

.hud div {
  display: grid;
  gap: 2px;
}

.build-version {
  color: #f6d7ff;
  font-size: clamp(0.95rem, 2.5vw, 1.35rem);
}

.hud span {
  color: var(--purple);
  font-size: clamp(0.7rem, 2vw, 0.9rem);
  font-weight: 900;
}

.hud strong {
  font-size: clamp(1.2rem, 4vw, 2rem);
  line-height: 1;
}

.screen-wrap {
  position: relative;
  background: #000;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  background: #000;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background: rgba(0, 0, 0, 0.78);
}

.overlay.hidden {
  display: none;
}

.overlay h1 {
  margin: 0;
  color: var(--yellow);
  font-size: clamp(2.4rem, 8vw, 5.8rem);
  line-height: 0.9;
  text-shadow: 5px 5px 0 var(--purple-dark);
}

.overlay p {
  max-width: 560px;
  margin: 0;
  color: #f4c3ef;
  line-height: 1.45;
  font-weight: 900;
}

.overlay button,
.controls button {
  min-height: 44px;
  border: 2px solid var(--purple);
  border-radius: 8px;
  color: var(--ink);
  background: #170c19;
  font-weight: 900;
  cursor: pointer;
}

.overlay button {
  width: fit-content;
  min-width: 150px;
  margin: 0 auto;
  color: #1b1421;
  background: var(--yellow);
}

.controls {
  justify-content: center;
  flex-wrap: wrap;
  border-top: 10px solid var(--purple);
}

.controls button {
  min-width: 58px;
  padding: 0 14px;
}

@media (max-width: 640px) {
  .arcade-shell {
    width: min(100% - 12px, 520px);
    padding-top: 66px;
  }

  .cabinet {
    border-width: 8px;
  }

  .hud {
    padding: 8px 10px;
  }
}
