* {
  position: relative;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  background-color: #000;
}

body {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.5);
  font-family: "Russo One", arial, sans-serif;
  line-height: 1.25;
  letter-spacing: 0.06em;
}

.hide {
  opacity: 0;
  visibility: hidden;
}

.remove {
  display: none !important;
}

.blur {
  filter: blur(12px);
}

.container {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loading-init {
  width: 100%;
  align-self: center;
  text-align: center;
  text-transform: uppercase;
}
.loading-init__header {
  font-size: 2.2em;
}
.loading-init__status {
  margin-top: 1em;
  font-size: 0.8em;
  opacity: 0.75;
}

.stage-container {
  overflow: hidden;
  box-sizing: initial;
  border: 1px solid #222;
  margin: -1px;
}
@media (max-width: 840px) {
  .stage-container {
    border: none;
    margin: 0;
  }
}

.canvas-container {
  width: 100%;
  height: 100%;
  transition: filter 0.3s;
}
.canvas-container canvas {
  position: absolute;
  mix-blend-mode: lighten;
  transform: translateZ(0);
}

.controls {
  position: absolute;
  top: 14px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 50 !important;
  transition: opacity 0.3s, visibility 0.3s;
}
.controls-left, .controls-right {
  display: flex;
  gap: 12px;
  align-items: center;
  pointer-events: auto;
}
@media (min-width: 840px) {
  .controls {
    visibility: visible;
  }
  .controls.hide:hover {
    opacity: 1;
  }
}

.menu {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.42);
  transition: opacity 0.3s, visibility 0.3s;
}
.menu__inner-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  transition: opacity 0.3s;
}
.menu__header {
  margin-top: auto;
  margin-bottom: 8px;
  padding-top: 16px;
  font-size: 2em;
  text-transform: uppercase;
}
.menu__subheader {
  margin-bottom: auto;
  padding-bottom: 12px;
  font-size: 0.86em;
  opacity: 0.8;
}
.menu form {
  width: 100%;
  max-width: 400px;
  padding: 0 10px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.menu .form-option {
  display: flex;
  align-items: center;
  margin: 16px 0;
  transition: opacity 0.3s;
}
.menu .form-option label {
  display: block;
  width: 50%;
  padding-right: 12px;
  text-align: right;
  text-transform: uppercase;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}
.menu .form-option--select select {
  display: block;
  width: 50%;
  height: 30px;
  font-size: 1rem;
  font-family: "Russo One", arial, sans-serif;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.06em;
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.menu .form-option--select select option {
  background-color: black;
}
.menu .form-option--checkbox input {
  display: block;
  width: 26px;
  height: 26px;
  margin: 0;
  opacity: 0.5;
}
@media (max-width: 840px) {
  .menu .form-option select, .menu .form-option input {
    outline: none;
  }
}

.close-menu-btn {
  position: absolute;
  top: 0;
  right: 0;
}

.btn {
  opacity: 0.82;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(26, 0, 12, 0.65);
  border: 1px solid rgba(255, 215, 0, 0.4);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(255, 215, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.25s cubic-bezier(0.2, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn--bright {
  opacity: 0.9;
}
.btn:hover {
  opacity: 1;
  transform: translateY(-2px) scale(1.06);
  border-color: rgba(255, 215, 0, 0.9);
  box-shadow: 0 6px 20px rgba(255, 107, 0, 0.5), 0 0 16px rgba(255, 215, 0, 0.6);
}
.btn:active {
  transform: scale(0.96);
}
.btn--bright:hover {
  opacity: 1;
}
.btn svg {
  display: block;
  margin: auto;
  pointer-events: none;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.4));
}

.help-modal {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  visibility: hidden;
  transition-property: visibility;
  transition-duration: 0.25s;
}
.help-modal__overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  opacity: 0;
  transition-property: opacity;
  transition-timing-function: ease-in;
  transition-duration: 0.25s;
}
.help-modal__dialog {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 400px;
  max-height: calc(100vh - 100px);
  margin: 10px;
  padding: 20px;
  border-radius: 0.3em;
  background-color: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: scale(0.9, 0.9);
  transition-property: opacity, transform;
  transition-timing-function: ease-in;
  transition-duration: 0.25s;
}
@media (min-width: 840px) {
  .help-modal__dialog {
    font-size: 1.25rem;
    max-width: 500px;
  }
}
.help-modal__header {
  font-size: 1.75em;
  text-transform: uppercase;
  text-align: center;
}
.help-modal__body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1em 0;
  padding: 1em 0;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
}
.help-modal__close-btn {
  flex-shrink: 0;
  outline: none;
  border: none;
  border-radius: 2px;
  padding: 0.25em 0.75em;
  margin-top: 0.36em;
  font-family: "Russo One", arial, sans-serif;
  font-size: 1em;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background-color: rgba(255, 255, 255, 0.25);
  transition: color 0.3s, background-color 0.3s;
}
.help-modal__close-btn:hover, .help-modal__close-btn:active, .help-modal__close-btn:focus {
  color: #FFF;
  background-color: #09F;
}
.help-modal.active {
  visibility: visible;
  transition-duration: 0.4s;
}
.help-modal.active .help-modal__overlay {
  opacity: 1;
  transition-timing-function: ease-out;
  transition-duration: 0.4s;
}
.help-modal.active .help-modal__dialog {
  opacity: 1;
  transform: scale(1, 1);
  transition-timing-function: ease-out;
  transition-duration: 0.4s;
}


/* ================================================================
   DIWALI OVERLAY — Deepavali Festival of Lights Theme
   Sits above the fireworks canvas (z-index > canvas mix-blend layer)
   pointer-events: none so fireworks still receive clicks
   ================================================================ */

:root {
  --gold:       #FFD700;
  --gold-light: #FFE873;
  --amber:      #FF9900;
  --saffron:    #FF6A00;
  --crimson:    #E60039;
  --font-display: 'Cinzel Decorative', serif;
  --font-hindi:   'Noto Sans Devanagari', sans-serif;
  --font-body:    'Poppins', sans-serif;
}

/* Deep royal cosmic Diwali night sky */
html {
  background: radial-gradient(ellipse at 50% -5%, #230833 0%, #12041d 35%, #08020d 70%, #000000 100%) !important;
}
body {
  background: transparent !important;
}

/* Make their container fill screen */
.container {
  width: 100%;
  height: 100%;
}

/* ── Diwali overlay div ────────────────────────────────────────── */
#diwali-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  overflow: hidden;
}

/* ── Toran (Bandhanwar) ────────────────────────────────────────── */
#toran {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.toran-inner {
  display: flex;
  align-items: flex-end;
  gap: clamp(2px, 0.8vw, 6px);
  background: linear-gradient(180deg, rgba(160, 45, 0, 0.5) 0%, rgba(80, 10, 0, 0.2) 65%, transparent 100%);
  padding: 6px 30px 14px;
  border-radius: 0 0 50px 50px;
  border-bottom: 2px solid rgba(255, 215, 0, 0.4);
  box-shadow: 0 4px 30px rgba(255, 120, 0, 0.3);
}
.t-marigold,
.t-leaf,
.t-flower,
.t-bell,
.t-diya {
  font-size: clamp(16px, 2.5vw, 24px);
  display: inline-block;
  filter: drop-shadow(0 2px 8px rgba(255, 140, 0, 0.7));
  animation: toranSwing var(--sw, 2.5s) ease-in-out infinite var(--sd, 0s);
  transform-origin: top center;
}
.t-leaf     { --sw: 2.8s; --sd: 0s; }
.t-flower   { --sw: 2.3s; --sd: 0.3s; }
.t-marigold { --sw: 2.6s; --sd: 0.15s; }
.t-bell     { --sw: 2.1s; --sd: 0.4s; }
.t-diya     { --sw: 2.5s; --sd: 0.2s; }

