:root {
  --bg: #060000;
  --panel: #100000;
  --red: #ff2a2a;
  --red-soft: #b10000;
  --text: #ff5d5d;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: "Courier New", "Lucida Console", monospace;
  background: radial-gradient(circle at 50% 20%, #180000, var(--bg));
  color: var(--text);
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.vb-shell {
  width: min(100vw, 480px);
  height: 100vh;
  padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}

.brand {
  text-align: center;
  letter-spacing: 0.2em;
  font-size: clamp(0.75rem, 2.5vw, 0.95rem);
  color: #ff8c8c;
  text-shadow: 0 0 8px var(--red);
}

.viewport {
  position: relative;
  border: 1px solid var(--red-soft);
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: inset 0 0 50px #390000, 0 0 20px #220000;
}

.viewport::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 0, 0, 0.08),
    rgba(255, 0, 0, 0.08) 2px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: screen;
  z-index: 5;
}

#gameCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  background: rgba(0, 0, 0, 0.82);
  padding: 18px;
  gap: 10px;
}

.screen.active {
  display: flex;
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  color: #ff2f2f;
  text-shadow: 0 0 14px #ff0000;
  letter-spacing: 0.08em;
}

p {
  line-height: 1.35;
  max-width: 24ch;
}

.hint {
  opacity: 0.75;
  font-size: 0.8rem;
}

.btn {
  border: 1px solid var(--red);
  background: #240000;
  color: #ff7a7a;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  box-shadow: 0 0 10px #5f0000;
}

.btn:active {
  transform: translateY(1px);
}

.btn-secondary {
  border-color: #8a0000;
  color: #d24a4a;
}

@media (min-width: 700px) {
  .vb-shell {
    height: min(100vh, 900px);
  }
}