* { box-sizing: border-box; }

:root{
  --bg:#2a1608;
  --bg-soft:#3a1f0b;
  --surface:#4a2810;
  --surface-2:#5a3114;
  --text:#fff5e7;
  --muted:#f0d9bf;
  --gold:#d97810;
  --gold-2:#f0952a;
  --green:#a8560f;
  --green-2:#c56d14;
  --line:#8f5320;
  --shadow:0 14px 30px rgba(0,0,0,.32);
}

body{
  margin:0;
  font-family:"Noto Sans Devanagari", Arial, sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at 18% 8%, #6f3a12 0%, rgba(111,58,18,0) 40%),
    radial-gradient(circle at 82% 0%, #8e4f17 0%, rgba(142,79,23,0) 36%),
    var(--bg);
  padding-right: 240px;
}

#appShell{
  min-height: 100vh;
}

.login-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    linear-gradient(rgba(28, 12, 3, 0.78), rgba(28, 12, 3, 0.86)),
    url("/api/media/intro") center center / cover no-repeat;
  backdrop-filter: blur(6px);
}

.login-overlay.hidden{
  display: none;
}

.login-card{
  width: min(96vw, 520px);
  background: linear-gradient(180deg, #5a2f12, #3f210d);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}
.entry-hero{
  width: min(96vw, 760px);
  background: linear-gradient(180deg, rgba(74, 40, 16, 0.86), rgba(50, 27, 10, 0.92));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}
.entry-hero h1{
  margin: 0 0 10px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.06;
}
.entry-hero p{
  margin: 0;
  color: var(--muted);
  font-size: 1.06rem;
}

.login-card h2{
  margin: 0 0 8px;
  font-size: 32px;
}

.login-card p{
  margin: 0;
  color: var(--muted);
}

.login-actions{
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.login-actions .chip{
  width: 100%;
  text-align: center;
}

.login-status{
  margin-top: 12px !important;
  font-size: 14px;
}

.entry-points{
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.entry-points span{
  border: 1px solid #b57b3f;
  border-radius: 6px;
  padding: 8px 10px;
  color: #ffe2bc;
  background: rgba(94, 53, 20, 0.62);
  font-size: 14px;
}

.topbar{
  position:sticky;
  top:0;
  z-index:30;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 20px;
  backdrop-filter: blur(8px);
  background:rgba(52,27,10,.82);
  border-bottom:1px solid var(--line);
}

.topbar-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

.guest-timer{
  display:inline-flex;
  align-items:center;
  border:1px solid #d6a669;
  border-radius:6px;
  padding:6px 10px;
  font-size:13px;
  color:#ffe2bc;
  background:rgba(91,51,18,.7);
}

.guest-timer.hidden{
  display:none;
}

.brand{ font-weight:800; letter-spacing:.2px; }

.hero,.avatar,.sloka-page,.types,.ask,.how,.proof,.final-cta{
  max-width:1020px;
  margin:0 auto;
  padding:22px 20px;
}

.right-rail{
  position:fixed;
  right:0;
  top:0;
  height:100vh;
  width:220px;
  background:rgba(35,18,7,.92);
  border-left:1px solid var(--line);
  z-index:20;
  display:flex;
  flex-direction:column;
}
.rail-title{
  padding:14px 12px;
  font-weight:700;
  border-bottom:1px solid var(--line);
}
.rail-marquee{
  overflow:hidden;
  flex:1;
  position:relative;
}
.rail-track{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:10px;
  animation: railScroll 95s linear infinite;
}
.rail-track:hover{
  animation-play-state: paused;
}
.rail-item{
  border:none;
  border-radius:6px;
  padding:8px 10px;
  text-align:left;
  background:linear-gradient(160deg, #6b390f, #552d0d);
  color:var(--text);
  box-shadow: inset 0 0 0 1px #a56730;
  cursor:pointer;
}
.rail-item:hover{
  background:linear-gradient(160deg, #7c4413, #61340f);
}

@keyframes railScroll{
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.hero{
  padding-top:34px;
}

.hero h1{
  margin:0 0 10px;
  font-size:clamp(30px, 4vw, 54px);
  line-height:1.08;
  text-wrap:balance;
}

.hero p,.types p,#micStatus,.card p,.final-cta p{
  color:var(--muted);
}

.hero-cta{
  margin-top:16px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.cta{
  display:inline-block;
  text-decoration:none;
  color:#fff;
  background:linear-gradient(160deg, var(--gold-2), var(--gold));
  border:1px solid #f1c06a44;
  border-radius:6px;
  padding:9px 13px;
  box-shadow: var(--shadow);
  transition:transform .16s ease, filter .16s ease;
}
.cta:hover{ transform:translateY(-1px); filter:brightness(1.05); }
.cta-big{ padding:11px 18px; font-weight:700; }
.cta-ghost{
  background:linear-gradient(160deg, #b86113, #a2500e);
  border-color:#bde3c344;
}

.types h2,.ask h2,.how h2,.proof h2,.avatar h2,.final-cta h2{
  margin:0 0 12px;
  font-size:31px;
  line-height:1.15;
}

.chips,.refs{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.refs{ margin-top:14px; }

.chip{
  border:none;
  border-radius:6px;
  padding:9px 13px;
  background:linear-gradient(160deg, #6b390f, #552d0d);
  color:var(--text);
  box-shadow: inset 0 0 0 1px #a56730;
  cursor:pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.chip.active{
  background:linear-gradient(160deg, #b56b1e, #8f4f13);
  box-shadow: inset 0 0 0 1px #f1c06a;
}
.mood-sub{
  color: var(--muted);
  margin-top: 2px;
}
.chip:hover{
  transform:translateY(-1px);
  background:linear-gradient(160deg, #7c4413, #61340f);
  box-shadow: inset 0 0 0 1px #cf8a44, var(--shadow);
}
.ref-chip{
  text-align:left;
}
.refs-panel{
  margin-top:14px;
}
.refs-wrap{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.panel,.card{
  background:linear-gradient(180deg, var(--surface), var(--surface-2));
  border:1px solid var(--line);
  border-radius:8px;
  box-shadow: var(--shadow);
}

.panel{
  padding:16px;
}

.avatar-layout{
  display:grid;
  grid-template-columns: minmax(320px, 520px) minmax(280px, 1fr);
  gap:16px;
  align-items:start;
}

.avatar-media{
  width:100%;
}

.answer-side{
  background: rgba(0,0,0,.18);
  border:1px solid var(--line);
  border-radius:8px;
  padding:12px;
  min-height: 500px;
}

.answer-side h3{
  margin:0 0 10px;
  font-size:20px;
}

#slokaTitle{
  margin: 0 0 10px;
  color: var(--muted);
}

#slokaAudio{
  width: min(100%, 460px);
  display: block;
  margin: 10px auto 0;
}

.sloka-layout{
  display:grid;
  grid-template-columns: minmax(320px, 520px) minmax(280px, 1fr);
  gap:16px;
  align-items:start;
}

.sloka-media{
  width:100%;
}

.sloka-script-wrap{
  background: rgba(0,0,0,.18);
  border:1px solid var(--line);
  border-radius:8px;
  padding:12px;
  min-height: 500px;
}

.sloka-script-wrap h3{
  margin:0 0 10px;
  font-size:20px;
}

.sloka-script{
  white-space: pre-wrap;
  line-height: 1.8;
  color: var(--muted);
  font-size: 1.02rem;
  max-height: 65vh;
  overflow: auto;
}

.sloka-script-line{
  margin: 0 0 8px;
}

.sloka-word{
  color: #cbb39a;
  transition: color .18s ease;
}

.sloka-word.on{
  color: #f6c35b;
  text-shadow: 0 0 10px rgba(246,195,91,.28);
}

@media (max-width: 980px){
  .avatar-layout{
    grid-template-columns: 1fr;
  }
  .answer-side{
    min-height: 240px;
  }
  .sloka-layout{
    grid-template-columns: 1fr;
  }
  .sloka-script-wrap{
    min-height: 280px;
  }
}

.krishna-video{
  width:min(100%, 460px);
  aspect-ratio: 9 / 16;
  min-height:420px;
  max-height:80vh;
  display:block;
  margin:0 auto;
  border-radius:8px;
  object-fit:contain;
  background:#000;
}

textarea{
  width:100%;
  resize:vertical;
  border-radius:6px;
  border:1px solid #63573d;
  background:#3a1f0b;
  color:var(--text);
  padding:12px;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
}
textarea:focus{
  border-color:#b88d4c;
  box-shadow:0 0 0 3px #b88d4c33;
}

.row{
  margin-top:10px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

button{
  border:none;
  border-radius:6px;
  padding:10px 14px;
  color:#fff;
  background:linear-gradient(160deg, var(--green-2), var(--green));
  box-shadow: var(--shadow);
  cursor:pointer;
  transition: transform .15s ease, filter .15s ease;
}
button:hover{ transform:translateY(-1px); filter:brightness(1.06); }
#askBtn{ background:linear-gradient(160deg, var(--gold-2), var(--gold)); }

#answer{
  margin-top:14px;
  line-height:1.7;
  white-space:pre-wrap;
  font-size:1.04rem;
}

#answer .ans-line{
  margin: 0 0 8px;
}

#answer .ans-word{
  color: #cbb39a;
}

#answer .ans-word.on{
  color: #f6c35b;
  text-shadow: 0 0 10px rgba(246,195,91,.28);
}

#debugInfo{
  margin-top:8px;
  color:#ffd8ac;
}

.grid-3{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:12px;
}

.card{
  padding:14px;
  transition:transform .15s ease, border-color .15s ease;
}
.card:hover{
  transform:translateY(-2px);
  border-color:#8f825e;
}

.card h3{
  margin:0 0 8px;
  font-size:19px;
}

.final-cta{
  text-align:center;
  padding-bottom:40px;
}

@media (max-width: 900px){
  .grid-3{ grid-template-columns:1fr; }
  .hero{ padding-top:22px; }
  .right-rail{ display:none; }
  body{ padding-right:0; }
}
