/* ══════════════════════════════════════════
   SPONSOREALO ARCADE — style.css
   Futuristic / Holographic / Cyberpunk
══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Exo+2:wght@300;400;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

/* ── VARIABLES ── */
:root {
  --cyan:    #01E5FE;
  --pink:    #FF00A4;
  --amber:   #FFB800;
  --green:   #00FF88;
  --red:     #FF2D55;
  --white:   #FFFFFF;
  --bg:      #030712;
  --bg2:     #0a0f1e;
  --bg3:     #0f1729;
  --border:  rgba(1,229,254,0.12);
  --border2: rgba(1,229,254,0.25);
  --grad:    linear-gradient(135deg, #01E5FE, #FF00A4);
  --shadow-cyan: 0 0 20px rgba(1,229,254,0.3);
  --shadow-pink: 0 0 20px rgba(255,0,164,0.3);
  --font-display: 'Orbitron', monospace;
  --font-body:    'Exo 2', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

/* ── SCANLINES ── */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
  animation: scanMove 8s linear infinite;
}
@keyframes scanMove {
  from { background-position: 0 0; }
  to   { background-position: 0 100px; }
}

/* ── AMBIENT PARTICLES ── */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.ambient-particle {
  position: absolute;
  border-radius: 50%;
  animation: ambientFloat linear infinite;
  pointer-events: none;
}
@keyframes ambientFloat {
  0%   { transform: translateY(110vh) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-10vh) rotate(720deg); opacity: 0; }
}

/* ── GRID BACKGROUND ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(1,229,254,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(1,229,254,0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
}

/* Radial glow center */
body::after {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(ellipse, rgba(1,229,254,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── HUD CORNERS ── */
.hud-corner {
  position: fixed;
  width: 24px;
  height: 24px;
  z-index: 50;
  pointer-events: none;
}
.hud-tl { top: 12px; left: 12px;  border-top: 2px solid var(--cyan); border-left: 2px solid var(--cyan); }
.hud-tr { top: 12px; right: 12px; border-top: 2px solid var(--cyan); border-right: 2px solid var(--cyan); }
.hud-bl { bottom: 12px; left: 12px;  border-bottom: 2px solid var(--cyan); border-left: 2px solid var(--cyan); }
.hud-br { bottom: 12px; right: 12px; border-bottom: 2px solid var(--cyan); border-right: 2px solid var(--cyan); }

/* ── SCREENS ── */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  overflow-y: auto;
  padding: 20px;
}
.screen.active { display: flex; }

.screen-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 20px 0;
  animation: screenIn .4s cubic-bezier(0.16, 1, 0.3, 1);
}
.screen-inner--narrow { max-width: 420px; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

/* ── LOGO ── */
.logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-link { display: flex; align-items: center; }
.logo-img { height: 28px;}
.logo-tag {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border: 1px solid rgba(1,229,254,0.3);
  padding: 3px 8px;
  border-radius: 4px;
}

/* ── GLITCH TITLE ── */
.glitch-wrap { overflow: hidden; }
.glitch {
  font-family: var(--font-display);
  font-size: clamp(38px, 10vw, 72px);
  font-weight: 900;
  letter-spacing: .05em;
  color: var(--white);
  position: relative;
  text-shadow: var(--shadow-cyan);
  animation: glitchIdle 4s ease-in-out infinite;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-display);
  font-size: inherit;
  font-weight: 900;
}
.glitch::before {
  color: var(--cyan);
  clip-path: polygon(0 30%, 100% 30%, 100% 50%, 0 50%);
  animation: glitch1 3s infinite;
}
.glitch::after {
  color: var(--pink);
  clip-path: polygon(0 60%, 100% 60%, 100% 75%, 0 75%);
  animation: glitch2 3s infinite;
}
@keyframes glitchIdle {
  0%, 92%, 100% { transform: none; }
  93% { transform: translateX(-2px); }
  94% { transform: translateX(2px); }
  95% { transform: none; }
}
@keyframes glitch1 {
  0%, 92%, 100% { transform: none; opacity: 0; }
  93% { transform: translateX(-4px); opacity: .8; }
  94% { transform: translateX(4px); opacity: .8; }
  95% { opacity: 0; }
}
@keyframes glitch2 {
  0%, 94%, 100% { transform: none; opacity: 0; }
  95% { transform: translateX(4px); opacity: .8; }
  96% { transform: translateX(-4px); opacity: .8; }
  97% { opacity: 0; }
}

.title-line2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 8vw, 56px);
  font-weight: 900;
  letter-spacing: .03em;
  line-height: 1.1;
  text-align: center;
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.intro-sub {
  font-size: clamp(13px, 3vw, 16px);
  color: rgba(255,255,255,0.5);
  text-align: center;
  line-height: 1.6;
  letter-spacing: .01em;
}

