/* ============================================
   SLAP ASS — Dark Neon Aesthetic
   ============================================ */

:root {
  --bg-black: #050508;
  --bg-dark: #0a0a12;
  --bg-card: #0e0e18;
  --neon-red: #ff1744;
  --neon-red-dim: #cc1138;
  --neon-pink: #ff4081;
  --neon-orange: #ff6e40;
  --neon-gold: #ffd740;
  --neon-cyan: #00e5ff;
  --neon-green: #00e676;
  --neon-white: #ffe0e6;
  --text-dim: #6a5060;
  --glow-red: 0 0 10px #ff1744, 0 0 40px rgba(255,23,68,0.4), 0 0 80px rgba(255,23,68,0.15);
  --glow-red-strong: 0 0 10px #ff1744, 0 0 40px rgba(255,23,68,0.6), 0 0 100px rgba(255,23,68,0.3), 0 0 200px rgba(255,23,68,0.1);
  --glow-gold: 0 0 10px #ffd740, 0 0 40px rgba(255,215,64,0.3);
  --glow-cyan: 0 0 10px #00e5ff, 0 0 40px rgba(0,229,255,0.3);
  --font-display: 'Permanent Marker', cursive;
  --font-heading: 'Russo One', sans-serif;
  --font-body: 'Outfit', sans-serif;
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg-black);
  font-family: var(--font-body);
  color: var(--neon-white);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ============ SHARED ============ */
.screen {
  position: fixed; inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.screen.active { display: flex; }

.neon-glow-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255,23,68,0.12) 0%, transparent 65%),
    radial-gradient(ellipse at 20% 80%, rgba(255,23,68,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255,64,129,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.scanlines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.08) 2px, rgba(0,0,0,0.08) 4px);
  pointer-events: none; z-index: 1;
}

/* ============ MARKET CAP TICKER ============ */
.mc-ticker {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(5,5,8,0.9);
  border-bottom: 1px solid rgba(255,23,68,0.2);
  padding: 6px 16px;
  text-align: center;
  backdrop-filter: blur(8px);
}
.mc-ticker.hidden { display: none; }
.mc-link {
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mc-label { color: var(--text-dim); }
.mc-price { color: var(--neon-gold); text-shadow: 0 0 6px rgba(255,215,64,0.3); }
.mc-cap { color: var(--neon-cyan); text-shadow: 0 0 6px rgba(0,229,255,0.3); }
.mc-sep { color: rgba(255,255,255,0.15); }
.mc-change { font-size: 0.7rem; }
.mc-change.up { color: var(--neon-green); }
.mc-change.down { color: var(--neon-red); }
.mc-supply { color: var(--neon-white); opacity: 0.7; }

/* ============ BUTTONS ============ */
.btn-neon {
  font-family: var(--font-heading);
  font-size: clamp(0.85rem, 2.5vw, 1.1rem);
  padding: 12px 36px;
  border: 2px solid var(--neon-red);
  border-radius: 4px;
  background: var(--neon-red);
  color: #fff;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow: var(--glow-red);
  transition: all 0.2s;
  display: block;
  width: 300px;
  text-align: center;
  margin: 5px auto;
}
.btn-neon:hover { box-shadow: var(--glow-red-strong); transform: scale(1.03); }
.btn-neon:active { transform: scale(0.97); }
.btn-neon.btn-outline { background: transparent; color: var(--neon-red); }
.btn-neon.btn-outline:hover { background: rgba(255,23,68,0.1); }
.btn-neon.btn-gold {
  background: transparent; border-color: var(--neon-gold); color: var(--neon-gold); box-shadow: var(--glow-gold);
}
.btn-neon.btn-gold:hover { background: rgba(255,215,64,0.1); box-shadow: 0 0 10px #ffd740, 0 0 40px rgba(255,215,64,0.5); }
.btn-neon.btn-x {
  background: transparent; border-color: #1d9bf0; color: #1d9bf0;
  box-shadow: 0 0 10px #1d9bf0, 0 0 30px rgba(29,155,240,0.3);
}
.btn-neon.btn-x:hover { background: rgba(29,155,240,0.1); box-shadow: 0 0 10px #1d9bf0, 0 0 40px rgba(29,155,240,0.5); }
.btn-neon.btn-small { width: auto; padding: 10px 20px; font-size: 0.75rem; }

/* ============ TITLE SCREEN ============ */
.title-content {
  text-align: center; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding-top: 30px;
}
.title-logo-wrap { position: relative; margin-bottom: 4px; }
.title-ass-img {
  width: clamp(120px, 25vw, 190px); height: auto;
  border-radius: 12px;
  filter: brightness(1.1) saturate(1.2);
  box-shadow: var(--glow-red-strong);
  animation: neonPulse 3s ease-in-out infinite;
}
.title-logo {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 9vw, 5.5rem);
  line-height: 0.95; color: var(--neon-red);
  text-shadow: 0 0 10px var(--neon-red), 0 0 40px rgba(255,23,68,0.6), 0 0 80px rgba(255,23,68,0.3);
  letter-spacing: 6px; margin-top: 6px;
  animation: neonFlicker 4s ease-in-out infinite;
}
.title-sub {
  font-family: var(--font-heading);
  font-size: clamp(0.65rem, 1.8vw, 0.85rem);
  color: var(--neon-gold);
  text-shadow: var(--glow-gold);
  letter-spacing: 1px;
}

@keyframes neonPulse {
  0%, 100% { filter: brightness(1.1) saturate(1.2); box-shadow: var(--glow-red); }
  50% { filter: brightness(1.3) saturate(1.4); box-shadow: var(--glow-red-strong); }
}
@keyframes neonFlicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; text-shadow: 0 0 10px var(--neon-red), 0 0 40px rgba(255,23,68,0.6), 0 0 80px rgba(255,23,68,0.3); }
  20%, 24%, 55% { opacity: 0.85; text-shadow: 0 0 5px var(--neon-red), 0 0 20px rgba(255,23,68,0.3); }
}

