/* Echoes of You - styles.css */

:root {
  --bg1:#020402;
  --fg:#eaffea;
  --muted:#7fbf7f;
  --accent:#39ff14;
  --accent-2:#2ecc71;
}

* { box-sizing:border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden !important;
  font-family:Inter, system-ui, Segoe UI, Roboto, Arial;
  color:var(--fg);
  -webkit-font-smoothing:antialiased;
  background:#050505;
}

/* ============================================
   CINEMATIC INTRO SCREEN
   ============================================ */
.intro-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 1.2s ease-out;
  pointer-events: all;
}

.intro-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.intro-screen.hidden {
  display: none;
}

.intro-content {
  max-width: 800px;
  padding: 40px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.intro-line {
  font-family: Inter, Arial, sans-serif;
  font-size: 24px;
  font-weight: 300;
  color: #39ff14;
  margin: 0 0 30px 0;
  opacity: 0;
  text-shadow: 
    0 0 20px rgba(57, 255, 20, 0.8),
    0 0 40px rgba(57, 255, 20, 0.4),
    0 0 60px rgba(57, 255, 20, 0.2);
  letter-spacing: 1px;
  line-height: 1.6;
  animation-fill-mode: forwards;
}

.intro-line:last-child {
  margin-bottom: 0;
}

/* Staggered fade-in animations */
.intro-line-1 {
  animation: introFadeIn 0.8s ease-out 0.3s forwards;
}

.intro-line-2 {
  animation: introFadeIn 0.8s ease-out 1.2s forwards;
}

.intro-line-3 {
  animation: introFadeIn 0.8s ease-out 2.1s forwards;
}

.intro-line-4 {
  animation: introFadeIn 0.8s ease-out 3.0s forwards;
}

@keyframes introFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Subtle CRT flicker effect */
.intro-content {
  animation: subtleFlicker 0.15s infinite alternate;
}

@keyframes subtleFlicker {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0.98;
  }
}

/* Scanlines overlay */
.intro-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    transparent 1px,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 3px
  );
  pointer-events: none;
  opacity: 0.3;
  z-index: 1;
  animation: scanlineScroll 8s linear infinite;
}

@keyframes scanlineScroll {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(3px);
  }
}

/* Glow pulse effect */
.intro-line {
  animation-name: introFadeInGlow;
}

.intro-line-1 {
  animation: introFadeInGlow 0.8s ease-out 0.3s forwards;
}

.intro-line-2 {
  animation: introFadeInGlow 0.8s ease-out 1.2s forwards;
}

.intro-line-3 {
  animation: introFadeInGlow 0.8s ease-out 2.1s forwards;
}

.intro-line-4 {
  animation: introFadeInGlow 0.8s ease-out 3.0s forwards;
}

@keyframes introFadeInGlow {
  0% {
    opacity: 0;
    transform: translateY(10px);
    text-shadow: 
      0 0 10px rgba(57, 255, 20, 0.4),
      0 0 20px rgba(57, 255, 20, 0.2);
  }
  50% {
    text-shadow: 
      0 0 25px rgba(57, 255, 20, 1),
      0 0 50px rgba(57, 255, 20, 0.6),
      0 0 75px rgba(57, 255, 20, 0.3);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    text-shadow: 
      0 0 20px rgba(57, 255, 20, 0.8),
      0 0 40px rgba(57, 255, 20, 0.4),
      0 0 60px rgba(57, 255, 20, 0.2);
  }
}

/* Responsive text sizing */
@media (max-width: 768px) {
  .intro-line {
    font-size: 18px;
    margin-bottom: 25px;
  }
  
  .intro-content {
    padding: 30px 20px;
  }
}

@media (max-width: 480px) {
  .intro-line {
    font-size: 16px;
    margin-bottom: 20px;
  }
}

/* ============================================
   TITLE SCREEN ANIMATED CRT BACKGROUND
   ============================================ */
.title-bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.7;
  background: #000;
}

/* Hide canvas when game is running or scrolled down */
@media (max-height: 600px) {
  .title-bg-canvas {
    opacity: 0.5;
  }
}

/* Background Layers */
.bg-wrap { position:fixed; inset:0; overflow:hidden; z-index:0; }
.bg-layer { position:absolute; inset:-10% -10%; background-position:center; background-repeat:no-repeat; background-size:cover; transform:translate3d(0,0,0); will-change:transform,filter; }
.bg-back {
  background-image: url('assets/Halloween_background.jpg');
  filter: brightness(0.75) contrast(1.1) saturate(1.05);
  z-index: 0;
}
.bg-mid {
  background-image: url('assets/Halloween_background.jpg');
  filter: brightness(0.58) blur(1px) saturate(0.9);
  opacity: 0.68;
  z-index: 1;
}
.bg-front {
  background-image: url('assets/Halloween_background.jpg');
  filter: brightness(0.38) contrast(1.05) saturate(0.82);
  opacity: 0.48;
  z-index: 2;
}
.bg-vignette{ position:absolute; inset:0; pointer-events:none; background:radial-gradient(ellipse at 50% 40%, rgba(0,0,0,0) 30%, rgba(0,0,0,0.5) 100%); z-index:4; }

/* Floating animation */
@keyframes floatSlow { 0%{transform:translateY(0px) scale(1.02);}50%{transform:translateY(-14px) scale(1.035);}100%{transform:translateY(0px) scale(1.02);} }

.bg-back{ animation:floatSlow 26s ease-in-out infinite; }
.bg-mid { animation:floatSlow 40s ease-in-out infinite; }
.bg-front{ animation:floatSlow 18s ease-in-out infinite; }

/* Page */
.page { 
  position:relative; 
  z-index:10; 
  max-width:1200px; 
  height:100vh;
  margin:0 auto; 
  padding:15px 20px; 
  display:flex; 
  flex-direction:column; 
  gap:12px;
  overflow-y:auto;
  overflow-x:hidden;
}

