@import url('/assets/fonts/outfit-plus-jakarta-sans-3baf9e.css');

:root {
  --ink: #1b2430;
  --navy: #132238;
  --teal: #1d6f73;
  --teal-dark: #155457;
  --gold: #d6a84f;
  --cream: #fffaf0;
  --paper: #fdfbf7;
  --muted: #5a6471;
  --red: #9f3434;
  --line: rgba(17, 24, 39, 0.08);
  --shadow: 0 12px 28px rgba(17, 24, 39, 0.06);
  --shadow-soft: 0 4px 12px rgba(17, 24, 39, 0.04);
  --font-display: "Outfit", sans-serif;
  --font-main: "Plus Jakarta Sans", sans-serif;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--ink);
  line-height: 1.6;
  background: #f4f6f9;
}

a {
  color: inherit;
}
button,
input {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 6px;
}

.shell {
  width: min(1080px, calc(100% - 28px));
  margin: 0 auto 48px;
}

/* ---------- Layout Grids ---------- */
.layout-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.layout-interactive {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: start;
}
.layout-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.layout-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (max-width: 900px) {
  .layout-interactive {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ---------- Hero ---------- */
.hero {
  margin: 16px 0 24px;
  border-radius: 20px;
  background: linear-gradient(125deg, #132238, #25465d);
  color: var(--cream);
  box-shadow: var(--shadow);
  border-top: 4px solid var(--gold);
}
.hero-inner {
  padding: 32px;
}
.eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.hero h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.15;
}
.hero h1 span {
  color: var(--gold);
}
.hero-copy {
  margin: 0 0 20px;
  max-width: 65ch;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 250, 240, 0.92);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}
.btn.gold {
  background: var(--gold);
  color: #2a1c05;
  box-shadow: 0 4px 12px rgba(214, 168, 79, 0.2);
}
.btn.gold:hover {
  background: #c59740;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(214, 168, 79, 0.3);
}
.btn.clear {
  background: transparent;
  border-color: rgba(255, 250, 240, 0.4);
  color: var(--cream);
}
.btn.clear:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 250, 240, 0.8);
  transform: translateY(-2px);
}

/* ---------- Card deck ---------- */
.card-deck {
  display: flex;
  flex-direction: column;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease;
}
.card:hover {
  box-shadow: 0 16px 36px rgba(17, 24, 39, 0.08);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.card-icon {
  font-size: 1.6rem;
  line-height: 1;
}
.card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--navy);
}
.card-note {
  margin: 4px 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
}
.card h3.sub {
  margin: 20px 0 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-dark);
}

