/* SturmVektor — cabinet framing. The canvas resizes its own logical resolution to the
   viewport (see resize() in game.js); CSS only ever scales it uniformly. */

:root {
  --deep: #201080;
  --ink: #05060c;
  --white: #f0f0f0;
  --amber: #f8b800;
  --grey: #606060;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100dvh;
  background: radial-gradient(ellipse at 50% 0%, #16183a 0%, var(--ink) 60%, #000 100%);
  color: var(--white);
  font: 12px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  display: flex;
  justify-content: center;
  padding: 12px;
  overflow: hidden;
  -webkit-font-smoothing: none;
}

.cab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 1100px;
  height: 100%;
  min-height: 0;          /* lets .screen actually shrink inside the flex column */
}

/* Echoes the in-game wordmark: gunmetal with an electric-blue rim, slightly
   italic. The canvas logo is the real one; this is just the page heading. */
.logo {
  margin: 0;
  font-size: 22px;
  letter-spacing: 5px;
  font-style: italic;
  text-transform: uppercase;
  background: linear-gradient(#f0f0f0 0%, #bcbcbc 38%, #606060 62%, #303030 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 0 rgba(60, 188, 252, .35);
  flex: none;
}

.logo span {
  background: linear-gradient(#f0f0f0 0%, #bcbcbc 38%, #3cbcfc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub {
  margin: -4px 0 0;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--grey);
  flex: none;
}

.sub em { color: #8a8fa8; font-style: normal; }

/* The bezel takes all remaining height; the canvas fills it and JS matches the
   playfield's logical aspect to this box. */
.screen {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  padding: 8px;
  border-radius: 10px;
  background: linear-gradient(#22242e, #101119);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .06),
    0 18px 50px rgba(0, 0, 0, .8),
    0 0 60px rgba(32, 16, 128, .35);
}

canvas {
  position: absolute;
  inset: 8px;
  display: block;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  object-fit: contain;      /* never distort, even when the aspect clamp kicks in */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
  border-radius: 3px;
  touch-action: none;
}

.scanlines {
  position: absolute;
  inset: 8px;
  pointer-events: none;
  border-radius: 3px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, .22) 0px,
    rgba(0, 0, 0, .22) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}

.keys {
  margin: 0;
  color: var(--grey);
  font-size: 10px;
  text-align: center;
  max-width: 620px;
  flex: none;
}

kbd {
  display: inline-block;
  min-width: 16px;
  padding: 1px 4px;
  margin: 0 1px;
  border: 1px solid #33364a;
  border-bottom-width: 2px;
  border-radius: 3px;
  background: #1a1c26;
  color: #c9cde0;
  font: inherit;
}

/* On a phone the playfield gets the whole viewport — the chrome is desktop garnish. */
@media (max-width: 820px), (max-height: 620px) {
  body { padding: 0; }
  .cab { gap: 0; }
  .logo, .sub, .keys { display: none; }
  .screen { padding: 0; border-radius: 0; box-shadow: none; background: #000; }
  canvas, .scanlines { inset: 0; width: 100%; height: 100%; border-radius: 0; }
}

@media (pointer: coarse) {
  .keys { display: none; }
}
