/* ═══════════════════════════════════════════════
   CVJ GAME — STYLE.CSS
   Cyberpunk / Pantheon Netflix Aesthetic
═══════════════════════════════════════════════ */

:root {
  --cyan: #00f5ff;
  --magenta: #ff00aa;
  --gold: #ffd700;
  --purple: #9d00ff;
  --green: #00ff8c;
  --red: #ff2244;
  --dark: #03050f;
  --darker: #010208;
  --panel: rgba(0, 245, 255, 0.06);
  --border: rgba(0, 245, 255, 0.2);
  --text: #c8d8e8;
  --font-hud: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  background: var(--darker);
  color: var(--text);
  font-family: var(--font-body);
  overflow: hidden;
  user-select: none;
}

/* ── SCREENS ───────────────────────────────── */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--darker);
}

.screen.active {
  display: flex;
}

/* Scanlines overlay */
.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.18) 2px,
      rgba(0, 0, 0, 0.18) 4px);
  z-index: 100;
}

/* ── GLITCH BG ─────────────────────────────── */
.glitch-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(157, 0, 255, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(0, 245, 255, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 60% 80%, rgba(255, 0, 170, 0.08) 0%, transparent 50%);
  animation: bgPulse 6s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% {
    opacity: 0.7;
  }

  100% {
    opacity: 1;
  }
}

/* ── START SCREEN ──────────────────────────── */
.start-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
  padding: 24px;
}

.logo-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--cyan);
  text-transform: uppercase;
  opacity: 0.8;
}

.game-title {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 0;
}

.title-line1 {
  font-family: var(--font-hud);
  font-size: clamp(22px, 4vw, 42px);
  font-weight: 400;
  letter-spacing: 12px;
  color: var(--text);
  text-transform: uppercase;
}

.title-line2 {
  font-family: var(--font-hud);
  font-size: clamp(60px, 12vw, 120px);
  font-weight: 900;
  letter-spacing: 6px;
  background: linear-gradient(135deg, var(--cyan), var(--purple), var(--magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  filter: drop-shadow(0 0 30px rgba(0, 245, 255, 0.4));
  animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  0% {
    filter: drop-shadow(0 0 20px rgba(0, 245, 255, 0.3));
  }

  100% {
    filter: drop-shadow(0 0 50px rgba(157, 0, 255, 0.6));
  }
}

.title-sub {
  font-family: var(--font-hud);
  font-size: clamp(12px, 2vw, 18px);
  font-weight: 400;
  letter-spacing: 18px;
  color: var(--magenta);
  text-transform: uppercase;
  margin-top: 4px;
}

.title-glitch {
  position: absolute;
  font-family: var(--font-hud);
  font-size: clamp(60px, 12vw, 120px);
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--cyan);
  opacity: 0.07;
  animation: glitchShift 4s infinite;
  pointer-events: none;
}

@keyframes glitchShift {

  0%,
  94%,
  100% {
    transform: translate(0, 0);
    clip-path: none;
  }

  95% {
    transform: translate(-3px, 1px);
    clip-path: inset(20% 0 60% 0);
  }

  97% {
    transform: translate(3px, -1px);
    clip-path: inset(60% 0 10% 0);
  }
}

.start-desc {
  font-size: 16px;
  color: var(--text);
  max-width: 500px;
  line-height: 1.6;
}

.highlight {
  color: var(--cyan);
  font-weight: 700;
}

.controls-hint {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.ctrl-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(200, 216, 232, 0.7);
  font-family: var(--font-mono);
}

kbd {
  background: rgba(0, 245, 255, 0.1);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cyan);
}

.footer-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(0, 245, 255, 0.3);
  text-transform: uppercase;
}

/* ── BUTTONS ───────────────────────────────── */
.btn-primary {
  position: relative;
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.15), rgba(157, 0, 255, 0.15));
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: var(--font-hud);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 3px;
  padding: 14px 40px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.3s;
  overflow: hidden;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-primary:hover {
  color: var(--darker);
  box-shadow: 0 0 25px rgba(0, 245, 255, 0.5);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary .btn-label {
  position: relative;
  z-index: 1;
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(200, 216, 232, 0.3);
  color: rgba(200, 216, 232, 0.6);
  font-family: var(--font-hud);
  font-size: 13px;
  letter-spacing: 2px;
  padding: 10px 28px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.3s;
}

.btn-secondary:hover {
  border-color: var(--magenta);
  color: var(--magenta);
}

.btn-primary.small,
.btn-secondary.small {
  font-size: 12px;
  padding: 10px 24px;
}

/* ── HUD ───────────────────────────────────── */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(1, 2, 8, 0.85);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.hud-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 3px;
  color: rgba(0, 245, 255, 0.5);
  text-transform: uppercase;
  margin-bottom: 3px;
}