/* ---------- Characters ---------- */
.people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.person {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.person-emoji {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.person-text {
  display: block;
}
.person-name {
  display: block;
  font-weight: 700;
  color: var(--navy);
}
.person-role {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- Main events ---------- */
.events {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 9px;
}
.events li {
  padding-left: 4px;
}
.events li::marker {
  color: var(--teal);
  font-weight: 700;
}

/* ---------- Important things ---------- */
.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.facts li {
  display: grid;
  gap: 2px;
}
.fk {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-dark);
  font-weight: 700;
}
.fv {
  color: var(--ink);
}
.vocab {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.vrow {
  display: grid;
  gap: 1px;
  padding: 8px 10px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.vword {
  font-weight: 700;
  color: var(--navy);
}
.vdef {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Read-aloud buttons */
.speak {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0 2px;
  opacity: 0.6;
}
.speak:hover {
  opacity: 1;
}

/* ---------- Floating tools ---------- */
.tools {
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 40;
}
.tools button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}
.tools button:hover {
  background: var(--paper);
}

/* ---------- Status pill ---------- */
.status {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: var(--cream);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
}
.status.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Accessibility toggles ---------- */
body.large-text {
  font-size: 1.18rem;
}
body.high-contrast {
  background: #000;
}
body.high-contrast .card {
  background: #111;
  border-color: #fff;
}
body.high-contrast,
body.high-contrast .card h2,
body.high-contrast .person-name,
body.high-contrast .fv,
body.high-contrast .vword {
  color: #fff;
}
body.high-contrast .card-note,
body.high-contrast .person-role,
body.high-contrast .vdef {
  color: #d9d9d9;
}
body.high-contrast .vrow {
  background: #1a1a1a;
  border-color: #555;
}

@media (max-width: 540px) {
  .hero-inner {
    padding: 20px 18px;
  }
}

/* ---------- Print ---------- */
@media print {
  body {
    background: #fff;
  }
  .tools,
  .status,
  .hero-actions {
    display: none !important;
  }
  .hero {
    background: none;
    color: #000;
    box-shadow: none;
    border-bottom: 2px solid #000;
    border-radius: 0;
  }
  .hero h1 span,
  .eyebrow {
    color: #000;
  }
  .hero-copy {
    color: #000;
  }
  .card-deck {
    display: block;
  }
  .card {
    box-shadow: none;
    border: 1px solid #999;
    break-inside: avoid;
    margin-bottom: 14px;
  }
  .speak {
    display: none;
  }
}

/* ---------- Interactive Storyboard ---------- */
#card-scenes.card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 20px;
}
.storyboard-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  margin-top: 18px;
}
@media (max-width: 768px) {
  .storyboard-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
.scene-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 2px solid var(--line);
  padding-right: 16px;
  position: relative;
}
@media (max-width: 768px) {
  .scene-nav {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 2px solid var(--line);
    padding-right: 0;
    padding-bottom: 12px;
    white-space: nowrap;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
  }
}
.scene-tab-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
  color: var(--ink);
  position: relative;
}
@media (max-width: 768px) {
  .scene-tab-btn {
    width: auto;
    flex-shrink: 0;
    border-radius: 99px;
    border: 1.5px solid var(--line);
    padding: 8px 18px;
    background: #fff;
  }
}
.scene-tab-btn:hover {
  background: rgba(29, 111, 115, 0.06);
  transform: translateX(4px);
}
@media (max-width: 768px) {
  .scene-tab-btn:hover {
    transform: none;
    background: var(--paper);
  }
}
.scene-tab-btn.active {
  background: var(--navy);
  color: var(--cream);
  box-shadow: 0 4px 12px rgba(19, 34, 56, 0.12);
  transform: translateX(4px);
}
@media (max-width: 768px) {
  .scene-tab-btn.active {
    transform: none;
    border-color: var(--navy);
    box-shadow: none;
  }
}
.scene-tab-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--teal);
  transition: color 0.2s;
}
.scene-tab-btn.active .scene-tab-num {
  color: var(--gold);
}
.scene-tab-label {
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
@media (max-width: 768px) {
  .scene-tab-label {
    display: inline-block;
  }
}

.scene-panel {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
  min-height: 380px;
  animation: fadeIn 0.3s ease-in-out;
}
@media (max-width: 900px) {
  .scene-panel {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.scene-illustration-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  align-self: start;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.scene-illustration-container:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.scene-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.scene-illustration-container:hover .scene-img {
  transform: scale(1.03);
}
.scene-img-caption {
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 500;
  font-style: italic;
  color: var(--muted);
  padding: 12px 16px;
  line-height: 1.4;
  text-align: center;
  border-top: 1px solid var(--line);
  background: var(--cream);
}

.scene-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.scene-meta {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal-dark);
}
.scene-info h3 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 800;
}
.scene-quote {
  margin: 0;
  padding: 14px 18px;
  background: var(--paper);
  border-left: 4px solid var(--gold);
  border-radius: 0 12px 12px 0;
  position: relative;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  box-shadow: inset 2px 0 8px rgba(0, 0, 0, 0.01);
}
.scene-quote p {
  margin: 0;
  flex: 1;
}
.scene-summary {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink);
}
.scene-details {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 8px;
  font-size: 0.94rem;
  color: var(--ink);
  line-height: 1.5;
}
.scene-details li::marker {
  color: var(--teal);
}
.scene-explain {
  background: rgba(29, 111, 115, 0.04);
  border: 1px solid rgba(29, 111, 115, 0.12);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
  position: relative;
}
.scene-explain strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 4px;
}
.scene-check {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.2s;
}
.scene-check[open] {
  box-shadow: var(--shadow);
}
.scene-check summary {
  padding: 14px 16px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  user-select: none;
  background: var(--cream);
  transition: background 0.2s;
  font-size: 0.95rem;
}
.scene-check summary:hover {
  background: var(--paper);
}
.scene-check-content {
  padding: 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.scene-check-content ul {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.5;
}
.scene-check-content li::marker {
  color: var(--gold);
}

/* ---------- Completion Button Styles ---------- */
.btn.gold.completed {
  background: var(--teal) !important;
  color: #fff !important;
  border-color: var(--teal) !important;
}
.btn.gold.completed:hover {
  background: var(--teal-dark) !important;
}

/* ---------- Student Worksheets & Print Fallbacks ---------- */
.print-only {
  display: none;
}

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .shell, .tools, .status, .hero-actions, #cardDeck {
    display: none !important;
  }
  .print-only {
    display: block !important;
    width: 100%;
    margin: 0;
    padding: 0;
    color: #000;
  }
  .print-scene-item {
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 28px;
    border-bottom: 1px dashed #666;
    padding-bottom: 20px;
  }
  .print-scene-header {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0 0 10px 0;
    border-bottom: 1.5px solid #000;
    padding-bottom: 4px;
    font-family: "Outfit", sans-serif;
  }
  .print-scene-quote {
    font-style: italic;
    margin: 10px 0;
    padding-left: 12px;
    border-left: 3px solid #666;
    color: #333;
  }
  .print-scene-summary {
    margin-bottom: 12px;
    font-size: 0.95rem;
  }
  .print-scene-check-title {
    font-weight: 700;
    margin-top: 12px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .print-question-item {
    margin-top: 10px;
  }
  .print-question-text {
    font-weight: 600;
    margin-bottom: 6px;
  }
  .print-writing-lines {
    border-bottom: 1px solid #aaa;
    height: 24px;
    margin-bottom: 8px;
  }
}

