/* ==========================================================================
   DIWALI MEME DHAMAKA - HIGH ENERGY FESTIVE & CRAFTED PRANK STYLESHEET
   Features:
   - Dynamic Festive Ambient Particle Lighting & Floating Sky Lanterns
   - 3D Tactile Sutli Bomb with Live Sparkler Smoke & Burning Fuse
   - 440V Screen Shatter & Emergency Hardware Alarm
   - Instagram Story-Style 3-Part Sequential Video Playlist
   - Flying Reaction Physics & Golden Festive Trim
   ========================================================================== */

:root {
  --bg-dark: #07090f;
  --surface-card: #111726;
  --surface-raised: #1c2438;
  --surface-border: rgba(245, 158, 11, 0.25);
  --gold-glow: #f59e0b;
  --gold-bright: #fbbf24;
  --vermilion: #ef4444;
  --emerald: #10b981;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

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

/* App Shell */
.app-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  padding: 20px 16px 40px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Stage Transitions */
.stage-view {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.stage-view.active {
  display: flex;
  animation: stageZoom 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes stageZoom {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   STAGE 1: THE TACTILE PRANK TRAP
   ========================================================================== */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--gold-bright);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
  margin-bottom: 16px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulseDot 1.4s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.8); opacity: 0.4; }
}

.challenge-header {
  margin-bottom: 16px;
}