/* ── INTRO STATS ── */
.intro-stats {
  display: flex;
  gap: 12px;
  width: 100%;
}
.istat {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  transition: border-color .2s, transform .2s;
}
.istat:hover { border-color: var(--border2); transform: translateY(-2px); }
.istat-icon { font-size: 22px; margin-bottom: 4px; }
.istat-val {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: .1em;
}
.istat-lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255,255,255,.4);
  margin-top: 2px;
}

/* ── BUTTONS ── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  cursor: pointer;
  border: none;
  transition: transform .15s, box-shadow .15s;
  width: 100%;
  overflow: hidden;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--grad);
  color: #000;
  box-shadow: 0 4px 24px rgba(1,229,254,0.25);
}
.btn-primary:hover { box-shadow: 0 4px 32px rgba(1,229,254,0.4); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--white);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.btn-cta {
  background: transparent;
  border: 1px solid rgba(255,0,164,0.4);
  color: var(--pink);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
}
.btn-cta:hover { background: rgba(255,0,164,0.1); border-color: var(--pink); }

.btn-xl { padding: 18px 36px; font-size: 14px; }

.btn-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
  pointer-events: none;
}

.back-link {
  font-size: 12px;
  color: rgba(255,255,255,.3);
  text-decoration: none;
  letter-spacing: .05em;
  transition: color .2s;
}
.back-link:hover { color: var(--cyan); }

/* ── REGISTER FORM ── */
.reg-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.reg-icon { font-size: 40px; }
.reg-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 6vw, 36px);
  font-weight: 900;
  letter-spacing: .05em;
  line-height: 1.1;
  text-align: center;
}
.reg-sub {
  font-size: 13px;
  color: rgba(255,255,255,.45);
  line-height: 1.6;
  max-width: 320px;
}

.form-card {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}
.form-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--grad);
  opacity: .6;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
  color: rgba(255,255,255,.45);
}
.form-optional { color: rgba(255,255,255,.25); font-weight: 400; }
.form-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--white);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
.form-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(1,229,254,0.1);
}
.form-input::placeholder { color: rgba(255,255,255,.2); }
.form-error {
  font-size: 13px;
  color: var(--red);
  text-align: center;
  font-family: var(--font-mono);
  display: none;
  padding: 8px;
  background: rgba(255,45,85,.08);
  border-radius: 6px;
  border: 1px solid rgba(255,45,85,.2);
}

/* ── GAME SCREEN ── */
#s-game {
  flex-direction: column;
  padding: 0;
  justify-content: flex-start;
  background: var(--bg);
}

/* Game HUD top */
.game-hud {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--border);
  background: rgba(3,7,18,0.9);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 20;
  flex-shrink: 0;
}
.hud-block { display: flex; flex-direction: column; gap: 2px; min-width: 80px; }
.hud-center { align-items: center; }
.hud-right  { align-items: flex-end; }
.hud-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .15em;
  color: rgba(255,255,255,.35);
}
.hud-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
  transition: color .15s;
  line-height: 1;
}
.hud-value.flash  { color: var(--cyan); }
.hud-value.danger { color: var(--red);  }
.hud-timer { color: var(--cyan); }

.hud-lives { display: flex; gap: 6px; align-items: center; }
.life {
  font-size: 16px;
  color: var(--red);
  transition: all .3s;
  filter: drop-shadow(0 0 6px var(--red));
}
.life.lost { color: rgba(255,255,255,.1); filter: none; }

/* Sub HUD */
.game-subhud {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 6px 16px;
  background: rgba(10,15,30,0.7);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.subhud-item { display: flex; align-items: center; gap: 6px; }
.subhud-label {
  font-family: var(--font-display);
  font-size: 9px;
  color: rgba(255,255,255,.3);
  letter-spacing: .1em;
}
.subhud-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan);
}

/* Canvas */
.canvas-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: none;
}

/* Combo popup */
.combo-popup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.8);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .05em;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  pointer-events: none;
  opacity: 0;
  text-align: center;
  text-shadow: none;
  filter: drop-shadow(0 0 12px rgba(1,229,254,0.8));
  transition: opacity .1s, transform .1s;
  white-space: nowrap;
  z-index: 30;
}
.combo-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: comboPop .8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes comboPop {
  0%  { transform: translate(-50%, -60%) scale(1.3); opacity: 1; }
  70% { opacity: 1; }
  100%{ transform: translate(-50%, -80%) scale(.9); opacity: 0; }
}

/* Miss flash */
.miss-flash {
  position: absolute;
  inset: 0;
  background: rgba(255,45,85,0.15);
  pointer-events: none;
  opacity: 0;
  z-index: 20;
  transition: opacity .1s;
}
.miss-flash.show { opacity: 1; }

