:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  background: #0c1118;
  color: #f3f6fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(55, 93, 138, 0.22), transparent 40%),
    linear-gradient(180deg, #0d1722 0%, #0b0f15 100%);
}

body.game-active {
  overflow: hidden;
}

body.menu-active {
  overflow: hidden;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

body.game-active .app-shell {
  padding: 0;
  display: block;
}

body.game-active .screen {
  width: 100vw;
}

body.menu-active .app-shell {
  padding: 0;
  display: block;
}

body.menu-active .screen {
  width: 100vw;
}

.screen {
  width: min(1120px, 100%);
}

#menu-screen {
  width: 100vw;
  min-height: 100vh;
}

.menu-hero {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
}

.menu-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(8px);
  transform: scale(1.05);
}

.menu-video-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 10, 16, 0.22) 0%, rgba(6, 10, 16, 0.46) 100%),
    rgba(10, 16, 24, 0.08);
}

.hidden {
  display: none !important;
}

.panel {
  background: rgba(11, 16, 24, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.hero-panel,
.round-panel,
.overlay-panel {
  padding: 32px;
}

.hero-panel {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: 64px;
  background: rgba(0, 0, 0, 0.92);
}

.hero-panel h1,
.round-copy h2,
.overlay-panel h2 {
  margin: 0 0 18px;
  line-height: 1.05;
}

.hero-panel h1 {
  font-size: clamp(2.4rem, 5vw, 4.4rem);
}

.round-copy h2,
.overlay-panel h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.lede,
#round-text,
#overlay-text {
  max-width: 56ch;
  margin-bottom: 32px;
  line-height: 1.5;
  color: #c8d3e2;
}

.eyebrow,
.meta-label {
  display: block;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: #8da3bf;
  margin-bottom: 8px;
}

.meta-grid,
.round-stats {
  display: grid;
  gap: 16px;
  margin: 32px 0;
}

.meta-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.round-panel {
  display: grid;
  gap: 24px;
  align-items: center;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 420px);
}

.preview-wrap {
  display: flex;
  justify-content: center;
}

#preview-canvas,
#game-canvas {
  display: block;
  image-rendering: pixelated;
}

#preview-canvas {
  width: min(100%, 420px);
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #d0d0d0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

button {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  font: inherit;
  cursor: pointer;
}

.primary-btn {
  background: #d7e5f8;
  color: #09111d;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #eff4fb;
}

.game-frame {
  position: relative;
  width: 100vw;
  height: 100vh;
  margin: 0 auto;
  overflow: hidden;
}

#game-canvas {
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: cover;
  object-position: center;
}

.hud {
  position: absolute;
  inset: 16px 16px auto;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 1.38rem;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}

.hud span {
  min-width: 0;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.5);
}

.overlay-panel {
  width: min(520px, 100%);
}

.overlay-minimap-wrap {
  margin-top: 20px;
}

#overlay-minimap {
  display: block;
  width: min(100%, 320px);
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #d0d0d0;
}

@media (max-width: 860px) {
  .round-panel {
    grid-template-columns: 1fr;
  }

  .hud {
    flex-direction: column;
    align-items: flex-start;
  }

  .menu-hero {
    padding: 16px;
  }

  .hero-panel {
    padding: 40px 24px;
  }
}
