:root {
  --saffron:        #C85A12;
  --saffron-mid:    #E07235;
  --saffron-light:  #F4A261;
  --saffron-pale:   #FEF0E0;
  --teacher-bg:     #FFFBEB;
  --teacher-border: #F59E0B;
  --teacher-text:   #7C2D12;
  --student-bg:     #EFF6FF;
  --student-border: #3B82F6;
  --student-text:   #1E3A8A;
  --cream:          #FFFDF7;
  --brown-dark:     #2C1408;
  --brown-mid:      #6B3012;
  --brown-light:    #A0522D;
  --gray:           #6B7280;
  --gray-light:     #F3F4F6;
  --border:         #E8D5BC;
  --white:          #FFFFFF;
  --green:          #16A34A;
  --green-bg:       #F0FDF4;
  --radius:         12px;
  --shadow-sm:      0 1px 4px rgba(44,20,8,.08);
  --shadow-md:      0 4px 16px rgba(44,20,8,.12);
}
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
body { font-family:'Inter',system-ui,sans-serif; background:var(--cream); color:var(--brown-dark); min-height:100vh; line-height:1.5; }

.screen          { display:none !important; }
.screen.active   { display:block !important; }
#screen-session.active, #screen-loading.active { display:flex !important; }

/* ══ Loading ═════════════════════════════════════════════════════ */
#screen-loading { flex-direction:column; align-items:center; justify-content:center; min-height:100vh; text-align:center; padding:40px; }
.loading-om    { font-size:64px; animation:pulse 2s ease-in-out infinite; }
.loading-title { font-size:22px; font-weight:700; margin:16px 0 8px; }
.loading-sub   { font-size:14px; color:var(--gray); margin-bottom:28px; }
.loading-bar-track { width:280px; height:6px; background:var(--border); border-radius:3px; overflow:hidden; }
.loading-bar-fill  { height:100%; background:var(--saffron-mid); border-radius:3px; width:0; transition:width .4s; }
.loading-status    { font-size:12px; color:var(--gray); margin-top:10px; min-height:18px; }
.loading-error     { color:#DC2626; font-size:13px; margin-top:16px; max-width:400px; white-space:pre-wrap; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

/* ══ SETUP SCREEN ════════════════════════════════════════════════ */

/* Hero bar — compact horizontal strip */
.hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #2E0700 0%, #7C1E08 45%, #C85A12 100%);
  color: white;
  padding: 13px 20px;
  gap: 12px;
}
.hero-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-bar-om {
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(255,200,80,.55));
  flex-shrink: 0;
}
.hero-bar-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.hero-bar-sub {
  font-size: 11px;
  opacity: .72;
  letter-spacing: .3px;
  margin-top: 1px;
}
.hero-bar-right {
  text-align: right;
  flex-shrink: 0;
}
.hero-bar-verse {
  font-size: 13px;
  font-style: italic;
  opacity: .88;
}
.hero-bar-ref {
  font-size: 11px;
  opacity: .55;
  margin-top: 2px;
}

/* Event card */
.event-card {
  background: #FAF5EC;
  border-bottom: 1px solid var(--border);
  padding: 14px 16px 16px;
  max-width: 640px;
  margin: 0 auto;
}
.event-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.event-card-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  color: var(--saffron);
  margin-bottom: 3px;
}
.event-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--brown-dark);
  margin-bottom: 3px;
  letter-spacing: -.2px;
}
.event-card-meta {
  font-size: 12px;
  color: var(--brown-mid);
  line-height: 1.5;
}
.btn-register-sm {
  display: inline-block;
  background: linear-gradient(135deg, #5C0F00, var(--saffron-mid));
  color: white;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 13px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
  box-shadow: 0 2px 8px rgba(184,74,16,.3);
  transition: opacity .15s, transform .1s;
}
.btn-register-sm:hover { opacity:.9; transform:translateY(-1px); text-decoration:none; }

/* Video embed (kept from before — do not change) */
.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(44,20,8,.14);
}
.video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 10px;
}