/* ---------- Audio Follow-Along Highlighting ---------- */
.audio-highlight {
  background-color: rgba(214, 168, 79, 0.15) !important;
  border-color: var(--gold) !important;
  box-shadow: 0 0 12px rgba(214, 168, 79, 0.3) !important;
  transition: background-color 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.speak.playing {
  color: var(--teal) !important;
  opacity: 1 !important;
  animation: pulse-audio 1.2s infinite;
}
@keyframes pulse-audio {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ---------- Vocabulary Flashcard Deck ---------- */
.vocab-toggle-btn {
  background: transparent;
  border: 1.5px solid var(--teal);
  color: var(--teal);
  border-radius: 20px;
  padding: 5px 14px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.vocab-toggle-btn:hover {
  background: var(--teal);
  color: #fff;
  transform: translateY(-1px);
}
.vocab-toggle-btn.active-mode {
  background: var(--teal-dark);
  color: #fff;
  border-color: var(--teal-dark);
}
.vocab-flashcard-deck {
  perspective: 1200px;
  width: 100%;
  height: 230px;
  margin-top: 15px;
  position: relative;
}
.vocab-card-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  cursor: pointer;
}
.vocab-card-wrapper.active {
  display: block;
}
.vocab-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.vocab-card-wrapper.flipped .vocab-card-inner {
  transform: rotateY(180deg);
}
.vocab-card-front, .vocab-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.vocab-card-front {
  background: var(--paper);
  color: var(--navy);
  border-top: 4px solid var(--gold);
}
.vocab-card-back {
  background: var(--cream);
  color: var(--ink);
  transform: rotateY(180deg);
  border-top: 4px solid var(--teal);
}
.vocab-card-emoji {
  font-size: 2.8rem;
  margin-bottom: 12px;
  user-select: none;
}
.vocab-card-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.65rem;
  text-align: center;
  margin: 0;
  color: var(--navy);
}
.vocab-card-word-mini {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--teal-dark);
  border-bottom: 1.5px solid var(--line);
  width: 100%;
  padding-bottom: 8px;
  margin-bottom: 14px;
  text-align: center;
}
.vocab-card-def {
  font-size: 1.02rem;
  line-height: 1.5;
  text-align: center;
  margin: 0;
  color: var(--ink);
}
.vocab-card-hint {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 14px;
  margin-bottom: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.vocab-card-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}