#hud-left,
#hud-right {
  display: flex;
  flex-direction: column;
  min-width: 140px;
}

#hud-right {
  align-items: flex-end;
}

.hp-bar-wrap {
  width: 140px;
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════
   9. MOBILE CONTROLS (HUD)
═══════════════════════════════════════════════ */
#mobile-controls {
  display: none;
  /* hidden by default on desktop */
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 100%;
  pointer-events: none;
  /* let touches pass through empty spaces */
  z-index: 80;
  justify-content: space-between;
  padding: 0 15px;
  user-select: none;
  -webkit-user-select: none;
}

#m-dpad,
#m-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  pointer-events: auto;
  /* Buttons catch touch */
}

.m-btn {
  background: rgba(10, 20, 30, 0.6);
  border: 1px solid rgba(0, 245, 255, 0.3);
  color: rgba(200, 230, 255, 0.8);
  border-radius: 8px;
  font-family: inherit;
  font-size: 24px;
  font-weight: bold;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.5);
  transition: all 0.05s;
}

.m-btn.pressed {
  background: rgba(0, 245, 255, 0.4);
  color: #fff;
  border-color: #00f5ff;
  transform: translateY(4px);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0), 0 0 15px rgba(0, 245, 255, 0.8);
}

#m-dpad .m-btn {
  width: 55px;
  height: 55px;
}

#btn-down {
  height: 40px;
  align-self: flex-end;
  /* slightly smaller/lower */
}

#m-actions {
  flex-wrap: wrap-reverse;
  justify-content: flex-end;
  max-width: 180px;
}

#m-actions .m-btn.text {
  font-size: 12px;
  width: 50px;
  height: 35px;
  border-radius: 4px;
  border-color: #ff00aa;
  color: #ff00aa;
}

#m-actions .m-btn.text.pressed {
  background: rgba(255, 0, 170, 0.4);
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 0, 170, 0.8);
}

#m-actions .m-btn.round {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-left: 10px;
}

#btn-interact {
  width: 40px !important;
  height: 40px !important;
  margin-bottom: 20px;
  border-color: #ffd700;
  color: #ffd700;
  font-size: 16px;
}

#btn-interact.pressed {
  background: rgba(255, 215, 0, 0.4);
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

/* Show controls only on touch devices or small screens */
@media (pointer: coarse),
(max-width: 768px) {
  #mobile-controls {
    display: flex;
  }

  #dialogue-box {
    bottom: 90px;
  }

  /* lift dialogue above controls */
}

#hp-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--green), #00cc6a);
  transition: width 0.3s, background 0.5s;
  border-radius: 2px;
}

#hp-text {
  position: absolute;
  right: 4px;
  top: -1px;
  font-size: 8px;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.7);
}

#hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#hud-stage-badge {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

#hud-stage-num {
  font-family: var(--font-hud);
  font-size: 24px;
  font-weight: 900;
  color: var(--cyan);
  line-height: 1;
}

#hud-stage-name {
  font-family: var(--font-hud);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--magenta);
  text-transform: uppercase;
}

.cvj-dots {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(0, 245, 255, 0.3);
  background: transparent;
  transition: all 0.4s;
}

.dot.done {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}

.dot.active {
  background: var(--magenta);
  border-color: var(--magenta);
  box-shadow: 0 0 8px var(--magenta);
  animation: dotPulse 1s infinite;
}

@keyframes dotPulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0.4
  }
}

#hud-score,
#hud-coins {
  font-family: var(--font-hud);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
}

/* ── CANVAS ────────────────────────────────── */
#screen-game {
  padding-top: 56px;
}

#game-canvas {
  display: block;
  width: 100%;
  height: calc(100vh - 56px);
  image-rendering: pixelated;
}

/* ── DIALOGUE ──────────────────────────────── */
#dialogue-box {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(700px, 90vw);
  background: rgba(1, 2, 8, 0.92);
  border: 1px solid var(--cyan);
  padding: 18px 24px;
  z-index: 60;
  box-shadow: 0 0 30px rgba(0, 245, 255, 0.15), inset 0 0 30px rgba(0, 245, 255, 0.03);
  clip-path: polygon(12px 0%, 100% 0%, calc(100% - 12px) 100%, 0% 100%);
  backdrop-filter: blur(10px);
}

