/* NEON BREACH — synthwave arcade */
:root {
  --cyan: #00f6ff;
  --pink: #ff2bd6;
  --orange: #ffb000;
  --bg: #06010f;
  --panel: rgba(10, 2, 30, 0.88);
}

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

html, body {
  height: 100%;
  background: radial-gradient(ellipse at 50% 120%, #1a0533 0%, var(--bg) 65%);
  overflow: hidden;
  font-family: 'Press Start 2P', monospace;
  color: #e8e6ff;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  overscroll-behavior: none;
}

#stage {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas#game {
  height: min(100vh, 125vw);
  aspect-ratio: 4 / 5;
  max-width: 100vw;
  background: #06010f;
  display: block;
  image-rendering: pixelated;
  box-shadow: 0 0 60px rgba(123, 0, 255, 0.35), 0 0 120px rgba(0, 246, 255, 0.12);
}

/* ---------- CRT overlay ---------- */
#crt {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.16) 0px, rgba(0,0,0,0.16) 1px, transparent 2px, transparent 4px);
  mix-blend-mode: multiply;
}
#crt::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: min(100vh, 125vw);
  aspect-ratio: 4 / 5;
  max-width: 100vw;
  display: flex;
  justify-content: space-between;
  padding: 14px 18px;
  pointer-events: none;
  text-shadow: 0 0 8px var(--cyan);
}
.hud-label { font-size: 9px; color: #8f8ab8; letter-spacing: 2px; }
.hud-value { font-size: 16px; margin-top: 6px; color: var(--cyan); }
.hud-center { text-align: center; }
.hud-center .hud-value { color: var(--orange); text-shadow: 0 0 8px var(--orange); }
.hud-right { text-align: right; }
#hud-lives { margin-top: 8px; font-size: 13px; color: var(--pink); text-shadow: 0 0 8px var(--pink); letter-spacing: 3px; }

.combo { margin-top: 10px; }
#combo-mult { font-size: 13px; color: var(--orange); text-shadow: 0 0 10px var(--orange); }
.combo-bar {
  width: 110px; height: 5px; margin-top: 5px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,176,0,0.5);
}
#combo-fill { height: 100%; width: 100%; background: var(--orange); box-shadow: 0 0 8px var(--orange); }

#od-wrap { margin-top: 14px; }
.od-bar {
  width: 110px; height: 6px; margin-top: 5px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(0,246,255,0.5);
}
#od-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--cyan), var(--pink)); box-shadow: 0 0 8px var(--cyan); }
#od-wrap.ready .od-bar { animation: odpulse 0.5s steps(2) infinite; }
@keyframes odpulse { 50% { border-color: var(--pink); box-shadow: 0 0 12px var(--pink); } }
#od-wrap.active #od-fill { background: var(--pink); box-shadow: 0 0 12px var(--pink); }
.od-hint { font-size: 9px; color: var(--pink); margin-top: 5px; animation: blink 0.6s steps(2) infinite; text-shadow: 0 0 8px var(--pink); }

#pw-status { margin-top: 12px; font-size: 8px; line-height: 2; color: #b9b3e6; text-shadow: none; }
#pw-status span { display: block; }

