/* ══════════════════════════════════════════════════════════════════════════════
   lesson-shared.css — Shared styles for all Kisah Bagi Kita lesson pages
   ══════════════════════════════════════════════════════════════════════════════ */

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

:root {
  --bg:        #060d18;
  --card:      #0d1e30;
  --gold:      #f5c842;
  --gold-glow: rgba(245,200,66,0.25);
  --blue:      #4fc3f7;
  --text:      #e8f0f8;
  --dim:       #4a6a85;
  --nav-h:     72px;
}

html {
  height: 100%;
  background: #02080f; /* desktop surround — slightly darker than --bg */
}

body {
  height: 100%;
  background: #02080f;
  color: var(--text);
  font-family: 'Segoe UI', Arial, sans-serif;
  overflow: hidden;
  /* Center the phone column on wide screens */
  display: flex;
  justify-content: center;
}

/* ─── LANDSCAPE ROTATION OVERLAY ───────────────────────────────────────────── */
#landscapeMsg {
  display: none;
  position: absolute; inset: 0; z-index: 999;
  background: var(--bg);
  align-items: center; justify-content: center;
  pointer-events: all;
}
/* Show only on small-screen landscape (phones rotated sideways) */
@media (orientation: landscape) and (max-height: 480px) {
  #landscapeMsg { display: flex; }
}
.landscape-inner {
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.landscape-inner svg { color: var(--gold); opacity: 0.75; }
.landscape-inner p {
  font-size: 1.05rem; font-weight: 600;
  color: var(--dim); letter-spacing: 0.5px;
}

/* ─── MAIN CONTAINER ────────────────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100dvh;
  flex-direction: column;
  position: relative;
  width: 100%;
  max-width: 430px;
  overflow: hidden;
  background: var(--bg);
}
@supports not (height: 100dvh) {
  #app { height: 100vh; }
}
/* Subtle drop-shadow on desktop to separate phone column from surround */
@media (min-width: 500px) {
  #app { box-shadow: 0 0 60px rgba(0,0,0,0.7); }
}

/* ─── SLIDE STAGE ───────────────────────────────────────────────────────────── */
#stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
}

/* Area below the banner where slides live */
.slides-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.slide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transition: opacity 0.7s ease;
}
.slide.active { opacity: 1; pointer-events: all; }

/* Cover slide — image fills full height */
.cover-slide .slide-img-wrap { flex: 1; }

/* Content slides */
.slide-img-wrap {
  position: relative;
  flex: 0 0 56%;
  overflow: hidden;
  background: #020810;
}
.slide-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.9);
}
.slide-img-wrap::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 110px;
  background: linear-gradient(transparent, var(--bg));
}

.slide-page-label {
  position: absolute; top: 16px; right: 16px;
  background: rgba(6,13,24,0.8);
  border: 1px solid rgba(245,200,66,0.3);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 2px;
  padding: 4px 12px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
}

.slide-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 10%;
  gap: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE / Edge */
}
.slide-text::-webkit-scrollbar { display: none; } /* Chrome / Safari / Opera */
/* Collapsing spacers — center content when it fits, collapse when it overflows */
.slide-text::before,
.slide-text::after {
  content: '';
  flex: 1;
  min-height: 16px;
  pointer-events: none;
}