/* Very subtle green glow for normal mode */
.page:not(.difficulty-hard):not(.difficulty-god)::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 80px 20px rgba(57,255,20,0.08);
  z-index: 10;
}

/* Hero */
.hero { 
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding-top: 40px;
  padding-bottom: 40px;
  padding-left: 14px;
  padding-right: 14px;
  border-radius:12px; 
  background:linear-gradient(180deg,rgba(0,0,0,0.4),rgba(0,0,0,0.25)); 
  box-shadow:0 12px 60px rgba(0,0,0,0.5); 
  border:1px solid rgba(57,255,20,0.06);
  animation: titleFadeIn 1s ease forwards;
  position: relative;
}

/* Hero Content Wrapper */
.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  flex: 1;
}

/* Grim Reaper Artwork */
.hero-reaper {
  width: 320px;
  max-width: 340px;
  height: auto;
  opacity: 0.9;
  pointer-events: none;
  user-select: none;
  animation: reaperFloat 4.5s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(57,255,20,0.35));
  margin-left: -20px;
  flex-shrink: 0;
}

@keyframes reaperFloat {
  0%   { transform: translateY(0px); }
  50%  { transform: translateY(-14px); }
  100% { transform: translateY(0px); }
}
.logo { 
  max-width: 320px;
  height: auto;
  display:flex; 
  align-items:center; 
  justify-content:center; 
  transform-origin:center;
  transition: filter 0.8s ease;
  filter: drop-shadow(0 0 14px rgba(57,255,20,0.3));
  margin-bottom: 8px;
}

/* Subtle glow for normal mode */
.page:not(.difficulty-hard):not(.difficulty-god) .logo {
  filter: drop-shadow(0 0 14px rgba(57,255,20,0.3));
}
.title h1 { 
  margin:0; 
  font-size:3rem; 
  letter-spacing: 3px;
  font-family:Nosifer,Inter,Arial; 
  color:var(--accent); 
  text-shadow: 
    0 0 6px rgba(57,255,20,0.45),
    0 0 16px rgba(57,255,20,0.25),
    0 0 32px rgba(57,255,20,0.15);
  transition: color 0.8s ease, text-shadow 0.8s ease;
}

/* Subtle glow for normal mode */
.page:not(.difficulty-hard):not(.difficulty-god) .title h1 {
  text-shadow: 
    0 0 6px rgba(57,255,20,0.45),
    0 0 16px rgba(57,255,20,0.25),
    0 0 32px rgba(57,255,20,0.15);
}

/* No animation for normal mode - keep it calm */
.tag { color:var(--muted); margin-top:6px; }
.hero-controls { 
  display:flex; 
  flex-direction:column;
  gap:16px; 
  align-items:center;
  margin-top: 10px;
}

/* Hero buttons premium style */
.hero-controls button {
  padding: 14px 28px;
  font-size: 1.15rem;
  letter-spacing: 0.8px;
  color: #39ff14;
  background: rgba(10,10,10,0.55);
  border: 2px solid rgba(57,255,20,0.6);
  border-radius: 8px;
  transition: all 0.25s ease;
  box-shadow:
    0 0 10px rgba(57,255,20,0.25),
    inset 0 0 10px rgba(57,255,20,0.15);
}

.hero-controls button:hover {
  background: rgba(57,255,20,0.15);
  transform: scale(1.05);
  box-shadow:
    0 0 18px rgba(57,255,20,0.45),
    inset 0 0 14px rgba(57,255,20,0.25);
}

/* Main Module */
.main-module { display:flex; flex-direction:column; align-items:center; gap:12px; }
.game-wrap { width:100%; max-width:1100px; border-radius:14px; padding:12px; background:linear-gradient(180deg,rgba(0,0,0,0.35),rgba(0,0,0,0.22)); box-shadow:0 30px 120px rgba(0,0,0,0.65); border:1px solid rgba(57,255,20,0.08); position:relative; overflow:hidden; z-index:5; }
.game-glow { 
  position:absolute; 
  inset:-20px; 
  border-radius:22px; 
  pointer-events:none; 
  z-index:2;
  transition: box-shadow 0.8s ease;
}

/* Subtle glow for normal mode */
.page:not(.difficulty-hard):not(.difficulty-god) .game-glow {
  box-shadow:0 0 30px 10px rgba(57,255,20,0.18),0 0 80px 20px rgba(57,255,20,0.1);
}

.game-canvas-wrap {
  position: relative;
  width: 100%;
  height: calc(100vh - 220px);
  min-height: 280px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(57, 255, 20, 0.4);
  box-shadow: 
    0 0 15px rgba(57, 255, 20, 0.3),
    inset 0 0 20px rgba(57, 255, 20, 0.05);
}
canvas { position:absolute; left:0; top:0; width:100%; height:100%; display:block; opacity:1 !important; visibility:visible !important; }
.bats-canvas { pointer-events:none; z-index:3; }
.flash { position:fixed; inset:0; background:rgba(255,255,255,0.9); pointer-events:none; mix-blend-mode:screen; opacity:0; transition:opacity 0.12s ease; z-index:9; }

/* Controls */
.controls { display:flex; gap:10px; align-items:center; margin-top:12px; width:100%; justify-content:space-between; position:relative; z-index:8; }
.btn { 
  background:linear-gradient(180deg,var(--accent),var(--accent-2)); 
  border:none; 
  color:#022; 
  padding:10px 14px; 
  border-radius:10px; 
  font-weight:700; 
  cursor:pointer; 
  box-shadow: 
    0 0 10px rgba(57,255,20,0.25),
    inset 0 0 10px rgba(57,255,20,0.15),
    0 4px 8px rgba(0,0,0,0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  letter-spacing: 0.5px;
  user-select: none;
}

.btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
  background-size: 200% 200%;
  animation: sweepLight 3s linear infinite;
  opacity: 0.5;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 0 16px rgba(57,255,20,0.45),
    inset 0 0 14px rgba(57,255,20,0.25),
    0 6px 12px rgba(0,0,0,0.4);
  animation: hauntedPulse 1.5s ease-in-out infinite;
}