.title-form { display: flex; flex-direction: column; align-items: center; gap: 5px; margin: 4px 0; }
.input-label { font-family: var(--font-heading); font-size: 0.65rem; letter-spacing: 4px; color: var(--text-dim); text-transform: uppercase; }
.neon-input {
  font-family: var(--font-body); font-size: 1rem; font-weight: 600;
  padding: 10px 20px; width: 260px;
  border: 2px solid rgba(255,23,68,0.4); border-radius: 4px;
  background: rgba(255,23,68,0.05); color: var(--neon-white);
  text-align: center; outline: none; transition: all 0.3s;
}
.neon-input::placeholder { color: rgba(255,224,230,0.2); }
.neon-input:focus { border-color: var(--neon-red); box-shadow: 0 0 20px rgba(255,23,68,0.3); background: rgba(255,23,68,0.08); }

.name-error {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--neon-red);
  text-shadow: 0 0 6px rgba(255,23,68,0.3);
  min-height: 1.2em;
  opacity: 0;
  transition: opacity 0.2s;
}
.name-error.visible { opacity: 1; }

/* ============ HUD ============ */
.hud {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between;
  padding: 14px 20px; z-index: 50;
  background: linear-gradient(180deg, rgba(5,5,8,0.95) 0%, transparent 100%);
}
.hud-item { text-align: center; }
.hud-label { display: block; font-family: var(--font-heading); font-size: 0.6rem; letter-spacing: 3px; color: var(--text-dim); }
.hud-value { font-family: var(--font-heading); font-size: clamp(1.6rem, 5vw, 2.4rem); color: var(--neon-white); text-shadow: 0 0 8px rgba(255,224,230,0.3); }
.hud-timer .hud-value { color: var(--neon-cyan); text-shadow: var(--glow-cyan); }
.hud-value.pulse { animation: hudPulse 0.25s ease-out; }
@keyframes hudPulse { 0% { transform: scale(1.5); color: var(--neon-gold); } 100% { transform: scale(1); } }
.hud-timer .hud-value.danger { color: var(--neon-red); text-shadow: var(--glow-red); animation: dangerPulse 0.5s ease-in-out infinite; }
@keyframes dangerPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ============ GAME AREA ============ */
#game-area {
  position: fixed; inset: 0; cursor: none;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,23,68,0.04) 0%, transparent 70%), var(--bg-black);
}
.zone { position: absolute; width: 200px; height: 200px; }
.zone[data-zone="0"] { top: 6%; left: 8%; }
.zone[data-zone="1"] { top: 6%; right: 8%; }
.zone[data-zone="2"] { top: 36%; left: 3%; }
.zone[data-zone="3"] { top: 32%; left: 50%; transform: translateX(-50%); }
.zone[data-zone="4"] { top: 36%; right: 3%; }
.zone[data-zone="5"] { bottom: 10%; left: 12%; }
.zone[data-zone="6"] { bottom: 10%; right: 12%; }