.sentence {
  font-size: calc(1.25rem * var(--font-scale, 1));
  line-height: 1.75;
  text-align: center;
  color: var(--dim);
  border-left: 3px solid transparent;
  padding: 10px 20px;
  border-radius: 8px;
  transition: all 0.5s ease;
  cursor: pointer;
  max-width: 900px;
}
.sentence:hover { color: #8ab0cc; }
.sentence.active {
  color: #fff;
  background: rgba(245,200,66,0.07);
  border-left-color: var(--gold);
  text-shadow: 0 0 18px rgba(245,200,66,0.35);
  animation: sentencePulse 1.5s ease-out 0.1s 1;
}
.sentence.done { color: #4d7a9e; }

@keyframes sentencePulse {
  0%   { box-shadow: 0 0 0 0 rgba(245,200,66,0.3); }
  50%  { box-shadow: 0 0 0 8px rgba(245,200,66,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,200,66,0); }
}

/* ─── QUESTIONS SLIDE ───────────────────────────────────────────────────────── */
#questionsSlide {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  transition: opacity 0.7s ease;
  overflow-y: auto;
  padding: 36px 8% 90px;
  background: radial-gradient(ellipse at 50% 0%, #0c1d30 0%, var(--bg) 60%);
}
#questionsSlide.active { opacity: 1; pointer-events: all; }
#questionsSlide::-webkit-scrollbar { width: 6px; }
#questionsSlide::-webkit-scrollbar-track { background: transparent; }
#questionsSlide::-webkit-scrollbar-thumb { background: #1e3348; border-radius: 3px; }

.q-header {
  text-align: center;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(79,195,247,0.15);
}
.q-header h1 { font-size: 2rem; color: var(--blue); text-shadow: 0 0 20px rgba(79,195,247,0.25); }
.q-header p { margin-top: 8px; color: var(--dim); font-size: 0.95rem; }

/* ─── QUESTION STEPS (paginated: retelling + one slide per question) ────────── */
.q-steps { max-width: 640px; margin: 0 auto; }
.q-step { display: none; }
.q-step.active { display: block; animation: qStepIn 0.28s ease; }
@keyframes qStepIn {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: none; }
}
.q-step-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 30px;
}
.q-nav-spacer { flex: 0 0 auto; }
.q-nav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 22px; border-radius: 50px;
  font-family: inherit; font-size: 0.92rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  border: 1px solid rgba(79,195,247,0.35);
  background: rgba(79,195,247,0.08); color: var(--blue);
}
.q-nav-btn:hover { background: rgba(79,195,247,0.18); border-color: rgba(79,195,247,0.55); }
.q-nav-btn svg { width: 16px; height: 16px; display: block; }
.q-nav-back {
  background: transparent;
  border-color: rgba(122,155,181,0.3);
  color: var(--dim);
}
.q-nav-back:hover { background: rgba(122,155,181,0.1); border-color: rgba(122,155,181,0.55); }

/* ─── RETELLING ACTIVITY CARD ───────────────────────────────────────────────── */
.retelling-card {
  background: rgba(79,195,247,0.07);
  border: 1px solid rgba(79,195,247,0.22);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 32px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.retelling-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(79,195,247,0.15);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue);
  margin-top: 2px;
}
.retelling-icon svg { display: block; }
.retelling-body {}
.retelling-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 6px;
}
.retelling-text {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.65;
}

.q-section { margin-bottom: 28px; }

.q-item { margin-bottom: 20px; }
.q-label {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 8px;
  font-size: 1rem; color: #c4d8ea; line-height: 1.6;
}
.q-num {
  flex-shrink: 0;
  width: 26px; height: 26px;
  background: rgba(245,200,66,0.12);
  border: 1px solid rgba(245,200,66,0.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: var(--gold);
  margin-top: 2px;
}
.q-textarea {
  width: 100%; min-height: 90px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(79,195,247,0.2);
  border-radius: 10px;
  color: #e8f0f8; font-size: 0.95rem; line-height: 1.6;
  padding: 12px 16px; resize: vertical; font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}
.q-textarea:focus { outline: none; border-color: var(--gold); background: rgba(245,200,66,0.04); }
.q-textarea::placeholder { color: #2e4a62; }

/* ─── MIC BUTTON ────────────────────────────────────────────────────────────── */
.q-input-wrap { position: relative; }
.q-input-wrap .q-textarea { padding-right: 46px; }
.mic-btn {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(79,195,247,0.25);
  background: rgba(79,195,247,0.1);
  color: var(--blue);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.mic-btn:hover:not(:disabled) { background: rgba(79,195,247,0.22); border-color: rgba(79,195,247,0.5); }
.mic-btn.recording {
  background: rgba(255,92,92,0.15);
  border-color: rgba(255,92,92,0.5);
  color: #ff5c5c;
  animation: micPulse 1s ease-in-out infinite;
}
.mic-btn:disabled { opacity: 0.35; cursor: default; }
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,92,92,0.35); }
  50%       { box-shadow: 0 0 0 7px rgba(255,92,92,0); }
}

/* ─── RETELLING VOICE RECORDER ──────────────────────────────────────────────── */
.retell-recorder {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px; flex-wrap: wrap;
}
.retell-rec-btn, .retell-play-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; padding: 0;
  cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.retell-ic { display: block; fill: currentColor; }