.btn:hover::before {
  opacity: 1;
  animation: ghostlyShimmer 2s linear infinite;
}

.btn:active {
  transform: translateY(0) scale(0.95);
  box-shadow: 0 0 10px rgba(57,255,20,0.5), 0 2px 4px rgba(0,0,0,0.3);
  animation: clickRipple 0.6s ease-out;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(57,255,20,0.3), 0 0 25px rgba(57,255,20,0.6);
}

.small { 
  font-size:13px; 
  padding:8px 10px; 
  border-radius:8px; 
  border:1px solid rgba(57,255,20,0.2); 
  background:rgba(0,0,0,0.4); 
  color:var(--fg); 
  cursor:pointer; 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(57,255,20,0.2);
  position: relative;
  backdrop-filter: blur(5px);
  user-select: none;
  font-weight: 500;
}

.small:hover {
  background:rgba(57,255,20,0.1);
  border-color: rgba(57,255,20,0.5);
  box-shadow: 0 0 20px rgba(57,255,20,0.4);
  transform: translateY(-1px);
  animation: eerieGlow 1s ease-in-out infinite;
}

.small::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 8px;
  background: linear-gradient(45deg, rgba(57,255,20,0.2), transparent, rgba(57,255,20,0.2));
  background-size: 200% 200%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.small:hover::before {
  opacity: 1;
  animation: borderGlow 2s linear infinite;
}

.small:active {
  transform: translateY(0) scale(0.97);
  animation: clickFlash 0.3s ease-out;
}

.small:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(57,255,20,0.4), 0 0 20px rgba(57,255,20,0.4);
}

@keyframes hauntedPulse {
  0%, 100% { 
    box-shadow: 0 0 25px rgba(57,255,20,0.6), 0 6px 12px rgba(0,0,0,0.4);
  }
  50% { 
    box-shadow: 0 0 35px rgba(57,255,20,0.8), 0 6px 12px rgba(0,0,0,0.4);
  }
}

@keyframes ghostlyShimmer {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes eerieGlow {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(57,255,20,0.4);
  }
  50% { 
    box-shadow: 0 0 30px rgba(57,255,20,0.6);
  }
}

@keyframes sweepLight {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes clickRipple {
  0% { 
    box-shadow: 0 0 0 0 rgba(57,255,20,0.8), 0 0 10px rgba(57,255,20,0.5);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(57,255,20,0), 0 0 30px rgba(57,255,20,0.3);
  }
  100% { 
    box-shadow: 0 0 0 20px rgba(57,255,20,0), 0 0 10px rgba(57,255,20,0.5);
  }
}

@keyframes clickFlash {
  0% { 
    background: rgba(57,255,20,0.3);
  }
  50% {
    background: rgba(57,255,20,0.5);
  }
  100% { 
    background: rgba(0,0,0,0.4);
  }
}

@keyframes borderGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Details */
.details { display:grid; grid-template-columns:1fr 360px; gap:18px; margin-top:6px; }
.card { padding:14px; border-radius:12px; background:linear-gradient(180deg,rgba(0,0,0,0.3),rgba(0,0,0,0.2)); border:1px solid rgba(255,255,255,0.04); }

footer { margin-top:10px; color:var(--muted); font-size:13px; text-align:center; }

/* Difficulty Selector */
.difficulty-selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.4);
  border-radius: 10px;
  border: 1px solid rgba(57,255,20,0.2);
  backdrop-filter: blur(5px);
}

.difficulty-label-top {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: rgba(57,255,20,0.6);
  text-align: center;
}

.difficulty-options {
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,0.3);
  padding: 3px;
  border-radius: 8px;
}

.diff-option {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  user-select: none;
}

.diff-option:hover {
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.05);
}

.diff-option.active {
  color: #022;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.diff-option[data-level="0"].active {
  background: linear-gradient(180deg, #39ff14, #2ecc71);
  box-shadow: 0 0 15px rgba(57,255,20,0.5);
}

.diff-option[data-level="1"].active {
  background: linear-gradient(180deg, #ff9500, #ff6b00);
  box-shadow: 0 0 15px rgba(255,149,0,0.5);
  animation: hardPulse 2s ease-in-out infinite;
}

.diff-option[data-level="2"].active {
  background: linear-gradient(180deg, #ff003c, #cc0030);
  box-shadow: 0 0 20px rgba(255,0,60,0.6);
  animation: godPulse 1.5s ease-in-out infinite;
}

@keyframes hardPulse {
  0%, 100% { 
    box-shadow: 0 0 15px rgba(255,149,0,0.5);
  }
  50% { 
    box-shadow: 0 0 25px rgba(255,149,0,0.7);
  }
}

@keyframes godPulse {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(255,0,60,0.6);
  }
  50% { 
    box-shadow: 0 0 35px rgba(255,0,60,0.9);
  }
}

/* Neon Difficulty Slider */
.difficulty-slider-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(0,0,0,0.85), rgba(10,10,15,0.75));
  border-radius: 12px;
  border: 2px solid rgba(0,255,102,0.4);
  box-shadow: 0 4px 20px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1), 0 0 20px rgba(0,255,102,0.2);
  position: relative;
  min-width: 280px;
  backdrop-filter: blur(10px);
}

.difficulty-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(0,255,102,0.7);
  text-align: center;
  text-shadow: 0 0 8px rgba(0,255,102,0.5);
}

