:root {
  --bg-deep: #03070f;
  --bg-mid: #0a162a;
  --bg-soft: #14355c;
  --hud: #78e7ff;
  --hud-soft: rgba(120, 231, 255, 0.18);
  --hud-mid: rgba(120, 231, 255, 0.5);
  --warn: #ffbf67;
  --danger: #ff6f61;
  --text: #eaf9ff;
  --text-soft: rgba(234, 249, 255, 0.72);
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at 50% 18%, rgba(120, 231, 255, 0.16), transparent 24%),
    radial-gradient(circle at 15% 15%, rgba(255, 191, 103, 0.14), transparent 18%),
    linear-gradient(180deg, #091220 0%, #050c15 44%, #02060b 100%);
  color: var(--text);
  font-family: "Manrope", Arial, sans-serif;
}

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

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: 38px 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(120, 231, 255, 0.18) 0%, rgba(120, 231, 255, 0.08) 30%, transparent 68%);
  filter: blur(24px);
  pointer-events: none;
}

.background-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 231, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 231, 255, 0.025) 1px, transparent 1px);
  background-size: 70px 70px;
  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 {
  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.7rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 24px rgba(120, 231, 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 {
  padding: 8px 12px;
  border: 1px solid rgba(120, 231, 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(120, 231, 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(120, 231, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 28px;
}

.frame-glow {
  position: absolute;
  inset: 12px;
  border-radius: 24px;
  border: 1px solid rgba(120, 231, 255, 0.08);
  box-shadow: 0 0 80px rgba(120, 231, 255, 0.08), inset 0 0 40px rgba(120, 231, 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(120, 231, 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.06) brightness(0.7);
}

#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.46) 100%);
}

.gridline {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(rgba(120, 231, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 231, 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(120, 231, 255, 0.82), transparent);
  box-shadow: 0 0 18px rgba(120, 231, 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(120, 231, 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);
}

.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(120, 231, 255, 0.1), inset 0 0 20px rgba(120, 231, 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 {
    font-size: 10px;
    letter-spacing: 0.1em;
  }

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

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

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