:root {
  --bg-deep: #04070f;
  --bg-mid: #0a1528;
  --bg-soft: #183a56;
  --hud: #62ddff;
  --hud-soft: rgba(98, 221, 255, 0.18);
  --hud-mid: rgba(98, 221, 255, 0.46);
  --warn: #ffbe62;
  --danger: #ff6f72;
  --text: #e3f8ff;
  --text-soft: rgba(227, 248, 255, 0.7);
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at top center, rgba(98, 221, 255, 0.18), transparent 28%),
    radial-gradient(circle at 18% 18%, rgba(255, 190, 98, 0.12), transparent 20%),
    linear-gradient(180deg, #07101c 0%, #040913 42%, #010409 100%);
  color: var(--text);
  font-family: "Manrope", Arial, sans-serif;
}

code {
  color: #fff;
  font-size: 12px;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: 40px 28px 32px;
  overflow: hidden;
}

.background-aura {
  position: absolute;
  inset: auto auto 10% 50%;
  width: 48rem;
  height: 48rem;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(98, 221, 255, 0.18) 0%, rgba(98, 221, 255, 0.08) 30%, transparent 68%);
  filter: blur(24px);
  pointer-events: none;
}

.background-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(98, 221, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(98, 221, 255, 0.025) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 88%);
  pointer-events: none;
}

.hero {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto 24px;
  text-align: center;
}

.eyebrow,
.title,
.overlay-kicker,
.overlay-card h2,
.overlay-value {
  font-family: "Orbitron", Arial, sans-serif;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.42em;
  color: var(--hud);
}

.hero h1 {
  margin: 0;
  font-family: "Orbitron", Arial, sans-serif;
  font-size: clamp(2rem, 4vw, 4.6rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 24px rgba(98, 221, 255, 0.12);
}

.lead {
  max-width: 760px;
  margin: 14px auto 0;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.65;
}

.hero-strip {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
}

.hero-strip span,
.overlay-actions span {
  padding: 8px 12px;
  border: 1px solid rgba(98, 221, 255, 0.22);
  background: rgba(6, 18, 30, 0.6);
  color: rgba(234, 249, 255, 0.8);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.layout {
  position: relative;
  z-index: 1;
  max-width: 1540px;
  margin: 0 auto;
}

.stage-frame {
  position: relative;
  padding: 18px;
  border: 1px solid rgba(98, 221, 255, 0.18);
  background: linear-gradient(180deg, rgba(5, 17, 31, 0.9), rgba(5, 17, 31, 0.56));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.34), inset 0 0 40px rgba(98, 221, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 28px;
}

.frame-glow {
  position: absolute;
  inset: 12px;
  border-radius: 24px;
  border: 1px solid rgba(98, 221, 255, 0.08);
  box-shadow: 0 0 80px rgba(98, 221, 255, 0.08), inset 0 0 40px rgba(98, 221, 255, 0.04);
  pointer-events: none;
}

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: min(74vh, 760px);
  background: #000;
  border: 1px solid rgba(98, 221, 255, 0.16);
  overflow: hidden;
  border-radius: 22px;
}

video,
canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

video {
  transform: scaleX(-1);
  filter: saturate(0.9) contrast(1.04) brightness(0.62);
}

#gameCanvas,
.gridline,
.scanline,
.vignette {
  pointer-events: none;
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at center, transparent 30%, rgba(1, 8, 14, 0.18) 58%, rgba(1, 4, 8, 0.52) 100%);
}

.gridline {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(rgba(98, 221, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(98, 221, 255, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
}

.scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  z-index: 2;
  background: linear-gradient(90deg, transparent, rgba(98, 221, 255, 0.82), transparent);
  box-shadow: 0 0 18px rgba(98, 221, 255, 0.62);
  animation: scan 4.2s linear infinite;
}

.hint {
  position: absolute;
  left: 50%;
  top: 16px;
  z-index: 4;
  transform: translateX(-50%);
  padding: 8px 14px;
  border: 1px solid rgba(98, 221, 255, 0.34);
  background: rgba(7, 19, 26, 0.72);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-align: center;
  border-radius: 999px;
  max-width: calc(100% - 32px);
}

.stage-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at center, rgba(4, 14, 24, 0.18), rgba(1, 8, 14, 0.8) 72%),
    linear-gradient(180deg, rgba(3, 10, 18, 0.34), rgba(3, 10, 18, 0.78));
  transition: opacity 180ms ease, visibility 180ms ease;
}