/* ══ TRIBUTE SECTION ═════════════════════════════════════════════ */
.tribute-section {
  background: var(--cream);
  padding: 24px 16px 14px;
  max-width: 640px;
  margin: 0 auto;
}
.tribute-heading {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 2px; color: var(--saffron); margin-bottom: 16px;
}
.tribute-heading-line { flex:1; height:1px; background:var(--border); }

.tribute-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  display: flex; gap: 14px; align-items: flex-start;
}
.tribute-card.audio-card { border-color:#DBEAFE; background:#F8FBFF; }

.tribute-avatar {
  width:48px; height:48px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:20px; flex-shrink:0; border:2px solid;
}
.tribute-avatar.chin   { background:linear-gradient(135deg,var(--saffron-pale),#FDE8C8); border-color:var(--saffron-light); }
.tribute-avatar.brahma { background:linear-gradient(135deg,#EFF6FF,#DBEAFE); border-color:#93C5FD; }

.tribute-label {
  font-size:10px; font-weight:700; text-transform:uppercase;
  letter-spacing:1.2px; color:var(--saffron); margin-bottom:2px;
}
.tribute-label.audio-label { color:#3B82F6; }
.tribute-name  { font-size:15px; font-weight:700; color:var(--brown-dark); margin-bottom:2px; }
.tribute-years { font-size:11px; color:var(--gray); margin-bottom:7px; }
.tribute-desc  { font-size:13px; color:#5C3D28; line-height:1.6; }
.tribute-card.audio-card .tribute-desc { color:#374151; }

/* Settings panel */
.setup-panel {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 20px;
}
.panel-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gray);
  margin-bottom: 10px;
}

/* Chapter select */
.chapter-select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 2px solid var(--border);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  color: var(--brown-dark);
  background: white;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23A0522D' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color .15s;
}
.chapter-select:focus { outline:none; border-color:var(--saffron); }

/* Settings rows */
.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row.last {
  border-bottom: none;
  margin-bottom: 12px;
}
.settings-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--brown-mid);
  min-width: 68px;
  flex-shrink: 0;
  line-height: 1.4;
}

/* Btn row (options group inside a settings-row) */
.btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}
.btn-row .btn-opt {
  flex: none;
  padding: 7px 11px;
  font-size: 12px;
  line-height: 1.3;
}
.btn-row .btn-opt .sub {
  display: inline;
  margin-top: 0;
  margin-left: 3px;
  font-size: 10px;
}

/* Option buttons (shared) */
.btn-opt {
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--brown-mid);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  line-height: 1.3;
}
.btn-opt .sub { font-size:11px; font-weight:400; color:var(--gray); display:block; margin-top:2px; }
.btn-opt:hover { border-color:var(--saffron-light); background:var(--saffron-pale); }
.btn-opt.sel   { border-color:var(--saffron); background:var(--saffron); color:white; }
.btn-opt.sel .sub { color:rgba(255,255,255,.75); }

/* Start button (inline in panel, not fixed) */
.btn-start {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #5C0F00, var(--saffron-mid));
  color: white;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(184,74,16,.35);
  transition: opacity .15s, transform .1s;
}
.btn-start:hover:not(:disabled) { opacity:.93; transform:translateY(-1px); }
.btn-start:disabled { opacity:.35; cursor:not-allowed; box-shadow:none; }

/* Attribution strip */
.attribution-strip {
  background: var(--saffron-pale);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--brown-mid);
  flex-wrap: wrap;
  text-align: center;
  line-height: 1.6;
}
.attr-sep { color: var(--border); font-size: 16px; line-height: 1; }