.dialogue-speaker {
  font-family: var(--font-hud);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--cyan);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.dialogue-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  font-family: var(--font-body);
}

.dialogue-continue {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--magenta);
  text-align: right;
  margin-top: 10px;
  animation: blinkAnim 1.2s infinite;
}

@keyframes blinkAnim {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0.2
  }
}

/* ── PAUSE ─────────────────────────────────── */
#pause-overlay {
  position: absolute;
  inset: 0;
  background: rgba(1, 2, 8, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  backdrop-filter: blur(6px);
}

.pause-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  border: 1px solid var(--border);
  padding: 48px 64px;
  background: rgba(0, 245, 255, 0.03);
}

.pause-menu h2 {
  font-family: var(--font-hud);
  font-size: 28px;
  color: var(--cyan);
  letter-spacing: 6px;
}

/* ── LEVEL COMPLETE ────────────────────────── */
#screen-level {
  background: var(--darker);
}

.level-complete-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  padding: 32px;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lc-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 5px;
  color: var(--green);
  text-transform: uppercase;
}

.lc-stage-icon {
  font-family: var(--font-hud);
  font-size: 64px;
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 2px var(--cyan);
  text-shadow: 0 0 40px rgba(0, 245, 255, 0.5);
}

#screen-level h2 {
  font-family: var(--font-hud);
  font-size: 42px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#screen-level p {
  font-size: 16px;
  color: var(--text);
  max-width: 540px;
  line-height: 1.7;
}

.lc-stats {
  display: flex;
  gap: 40px;
  align-items: flex-end;
}

.lc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.lc-val {
  font-family: var(--font-hud);
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
}

.lc-key {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(200, 216, 232, 0.5);
  text-transform: uppercase;
}

/* ── GAME OVER ─────────────────────────────── */
.go-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.go-glitch {
  font-family: var(--font-hud);
  font-size: clamp(48px, 10vw, 96px);
  font-weight: 900;
  color: var(--red);
  text-shadow: 0 0 40px rgba(255, 34, 68, 0.6);
  animation: goGlitch 3s infinite;
}

@keyframes goGlitch {

  0%,
  92%,
  100% {
    transform: translate(0);
    text-shadow: 0 0 40px rgba(255, 34, 68, 0.6);
  }

  94% {
    transform: translate(-4px, 2px);
    text-shadow: 4px 0 var(--cyan);
  }

  96% {
    transform: translate(4px, -2px);
    text-shadow: -4px 0 var(--magenta);
  }
}

.go-content p {
  font-size: 16px;
  color: var(--text);
}

.go-tip {
  background: rgba(255, 34, 68, 0.1);
  border-left: 2px solid var(--red);
  padding: 12px 20px;
  font-size: 14px;
  color: rgba(200, 216, 232, 0.8);
  max-width: 400px;
  text-align: left;
  font-family: var(--font-mono);
}

/* ── DIAGNOSTIC (MVP) ──────────────────────── */
.diagnostic-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  padding: 40px;
  background: rgba(1, 2, 8, 0.85);
  border: 1px solid var(--purple);
  box-shadow: 0 0 40px rgba(157, 0, 255, 0.2);
  backdrop-filter: blur(10px);
  animation: fadeInUp 0.6s ease-out;
  border-radius: 8px;
}

.diag-badge {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 4px;
  color: var(--purple);
  text-transform: uppercase;
}

.diag-title {
  font-family: var(--font-hud);
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.diag-highlight {
  color: var(--cyan);
  filter: drop-shadow(0 0 10px rgba(0, 245, 255, 0.4));
}

.diag-desc {
  font-size: 18px;
  color: var(--text);
  max-width: 500px;
  line-height: 1.6;
}

.diag-score {
  font-family: var(--font-hud);
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--gold);
  margin-top: 10px;
}

/* ── WIN ───────────────────────────────────── */
.win-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
  padding: 32px;
}

.win-badge {
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 4px;
  color: var(--gold);
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.win-title {
  font-family: var(--font-hud);
  font-size: 40px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.promotor-text {
  font-size: 72px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--magenta), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.4));
}

.win-desc {
  font-size: 16px;
  color: var(--text);
  max-width: 560px;
  line-height: 1.7;
}

.win-score {
  font-family: var(--font-hud);
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--gold);
}

#win-score-val {
  font-size: 28px;
  font-weight: 900;
}

/* ── UTILS ─────────────────────────────────── */
.hidden {
  display: none !important;
}