/* ── Record button — large circular record symbol ── */
.retell-rec-btn {
  width: 46px; height: 46px;
  background: rgba(255,92,92,0.12);
  border: 2px solid rgba(255,92,92,0.5);
  color: #ff5c5c;
}
.retell-rec-btn:hover:not(:disabled) { background: rgba(255,92,92,0.22); }
.retell-rec-btn .retell-ic { width: 24px; height: 24px; }
.retell-rec-btn .retell-ic-stop { display: none; }
.retell-rec-btn.recording {
  background: rgba(255,92,92,0.22);
  border-color: rgba(255,92,92,0.75);
  animation: micPulse 1s ease-in-out infinite;
}
.retell-rec-btn.recording .retell-ic-rec  { display: none; }
.retell-rec-btn.recording .retell-ic-stop { display: block; }

/* ── Play button — standard play icon (toggles to pause during playback) ── */
.retell-play-btn {
  width: 46px; height: 46px;
  background: rgba(79,195,247,0.1);
  border: 1px solid rgba(79,195,247,0.4);
  color: var(--blue);
}
.retell-play-btn:hover:not(:disabled) { background: rgba(79,195,247,0.22); }
.retell-play-btn .retell-ic { width: 24px; height: 24px; }
.retell-play-btn .retell-ic-play  { margin-left: 3px; } /* optical centering of triangle */
.retell-play-btn .retell-ic-pause { display: none; }
.retell-play-btn.playing .retell-ic-play  { display: none; }
.retell-play-btn.playing .retell-ic-pause { display: block; margin-left: 0; }

.retell-rec-btn:disabled, .retell-play-btn:disabled { opacity: 0.4; cursor: default; }
.retell-meter {
  width: 140px; height: 34px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(79,195,247,0.15);
  border-radius: 8px; flex-shrink: 0;
}
.retell-time {
  font-size: 0.85rem; color: var(--dim);
  font-variant-numeric: tabular-nums; min-width: 34px;
}
.retell-hint {
  margin-top: 9px; font-size: 0.82rem;
  color: var(--dim); line-height: 1.5; min-height: 1em;
}
.retell-hint.error { color: #b3261e; font-weight: 700; }
#retellAudio { display: none; }

.q-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.char-count { font-size: 0.75rem; color: var(--dim); }
.q-submit-row { margin-top: 28px; display: flex; justify-content: center; }
.btn-submit-all {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 48px;
  background: var(--gold); color: #080f1a;
  font-size: 1rem; font-weight: 700;
  border: none; border-radius: 50px;
  cursor: pointer; transition: all 0.25s; letter-spacing: 0.5px;
}
.btn-submit-all:hover { background: #ffd86e; transform: translateY(-2px); box-shadow: 0 8px 24px var(--gold-glow); }
.btn-submit-all.submitted {
  background: rgba(79,195,247,0.12);
  border: 1px solid var(--blue);
  color: var(--blue);
  cursor: default; transform: none; box-shadow: none;
}

/* ─── NAV BAR ───────────────────────────────────────────────────────────────── */
#navBar {
  height: var(--nav-h);
  background: rgba(6,13,24,0.97);
  border-top: 1px solid rgba(79,195,247,0.12);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  flex-shrink: 0;
}

.nav-btn {
  flex-shrink: 0;
  background: none; border: none;
  color: var(--dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  transition: all 0.2s;
}
.nav-btn:hover { background: rgba(79,195,247,0.12); color: var(--blue); }
.nav-btn:disabled { opacity: 0.3; cursor: default; }
.nav-btn svg { width: 20px; height: 20px; }

#playPauseBtn {
  width: 46px; height: 46px;
  background: var(--gold); color: #080f1a;
  border-radius: 50%; transition: all 0.2s;
}
#playPauseBtn:hover { background: #ffd86e; transform: scale(1.08); }

.time-display {
  font-size: 0.78rem; color: var(--dim);
  font-variant-numeric: tabular-nums;
  min-width: 68px; text-align: center;
}

/* ─── PROGRESS BAR + SEEK THUMB ────────────────────────────────────────────── */
.progress-wrap {
  flex: 1;
  height: 6px;
  background: rgba(79,195,247,0.15);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: height 0.15s;
  touch-action: none; /* prevent page scroll while dragging */
}
.progress-wrap:hover { height: 8px; }
#progressFill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  width: 0%;
  pointer-events: none;
}
/* Draggable thumb */
#progressThumb {
  position: absolute;
  width: 14px; height: 14px;
  background: var(--gold);
  border-radius: 50%;
  top: 50%; left: 0%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: left 0.15s linear, width 0.15s, height 0.15s;
  box-shadow: 0 0 6px rgba(245,200,66,0.55);
}
.progress-wrap:hover #progressThumb,
.progress-wrap.dragging #progressThumb {
  width: 18px; height: 18px;
  box-shadow: 0 0 10px rgba(245,200,66,0.75);
}