.slider-track {
  position: relative;
  padding: 20px 0;
}

.slider-glow {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 6px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, 
    rgba(0,255,102,0.1) 0%, 
    rgba(0,255,102,0.3) 50%, 
    rgba(0,255,102,0.1) 100%);
  border-radius: 3px;
  filter: blur(8px);
  pointer-events: none;
  transition: all 0.3s ease;
}

.difficulty-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, #1a1a1f 0%, #252530 100%);
  border-radius: 3px;
  outline: none;
  position: relative;
  z-index: 2;
  cursor: pointer;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.03);
}

.difficulty-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, #00ff66 0%, #00cc52 70%, #008f3a 100%);
  cursor: pointer;
  box-shadow: 
    0 0 0 3px rgba(0,0,0,0.8),
    0 0 15px rgba(0,255,102,0.8),
    0 0 30px rgba(0,255,102,0.4),
    0 4px 8px rgba(0,0,0,0.5);
  transition: all 0.2s ease;
  position: relative;
  border: 2px solid rgba(0,255,102,0.3);
  animation: thumbGlow 2s ease-in-out infinite;
}

.difficulty-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, #00ff66 0%, #00cc52 70%, #008f3a 100%);
  cursor: pointer;
  box-shadow: 
    0 0 0 3px rgba(0,0,0,0.8),
    0 0 15px rgba(0,255,102,0.8),
    0 0 30px rgba(0,255,102,0.4),
    0 4px 8px rgba(0,0,0,0.5);
  transition: all 0.2s ease;
  border: 2px solid rgba(0,255,102,0.3);
  animation: thumbGlow 2s ease-in-out infinite;
}

.difficulty-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 
    0 0 0 3px rgba(0,0,0,0.9),
    0 0 20px rgba(0,255,102,1),
    0 0 40px rgba(0,255,102,0.6),
    0 6px 12px rgba(0,0,0,0.6);
}

.difficulty-range::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 
    0 0 0 3px rgba(0,0,0,0.9),
    0 0 20px rgba(0,255,102,1),
    0 0 40px rgba(0,255,102,0.6),
    0 6px 12px rgba(0,0,0,0.6);
}

.difficulty-range:active::-webkit-slider-thumb {
  transform: scale(1.05);
  box-shadow: 
    0 0 0 3px rgba(0,0,0,0.9),
    0 0 25px rgba(0,255,102,1),
    0 0 50px rgba(0,255,102,0.8),
    0 2px 6px rgba(0,0,0,0.7);
}

.difficulty-range:active::-moz-range-thumb {
  transform: scale(1.05);
  box-shadow: 
    0 0 0 3px rgba(0,0,0,0.9),
    0 0 25px rgba(0,255,102,1),
    0 0 50px rgba(0,255,102,0.8),
    0 2px 6px rgba(0,0,0,0.7);
}

.slider-markers {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  position: relative;
}

.marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  transition: all 0.3s ease;
  opacity: 0.5;
  cursor: pointer;
}

.marker.active {
  opacity: 1;
}

.marker-icon {
  font-size: 18px;
  filter: drop-shadow(0 0 4px rgba(0,255,102,0.3));
  transition: all 0.3s ease;
}

.marker.active .marker-icon {
  filter: drop-shadow(0 0 12px rgba(0,255,102,0.9));
  transform: scale(1.2);
  animation: pulse 2s ease-in-out infinite;
}

.marker-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  transition: all 0.3s ease;
}

.marker.active .marker-label {
  color: #00ff66;
  text-shadow: 0 0 8px rgba(0,255,102,0.6), 0 1px 2px rgba(0,0,0,0.8);
}

@keyframes pulse {
  0%, 100% { transform: scale(1.2); }
  50% { transform: scale(1.3); }
}

@keyframes thumbGlow {
  0%, 100% { 
    box-shadow: 
      0 0 0 3px rgba(0,0,0,0.8),
      0 0 15px rgba(0,255,102,0.8),
      0 0 30px rgba(0,255,102,0.4),
      0 4px 8px rgba(0,0,0,0.5);
  }
  50% { 
    box-shadow: 
      0 0 0 3px rgba(0,0,0,0.8),
      0 0 20px rgba(0,255,102,1),
      0 0 40px rgba(0,255,102,0.6),
      0 4px 8px rgba(0,0,0,0.5);
  }
}

/* CRT grain effect */
.difficulty-slider-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.05) 0px,
    transparent 1px,
    transparent 2px,
    rgba(0,0,0,0.05) 3px
  );
  pointer-events: none;
  border-radius: 12px;
  opacity: 0.3;
}

/* HUD Effects */
.hud-effects { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; z-index: 10; }
.hud-icon { width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,0.6); border: 2px solid rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 20px; position: relative; }
.hud-icon-timer { position: absolute; inset: 0; border-radius: 50%; }

/* Responsive */
@media(max-width:980px){
  .details { grid-template-columns:1fr; }
  .game-canvas-wrap { height:58vh; }
  
  .hero {
    flex-direction: column;
    gap: 22px;
  }
  
  .hero-reaper {
    width: 240px;
    margin-left: 0;
  }
}

@media(max-width:600px){
  .hero-reaper {
    width: 180px;
  }
}

/* ============================================
   DIFFICULTY MOOD SYSTEM
   ============================================ */

/* HARD MODE - Dark Purple Haunted */
.page.difficulty-hard {
  --accent: #b794f6;
  --accent-2: #9f7aea;
}

.page.difficulty-hard .bg-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(75, 0, 130, 0.6) 0%, rgba(138, 43, 226, 0.5) 50%, rgba(75, 0, 130, 0.7) 100%);
  pointer-events: none;
  z-index: 3;
}

.page.difficulty-hard .bg-back {
  filter: brightness(0.5) contrast(1.3) saturate(1.2) hue-rotate(260deg);
}

