:root {
  --gold: #f5c842;
  --deep-gold: #c9972a;
  --saffron: #ff9933;
  --darker: #060304;
  --parchment: #f4e4bc;
  --fire: #ff6600;
}

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

body {
  background: var(--darker);
  font-family: 'Crimson Pro', Georgia, serif;
  min-height: 100vh;
  overflow-x: hidden;
}

#particles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.header { position: relative; z-index: 10; text-align: center; padding: 40px 20px 20px; border-bottom: 1px solid rgba(245,200,66,0.2); }
.header h1 { font-family: 'Cinzel Decorative', serif; color: var(--gold); letter-spacing: 0.15em; }

.deity-grid {
  position: relative; z-index: 10; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px; padding: 30px 20px; max-width: 800px; margin: 0 auto;
}

.deity-card {
  background: linear-gradient(145deg, rgba(245,200,66,0.08), rgba(245,200,66,0.03));
  border: 1px solid rgba(245,200,66,0.2); border-radius: 16px; padding: 20px 12px; text-align: center; cursor: pointer; transition: 0.3s;
}

.deity-img-wrap { width: 80px; height: 80px; margin: 0 auto 12px; border-radius: 50%; border: 2px solid var(--gold); overflow: hidden; }
.deity-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.deity-name-en { font-family: 'Cinzel Decorative', serif; font-size: 0.75rem; color: var(--gold); display: block; }
.deity-name-sa { font-family: 'Tiro Devanagari Sanskrit', serif; font-size: 1.1rem; color: rgba(245,200,66,0.7); display: block; }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 100; overflow-y: auto; backdrop-filter: blur(8px); -webkit-overflow-scrolling: touch; }
.modal-overlay.active { display: block; }
.modal { max-width: 1200px; margin: 20px auto; padding: 0 20px 40px; }
.back-btn { color: var(--gold); background: none; border: 1px solid var(--gold); padding: 8px 18px; border-radius: 20px; cursor: pointer; margin-bottom: 25px; font-family: 'Cinzel Decorative'; }

.darshan-layout { display: flex; justify-content: center; align-items: flex-start; gap: 30px; width: 100%; }
.mantra-col, .right-sidebar { flex: 0 0 280px; display: flex; flex-direction: column; gap: 20px; }
.portrait-col { flex: 1; display: flex; flex-direction: column; align-items: center; max-width: 500px; }

.deity-portrait-frame { 
  position: relative; width: 100%; height: 550px;
  border-radius: 20px; border: 3px solid var(--gold); overflow: visible; 
  box-shadow: 0 0 40px rgba(245,200,66,0.3); background: #111; 
}
.deity-portrait-frame img.main-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; transition: 1s ease; }

.altar-pedestal {
  width: 120%; height: 140px;
  background-image: url('images/altar_table.png'); 
  background-size: 100% 100%; background-position: center; background-repeat: no-repeat;
  display: flex; justify-content: center; align-items: flex-end; gap: 40px;
  padding-bottom: 90px; position: relative; margin-top: 25px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.9); border-radius: 12px; z-index: 5;
}

.bhog-plate {
  width: 130px; height: 42px; 
  background: radial-gradient(ellipse at center, #f5c842 0%, #8b6914 100%);
  border: 1px solid #5a4209; border-radius: 50%;
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 1px;
  box-shadow: 0 8px 15px rgba(0,0,0,0.6);
}

.bhog-item-on-plate {
  font-size: 1.6rem; line-height: 1; filter: drop-shadow(0 3px 2px rgba(0,0,0,0.6));
  user-select: none; animation: dropIn 0.3s ease-out;
}

@keyframes dropIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.sankalpa-card {
  background: linear-gradient(to bottom, #f4e4bc, #e2d1a3);
  border-radius: 5px; padding: 15px; position: relative;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.1), 0 5px 15px rgba(0,0,0,0.5);
  border-left: 10px solid #d4c08d; border-right: 10px solid #d4c08d;
  margin-top: 5px;
}
.sankalpa-card::before, .sankalpa-card::after {
  content: ""; position: absolute; height: 15px; left: -10px; right: -10px;
  background: #c4b07d; border-radius: 10px;
}
.sankalpa-card::before { top: -8px; }
.sankalpa-card::after { bottom: -8px; }

.sankalpa-textarea {
  width: 100%; background: transparent; border: none;
  font-family: 'Crimson Pro', serif; font-size: 1rem; font-style: italic;
  color: #4a3721; resize: none; outline: none; text-align: center;
  line-height: 1.4; height: 80px;
}
.sankalpa-btn {
  width: 100%; background: #4a3721; color: #f4e4bc; border: none;
  padding: 10px; margin-top: 10px; border-radius: 4px; cursor: pointer;
  font-family: 'Cinzel Decorative', serif; font-size: 0.75rem; transition: 0.3s;
}

#jaapOverlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.98);
  z-index: 500; flex-direction: column; align-items: center; justify-content: center;
  color: var(--gold); text-align: center; cursor: pointer; user-select: none;
}
#jaapOverlay.active { display: flex; }
.jaap-count { font-size: 8rem; font-family: 'Cinzel Decorative', serif; margin: 20px 0; text-shadow: 0 0 20px var(--gold); }
.jaap-mala { font-size: 1.2rem; color: var(--saffron); letter-spacing: 2px; }
.jaap-mantra { font-size: 2rem; font-family: 'Tiro Devanagari Sanskrit', serif; max-width: 80%; line-height: 1.4; }
.jaap-hint { position: absolute; bottom: 40px; font-size: 0.8rem; opacity: 0.5; font-style: italic; }
.jaap-close { position: absolute; top: 30px; right: 30px; padding: 10px 20px; border: 1px solid var(--gold); border-radius: 20px; color: var(--gold); background: none; font-family: 'Cinzel Decorative'; z-index: 600; }