/* ============ ASS TARGET ============ */
#ass-target {
  position: absolute; width: 150px; height: 180px;
  display: flex; align-items: center; justify-content: center;
  cursor: none; z-index: 20;
  transition: left 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), top 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ass-img {
  width: 140px; height: auto; border-radius: 8px;
  filter: brightness(1.1) saturate(1.3); pointer-events: none;
  animation: assIdle 2s ease-in-out infinite; position: relative; z-index: 2;
}
.ass-glow {
  position: absolute; inset: -15px; border-radius: 16px;
  background: radial-gradient(ellipse, rgba(255,23,68,0.25) 0%, transparent 70%);
  filter: blur(10px); z-index: 1; animation: glowPulse 2s ease-in-out infinite;
}
@keyframes assIdle { 0%, 100% { transform: scale(1) rotate(-1deg); } 50% { transform: scale(1.03) rotate(1deg); } }
@keyframes glowPulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
#ass-target.slapped .ass-img { animation: slapReact 0.3s ease-out !important; }
@keyframes slapReact {
  0% { transform: scale(1); filter: brightness(1.1); }
  20% { transform: scale(0.75) rotate(12deg); filter: brightness(2); }
  50% { transform: scale(1.15) rotate(-4deg); filter: brightness(1.5); }
  100% { transform: scale(1) rotate(0deg); filter: brightness(1.1); }
}

/* ============ HAND CURSOR ============ */
#hand-cursor { position: fixed; width: 70px; height: 70px; pointer-events: none; z-index: 100; transform: translate(-35px, -35px); }
.hand-emoji { font-size: 48px; transform: rotate(-30deg) scaleX(-1); transition: transform 0.08s; filter: drop-shadow(0 0 10px rgba(255,23,68,0.4)); }
#hand-cursor.slapping .hand-emoji { animation: slapHand 0.18s ease-out; }
@keyframes slapHand { 0% { transform: rotate(-30deg) scaleX(-1) scale(1); } 40% { transform: rotate(25deg) scaleX(-1) scale(1.4); } 100% { transform: rotate(-30deg) scaleX(-1) scale(1); } }

/* ============ POPUPS ============ */
#popups { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.popup { position: absolute; font-family: var(--font-display); font-size: 1.8rem; color: var(--neon-gold); text-shadow: 0 0 10px var(--neon-gold), 0 0 30px rgba(255,215,64,0.4); animation: popFloat 0.8s ease-out forwards; pointer-events: none; white-space: nowrap; }
.popup.miss { color: var(--neon-red); font-size: 1.3rem; text-shadow: 0 0 8px var(--neon-red); }
.popup.combo { font-size: 2.4rem; color: var(--neon-cyan); text-shadow: 0 0 10px var(--neon-cyan), 0 0 40px rgba(0,229,255,0.5); }
@keyframes popFloat { 0% { transform: translateY(0) scale(0.5); opacity: 1; } 100% { transform: translateY(-90px) scale(1.2); opacity: 0; } }
.screen-flash { position: fixed; inset: 0; background: var(--neon-red); opacity: 0; pointer-events: none; z-index: 10; animation: flashBang 0.12s ease-out; }
@keyframes flashBang { 0% { opacity: 0.2; } 100% { opacity: 0; } }
.slap-ripple { position: absolute; width: 20px; height: 20px; border: 2px solid var(--neon-red); border-radius: 50%; pointer-events: none; z-index: 15; box-shadow: 0 0 8px var(--neon-red); animation: rippleExpand 0.5s ease-out forwards; }
@keyframes rippleExpand { 0% { transform: translate(-50%,-50%) scale(1); opacity: 1; } 100% { transform: translate(-50%,-50%) scale(8); opacity: 0; } }