.stage-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.overlay-card {
  width: min(100%, 740px);
  padding: 28px 30px;
  border: 1px solid rgba(98, 221, 255, 0.28);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(5, 16, 29, 0.92), rgba(4, 11, 19, 0.72));
  box-shadow: 0 0 48px rgba(98, 221, 255, 0.12), inset 0 0 24px rgba(98, 221, 255, 0.06);
  backdrop-filter: blur(10px);
  text-align: center;
}

.overlay-kicker {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.34em;
  color: var(--warn);
}

.overlay-card h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f5fcff;
}

.overlay-text {
  max-width: 560px;
  margin: 14px auto 0;
  color: var(--text-soft);
  font-size: 0.98rem;
  line-height: 1.65;
}

.overlay-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.overlay-metric {
  padding: 14px 16px;
  border: 1px solid rgba(98, 221, 255, 0.18);
  border-radius: 18px;
  background: rgba(8, 19, 31, 0.62);
}

.overlay-label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(234, 249, 255, 0.56);
}

.overlay-value {
  display: block;
  font-size: 1rem;
  color: #fff4dc;
}

.overlay-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
}

.panel {
  position: absolute;
  z-index: 3;
  border: 1px solid var(--hud-mid);
  background: linear-gradient(180deg, rgba(8, 20, 33, 0.88), rgba(8, 20, 33, 0.52));
  box-shadow: 0 0 20px rgba(98, 221, 255, 0.1), inset 0 0 20px rgba(98, 221, 255, 0.04);
  backdrop-filter: blur(8px);
}

.top-left {
  left: 18px;
  top: 18px;
  width: 270px;
  padding: 12px 14px;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
}

.top-right {
  right: 18px;
  top: 18px;
  width: 300px;
  padding: 12px 14px;
  clip-path: polygon(18px 0, 100% 0, 100% 100%, 0 100%, 0 18px);
}

.bottom-left {
  left: 18px;
  bottom: 18px;
  width: 320px;
  padding: 12px 14px;
}

.bottom-right {
  right: 18px;
  bottom: 18px;
  width: 320px;
  padding: 12px 14px;
}

.title {
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--hud);
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0;
  font-size: 12px;
}

.label {
  color: rgba(234, 249, 255, 0.62);
}

.value {
  color: #f7fdff;
  text-align: right;
}

@keyframes scan {
  0% { transform: translateY(0); }
  50% { transform: translateY(100%); }
  100% { transform: translateY(0); }
}

@media (max-width: 860px) {
  .app-shell {
    padding: 20px 14px 18px;
  }

  .stage-frame {
    padding: 10px;
    border-radius: 18px;
  }

  .stage {
    min-height: 78vh;
    aspect-ratio: auto;
  }

  .panel {
    transform: scale(0.92);
    transform-origin: top left;
  }

  .top-right {
    transform-origin: top right;
  }

  .bottom-right {
    transform-origin: bottom right;
  }

  .bottom-left {
    transform-origin: bottom left;
  }
}

@media (max-width: 640px) {
  .hero-strip {
    gap: 8px;
  }

  .hero-strip span,
  .overlay-actions span {
    font-size: 10px;
    letter-spacing: 0.1em;
  }

  .hint {
    top: 12px;
    font-size: 11px;
    border-radius: 16px;
  }

  .stage-overlay {
    padding: 18px;
  }

  .overlay-card {
    padding: 22px 18px;
    border-radius: 22px;
  }

  .overlay-metrics {
    grid-template-columns: 1fr;
  }

  .panel {
    position: static;
    width: auto;
    clip-path: none;
    transform: none;
    margin: 10px;
  }

  .stage {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }
}