.pulse-count { animation: countPulse 0.2s ease-out; }
@keyframes countPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); color: #fff; }
  100% { transform: scale(1); }
}

.offering-fly {
  position: fixed; color: var(--gold); font-style: italic; pointer-events: none;
  z-index: 200; text-shadow: 0 0 15px var(--gold); font-weight: bold;
  transition: all 2.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  opacity: 1; transform: scale(1);
}

.real-diya-container { display: flex; flex-direction: column; align-items: center; position: relative; width: 100px; }
.diya-base-img { width: 100%; height: auto; z-index: 2; filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5)); }
.diya-stand-flame-pos { position: absolute; top: -5px; z-index: 3; } 

.aarthi-pivot-point {
  position: absolute; left: 50%; top: 45%; width: 0; height: 0; z-index: 50;
  animation: circular-motion 7s linear infinite;
}
.aarthi-lamp-wrapper { position: absolute; width: 220px; left: -15px; top: -25px; }
.aarthi-lamp-img { width: 100%; height: auto; filter: drop-shadow(5px 10px 20px rgba(0,0,0,0.7)); }

@keyframes circular-motion {
  0% { transform: rotate(0deg) translateY(-90px) rotate(0deg); }
  100% { transform: rotate(360deg) translateY(-90px) rotate(-360deg); }
}

.flame { 
  width: 12px; height: 26px; background: linear-gradient(to top, #ff3300, #ff6600, #ffcc00, #ffffaa); 
  border-radius: 50% 50% 20% 20% / 60% 60% 40% 40%; animation: flame-burn 0.15s infinite alternate; box-shadow: 0 0 15px var(--fire);
}
@keyframes flame-burn { from { transform: scale(1); } to { transform: scale(1.1) translateY(-2px); } }

.section-card { background: rgba(245,200,66,0.04); border: 1px solid rgba(245,200,66,0.15); border-radius: 15px; padding: 18px; }
.section-title { font-family: 'Cinzel Decorative', serif; font-size: 0.7rem; color: var(--saffron); text-align: center; margin-bottom: 12px; border-bottom: 1px solid rgba(245,200,66,0.1); padding-bottom: 8px; }
.offering-item { text-align: center; font-size: 0.65rem; color: var(--gold); background: rgba(245,200,66,0.03); padding: 10px; border-radius: 10px; cursor: pointer; transition: 0.2s; border: 1px solid transparent; }
.ritual-btn { width: 100%; cursor: pointer; background: rgba(245,200,66,0.05); border: 1px solid rgba(245,200,66,0.2); border-radius: 10px; padding: 12px; text-align: center; color: var(--gold); font-family: 'Cinzel Decorative', serif; margin-bottom: 10px; }
.ritual-btn.active { background: rgba(245,200,66,0.2); border-color: var(--gold); }
.bell-btn { background: rgba(245,200,66,0.05); border: 1px solid var(--gold); color: var(--gold); padding: 10px 20px; border-radius: 10px; cursor: pointer; }
.ringing { animation: ring 0.5s infinite; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(20deg); } }

.volume-control { display: flex; align-items: center; gap: 10px; margin-top: 15px; }
.volume-control input { flex: 1; accent-color: var(--gold); cursor: pointer; }

/* --- MOBILE VERTICAL STACK FIX --- */
@media (max-width: 900px) { 
  .darshan-layout { 
    flex-direction: column; 
    align-items: center; 
    gap: 20px;
    width: 100%;
  } 
  .mantra-col, .portrait-col, .right-sidebar { 
    flex: none; 
    width: 100% !important; 
    max-width: 100%; 
  }
  /* Force Order: Mantra -> Altar -> Rituals */
  .mantra-col { order: 1; }
  .portrait-col { order: 2; }
  .right-sidebar { order: 3; }

  .altar-pedestal { width: 100%; gap: 10px; padding-bottom: 60px; } 
  .deity-portrait-frame { height: 400px; }
}

.ritual-select {
    width:100%; 
    background:rgba(0,0,0,0.5); 
    color:var(--gold); 
    border:1px solid rgba(245,200,66,0.3); 
    border-radius:10px; 
    padding:10px; 
    font-family:inherit; 
    cursor:pointer; 
    font-size: 0.8rem;
    outline: none;
}

/* --- DROPDOWN LIST FIX --- */
.ritual-btn option {
  background-color: #1a1a1a; /* A solid dark background */
  color: var(--gold);       /* Ensuring the text stays gold */
  padding: 10px;
}

/* For some mobile browsers, we also want to ensure the select itself 
   doesn't turn white when clicked */
.ritual-btn:focus {
  background-color: rgba(245, 200, 66, 0.15);
  outline: none;
}