:root {
  --neon: #18e0ff;
  --frame: #1a1140;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #05030f;
  color: #fff;
  font-family: "Courier New", monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

#cabinet {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 18px 18px;
  background: linear-gradient(180deg, #120a33, #060418);
  border: 2px solid #2b2170;
  border-radius: 14px;
  box-shadow: 0 0 40px rgba(40, 20, 120, 0.6), inset 0 0 30px rgba(0,0,0,0.6);
}

#marquee {
  font-weight: bold;
  font-size: 30px;
  letter-spacing: 6px;
  margin-bottom: 12px;
  color: #ff3b5c;
  text-shadow: 0 0 8px #ff3b5c, 0 0 18px #b0002a;
}

#screen {
  background: #000;
  border: 2px solid #2b2170;
  border-radius: 6px;
  image-rendering: pixelated;
  box-shadow: 0 0 24px rgba(24, 224, 255, 0.25);
  /* scale up from the native 448x576 while keeping the aspect ratio crisp;
     height-driven so it stays centred and never overflows the viewport */
  aspect-ratio: 448 / 576;
  height: min(760px, 88vh);
  width: auto;
  max-width: 94vw;
}

#controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: center;
  align-items: flex-start;
  margin-top: 14px;
}

.ctl {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ctl .keys {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ctl kbd {
  font-family: "Courier New", monospace;
  font-size: 12px;
  font-weight: bold;
  color: #dfe7ff;
  background: linear-gradient(180deg, #2a2270, #171041);
  border: 1px solid #4b3fa0;
  border-bottom-width: 2px;
  border-radius: 5px;
  min-width: 20px;
  padding: 3px 6px;
  text-align: center;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

.ctl .lbl {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #8fa0d8;
}

.ctl .alt {
  font-size: 9px;
  color: #5566a0;
  margin: 0 1px;
}

/* visually hidden but available to assistive tech */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- on-screen controls (touch devices only) ---- */
#touch-controls {
  display: none;
  width: 100%;
  margin-top: 12px;
  gap: 12px;
  justify-content: space-between;
}
.tbtn {
  flex: 1;
  max-width: 130px;
  height: 66px;
  border-radius: 12px;
  border: 1px solid #4b3fa0;
  background: linear-gradient(180deg, #2a2270, #171041);
  color: #dfe7ff;
  font-size: 26px;
  font-weight: bold;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
}
.tbtn:active { background: #3a2f90; }
.tbtn.fire { color: #ff6b8a; border-color: #7a2f55; }

@media (pointer: coarse) {
  #touch-controls { display: flex; }
  #controls { display: none; }
  #screen { height: min(760px, 66vh); touch-action: none; }
}
/* Accessibility: honor prefers-reduced-motion — neutralize animations,
   transitions, and motion effects (pulse, shake, drop, blink, glows). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