.tip { font-size: 16px; color: #6f68a8; margin-top: 8px; }
.final-stats { font-family: 'VT323', monospace; font-size: 21px; color: #8f8ab8; letter-spacing: 1px; }

/* ---------- Overlays ---------- */
.overlay {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  height: min(100vh, 125vw);
  aspect-ratio: 4 / 5;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  background: var(--panel);
  backdrop-filter: blur(2px);
  text-align: center;
  padding: 24px;
  overflow-y: auto;
}
.hidden { display: none !important; }

.title {
  font-size: clamp(28px, 6vmin, 52px);
  letter-spacing: 6px;
  line-height: 1.2;
}
.title span { display: block; color: var(--cyan); text-shadow: 0 0 18px var(--cyan), 0 0 60px rgba(0,246,255,0.6); }
.title .title-pink { color: var(--pink); text-shadow: 0 0 18px var(--pink), 0 0 60px rgba(255,43,214,0.6); }
.subtitle {
  margin-top: 14px;
  font-family: 'VT323', monospace;
  font-size: 22px;
  letter-spacing: 8px;
  color: var(--orange);
  text-shadow: 0 0 10px var(--orange);
}

.blink { font-size: 13px; color: #fff; animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.controls {
  font-family: 'VT323', monospace;
  font-size: 21px;
  color: #b9b3e6;
  line-height: 1.7;
}
.controls b { color: var(--cyan); }

.board { width: min(420px, 86%); }
.board-title { font-size: 11px; color: var(--pink); text-shadow: 0 0 8px var(--pink); margin-bottom: 12px; }
.board-list {
  list-style: none;
  font-family: 'VT323', monospace;
  font-size: 22px;
  line-height: 1.55;
  counter-reset: rank;
}
.board-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  counter-increment: rank;
  color: #d8d4ff;
}
.board-list li::before { content: counter(rank, decimal-leading-zero); color: #6f68a8; }
.board-list li:first-child { color: var(--orange); text-shadow: 0 0 8px var(--orange); }
.board-list li.dim { justify-content: center; color: #6f68a8; text-shadow: none; }
.board-list li.dim::before { content: none; }
.board-list li .nm { flex: 1; text-align: left; letter-spacing: 4px; }
.dim { color: #6f68a8; font-family: 'VT323', monospace; font-size: 20px; }

.big-label { font-size: clamp(26px, 5vmin, 44px); color: var(--cyan); text-shadow: 0 0 18px var(--cyan); letter-spacing: 5px; }
.big-label.danger { color: var(--pink); text-shadow: 0 0 18px var(--pink), 0 0 70px rgba(255,43,214,0.7); }

.final { font-size: 14px; line-height: 2; color: #b9b3e6; }
.final span { color: var(--orange); text-shadow: 0 0 8px var(--orange); }

#entry { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.entry-label { font-size: 10px; color: #8f8ab8; }
#initials {
  width: 150px;
  background: transparent;
  border: 2px solid var(--cyan);
  color: var(--cyan);
  font-family: 'Press Start 2P', monospace;
  font-size: 26px;
  text-align: center;
  letter-spacing: 10px;
  padding: 10px 0 10px 10px;
  text-transform: uppercase;
  outline: none;
  box-shadow: 0 0 14px rgba(0,246,255,0.4), inset 0 0 14px rgba(0,246,255,0.15);
  caret-color: var(--pink);
}

.btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  padding: 14px 26px;
  background: transparent;
  color: var(--cyan);
  border: 2px solid var(--cyan);
  cursor: pointer;
  box-shadow: 0 0 14px rgba(0,246,255,0.35);
  transition: background .15s, color .15s;
}
.btn:hover, .btn:focus-visible { background: var(--cyan); color: #06010f; }
.btn-pink { color: var(--pink); border-color: var(--pink); box-shadow: 0 0 14px rgba(255,43,214,0.35); }
.btn-pink:hover, .btn-pink:focus-visible { background: var(--pink); color: #06010f; }

.credit { font-size: 8px; color: #564f8a; letter-spacing: 3px; }

/* ---------- Mobil ---------- */
.ctrl-pick { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ctrl-pick .btn { min-width: 240px; }

.mob-btn {
  position: absolute;
  z-index: 5;
  font-family: 'Press Start 2P', monospace;
  background: rgba(10, 2, 30, 0.75);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mob-pause {
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #8f8ab8;
  border: 1px solid #564f8a;
  padding: 9px 12px;
  margin-top: 44px;
}
.mob-od {
  bottom: calc(22px + env(safe-area-inset-bottom));
  right: calc(16px + env(safe-area-inset-right));
  width: 84px;
  height: 84px;
  border-radius: 50%;
  font-size: 15px;
  color: var(--pink);
  border: 3px solid var(--pink);
  box-shadow: 0 0 18px rgba(255,43,214,0.5);
  animation: odpulse 0.5s steps(2) infinite;
}
.mob-od:active { background: var(--pink); color: #06010f; }
.mob-od.spent { animation: none; opacity: 0.5; border-color: #564f8a; color: #564f8a; box-shadow: none; }

@media (max-width: 600px) {
  .hud-label { font-size: 7px; }
  .hud-value { font-size: 12px; }
  #hud { padding: 10px 12px; }
  .combo-bar, .od-bar { width: 84px; }
  .title { letter-spacing: 3px; }
  .controls { font-size: 17px; }
  .board-list { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .blink { animation: none; }
}