@keyframes toranSwing {
  0%, 100% { transform: rotate(-5deg); }
  50%      { transform: rotate(5deg); }
}

/* ── Hero text ─────────────────────────────────────────────────── */
#hero {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: min(680px, 92vw);
  animation: heroFloat 7s ease-in-out infinite;
}
@keyframes heroFloat {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50%      { transform: translate(-50%, -50%) translateY(-14px); }
}

#shubh-labh,
#om-symbol {
  font-family: var(--font-hindi);
  font-size: clamp(20px, 3.6vw, 34px);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
  display: block;
  margin-bottom: 4px;
  text-shadow: 0 0 18px rgba(255, 215, 0, 0.95), 0 0 45px rgba(255, 107, 0, 0.65);
  animation: labhPulse 3s ease-in-out infinite;
}
@keyframes labhPulse {
  0%, 100% {
    transform: scale(1);
    text-shadow: 0 0 18px rgba(255, 215, 0, 0.95), 0 0 45px rgba(255, 107, 0, 0.65);
  }
  50% {
    transform: scale(1.06);
    text-shadow: 0 0 30px rgba(255, 215, 0, 1), 0 0 70px rgba(255, 140, 0, 0.85);
  }
}

#hindi-title {
  font-family: var(--font-hindi);
  font-size: clamp(22px, 4.4vw, 42px);
  font-weight: 900;
  letter-spacing: 4px;
  margin-bottom: 2px;
  background: linear-gradient(90deg, #FF6A00, #FFE873, #FFB300, #FF6A00);
  background-size: 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: saffronFlow 3.5s linear infinite;
  filter: drop-shadow(0 0 20px rgba(255, 140, 0, 0.75));
}
@keyframes saffronFlow {
  0%   { background-position: 0%; }
  100% { background-position: 200%; }
}