.page.difficulty-hard .bg-mid {
  filter: brightness(0.35) blur(2px) saturate(1.0) hue-rotate(260deg);
}

.page.difficulty-hard .bg-front {
  filter: brightness(0.25) contrast(1.2) saturate(0.9) hue-rotate(260deg);
}

.page.difficulty-hard .bg-vignette {
  background: radial-gradient(ellipse at 50% 40%, rgba(75, 0, 130, 0.3) 10%, rgba(50, 0, 80, 0.8) 100%);
}

/* GOD MODE - Blood Red Haunted */
.page.difficulty-god {
  --accent: #ff6b9d;
  --accent-2: #ff3860;
}

.page.difficulty-god .bg-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(139, 0, 0, 0.65) 0%, rgba(220, 20, 60, 0.55) 50%, rgba(100, 0, 0, 0.75) 100%);
  pointer-events: none;
  z-index: 3;
}

.page.difficulty-god .bg-back {
  filter: brightness(0.45) contrast(1.4) saturate(1.4) hue-rotate(340deg);
}

.page.difficulty-god .bg-mid {
  filter: brightness(0.3) blur(2px) saturate(1.2) hue-rotate(340deg);
}

.page.difficulty-god .bg-front {
  filter: brightness(0.2) contrast(1.3) saturate(1.0) hue-rotate(340deg);
}

.page.difficulty-god .bg-vignette {
  background: radial-gradient(ellipse at 50% 40%, rgba(139, 0, 0, 0.4) 10%, rgba(80, 0, 0, 0.85) 100%);
}

/* Smooth transitions between modes */
.page,
.bg-back,
.bg-mid,
.bg-front,
.bg-vignette,
.bg-wrap::after {
  transition: filter 0.8s ease, background 0.8s ease;
}

/* HARD MODE - Purple theme for text and elements */
.page.difficulty-hard {
  color: #e9d5ff;
}

.page.difficulty-hard .title h1 {
  color: #d8b4fe;
  text-shadow: 0 0 25px rgba(168, 85, 247, 0.9), 0 0 50px rgba(168, 85, 247, 0.6);
  animation: purplePulse 2.5s ease-in-out infinite;
}

@keyframes purplePulse {
  0%, 100% { text-shadow: 0 0 25px rgba(168, 85, 247, 0.9), 0 0 50px rgba(168, 85, 247, 0.6); }
  50% { text-shadow: 0 0 35px rgba(168, 85, 247, 1), 0 0 70px rgba(168, 85, 247, 0.8); }
}

.page.difficulty-hard .tag {
  color: #c4b5fd;
}

.page.difficulty-hard .logo {
  filter: drop-shadow(0 0 15px rgba(168, 85, 247, 0.9));
  animation: skullFloatPurple 3s ease-in-out infinite;
}

.page.difficulty-hard .hero-reaper {
  filter: drop-shadow(0 0 18px rgba(168, 85, 247, 0.5));
}

.page.difficulty-hard .logo svg path {
  fill: #e9d5ff;
  stroke: #a855f7;
}

@keyframes skullFloatPurple {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  25% { transform: translateY(-6px) rotate(-3deg); }
  50% { transform: translateY(0px) rotate(0deg); }
  75% { transform: translateY(-4px) rotate(3deg); }
}

.page.difficulty-hard .logo svg ellipse,
.page.difficulty-hard .logo svg path[fill="#0a0a0a"] {
  fill: #581c87;
}

.page.difficulty-hard .btn,
.page.difficulty-hard .diff-option {
  background: rgba(139, 92, 246, 0.15);
  border-color: #a855f7;
  color: #e9d5ff;
}

.page.difficulty-hard .btn:hover,
.page.difficulty-hard .diff-option:hover {
  background: rgba(168, 85, 247, 0.25);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

.page.difficulty-hard .card {
  background: rgba(88, 28, 135, 0.2);
  border-color: rgba(168, 85, 247, 0.3);
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.2);
}

.page.difficulty-hard .game-glow {
  box-shadow: 0 0 60px 20px rgba(168, 85, 247, 0.4);
  animation: purpleGlowPulse 3s ease-in-out infinite;
}

.page.difficulty-hard .game-canvas-wrap {
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 
    0 0 15px rgba(168, 85, 247, 0.4),
    inset 0 0 20px rgba(168, 85, 247, 0.08);
}

@keyframes purpleGlowPulse {
  0%, 100% { box-shadow: 0 0 60px 20px rgba(168, 85, 247, 0.4); }
  50% { box-shadow: 0 0 80px 30px rgba(168, 85, 247, 0.6); }
}

.page.difficulty-hard::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 120px 50px rgba(139, 92, 246, 0.35);
  z-index: 10;
  animation: purpleHauntedGlow 4s ease-in-out infinite;
}

@keyframes purpleHauntedGlow {
  0%, 100% { box-shadow: inset 0 0 120px 50px rgba(139, 92, 246, 0.35); }
  50% { box-shadow: inset 0 0 140px 60px rgba(139, 92, 246, 0.45); }
}

/* GOD MODE - Red theme for text and elements */
.page.difficulty-god {
  color: #ffe4e6;
}

.page.difficulty-god .title h1 {
  color: #fecdd3;
  text-shadow: 0 0 30px rgba(239, 68, 68, 1), 0 0 60px rgba(239, 68, 68, 0.7);
  animation: redPulse 2s ease-in-out infinite;
}

@keyframes redPulse {
  0%, 100% { text-shadow: 0 0 30px rgba(239, 68, 68, 1), 0 0 60px rgba(239, 68, 68, 0.7); }
  50% { text-shadow: 0 0 45px rgba(239, 68, 68, 1), 0 0 90px rgba(239, 68, 68, 0.9); }
}

.page.difficulty-god .tag {
  color: #fda4af;
}

