/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

:root {
  --bg-color: #07070c;
  --stranger-red: #e50914;
  --neon-red-glow: #ff003c;
  --neon-yellow: #ffe600;
  --neon-cyan: #00f0ff;
  --neon-green: #39ff14;
  --neon-pink: #ff007f;
  --arcade-border: #2a1147;
  --card-bg: rgba(20, 10, 35, 0.85);
}

body {
  background-color: var(--bg-color);
  color: #ffffff;
  font-family: 'Press Start 2P', monospace, cursive;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  background: radial-gradient(circle at center, #1b0c2e 0%, #080311 80%, #000000 100%);
}

/* Background Particle Canvas */
#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

/* CRT Overlay Effect */
.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  ), linear-gradient(
    90deg,
    rgba(255, 0, 0, 0.03),
    rgba(0, 255, 0, 0.01),
    rgba(0, 0, 255, 0.03)
  );
  background-size: 100% 4px, 6px 100%;
  pointer-events: none;
  z-index: 99;
  opacity: 0.85;
}

/* Audio Control Button */
.audio-control {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 100;
}

#musicToggleBtn {
  background: rgba(229, 9, 20, 0.2);
  border: 2px solid var(--neon-red-glow);
  color: var(--neon-red-glow);
  padding: 8px 14px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(255, 0, 60, 0.4);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

#musicToggleBtn:hover {
  background: var(--neon-red-glow);
  color: #fff;
  box-shadow: 0 0 20px var(--neon-red-glow);
}

/* Arcade Container */
.arcade-container {
  position: relative;
  z-index: 10;
  width: 90%;
  max-width: 680px;
  background: #12091f;
  border: 4px solid var(--neon-red-glow);
  border-radius: 16px;
  box-shadow: 
    0 0 25px rgba(229, 9, 20, 0.6),
    inset 0 0 15px rgba(229, 9, 20, 0.4),
    0 0 50px rgba(138, 43, 226, 0.3);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 20px auto;
}

/* Stranger Things Header */
.arcade-header {
  text-align: center;
  border-bottom: 2px dashed rgba(255, 0, 60, 0.3);
  padding-bottom: 15px;
}

.stranger-title {
  font-family: 'Bungee Shade', 'Press Start 2P', cursive;
  font-size: 32px;
  color: #000;
  -webkit-text-stroke: 1.5px var(--neon-red-glow);
  text-shadow: 
    0 0 10px var(--neon-red-glow),
    0 0 20px var(--neon-red-glow),
    0 0 30px var(--stranger-red);
  letter-spacing: 2px;
  margin-bottom: 8px;
  animation: flicker 3s infinite alternate;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.4; }
  94% { opacity: 1; }
  96% { opacity: 0.6; }
  97% { opacity: 1; }
}

.arcade-subtitle {
  font-family: 'VT323', monospace;
  font-size: 18px;
  color: var(--neon-cyan);
  letter-spacing: 3px;
  margin-bottom: 12px;
}

/* Stage Tracker */
.stage-tracker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.stage-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #555;
  background: #111;
  color: #777;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all 0.4s ease;
}

.stage-dot.active {
  border-color: var(--neon-red-glow);
  background: var(--stranger-red);
  color: #fff;
  box-shadow: 0 0 12px var(--neon-red-glow);
}

.stage-dot.completed {
  border-color: var(--neon-green);
  background: #114411;
  color: var(--neon-green);
}

.stage-line {
  height: 2px;
  width: 25px;
  background: #333;
}