#main-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(38px, 8vw, 84px);
  line-height: 1.05;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #FFF099 0%, #FFD700 22%, #FF7700 48%, #FF1A53 72%, #FFD700 88%, #FFF099 100%);
  background-size: 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: diwaliShimmer 4.5s linear infinite;
  filter: drop-shadow(0 0 32px rgba(255, 150, 0, 0.6)) drop-shadow(0 0 75px rgba(255, 70, 0, 0.4));
}
@keyframes diwaliShimmer {
  0%   { background-position: 0%; }
  100% { background-position: 300%; }
}

/* ── Sacred Deity Container (Shree Ganesh & Maha Lakshmi) ──────── */
#deity-container {
  margin: 4px auto 6px;
  width: clamp(210px, 36vw, 340px);
  max-width: 92vw;
  filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.45)) drop-shadow(0 4px 20px rgba(0, 0, 0, 0.7));
  animation: deityPulse 4s ease-in-out infinite;
  pointer-events: none;
  user-select: none;
}

#deity-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

@keyframes deityPulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.45)) drop-shadow(0 4px 20px rgba(0, 0, 0, 0.7));
  }
  50% {
    transform: scale(1.025);
    filter: drop-shadow(0 0 28px rgba(255, 220, 50, 0.7)) drop-shadow(0 4px 24px rgba(255, 120, 0, 0.4));
  }
}

#coin-shower {
  animation: coinSparkle 2s ease-in-out infinite;
  transform-origin: 220px 105px;
}
@keyframes coinSparkle {
  0%, 100% { opacity: 0.8; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(1.5px) scale(1.03); }
}

.deity-halo {
  animation: haloBreath 3s ease-in-out infinite alternate;
  transform-origin: center;
}
@keyframes haloBreath {
  0%   { opacity: 0.45; }
  100% { opacity: 0.75; }
}