/* ============ RESULTS ============ */
#results-screen { z-index: 100; }
.results-content { text-align: center; z-index: 2; position: relative; }
.results-title { font-family: var(--font-display); font-size: clamp(2.2rem, 7vw, 4rem); color: var(--neon-red); text-shadow: 0 0 10px var(--neon-red), 0 0 40px rgba(255,23,68,0.5); margin-bottom: 8px; }
.results-ass-img { width: clamp(70px, 12vw, 100px); border-radius: 8px; filter: brightness(0.9) saturate(1.1); box-shadow: var(--glow-red); margin-bottom: 8px; }
.results-score { margin: 6px 0; }
.results-label { display: block; font-family: var(--font-heading); font-size: 0.65rem; letter-spacing: 4px; color: var(--text-dim); }
.results-number { font-family: var(--font-display); font-size: clamp(2.5rem, 9vw, 5rem); color: var(--neon-gold); text-shadow: var(--glow-gold); }
.results-stats { display: flex; gap: 2rem; justify-content: center; margin: 12px 0; }
.stat { text-align: center; }
.stat-val { display: block; font-family: var(--font-heading); font-size: 1.6rem; color: var(--neon-cyan); text-shadow: var(--glow-cyan); }
.stat-label { font-size: 0.6rem; letter-spacing: 2px; color: var(--text-dim); text-transform: uppercase; font-family: var(--font-heading); }
.results-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 12px; }
#rank-display { font-family: var(--font-heading); font-size: 0.9rem; color: var(--neon-gold); min-height: 1.2em; }

/* ============ LEADERBOARD ============ */
#leaderboard-screen { z-index: 100; overflow-y: auto; }
.lb-content { text-align: center; z-index: 2; position: relative; width: 90%; max-width: 440px; padding: 20px 0; }
.lb-title { font-family: var(--font-display); font-size: clamp(1.6rem, 5vw, 2.5rem); color: var(--neon-gold); text-shadow: var(--glow-gold); margin-bottom: 4px; }
.lb-subtitle { font-family: var(--font-body); font-size: 0.75rem; color: var(--text-dim); margin-bottom: 14px; }
.lb-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; max-height: 35vh; overflow-y: auto; }
.lb-row { display: flex; align-items: center; padding: 9px 14px; background: rgba(255,23,68,0.04); border: 1px solid rgba(255,23,68,0.1); border-radius: 4px; font-family: var(--font-body); font-weight: 600; }
.lb-row:nth-child(-n+3) { border-color: rgba(255,215,64,0.2); background: rgba(255,215,64,0.04); }
.lb-rank { color: var(--neon-red); width: 36px; text-align: left; font-family: var(--font-heading); font-size: 0.8rem; }
.lb-row:nth-child(-n+3) .lb-rank { color: var(--neon-gold); }
.lb-name { flex: 1; text-align: left; color: var(--neon-white); font-size: 0.9rem; }
.lb-score { color: var(--neon-cyan); font-family: var(--font-heading); font-size: 0.95rem; text-shadow: 0 0 6px rgba(0,229,255,0.3); }
.lb-empty { color: var(--text-dim); font-style: italic; padding: 30px 0; }
.lb-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; }

/* Wallet Section */
.wallet-section { margin: 14px 0; padding: 14px; border: 1px solid rgba(255,215,64,0.15); border-radius: 6px; background: rgba(255,215,64,0.03); }
.wallet-label { font-family: var(--font-body); font-size: 0.75rem; color: var(--text-dim); margin-bottom: 8px; }
.wallet-row { display: flex; gap: 8px; align-items: center; }
.wallet-input { width: 100% !important; text-align: left !important; font-size: 0.8rem !important; padding: 8px 12px !important; }
.wallet-status { font-size: 0.75rem; margin-top: 6px; min-height: 1em; }
.wallet-status.ok { color: var(--neon-green); }
.wallet-status.err { color: var(--neon-red); }