/* ─── SLIDE DOTS ────────────────────────────────────────────────────────────── */
.dots-wrap { display: flex; align-items: center; gap: 7px; }
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(79,195,247,0.2);
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}
.dot.active { background: var(--gold); transform: scale(1.4); }

/* ─── SLIDE TITLE BANNER ────────────────────────────────────────────────────── */
.slide-banner {
  position: relative;
  flex-shrink: 0;
  min-height: 48px;
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 0;
  background: rgba(6,13,24,0.97);
  border-bottom: 1px solid rgba(79,195,247,0.12);
  z-index: 10;
}
.slide-banner h2 {
  font-size: 0.9rem; font-weight: 600;
  letter-spacing: 2px; color: var(--gold);
  text-transform: uppercase;
  min-width: 0;
  line-height: 1.3;
}

/* ─── SLIDE COUNTER ─────────────────────────────────────────────────────────── */
#slideCounter {
  margin-left: 12px;
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 1.5px; color: var(--blue);
  background: rgba(79,195,247,0.1);
  border: 1px solid rgba(79,195,247,0.25);
  padding: 3px 10px; border-radius: 12px;
  transition: opacity 0.3s;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── BACK TO MENU + SHARE ──────────────────────────────────────────────────── */
#backToMenu {
  margin-left: auto;
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  color: var(--text);
  text-decoration: none; transition: all 0.2s; flex-shrink: 0;
}
#backToMenu:hover { background: rgba(79,195,247,0.15); color: #fff; }
#shareBtn, #printBtn {
  margin-left: 6px;
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: none; border: none;
  color: var(--text); cursor: pointer;
  transition: all 0.2s; flex-shrink: 0;
}
#shareBtn:hover, #printBtn:hover { background: rgba(79,195,247,0.15); color: #fff; }

/* ─── FONT SIZE BUTTONS ─────────────────────────────────────────────────────── */
#fontDecBtn, #fontIncBtn {
  margin-left: 4px;
  background: none; border: none;
  color: var(--text); cursor: pointer;
  font-family: inherit; font-weight: 700;
  border-radius: 6px;
  padding: 4px 5px;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0; line-height: 1;
  letter-spacing: -0.5px;
}
#fontDecBtn { font-size: 0.78rem; }
#fontIncBtn { font-size: 1.05rem; }
#fontDecBtn:hover:not(:disabled), #fontIncBtn:hover:not(:disabled) {
  background: rgba(79,195,247,0.15); color: #fff;
}
#fontDecBtn:disabled, #fontIncBtn:disabled { opacity: 0.25; cursor: default; }

/* ─── TIMING NOTE TOOLTIP ───────────────────────────────────────────────────── */
#timingNote {
  position: absolute; bottom: 82px; right: 20px;
  background: rgba(13,30,48,0.95);
  border: 1px solid rgba(79,195,247,0.2);
  color: var(--blue); font-size: 0.75rem;
  padding: 8px 14px; border-radius: 8px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s; max-width: 260px; text-align: center;
}
#timingNote.show { opacity: 1; }

/* ─── COMPLETION SLIDE ──────────────────────────────────────────────────────── */
#completionSlide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.7s ease;
  padding: 28px 12% 90px; text-align: center; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 20%, #0c1d30 0%, var(--bg) 65%);
}
#completionSlide.active { opacity: 1; pointer-events: all; }
#completionSlide::-webkit-scrollbar { width: 6px; }
#completionSlide::-webkit-scrollbar-track { background: transparent; }
#completionSlide::-webkit-scrollbar-thumb { background: #1e3348; border-radius: 3px; }