/* Screen Area */
.arcade-screen {
  background: var(--card-bg);
  border: 2px solid #3d1b66;
  border-radius: 10px;
  padding: 25px 20px;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

/* Pages */
.page {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  animation: fadeIn 0.5s ease-in-out forwards;
}

.page.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* Badges */
.badge {
  font-size: 9px;
  padding: 6px 12px;
  border-radius: 12px;
  letter-spacing: 1px;
  margin-bottom: 15px;
  text-transform: uppercase;
}

.neon-red { background: rgba(229, 9, 20, 0.2); border: 1px solid var(--neon-red-glow); color: var(--neon-red-glow); }
.neon-yellow { background: rgba(255, 230, 0, 0.2); border: 1px solid var(--neon-yellow); color: var(--neon-yellow); }
.neon-pink { background: rgba(255, 0, 127, 0.2); border: 1px solid var(--neon-pink); color: var(--neon-pink); }
.neon-green { background: rgba(57, 255, 20, 0.2); border: 1px solid var(--neon-green); color: var(--neon-green); }

/* Headings */
.main-heading {
  font-size: 16px;
  line-height: 1.5;
  color: #fff;
  text-shadow: 0 0 8px var(--neon-red-glow);
  margin-bottom: 18px;
}

.yellow-glow { text-shadow: 0 0 10px var(--neon-yellow); color: #fff; }
.heart-glow { text-shadow: 0 0 12px var(--neon-pink); color: #fff; }
.green-glow { text-shadow: 0 0 12px var(--neon-green); color: #fff; }

/* Text Content */
.story-text {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.6;
  color: #e0e0e0;
  margin-bottom: 25px;
  max-width: 520px;
}

.love-letter {
  font-size: 16px;
  color: #ffdae9;
  font-style: italic;
}

.signature {
  display: block;
  margin-top: 15px;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: var(--neon-pink);
}

.flower-icon-display {
  font-size: 28px;
  margin: 15px 0 25px 0;
  animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Buttons Container & Runaway Logic */
.buttons-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
  width: 100%;
  position: relative;
  min-height: 90px;
}

/* Arcade Buttons */
.arcade-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  padding: 14px 22px;
  border: 3px solid;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-yes {
  background: rgba(57, 255, 20, 0.15);
  border-color: var(--neon-green);
  color: var(--neon-green);
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.4);
}

.btn-yes:hover {
  background: var(--neon-green);
  color: #000;
  box-shadow: 0 0 25px var(--neon-green);
  transform: scale(1.08);
}

.btn-no {
  background: rgba(229, 9, 20, 0.25);
  border-color: var(--neon-red-glow);
  color: var(--neon-red-glow);
  box-shadow: 0 0 15px rgba(255, 0, 60, 0.4);
  transition: left 0.15s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 50;
  white-space: nowrap;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn-next {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.btn-next:hover {
  background: var(--neon-cyan);
  color: #000;
  box-shadow: 0 0 25px var(--neon-cyan);
  transform: scale(1.05);
}

.btn-whatsapp {
  background: rgba(57, 255, 20, 0.2);
  border-color: var(--neon-green);
  color: var(--neon-green);
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.4);
}

.btn-whatsapp:hover {
  background: var(--neon-green);
  color: #000;
  box-shadow: 0 0 25px var(--neon-green);
  transform: scale(1.05);
}

.btn-restart {
  background: rgba(255, 255, 255, 0.1);
  border-color: #888;
  color: #ccc;
  margin-top: 10px;
}

.btn-restart:hover {
  background: #fff;
  color: #000;
}

/* Page 4 Card */
.arcade-card {
  background: rgba(0, 0, 0, 0.6);
  border: 2px dashed var(--neon-green);
  padding: 18px;
  border-radius: 8px;
  margin-bottom: 25px;
  width: 100%;
  max-width: 500px;
}

.final-notice {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  line-height: 1.8;
  color: #fff;
  text-align: left;
}

.highlight-time {
  font-family: 'Press Start 2P', monospace;
  color: var(--neon-yellow);
  font-size: 16px;
  text-shadow: 0 0 8px var(--neon-yellow);
}

.final-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

/* Arcade Footer */
.arcade-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 2px dashed rgba(255, 0, 60, 0.3);
  padding-top: 12px;
  font-size: 8px;
  color: #888;
}

.coin-slot {
  font-family: 'VT323', monospace;
  font-size: 14px;
  color: var(--neon-yellow);
  letter-spacing: 1px;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  .arcade-container {
    width: 95%;
    padding: 14px;
  }
  .stranger-title {
    font-size: 22px;
  }
  .main-heading {
    font-size: 13px;
  }
  .story-text {
    font-size: 13px;
  }
  .arcade-btn {
    font-size: 9px;
    padding: 12px 16px;
  }
  .final-notice {
    font-size: 12px;
  }
  .arcade-footer {
    flex-direction: column;
    gap: 8px;
  }
}

/* Intro Page Styling */
.intro-cassette {
  font-size: 34px;
  margin: 15px 0 25px 0;
  animation: pulseCassette 2s infinite ease-in-out;
}

@keyframes pulseCassette {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 5px var(--neon-red-glow)); }
  50% { transform: scale(1.12); filter: drop-shadow(0 0 18px var(--neon-red-glow)); }
}

.btn-start-game {
  background: var(--stranger-red);
  border-color: var(--neon-red-glow);
  color: #fff;
  font-size: 11px;
  padding: 16px 24px;
  box-shadow: 0 0 20px var(--neon-red-glow);
  cursor: pointer;
  animation: buttonGlow 2.5s infinite;
}

.btn-start-game:hover {
  background: #fff;
  color: #000;
  box-shadow: 0 0 30px #fff;
  transform: scale(1.05);
}

@keyframes buttonGlow {
  0%, 100% { box-shadow: 0 0 15px var(--neon-red-glow); }
  50% { box-shadow: 0 0 30px var(--neon-red-glow), 0 0 10px #ffffff; }
}