.page.difficulty-god .logo {
  filter: drop-shadow(0 0 18px rgba(239, 68, 68, 1));
  animation: skullFloatRed 2.5s ease-in-out infinite;
}

.page.difficulty-god .hero-reaper {
  filter: drop-shadow(0 0 18px rgba(239, 68, 68, 0.6));
}

.page.difficulty-god .logo svg path {
  fill: #ffe4e6;
  stroke: #ef4444;
}

.page.difficulty-god .game-canvas-wrap {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 
    0 0 15px rgba(239, 68, 68, 0.5),
    inset 0 0 20px rgba(239, 68, 68, 0.08);
}

@keyframes skullFloatRed {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  25% { transform: translateY(-8px) rotate(-4deg); }
  50% { transform: translateY(0px) rotate(0deg); }
  75% { transform: translateY(-5px) rotate(4deg); }
}

.page.difficulty-god .logo svg ellipse,
.page.difficulty-god .logo svg path[fill="#0a0a0a"] {
  fill: #7f1d1d;
}

.page.difficulty-god .btn,
.page.difficulty-god .diff-option {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ffe4e6;
}

.page.difficulty-god .btn:hover,
.page.difficulty-god .diff-option:hover {
  background: rgba(239, 68, 68, 0.25);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
}

.page.difficulty-god .card {
  background: rgba(127, 29, 29, 0.2);
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

.page.difficulty-god .game-glow {
  box-shadow: 0 0 70px 25px rgba(239, 68, 68, 0.5);
  animation: redGlowPulse 2.5s ease-in-out infinite;
}

@keyframes redGlowPulse {
  0%, 100% { box-shadow: 0 0 70px 25px rgba(239, 68, 68, 0.5); }
  50% { box-shadow: 0 0 100px 40px rgba(239, 68, 68, 0.7); }
}

.page.difficulty-god::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 140px 60px rgba(220, 38, 38, 0.5);
  z-index: 10;
  animation: redHauntedGlow 3s ease-in-out infinite;
}

@keyframes redHauntedGlow {
  0%, 100% { box-shadow: inset 0 0 140px 60px rgba(220, 38, 38, 0.5); }
  50% { box-shadow: inset 0 0 160px 70px rgba(220, 38, 38, 0.65); }
}

/* Glitch effect on hover */
@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(-3px, -2px); }
  60% { transform: translate(3px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

@keyframes glitchText {
  0% { 
    transform: translate(0);
    text-shadow: 0 3px 18px rgba(0,0,0,0.6), 0 0 15px rgba(57,255,20,0.3);
  }
  20% { 
    transform: translate(-2px, 1px);
    text-shadow: 2px 0 rgba(255,0,0,0.7), -2px 0 rgba(0,255,255,0.7);
  }
  40% { 
    transform: translate(-2px, -1px);
    text-shadow: -2px 0 rgba(255,0,0,0.7), 2px 0 rgba(0,255,255,0.7);
  }
  60% { 
    transform: translate(2px, 1px);
    text-shadow: 2px 2px rgba(255,0,0,0.7), -2px -2px rgba(0,255,255,0.7);
  }
  80% { 
    transform: translate(1px, -1px);
    text-shadow: -1px 0 rgba(255,0,0,0.7), 1px 0 rgba(0,255,255,0.7);
  }
  100% { 
    transform: translate(0);
    text-shadow: 0 3px 18px rgba(0,0,0,0.6), 0 0 15px rgba(57,255,20,0.3);
  }
}

.logo:hover {
  animation: glitch 0.3s ease-in-out;
}

.logo:hover ~ .title h1 {
  animation: glitchText 0.3s ease-in-out;
}

.title:hover h1 {
  animation: glitchText 0.3s ease-in-out;
}

.title:hover ~ .logo {
  animation: glitch 0.3s ease-in-out;
}

/* Make hero a flex container to enable sibling selectors */
.hero:hover .logo {
  animation: glitch 0.3s ease-in-out;
}

.hero:hover .title h1 {
  animation: glitchText 0.3s ease-in-out;
}

/* ============================================
   HOW TO PLAY POPUP
   ============================================ */

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: block;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, backdrop-filter 0.4s ease;
}

.popup-overlay.active {
  opacity: 1;
  pointer-events: all;
  animation: fadeInOverlay 0.4s ease forwards;
}

.popup-overlay.closing {
  animation: fadeOutOverlay 0.3s ease forwards;
}

@keyframes fadeInOverlay {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(4px);
  }
}

@keyframes fadeOutOverlay {
  from {
    opacity: 1;
    backdrop-filter: blur(4px);
  }
  to {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
}

.popup-box {
  position: fixed;
  top: 50%;
  left: 8%;
  transform: translateY(-50%);
  width: 520px;
  max-width: 520px;
  padding: 34px 38px;
  max-height: 85vh;
  overflow-y: auto;
  background: rgba(10, 10, 10, 0.78);
  border: 2px solid rgba(57, 255, 20, 0.55);
  box-shadow: 
    0 0 32px rgba(57, 255, 20, 0.32),
    0 0 12px rgba(57, 255, 20, 0.22) inset;
  border-radius: 10px;
  backdrop-filter: blur(2px);
  animation: popupAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Scanlines overlay effect */
.popup-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.08) 0px,
    transparent 1px,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 3px
  );
  pointer-events: none;
  border-radius: 12px;
  opacity: 0.4;
  z-index: 1;
}

/* Ensure content is above scanlines */
.popup-box > * {
  position: relative;
  z-index: 2;
}