.comp-badge-wrap {
  position: relative; width: 160px; height: 160px;
  margin: 0 auto 22px; flex-shrink: 0;
  filter: drop-shadow(0 0 24px rgba(0,0,0,0.6));
  animation: badgePop 0.9s cubic-bezier(0.175,0.885,0.32,1.275) both;
}
.comp-badge-wrap img { width: 100%; height: 100%; }
@keyframes badgePop {
  0%   { transform: scale(0.4) rotate(-8deg); opacity: 0; }
  55%  { transform: scale(1.5) rotate(0deg);  opacity: 1; }
  100% { transform: scale(1)   rotate(0deg);  opacity: 1; }
}
.comp-trophy {
  position: absolute; bottom: -10px; right: -10px;
  width: 46px; height: 46px;
  background: radial-gradient(circle at 40% 35%, #1e3450, #0d1e30);
  border-radius: 50%; border: 2px solid #f5c842;
  display: flex; align-items: center; justify-content: center;
  color: #f5c842; box-shadow: 0 0 10px rgba(245,200,66,0.35);
  opacity: 0; transform: scale(0.3) rotate(20deg);
  animation: trophyPop 0.5s cubic-bezier(0.175,0.885,0.32,1.275) 0.75s both;
}
@keyframes trophyPop {
  from { opacity: 0; transform: scale(0.3) rotate(20deg); }
  to   { opacity: 1; transform: scale(1)   rotate(0deg);  }
}

.comp-title {
  font-size: 2rem; font-weight: 700; color: var(--gold);
  text-shadow: 0 0 24px rgba(245,200,66,0.35); margin-bottom: 6px;
}
.comp-subtitle { font-size: 1rem; color: var(--blue); font-weight: 600; margin-bottom: 4px; }
.comp-lesson-name { font-size: 0.88rem; color: var(--dim); margin-bottom: 14px; }
.comp-bible-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; font-weight: 600;
  color: var(--gold); text-decoration: none;
  background: rgba(245,200,66,0.08);
  border: 1px solid rgba(245,200,66,0.3);
  border-radius: 50px; padding: 8px 18px;
  margin-bottom: 26px;
  transition: background 0.2s, border-color 0.2s;
}
.comp-bible-link:hover { background: rgba(245,200,66,0.16); border-color: rgba(245,200,66,0.55); }

.comp-actions {
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-bottom: 18px;
}
.comp-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 28px; border-radius: 50px;
  font-size: 0.95rem; font-weight: 700;
  text-decoration: none; transition: all 0.25s; letter-spacing: 0.3px;
}
.comp-btn-home {
  background: rgba(79,195,247,0.1); border: 1px solid rgba(79,195,247,0.35); color: var(--blue);
}
.comp-btn-home:hover { background: rgba(79,195,247,0.2); transform: translateY(-2px); }
.comp-btn-badges {
  background: rgba(245,200,66,0.1); border: 1px solid rgba(245,200,66,0.35); color: var(--gold);
}
.comp-btn-badges:hover { background: rgba(245,200,66,0.2); transform: translateY(-2px); }
.comp-btn-next {
  background: var(--gold); border: none; color: #080f1a;
}
.comp-btn-next:hover { background: #ffd86e; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(245,200,66,0.3); }

/* ─── NEXT LESSON COUNTDOWN IN BUTTON ──────────────────────────────────────── */
/* Badge showing the seconds remaining — hidden until countdown starts          */
.comp-next-ct {
  display: none;
  align-items: center; justify-content: center;
  min-width: 26px; height: 26px;
  background: rgba(8,15,26,0.45);
  border-radius: 50%;
  font-size: 0.78rem; font-weight: 800;
  color: #fff;
  margin-left: 8px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0; line-height: 1;
}
/* Show badge and apply depleting progress fill when counting */
.comp-btn-next.counting .comp-next-ct { display: inline-flex; }
.comp-btn-next.counting {
  background: linear-gradient(
    to right,
    var(--gold)           0%,
    var(--gold)           calc(var(--cdr-pct) * 1%),
    rgba(140,105,10,0.45) calc(var(--cdr-pct) * 1%),
    rgba(140,105,10,0.45) 100%
  ) !important;
  border: 1px solid rgba(245,200,66,0.4) !important;
  transition: background 0s, border 0s, transform 0.25s, box-shadow 0.25s !important;
}
.comp-btn-next.counting:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245,200,66,0.2);
}

.comp-badges-link {
  font-size: 0.82rem; color: var(--dim); text-decoration: none;
  transition: color 0.2s; display: inline-flex; align-items: center; gap: 5px;
  margin-top: 6px;
}
.comp-badges-link:hover { color: var(--blue); }