.to-line {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.target-name {
  color: var(--gold-bright);
  font-weight: 800;
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.main-heading {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 4px;
}

.sender-name {
  color: #38bdf8;
  font-weight: 800;
}

.challenge-quote {
  font-family: 'Yatra One', cursive;
  font-size: 1.35rem;
  line-height: 1.3;
  color: #fca5a5;
  margin-top: 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  quotes: none;
}

/* 3D Tactile Bomb Showcase */
.bomb-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px 0 22px 0;
  position: relative;
}

.fuse-wrap {
  width: 40px;
  height: 36px;
  position: relative;
  margin-bottom: -8px;
}

.fuse-cord {
  width: 28px;
  height: 30px;
  border: 4px solid #78350f;
  border-color: #78350f transparent transparent #78350f;
  border-radius: 30px 0 0 0;
  position: absolute;
  top: 4px;
  left: 10px;
  transform: rotate(24deg);
}

.fuse-ember {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, #fbbf24 50%, #ef4444 100%);
  position: absolute;
  top: 0;
  left: 6px;
  box-shadow: 0 0 16px #fbbf24, 0 0 30px #ea580c;
  animation: emberSparks 0.12s infinite alternate;
}

@keyframes emberSparks {
  0% { transform: scale(1) translate(0, 0); filter: brightness(1.2); }
  50% { transform: scale(1.6) translate(-2px, 1px); filter: brightness(1.8); }
  100% { transform: scale(0.9) translate(1px, -1px); filter: brightness(1); }
}

/* Realistic Sutli Bomb / Festive Parcel */
.tactile-bomb {
  width: 160px;
  height: 160px;
  background: 
    repeating-linear-gradient(45deg, rgba(180, 83, 9, 0.4), rgba(180, 83, 9, 0.4) 3px, transparent 3px, transparent 8px),
    repeating-linear-gradient(-45deg, rgba(180, 83, 9, 0.4), rgba(180, 83, 9, 0.4) 3px, transparent 3px, transparent 8px),
    radial-gradient(circle at 35% 35%, #991b1b 0%, #7f1d1d 60%, #450a0a 100%);
  border-radius: 24px;
  border: 2px solid rgba(254, 240, 138, 0.4);
  box-shadow: 
    inset 0 0 20px rgba(0, 0, 0, 0.8),
    0 16px 36px -8px rgba(0, 0, 0, 0.9),
    0 0 25px rgba(239, 68, 68, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
}

.parcel-ribbon-v {
  position: absolute;
  width: 22px;
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b);
  border-left: 1px solid rgba(255, 255, 255, 0.4);
  border-right: 1px solid rgba(255, 255, 255, 0.4);
}

.parcel-ribbon-h {
  position: absolute;
  height: 22px;
  width: 100%;
  background: linear-gradient(180deg, #f59e0b, #fbbf24, #f59e0b);
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.parcel-bow {
  position: absolute;
  top: -20px;
  font-size: 2.2rem;
  z-index: 5;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

.tactile-bomb:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 
    inset 0 0 20px rgba(0, 0, 0, 0.8),
    0 22px 42px -8px rgba(0, 0, 0, 0.95),
    0 0 35px rgba(34, 197, 94, 0.5);
}

.tactile-bomb:active {
  transform: scale(0.95);
}

.bomb-label-strip {
  background: #dc2626;
  color: #fff;
  border: 1px solid #fef08a;
  padding: 6px 14px;
  border-radius: 6px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  transform: rotate(-4deg);
}

.label-brand {
  display: block;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: #fef08a;
  line-height: 1.1;
  text-shadow: 0 0 6px rgba(254, 240, 138, 0.5);
}

.label-desc {
  display: block;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
}

.diya-mark {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 1.15rem;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.8));
}

.hint-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 14px;
}

/* Big Blast Button with Festive Glow */
.primary-button {
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #fff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 8px 24px -2px rgba(239, 68, 68, 0.6), 0 0 16px rgba(245, 158, 11, 0.35);
  border: 1px solid rgba(254, 240, 138, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: pulseButton 1.5s infinite;
}

@keyframes pulseButton {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.primary-button:active {
  transform: scale(0.97);
}

.disclaimer-row {
  display: flex;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 14px;
}

/* ==========================================================================
   SHOCKING 440V JUMPSCARE: BROKEN SCREEN & HARDWARE ALARMS
   ========================================================================== */
.shock-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 99999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
}

.shock-overlay.active {
  display: flex;
  animation: strobeChaos 0.1s 4;
}

@keyframes strobeChaos {
  0%, 100% { background: #000000; }
  30% { background: #ffffff; }
  60% { background: #dc2626; }
}

.glitch-line {
  position: absolute;
  width: 100%;
  height: 3px;
  opacity: 0.9;
  z-index: 2;
}

.line-1 { top: 28%; background: #ef4444; box-shadow: 0 0 15px #ef4444; }
.line-2 { top: 62%; background: #38bdf8; box-shadow: 0 0 15px #38bdf8; }

.spiderweb-crack {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}

.hardware-error-box {
  position: relative;
  z-index: 10;
  background: rgba(185, 28, 28, 0.95);
  border: 2px solid #fef08a;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  text-align: center;
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.95);
  animation: shakeAlert 0.08s infinite;
  max-width: 90%;
}

@keyframes shakeAlert {
  0% { transform: translate(3px, 2px); }
  50% { transform: translate(-3px, -2px); }
  100% { transform: translate(2px, -3px); }
}

.error-badge {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fef08a;
  margin-bottom: 6px;
}

.error-main {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
}

.error-sub {
  font-size: 0.78rem;
  color: #fecaca;
  margin-top: 4px;
}

.rumble-screen {
  animation: violentEarthquake 0.07s infinite;
}

@keyframes violentEarthquake {
  0% { transform: translate(5px, 4px) rotate(1deg); }
  25% { transform: translate(-5px, -4px) rotate(-1.5deg); }
  50% { transform: translate(-4px, 5px) rotate(0deg); }
  75% { transform: translate(5px, -3px) rotate(-1deg); }
  100% { transform: translate(3px, 4px) rotate(1deg); }
}

/* ==========================================================================
   STAGE 2: MEME REVEAL & SEQUENTIAL PLAYLIST REEL
   ========================================================================== */
.dhamaka-header {
  margin-bottom: 14px;
}

.dhamaka-badge {
  display: inline-block;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 8px;
}

.dhamaka-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--gold-bright);
  line-height: 1.2;
}

.dhamaka-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Sequential Video Card */
.video-card {
  width: 100%;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85);
}

/* 3 Story Progress Bars at Top */
.story-progress-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
}

.progress-segment {
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.progress-segment .fill {
  height: 100%;
  width: 0%;
  background: var(--gold-bright);
  border-radius: var(--radius-pill);
  transition: width 0.1s linear;
}

.progress-segment.completed .fill {
  width: 100% !important;
}

.video-caption-bar {
  background: var(--surface-raised);
  border-radius: 8px;
  padding: 8px 12px;
  border-left: 3px solid var(--gold-glow);
  text-align: left;
}

.caption-text {
  font-size: 0.85rem;
  color: #fef08a;
  font-weight: 700;
  line-height: 1.35;
}

.video-viewport {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 440px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 2px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
}

#memeVideo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Tap Zones (Instagram Story Navigation) */
.tap-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 35%;
  z-index: 4;
  cursor: pointer;
}

.tap-left { left: 0; }
.tap-right { right: 0; }

.unmute-pill {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
}

.unmute-pill.hidden {
  display: none !important;
}

.unmute-pill span {
  background: #ea580c;
  color: #fff;
  border: 2px solid #fed7aa;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  box-shadow: 0 0 20px #ea580c;
  animation: pulseUnmute 1.2s infinite;
}

@keyframes pulseUnmute {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.video-nav-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

.reaction-strip {
  display: flex;
  justify-content: center;
}

.reaction-button {
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  color: #fff;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.1s ease, background-color 0.15s ease;
}

.reaction-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.reaction-button:active {
  transform: scale(0.96);
}

.reaction-count {
  font-size: 0.78rem;
  color: var(--gold-bright);
  font-weight: 800;
}

/* ==========================================================================
   VIRAL FORWARD CARD
   ========================================================================== */
.share-card {
  width: 100%;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  margin-top: 16px;
  text-align: left;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
}

.share-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #86efac;
}

.share-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.share-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #cbd5e1;
}

.form-group input {
  background: var(--bg-dark);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus {
  border-color: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.35);
}

.whatsapp-button {
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
  font-weight: 800;
  box-shadow: 0 8px 20px -2px rgba(34, 197, 94, 0.5);
}

.whatsapp-button:hover {
  transform: translateY(-2px);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 10px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.app-footer {
  margin-top: 24px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Toast Message */
.toast-box {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: #0f172a;
  border: 1px solid var(--gold-glow);
  color: #fef08a;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 10000;
  pointer-events: none;
}

.toast-box.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