/* ══ Session ═════════════════════════════════════════════════════ */
#screen-session { flex-direction:column; height:100vh; overflow:hidden; }
.sess-topbar { background:linear-gradient(135deg,#5C0F00,var(--saffron-mid)); color:white; padding:11px 16px; display:flex; align-items:center; justify-content:space-between; gap:10px; flex-shrink:0; }
.sess-topbar-info .ch-title { font-weight:700; font-size:14px; }
.sess-topbar-info .ch-meta  { font-size:11px; opacity:.8; margin-top:1px; }
.btn-exit { background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.35); color:white; padding:6px 13px; border-radius:7px; cursor:pointer; font-size:13px; font-weight:600; white-space:nowrap; transition:background .15s; }
.btn-exit:hover { background:rgba(255,255,255,.28); }

.overall-track { height:3px; background:rgba(255,255,255,.2); flex-shrink:0; }
.overall-fill  { height:100%; background:white; transition:width .6s; width:0; }

.sess-main { flex:1; overflow-y:auto; padding:16px 16px 12px; max-width:760px; margin:0 auto; width:100%; }

.phase-badge { display:flex; align-items:center; gap:12px; padding:12px 16px; border-radius:11px; margin-bottom:14px; border:2px solid; transition:all .3s; }
.phase-badge.teacher  { background:var(--teacher-bg); border-color:var(--teacher-border); color:var(--teacher-text); }
.phase-badge.student  { background:var(--student-bg); border-color:var(--student-border); color:var(--student-text); }
.phase-badge.complete { background:var(--green-bg);   border-color:var(--green);          color:#14532D; }
.phase-icon  { font-size:26px; flex-shrink:0; }
.phase-text  { flex:1; min-width:0; }
.phase-title { font-size:13px; font-weight:700; letter-spacing:.3px; }
.phase-sub   { font-size:12px; opacity:.75; margin-top:1px; }

.waveform { display:flex; align-items:center; gap:3px; height:28px; flex-shrink:0; }
.wave-bar { width:3px; border-radius:2px; background:currentColor; opacity:.55; animation:wave .9s ease-in-out infinite; height:6px; }
.wave-bar:nth-child(1){animation-delay:.00s}.wave-bar:nth-child(2){animation-delay:.13s}
.wave-bar:nth-child(3){animation-delay:.26s}.wave-bar:nth-child(4){animation-delay:.39s}
.wave-bar:nth-child(5){animation-delay:.26s}.wave-bar:nth-child(6){animation-delay:.13s}
.wave-bar:nth-child(7){animation-delay:.00s}
@keyframes wave { 0%,100%{height:4px} 50%{height:22px} }
.waveform.paused .wave-bar { animation-play-state:paused; height:6px !important; }

.chips-row { display:flex; gap:8px; margin-bottom:12px; flex-wrap:wrap; }
.chip { background:white; border:1px solid var(--border); border-radius:7px; padding:6px 12px; font-size:12px; font-weight:600; color:var(--brown-mid); }
.chip span { font-weight:400; color:var(--gray); }

.seg-timer-track { height:5px; background:var(--gray-light); border-radius:3px; margin-bottom:14px; overflow:hidden; }
.seg-timer-fill  { height:100%; border-radius:3px; background:var(--saffron-mid); width:0; transition:width .12s linear; }
.seg-timer-fill.is-student { background:var(--student-border); }

.sloka-card { background:white; border-radius:var(--radius); border:1px solid var(--border); padding:18px 20px; box-shadow:var(--shadow-sm); margin-bottom:12px; }
.sloka-header { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:1px; color:var(--gray); margin-bottom:12px; }

.seg-block { border-radius:9px; padding:12px 14px; margin-bottom:8px; border:2px solid transparent; transition:all .3s; }
.seg-block:last-child { margin-bottom:0; }
.seg-block.inactive       { background:#FAF7F3; opacity:.5; }
.seg-block.active-teacher { background:var(--teacher-bg); border-color:var(--teacher-border); box-shadow:0 2px 12px rgba(245,158,11,.15); opacity:1; }
.seg-block.active-student { background:var(--student-bg); border-color:var(--student-border); box-shadow:0 2px 12px rgba(59,130,246,.14); opacity:1; }

.seg-dev {
  font-family: 'Noto Sans Devanagari', 'Mangal', serif;
  font-size: 17px;
  line-height: 1.85;
  color: var(--brown-dark);
  margin-bottom: 3px;
}
.seg-text { font-size:13px; line-height:1.8; color:var(--brown-light); font-style:italic; }
.line-item   { display:block; border-radius:4px; padding:0 4px; transition:background .2s; }
.line-active { background:rgba(245,158,11,.2); }
.active-student .line-active { background:rgba(59,130,246,.18); }

.seg-dots { display:flex; justify-content:center; gap:5px; flex-wrap:wrap; margin-top:4px; }
.dot { width:8px; height:8px; border-radius:50%; background:var(--border); transition:all .2s; }
.dot.done    { background:var(--saffron-light); }
.dot.current { width:20px; border-radius:4px; background:var(--saffron); }

/* Controls */
.sess-controls { background:white; border-top:1px solid var(--border); padding:10px 16px 12px; flex-shrink:0; }
.ctrl-row { display:flex; align-items:center; justify-content:center; gap:10px; margin-bottom:10px; }

/* ── Discrete student volume dot slider ───────────────────────── */
.svol-ctrl {
  margin-top: 4px;
  padding: 8px 4px 2px;
  border-top: 1px solid var(--gray-light);
  opacity: .45;
  transition: opacity .3s;
}
.svol-ctrl.active-phase { opacity: 1; }
.svol-header {
  display: flex; align-items: center; gap: 5px;
  margin-bottom: 8px;
}
.svol-icon  { font-size: 13px; }
.svol-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--gray);
}
.svol-track-wrap {
  position: relative;
  display: flex;
  align-items: flex-start;
}
/* Full-width background track */
.svol-track-bg {
  position: absolute;
  left: calc(12.5%); right: calc(12.5%);
  top: 13px;           /* vertically centred on the pip */
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  pointer-events: none;
}
/* Coloured fill up to current step */
.svol-track-fill {
  position: absolute;
  left: calc(12.5%);
  top: 13px;
  height: 3px;
  background: var(--student-border);
  border-radius: 2px;
  width: 0;
  transition: width .2s ease;
  pointer-events: none;
}
/* Each step button */
.svol-step {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  padding: 0; position: relative; z-index: 1;
}
.svol-pip {
  width: 14px; height: 14px; border-radius: 50%;
  background: white; border: 2px solid var(--border);
  transition: all .15s; flex-shrink: 0;
}
.svol-step.active .svol-pip {
  width: 18px; height: 18px;
  border-color: var(--student-border);
  background: var(--student-border);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}
.svol-step span {
  font-size: 10px; color: var(--gray); font-weight: 500;
}
.svol-step.active span { color: var(--student-text); font-weight: 700; }
.ctrl-btn { width:46px; height:46px; border-radius:50%; border:2px solid var(--border); background:white; color:var(--brown-mid); font-size:17px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all .15s; flex-shrink:0; font-family:inherit; }
.ctrl-btn:hover    { background:var(--saffron-pale); border-color:var(--saffron-light); }
.ctrl-btn:disabled { opacity:.35; cursor:not-allowed; }
.ctrl-btn.primary  { width:56px; height:56px; background:var(--saffron-mid); border-color:var(--saffron-mid); color:white; font-size:20px; box-shadow:0 4px 14px rgba(224,114,53,.4); }
.ctrl-btn.primary:hover { background:var(--saffron); border-color:var(--saffron); }


/* Devanagari + meaning in sloka card */
.sloka-dev  { font-size:18px; line-height:1.9; color:var(--brown-dark); font-family:'Noto Sans Devanagari','Mangal',serif; margin-bottom:6px; }
.sloka-iast { font-size:14px; line-height:1.9; color:var(--brown-light); font-style:italic; margin-bottom:10px; }
.sloka-meaning { font-size:13px; line-height:1.65; color:#5C3D28; border-top:1px solid var(--border); padding-top:10px; margin-top:4px; }
.sloka-meaning-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:1px; color:var(--gray); margin-bottom:4px; }
.no-meanings-note { font-size:11px; color:var(--gray); text-align:center; padding:8px 0 4px; font-style:italic; }

#toast { position:fixed; bottom:100px; left:50%; transform:translateX(-50%); background:rgba(44,20,8,.85); color:white; padding:10px 20px; border-radius:8px; font-size:13px; white-space:nowrap; opacity:0; pointer-events:none; transition:opacity .3s; z-index:100; }
#toast.show { opacity:1; }

@media (max-width:480px) {
  .hero-bar-right { display:none; }
  .seg-text { font-size:15px; }
  .event-card-top { flex-wrap:wrap; }
  .btn-row { flex-wrap:wrap; }
}