/* ─── AUTOPLAY COUNTDOWN BAR ────────────────────────────────────────────────── */
#autoplayBar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center;
  background: rgba(79,195,247,0.06);
  border: 1px solid rgba(79,195,247,0.18);
  border-radius: 50px;
  padding: 10px 22px;
  margin-bottom: 16px;
  font-size: 0.88rem; color: var(--dim);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
#autoplayCt {
  color: var(--blue); font-weight: 700; font-size: 1.15em;
  min-width: 1.2em; display: inline-block; text-align: center;
}
#autoplayCancel {
  background: none;
  border: 1px solid rgba(79,195,247,0.3);
  border-radius: 20px;
  color: var(--blue); font-size: 0.8rem;
  padding: 4px 16px; cursor: pointer;
  transition: all 0.2s; font-family: inherit;
}
#autoplayCancel:hover { background: rgba(79,195,247,0.15); border-color: rgba(79,195,247,0.6); }

/* ─── MOBILE RESPONSIVE LAYOUT ──────────────────────────────────────────────── */
/* dvh = dynamic viewport height: adjusts as browser chrome appears/hides        */
@supports (height: 100dvh) {
  #app   { height: 100dvh; }
  #stage { height: calc(100dvh - var(--nav-h)); }
}
/* slides-viewport fills whatever remains after the banner via flex: 1 */
/* iOS safe-area: keep nav above the home indicator                               */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #navBar {
    height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}
@media (max-width: 640px) {
  /* Shrink image so text panel has more room                                     */
  .slide-img-wrap { flex-basis: 36% !important; flex-shrink: 0 !important; }
  /* Reduce side padding and tighten spacers on small screens                     */
  .slide-text { padding-left: 6% !important; padding-right: 6% !important; }
  .slide-text::before,
  .slide-text::after { min-height: 10px; }
  /* Tighter sentence sizing so more text fits                                    */
  .sentence {
    font-size: calc(1.05rem * var(--font-scale, 1)) !important;
    line-height: 1.6  !important;
    padding: 8px 14px !important;
  }
  .slide-banner h2 { font-size: 0.78rem !important; }
  #slideCounter    { font-size: 0.68rem !important; }
  /* Compact completion buttons on small screens                                  */
  .comp-btn { padding: 11px 18px !important; font-size: 0.88rem !important; }
  .comp-actions { gap: 10px !important; }
}

/* ─── PRINT VIEW (hidden in browser; shown by window.print() or ?print=1) ───── */
#printView { display: none; }

@media print {
  html, body {
    background: #fff !important;
    color: #000 !important;
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }
  #app {
    display: block !important;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    box-shadow: none !important;
    background: #fff !important;
    position: static !important;
  }
  #stage, #navBar, #landscapeMsg, #timingNote { display: none !important; }
  #printView { display: block !important; padding: 0; }

  .pv-header {
    margin-bottom: 18pt;
    padding-bottom: 10pt;
    border-bottom: 1.5pt solid #333;
  }
  .pv-header h1 { font-size: 18pt; font-weight: bold; color: #000; margin: 0; }
  .pv-ref { font-size: 10pt; color: #444; margin: 6pt 0 0; }

  .pv-body { margin-bottom: 14pt; }
  .pv-slide { margin-bottom: 8pt; }
  .pv-slide p { font-size: 11pt; line-height: 1.65; margin: 0 0 3pt; color: #000; }

  .pv-retelling {
    margin: 14pt 0;
    padding: 8pt 12pt;
    border-left: 3pt solid #777;
    background: #f5f5f5;
    page-break-inside: avoid;
  }
  .pv-retelling-label {
    font-size: 9pt; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1pt;
    color: #555; margin-bottom: 4pt;
  }
  .pv-retelling p { font-size: 11pt; color: #333; margin: 0; }

  .pv-questions h2 {
    font-size: 14pt; font-weight: bold; color: #000;
    margin: 0 0 8pt; padding-bottom: 6pt;
    border-bottom: 1pt solid #aaa;
  }
  .pv-questions ol { padding-left: 18pt; margin: 0; }
  .pv-questions li {
    font-size: 11pt; line-height: 1.6;
    margin-bottom: 20pt; page-break-inside: avoid;
  }
  .pv-q-text { display: block; margin-bottom: 6pt; }
  .pv-q-space { border-bottom: 1pt solid #ccc; height: 44pt; display: block; }
}