/* Life lost overlay */
.life-lost-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 25;
  background: radial-gradient(ellipse at center, rgba(255,45,85,0.3), transparent 70%);
  border: 3px solid rgba(255,45,85,0.5);
  transition: opacity .15s;
}
.life-lost-overlay.show { opacity: 1; }

/* Countdown overlay */
.countdown-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3,7,18,0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 40;
  backdrop-filter: blur(4px);
}
.countdown-num {
  font-family: var(--font-display);
  font-size: 100px;
  font-weight: 900;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  animation: countPop .7s cubic-bezier(0.16,1,0.3,1);
  filter: drop-shadow(0 0 30px rgba(1,229,254,0.5));
}
@keyframes countPop {
  from { transform: scale(2); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.countdown-sub {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: .25em;
  color: rgba(255,255,255,.4);
}

/* Pause overlay */
.pause-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3,7,18,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 40;
  padding: 32px;
  backdrop-filter: blur(8px);
}
.pause-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  letter-spacing: .2em;
  color: var(--white);
  margin-bottom: 8px;
}

/* Pause button */
.pause-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(1,229,254,0.1);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--cyan);
  width: 38px;
  height: 38px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  transition: background .2s;
}
.pause-btn:hover { background: rgba(1,229,254,0.2); }

/* ── RESULT SCREEN ── */
.result-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.result-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3em;
  color: rgba(255,255,255,.4);
}
.result-score {
  font-family: var(--font-mono);
  font-size: clamp(56px, 15vw, 88px);
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  filter: drop-shadow(0 0 20px rgba(1,229,254,0.4));
}
.result-detail {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255,255,255,.35);
  letter-spacing: .05em;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
}
.rstat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rstat-val {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}
.rstat-val.cyan   { color: var(--cyan); }
.rstat-val.pink   { color: var(--pink); }
.rstat-val.white  { color: var(--white); }
.rstat-val.amber  { color: var(--amber); }
.rstat-lbl {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .12em;
  color: rgba(255,255,255,.3);
}

/* Rank banner */
.rank-banner {
  width: 100%;
  background: rgba(1,229,254,0.06);
  border: 1px solid rgba(1,229,254,0.2);
  border-radius: 12px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.rank-icon { font-size: 24px; }
.rank-text {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: .05em;
}

/* Leaderboard */
.lb-wrap { width: 100%; }
.lb-title {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
  color: rgba(255,255,255,.3);
  margin-bottom: 10px;
}
.lb { display: flex; flex-direction: column; gap: 6px; }
.lb-loading {
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(255,255,255,.3);
  padding: 20px 0;
  text-align: center;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  transition: border-color .2s;
}
.lb-row.me {
  border-color: rgba(1,229,254,0.35);
  background: rgba(1,229,254,0.05);
}
.lb-pos {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
}
.lb-pos.gold   { color: #FFD700; filter: drop-shadow(0 0 6px #FFD700); }
.lb-pos.silver { color: #C0C0C0; }
.lb-pos.bronze { color: #CD7F32; }
.lb-pos.other  { color: rgba(255,255,255,.3); }
.lb-name { flex: 1; font-size: 14px; font-weight: 600; }
.lb-score {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--cyan);
}
.lb-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,.3);
  min-width: 40px;
  text-align: right;
}
.me-pill {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .1em;
  background: rgba(1,229,254,.15);
  color: var(--cyan);
  border: 1px solid rgba(1,229,254,.3);
  padding: 2px 7px;
  border-radius: 20px;
}

.result-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

/* ── MONO UTILITY ── */
.mono { font-family: var(--font-mono) !important; }

/* ── CUSTOM CURSOR ── */
.custom-cursor {
  position: fixed;
  width: 12px;
  height: 12px;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width .15s, height .15s, border-color .15s;
  mix-blend-mode: screen;
}
.custom-cursor.over-canvas {
  width: 6px;
  height: 6px;
  border-color: transparent;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .result-stats { grid-template-columns: repeat(2, 1fr); }
  .intro-stats { gap: 8px; }
  .istat { padding: 10px 4px; }
  .istat-icon { font-size: 18px; }
  .istat-val { font-size: 10px; }
  .game-subhud { gap: 20px; }
  .countdown-num { font-size: 72px; }
  .hud-value { font-size: 20px; }
}

@media (max-width: 380px) {
  .intro-stats { flex-wrap: wrap; }
  .istat { width: calc(50% - 4px); }
}

/* ── TOUCH DEVICE ── */
@media (hover: none) {
  .custom-cursor { display: none; }
  body { cursor: auto; }
  canvas { cursor: none; }
}
