:root {
  --ink: #08090f;
  --cyan: #5ff6ff;
  --hot: #ff4168;
  --amber: #ffc857;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 50% 0%, #1c2340 0%, #0a0c18 55%, #05060b 100%);
  color: #d9e3f5;
  font-family: "Courier New", Courier, monospace;
  overflow-x: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 12px 26px;
}

#cabinet {
  width: min(100%, 1000px);
  margin: 0 auto;
}

#marquee {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 6px 18px;
  padding: 10px 12px 12px;
  border: 2px solid #2b3a5c;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, #141a31, #090d1a);
  box-shadow: inset 0 1px 0 #3e557e, 0 -8px 30px rgba(95, 246, 255, 0.07);
}

.marquee-title {
  font-size: clamp(20px, 4.4vw, 38px);
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--hot);
  text-shadow: 0 0 6px rgba(255, 65, 104, 0.8), 2px 2px 0 #381036;
}

.marquee-sub {
  font-size: clamp(9px, 1.5vw, 13px);
  letter-spacing: 0.14em;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(95, 246, 255, 0.55);
}

#screen-wrap {
  position: relative;
  border: 2px solid #2b3a5c;
  border-radius: 0 0 10px 10px;
  background: var(--ink);
  padding: 8px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.7), inset 0 0 40px rgba(0, 0, 0, 0.9);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #111;
  border-radius: 3px;
}

#rotate-hint {
  display: none;
  padding: 8px 4px 2px;
  text-align: center;
  color: var(--amber);
  font-size: 11px;
  letter-spacing: 0.1em;
}

#instructions {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #24304b;
  border-radius: 8px;
  background: rgba(9, 13, 26, 0.85);
  color: #8fa1bd;
  font-size: clamp(9px, 1.5vw, 12px);
  line-height: 1.7;
  text-align: center;
}

#instructions strong { color: var(--amber); font-weight: 700; }

#touch-controls {
  display: none;
  gap: 10px;
  justify-content: space-between;
  margin-top: 12px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.touch-pad, .touch-actions { display: flex; flex-direction: column; gap: 6px; }
.touch-row { display: flex; gap: 6px; }
.touch-actions { display: grid; grid-template-columns: repeat(3, 1fr); align-content: start; }

#touch-controls button {
  min-width: 46px;
  min-height: 44px;
  border: 1px solid #39517a;
  border-radius: 8px;
  background: #15203a;
  color: var(--cyan);
  font: 700 11px "Courier New", monospace;
  letter-spacing: 0.04em;
  touch-action: manipulation;
}

#touch-controls button:active { background: #2b3f6b; color: #fff; }

@media (pointer: coarse) {
  #touch-controls { display: flex; }
}

@media (max-width: 560px) and (orientation: portrait) {
  #rotate-hint { display: block; }
}