/* History button - bottom right of leaderboard */
.btn-history {
  position: fixed; bottom: 20px; right: 20px;
  font-family: var(--font-heading); font-size: 0.8rem;
  padding: 10px 20px; border: 1px solid rgba(255,215,64,0.3);
  border-radius: 4px; background: rgba(255,215,64,0.05);
  color: var(--neon-gold); cursor: pointer; z-index: 10;
  transition: all 0.2s; letter-spacing: 1px;
}
.btn-history:hover { background: rgba(255,215,64,0.12); box-shadow: var(--glow-gold); }

/* ============ HISTORY ============ */
#history-screen { z-index: 100; overflow-y: auto; }
.history-content { text-align: center; z-index: 2; position: relative; width: 90%; max-width: 500px; padding: 20px 0; }

.hist-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255,23,68,0.04);
  border: 1px solid rgba(255,23,68,0.08);
  border-radius: 4px;
  text-align: left;
  font-family: var(--font-body);
}
.hist-row:nth-child(-n+3) { border-color: rgba(255,215,64,0.15); }
.hist-winner { font-weight: 700; color: var(--neon-gold); font-size: 0.9rem; }
.hist-details { font-size: 0.65rem; color: var(--text-dim); margin-top: 2px; }
.hist-score { font-family: var(--font-heading); color: var(--neon-cyan); font-size: 0.85rem; text-align: right; }
.hist-mcap { font-size: 0.65rem; color: var(--text-dim); text-align: right; white-space: nowrap; }

/* ============ FUNNY QUOTES ============ */
.funny-quote {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--neon-pink);
  text-shadow: 0 0 8px rgba(255,64,129,0.3);
  min-height: 1.2em;
  animation: quoteFade 0.5s ease-in;
}
.results-quote { margin-top: 6px; font-size: 0.75rem; }
@keyframes quoteFade { 0% { opacity: 0; transform: translateY(5px); } 100% { opacity: 1; transform: translateY(0); } }

/* ============ SITE FOOTER ============ */
.site-footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 150;
  background: rgba(5,5,8,0.9);
  border-top: 1px solid rgba(255,23,68,0.15);
  padding: 8px 16px;
  text-align: center;
  backdrop-filter: blur(6px);
}
.site-footer.hidden { display: none; }
.footer-row { margin: 2px 0; }
.footer-ca {
  font-family: var(--font-body);
  font-size: 0.6rem;
  color: var(--text-dim);
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: color 0.2s;
  word-break: break-all;
}
.footer-ca:hover { color: var(--neon-gold); }
.copy-hint { font-size: 0.65rem; opacity: 0.6; }
.footer-link {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  color: var(--neon-red);
  text-decoration: none;
  text-shadow: 0 0 6px rgba(255,23,68,0.3);
  transition: color 0.2s;
  letter-spacing: 1px;
}
.footer-link:hover { color: var(--neon-gold); text-shadow: var(--glow-gold); }
.footer-sep { color: rgba(255,255,255,0.15); margin: 0 8px; font-size: 0.7rem; }

/* ============ MOBILE ============ */
@media (max-width: 600px) {
  .zone { width: 130px; height: 130px; }
  #ass-target { width: 120px; height: 150px; }
  .ass-img { width: 110px; }
  .hud { padding: 10px 12px; }
  .zone[data-zone="0"] { top: 8%; left: 2%; }
  .zone[data-zone="1"] { top: 8%; right: 2%; }
  .zone[data-zone="2"] { top: 34%; left: 1%; }
  .zone[data-zone="4"] { top: 34%; right: 1%; }
  .zone[data-zone="5"] { bottom: 12%; left: 3%; }
  .zone[data-zone="6"] { bottom: 12%; right: 3%; }
  .btn-neon { width: 260px; padding: 11px 24px; font-size: 0.8rem; }
  .title-ass-img { width: clamp(100px, 25vw, 140px); }
  .wallet-row { flex-direction: column; }
  .hist-row { grid-template-columns: 1fr auto; }
  .hist-mcap { grid-column: 1 / -1; text-align: left; }
}