@keyframes popupAppear {
  from {
    transform: scale(0.85) translateY(-20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.popup-box.closing {
  animation: popupDisappear 0.3s ease forwards;
}

@keyframes popupDisappear {
  from {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
  to {
    transform: scale(0.9) translateY(10px);
    opacity: 0;
  }
}

.popup-title {
  margin-top: 0;
  margin-bottom: 18px;
  font-family: Nosifer, Inter, Arial;
  font-size: 1.9rem;
  color: var(--accent);
  text-align: center;
  text-shadow: 
    0 0 20px rgba(57, 255, 20, 0.8),
    0 0 40px rgba(57, 255, 20, 0.4);
  animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
  0%, 100% { text-shadow: 0 0 20px rgba(57, 255, 20, 0.8), 0 0 40px rgba(57, 255, 20, 0.4); }
  50% { text-shadow: 0 0 30px rgba(57, 255, 20, 1), 0 0 60px rgba(57, 255, 20, 0.6); }
}

.popup-intro-narrative {
  margin: 0 0 25px 0;
  font-family: Inter, Arial;
  font-size: 18px;
  font-weight: 300;
  font-style: italic;
  color: var(--accent);
  text-align: center;
  opacity: 0.85;
  text-shadow: 
    0 0 15px rgba(57, 255, 20, 0.7),
    0 0 30px rgba(57, 255, 20, 0.3);
  letter-spacing: 0.5px;
  line-height: 1.6;
  padding: 0 20px;
  animation: narrativeGlow 3s ease-in-out infinite;
}

@keyframes narrativeGlow {
  0%, 100% { 
    text-shadow: 0 0 15px rgba(57, 255, 20, 0.7), 0 0 30px rgba(57, 255, 20, 0.3);
    opacity: 0.85;
  }
  50% { 
    text-shadow: 0 0 20px rgba(57, 255, 20, 0.9), 0 0 40px rgba(57, 255, 20, 0.5);
    opacity: 0.95;
  }
}

.popup-content {
  color: var(--fg);
  line-height: 1.6;
  font-size: 1.1rem;
  padding-top: 10px;
  border-top: 1px solid rgba(57, 255, 20, 0.2);
}

.popup-content h3 {
  color: var(--accent);
  font-size: 20px;
  margin: 20px 0 10px 0;
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

.popup-content h3:first-child {
  margin-top: 0;
}

.popup-content ul {
  margin: 10px 0;
  padding-left: 25px;
}

.popup-content li {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 1.1rem;
}

.popup-content strong {
  color: var(--fg);
}

.popup-content p {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 1.1rem;
}

.popup-close-btn {
  position: absolute;
  top: 50%;
  right: -900px;
  transform: translateY(-50%);
  padding: 12px 24px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 1px;
  border: 2px solid rgba(57, 255, 20, 0.6);
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.9), rgba(10, 30, 10, 0.8));
  color: #39ff14;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  box-shadow: 
    0 0 20px rgba(57, 255, 20, 0.3),
    0 0 40px rgba(57, 255, 20, 0.1),
    inset 0 1px 0 rgba(57, 255, 20, 0.2);
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.8);
  position: relative;
  overflow: hidden;
}

.popup-close-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(57, 255, 20, 0.1) 50%,
    transparent 70%
  );
  transform: rotate(45deg);
  animation: buttonShine 3s linear infinite;
}

@keyframes buttonShine {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.popup-close-btn:hover {
  transform: translateY(-50%) scale(1.08);
  background: linear-gradient(135deg, rgba(57, 255, 20, 0.2), rgba(20, 40, 20, 0.9));
  border-color: rgba(57, 255, 20, 0.9);
  box-shadow: 
    0 0 30px rgba(57, 255, 20, 0.6),
    0 0 60px rgba(57, 255, 20, 0.3),
    0 0 90px rgba(57, 255, 20, 0.1),
    inset 0 0 20px rgba(57, 255, 20, 0.2);
  text-shadow: 
    0 0 15px rgba(57, 255, 20, 1),
    0 0 30px rgba(57, 255, 20, 0.5);
  animation: buttonPulse 1s ease-in-out infinite;
}

@keyframes buttonPulse {
  0%, 100% {
    box-shadow: 
      0 0 30px rgba(57, 255, 20, 0.6),
      0 0 60px rgba(57, 255, 20, 0.3),
      0 0 90px rgba(57, 255, 20, 0.1),
      inset 0 0 20px rgba(57, 255, 20, 0.2);
  }
  50% {
    box-shadow: 
      0 0 40px rgba(57, 255, 20, 0.8),
      0 0 80px rgba(57, 255, 20, 0.4),
      0 0 120px rgba(57, 255, 20, 0.2),
      inset 0 0 30px rgba(57, 255, 20, 0.3);
  }
}

.popup-close-btn:active {
  transform: translateY(-50%) scale(0.95);
  box-shadow: 
    0 0 15px rgba(57, 255, 20, 0.5),
    inset 0 0 10px rgba(57, 255, 20, 0.3);
}

/* Scrollbar styling for popup */
.popup-box::-webkit-scrollbar {
  width: 8px;
}

.popup-box::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.popup-box::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

.popup-box::-webkit-scrollbar-thumb:hover {
  background: var(--accent-2);
}

/* ============================================
   ENDING SCREEN
   ============================================ */
.ending-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #000000 0%, #0a0a0a 50%, #000000 100%);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.5s ease-in-out;
}

.ending-screen.active {
  opacity: 1;
  pointer-events: all;
}

.ending-screen.hidden {
  display: none;
}

.ending-content {
  max-width: 700px;
  padding: 50px 40px;
  text-align: center;
  position: relative;
  z-index: 2;
  animation: endingContentAppear 2s ease-out forwards;
}