#sub-line {
  font-family: var(--font-hindi);
  font-size: clamp(13px, 2.1vw, 20px);
  color: rgba(255, 235, 195, 0.9);
  font-weight: 500;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  line-height: 1.45;
  text-shadow: 0 0 14px rgba(255, 140, 0, 0.55);
}

#year-line {
  font-family: var(--font-body);
  font-size: clamp(10px, 1.4vw, 13px);
  font-weight: 400;
  color: rgba(255, 220, 120, 0.75);
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(255, 200, 50, 0.35);
}

/* ── Diya row (Deepak Mala) ────────────────────────────────────── */
#diya-row {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(8px, 2.5vw, 36px);
  padding: 0 12px 14px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.35) 45%, rgba(18, 4, 0, 0.8) 100%);
  pointer-events: none;
  z-index: 12;
}

.diya-lamp {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: clamp(42px, 6.5vw, 76px);
  user-select: none;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.65));
}

.diya-svg {
  width: 100%;
  height: auto;
  overflow: visible;
  display: block;
}

.diya-flame-group {
  transform-origin: 35px 25px;
  animation: flameFlicker var(--spd, 1.25s) ease-in-out infinite alternate var(--dly, 0s);
  filter: drop-shadow(0 0 6px rgba(255, 175, 0, 0.95)) drop-shadow(0 0 16px rgba(255, 80, 0, 0.7));
}

#d1 { --spd: 1.15s; --dly: 0.00s; }
#d2 { --spd: 1.45s; --dly: 0.25s; }
#d3 { --spd: 1.25s; --dly: 0.50s; }
#d4 { --spd: 1.55s; --dly: 0.15s; }
#d5 { --spd: 1.20s; --dly: 0.35s; }
#d6 { --spd: 1.50s; --dly: 0.60s; }
#d7 { --spd: 1.30s; --dly: 0.20s; }

@keyframes flameFlicker {
  0% {
    transform: rotate(-2.5deg) scale(0.97, 0.98);
    filter: drop-shadow(0 0 5px rgba(255, 160, 0, 0.9)) drop-shadow(0 0 14px rgba(255, 70, 0, 0.6));
  }
  30% {
    transform: rotate(1.8deg) scale(1.02, 1.01);
  }
  60% {
    transform: rotate(-1.2deg) scale(0.98, 1.03);
    filter: drop-shadow(0 0 7px rgba(255, 190, 0, 1)) drop-shadow(0 0 19px rgba(255, 90, 0, 0.75));
  }
  85% {
    transform: rotate(2.2deg) scale(1.03, 0.99);
  }
  100% {
    transform: rotate(0deg) scale(1, 1.01);
    filter: drop-shadow(0 0 5px rgba(255, 170, 0, 0.95)) drop-shadow(0 0 15px rgba(255, 80, 0, 0.65));
  }
}

/* ── Boost their controls above our overlay ────────────────────── */
.controls   { z-index: 20 !important; }
.menu       { z-index: 25 !important; }
.help-modal { z-index: 30 !important; }

/* ── Diwali loading screen override ───────────────────────────── */
.loading-init {
  font-family: var(--font-hindi), 'Russo One', sans-serif !important;
  color: rgba(255, 215, 120, 0.85) !important;
}
.loading-init__header {
  font-family: var(--font-display) !important;
  background: linear-gradient(135deg, #FFD700, #FF6A00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (max-width: 480px) {
  .toran-inner { padding: 4px 10px 10px; }
  #deity-container { width: clamp(190px, 60vw, 250px); margin: 2px auto 4px; }
  #main-title { font-size: clamp(30px, 8.5vw, 46px); }
  #hindi-title { font-size: clamp(18px, 4.8vw, 26px); }
  #sub-line { font-size: clamp(10px, 2.6vw, 13px); letter-spacing: 0.5px; }
  #shubh-labh { font-size: clamp(12px, 3.2vw, 16px); margin-bottom: 2px; }
  #diya-row { gap: 4px; padding: 0 8px 8px; }
}
