:root {
  color-scheme: dark;
  --cabinet: #0b0b10;
  --amber: #ffd56b;
  --red: #f25148;
  --cyan: #69d9ff;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -20%, rgba(255, 64, 70, 0.25), transparent 34%),
    linear-gradient(180deg, #261017 0%, #09090e 54%, #020204 100%);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

.cabinet {
  width: 100vw;
  height: 100dvh;
  display: grid;
  place-items: center;
  position: relative;
  background:
    linear-gradient(90deg, rgba(255, 213, 107, 0.11), transparent 18%, transparent 82%, rgba(105, 217, 255, 0.1)),
    radial-gradient(circle at 50% 100%, rgba(242, 81, 72, 0.18), transparent 45%);
}

canvas {
  width: min(100vw, calc(100dvh * 16 / 9));
  height: min(100dvh, calc(100vw * 9 / 16));
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #050509;
  border: 4px solid #09080d;
  box-shadow:
    0 0 0 2px rgba(255, 213, 107, 0.38),
    0 28px 80px rgba(0, 0, 0, 0.72),
    inset 0 0 80px rgba(0, 0, 0, 0.45);
}

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.18;
  mix-blend-mode: soft-light;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.2) 0 1px, transparent 1px 4px);
}

.boot-status {
  position: fixed;
  left: 12px;
  bottom: 10px;
  z-index: 5;
  padding: 5px 8px;
  border: 1px solid rgba(255, 213, 107, 0.45);
  background: rgba(5, 5, 9, 0.78);
  color: #fff4cf;
  font: 800 12px/1.2 Consolas, monospace;
  pointer-events: none;
}

.boot-status.ready {
  opacity: 0;
}

.boot-status.error {
  color: #ff8a80;
  opacity: 1;
}

.mobile-controls {
  position: fixed;
  inset: auto 8px 8px;
  display: none;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.mobile-controls button {
  pointer-events: auto;
  min-width: 48px;
  min-height: 44px;
  border: 1px solid rgba(255, 213, 107, 0.45);
  border-radius: 8px;
  background: rgba(8, 8, 12, 0.72);
  color: #fff4cf;
  font: 800 13px/1 system-ui, sans-serif;
  text-shadow: 0 2px 0 #000;
}

.pad,
.actions {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  gap: 6px;
}

.pad button:nth-child(1) { grid-column: 1; grid-row: 2; }
.pad button:nth-child(2) { grid-column: 2; grid-row: 1; }
.pad button:nth-child(3) { grid-column: 3; grid-row: 2; }
.pad button:nth-child(4) { grid-column: 2; grid-row: 3; }

@media (pointer: coarse) {
  .mobile-controls { display: flex; }
}