@keyframes endingContentAppear {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.ending-line {
  font-family: Inter, Arial, sans-serif;
  font-size: 28px;
  font-weight: 300;
  color: #39ff14;
  margin: 0 0 35px 0;
  opacity: 0;
  text-shadow: 
    0 0 25px rgba(57, 255, 20, 0.9),
    0 0 50px rgba(57, 255, 20, 0.5),
    0 0 75px rgba(57, 255, 20, 0.3);
  letter-spacing: 1.5px;
  line-height: 1.6;
}

.ending-line:last-of-type {
  margin-bottom: 50px;
}

/* Staggered fade-in for ending lines */
.ending-line-1 {
  animation: endingLineFadeIn 1s ease-out 0.5s forwards, endingFlicker 0.18s infinite 1.5s alternate;
}

.ending-line-2 {
  animation: endingLineFadeIn 1s ease-out 1.5s forwards, endingFlicker 0.18s infinite 2.5s alternate;
}

.ending-line-3 {
  animation: endingLineFadeIn 1s ease-out 2.5s forwards, endingFlicker 0.18s infinite 3.5s alternate;
}

@keyframes endingLineFadeIn {
  0% {
    opacity: 0;
    transform: translateY(15px);
    text-shadow: 
      0 0 15px rgba(57, 255, 20, 0.5),
      0 0 30px rgba(57, 255, 20, 0.3);
  }
  50% {
    text-shadow: 
      0 0 35px rgba(57, 255, 20, 1),
      0 0 70px rgba(57, 255, 20, 0.7),
      0 0 100px rgba(57, 255, 20, 0.4);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    text-shadow: 
      0 0 25px rgba(57, 255, 20, 0.9),
      0 0 50px rgba(57, 255, 20, 0.5),
      0 0 75px rgba(57, 255, 20, 0.3);
  }
}

/* Subtle CRT flicker for ending screen */
.ending-content {
  animation: none !important;
}

@keyframes endingFlicker {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0.97;
  }
}

/* Return button styling */
.ending-return-btn {
  opacity: 0;
  animation: endingButtonFadeIn 0.8s ease-out 3.5s forwards !important;
  margin-top: 20px;
  font-size: 18px;
  padding: 14px 40px;
  position: relative;
  overflow: visible;
  transform: translateZ(0);
  will-change: opacity, transform;
}

@keyframes endingButtonFadeIn {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ending-return-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 12px;
  background: linear-gradient(45deg, 
    rgba(57, 255, 20, 0.3), 
    transparent, 
    rgba(57, 255, 20, 0.3));
  background-size: 200% 200%;
  animation: endingButtonGlow 3s linear infinite;
  z-index: -1;
  opacity: 0.6;
}

@keyframes endingButtonGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Scanlines overlay for ending */
.ending-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.2) 0px,
    transparent 1px,
    transparent 2px,
    rgba(0, 0, 0, 0.2) 3px
  );
  pointer-events: none;
  opacity: 0.4;
  z-index: 1;
  animation: endingScanlineScroll 10s linear infinite;
}

@keyframes endingScanlineScroll {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(3px);
  }
}

/* Responsive ending screen */
@media (max-width: 768px) {
  .ending-line {
    font-size: 22px;
    margin-bottom: 30px;
  }
  
  .ending-line:last-of-type {
    margin-bottom: 40px;
  }
  
  .ending-content {
    padding: 40px 30px;
  }
  
  .ending-return-btn {
    font-size: 16px;
    padding: 12px 32px;
  }
}

@media (max-width: 480px) {
  .ending-line {
    font-size: 18px;
    margin-bottom: 25px;
  }
  
  .ending-line:last-of-type {
    margin-bottom: 35px;
  }
  
  .ending-content {
    padding: 30px 20px;
  }
  
  .ending-return-btn {
    font-size: 15px;
    padding: 10px 28px;
  }
}



/* Hide scrollbars but keep scrolling enabled */

/* Chrome, Safari, Edge */
::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
}

/* Firefox */
* {
  scrollbar-width: none !important;
}


/* Title Screen Fade-In Animation */
@keyframes titleFadeIn {
  from { 
    opacity: 0; 
    transform: translateY(10px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.hero * {
  animation: titleFadeIn 1s ease forwards;
}


/* --- FLOATING ANIMATION --- */
@keyframes reaperFloat {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

/* --- AURA GLOW PULSE --- */
@keyframes reaperAura {
  0% {
    filter: drop-shadow(0 0 12px rgba(57,255,20,0.25));
  }
  50% {
    filter: drop-shadow(0 0 22px rgba(57,255,20,0.55));
  }
  100% {
    filter: drop-shadow(0 0 12px rgba(57,255,20,0.25));
  }
}

/* Apply both animations to the reaper */
.reaper-image {
  animation: 
    reaperFloat 6s ease-in-out infinite,
    reaperAura 4s ease-in-out infinite;
}

/* --- DIFFICULTY MODE AURA COLORS --- */

/* HARD MODE: Purple glow */
@keyframes reaperAuraPurple {
  0% {
    filter: drop-shadow(0 0 12px rgba(168,85,247,0.25));
  }
  50% {
    filter: drop-shadow(0 0 22px rgba(168,85,247,0.55));
  }
  100% {
    filter: drop-shadow(0 0 12px rgba(168,85,247,0.25));
  }
}

/* GOD MODE: Red glow */
@keyframes reaperAuraRed {
  0% {
    filter: drop-shadow(0 0 12px rgba(239,68,68,0.25));
  }
  50% {
    filter: drop-shadow(0 0 22px rgba(239,68,68,0.55));
  }
  100% {
    filter: drop-shadow(0 0 12px rgba(239,68,68,0.25));
  }
}

/* Apply purple aura in hard mode */
.page.difficulty-hard .reaper-image {
  animation: 
    reaperFloat 6s ease-in-out infinite,
    reaperAuraPurple 4s ease-in-out infinite;
}

/* Apply red aura in god mode */
.page.difficulty-god .reaper-image {
  animation: 
    reaperFloat 6s ease-in-out infinite,
    reaperAuraRed 4s ease-in-out infinite;
}