.vocab-card-controls button {
  background: #fff;
  border: 1.5px solid var(--line);
  padding: 8px 16px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--ink);
}
.vocab-card-controls button:hover {
  background: var(--paper);
  border-color: rgba(29, 111, 115, 0.4);
  transform: translateY(-1px);
}
#vocabCardCounter {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

/* ---------- Samuel's Journal Entry Studio ---------- */
#card-journal.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.journal-textarea-wrapper {
  margin-top: 16px;
  position: relative;
}
#journalTextarea {
  width: 100%;
  height: 220px;
  font-family: var(--font-main);
  font-size: 0.98rem;
  line-height: 24px;
  padding: 12px 18px 12px 48px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  outline: none;
  resize: vertical;
  background: #fff linear-gradient(rgba(0,0,0,0) 95%, #e6eef5 95%);
  background-size: 100% 24px;
  background-image: 
    linear-gradient(90deg, transparent 42px, #ff9999 42px, #ff9999 44px, transparent 44px),
    linear-gradient(rgba(0,0,0,0) 95%, #e6eef5 95%);
  background-attachment: local;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  color: var(--ink);
}
#journalTextarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(29, 111, 115, 0.15);
}
.journal-status {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Clickable Images Lightbox ---------- */
.scene-img-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  outline: none;
}
.scene-img-btn:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: -3px;
}
.scene-img-btn .scene-img {
  cursor: zoom-in;
}
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(19, 34, 56, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox-modal.open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 3.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s ease, transform 0.2s ease;
  padding: 0;
  z-index: 1010;
}
.lightbox-close:hover {
  opacity: 1;
  transform: scale(1.1);
}
.lightbox-content {
  max-width: 90%;
  max-height: 85%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.lightbox-modal.open .lightbox-content {
  transform: scale(1);
}
.lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.lightbox-caption {
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* ---------- Exit Ticket Quiz ---------- */
#card-quiz.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--teal);
}
.quiz-question {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.45;
  color: var(--navy);
  margin-bottom: 16px;
}
.quiz-choices {
  display: grid;
  gap: 10px;
}
.quiz-choice-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  line-height: 1.4;
  transition: all 0.2s ease;
}
.quiz-choice-btn:hover:not(:disabled) {
  background: var(--paper);
  border-color: rgba(29, 111, 115, 0.4);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}
.quiz-choice-btn.correct {
  background: rgba(46, 117, 89, 0.1) !important;
  border-color: #2e7559 !important;
  color: #1e4e3a !important;
  font-weight: 700;
  cursor: default;
}
.quiz-choice-btn.incorrect {
  background: rgba(159, 52, 52, 0.08) !important;
  border-color: var(--red) !important;
  color: var(--red) !important;
  font-weight: 700;
  cursor: default;
}
.quiz-choice-btn:disabled:not(.correct):not(.incorrect) {
  opacity: 0.65;
  cursor: default;
}
.quiz-feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.4;
  animation: slideDown 0.25s ease-out;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.quiz-feedback.correct {
  background: rgba(46, 117, 89, 0.1);
  color: #1e4e3a;
  border: 1px solid rgba(46, 117, 89, 0.2);
}
.quiz-feedback.incorrect {
  background: rgba(159, 52, 52, 0.08);
  color: var(--red);
  border: 1px solid rgba(159, 52, 52, 0.15);
}

/* ---------- Speech Speed Controller ---------- */
.tools-speed-container {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}
.tools-speed-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}
#speakRateSelector {
  border: 1.5px solid var(--line);
  background: #fff;
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 6px 8px;
  outline: none;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease;
  width: 100%;
}
#speakRateSelector:focus {
  border-color: var(--teal);
}
