/* ==========================================================================
   TERRA DOS SOMNÍVOROS — ESTILO MANUSCRITO MEDIEVAL PURO & ILHAS FLUTUANTES
   PRENSA CLÁSSICA, SILENCIAMENTO DA INTERFACE & MÚSICA ALQUÍMICA
   ========================================================================== */

:root {
  /* 1. TIPOGRAFIA MEDIEVAL HISTÓRICA */
  --font-monument: 'MedievalSharp', cursive, serif;
  --font-rune: 'MedievalSharp', cursive, serif;
  --font-chapter: 'Cinzel', serif;
  --font-manuscript: 'IM Fell English', Georgia, serif;
  --font-brega: 'IM Fell English', 'Cormorant Garamond', Georgia, serif;
  --font-pestaninha: 'Caveat', 'MedievalSharp', cursive;
  --font-ui: 'Cinzel', serif;

  /* 2. PALETA DE CORES RÚSTICAS */
  --wood-bg: #090503;
  --wood-penumbra: #140b07;
  --wood-wine-ember: rgba(143, 20, 30, 0.16);

  /* Folha de Pergaminho Real (Marfim Tostado) */
  --parchment-top: #fbf6ec;
  --parchment-mid: #f2e3cb;
  --parchment-base: #e6ceaa;
  --parchment-shadow: rgba(7, 4, 2, 0.92);

  /* Nanquim em Alto Contraste */
  --ink-primary: #1a0f07;
  --ink-secondary: #2c160b;
  --ink-muted: #54341c;

  /* Vozes (Contraste Máximo & Distinção) */
  --brega-ink: #7a151b;
  --pestaninha-ink: #6e4302;

  /* Destaques Alquímicos */
  --flame-orange: #c75a10;
  --steel-blue: #1a5276;
}

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

body.taverna-theme {
  background-color: var(--wood-bg);
  background-image: 
    radial-gradient(circle at 50% 18%, var(--wood-wine-ember) 0%, transparent 60%),
    radial-gradient(circle at 50% 85%, rgba(0, 0, 0, 0.95) 0%, transparent 85%);
  color: #efe8dc;
  font-family: var(--font-manuscript);
  font-size: 19px;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   2. HIERARQUIA TIPOGRÁFICA & RELEVO MEDIEVAL
   ========================================================================== */
.monument-title {
  font-family: var(--font-monument);
  font-size: clamp(2.6rem, 5.5vw, 4.2rem);
  font-weight: 700;
  color: #f5eedc;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 16px 0 20px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 16px rgba(199, 90, 16, 0.45);
  text-align: center;
}

.parchment-sheet .monument-title {
  color: #7d0d1b !important;
  font-size: clamp(2.2rem, 4.4vw, 3.2rem);
  margin: 12px 0 16px;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8), 0 0 12px rgba(125, 13, 27, 0.35);
}

.rune-kicker {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  letter-spacing: 0.2em;
  color: var(--flame-orange);
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
  text-align: center;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
}

/* Subtítulos Coloridos com Presença Nobre */
.epigraph-subtitle {
  font-family: var(--font-brega, 'Cormorant Garamond', Georgia, serif);
  font-size: 1.62rem;
  font-style: italic;
  line-height: 1.6;
  color: #8f3412 !important;
  margin: 14px 0 32px;
  text-align: center;
  padding: 0 20px;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
}

.ink-flourish-divider {
  width: 190px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(199, 90, 16, 0.7), transparent);
  margin: 14px auto 24px;
}

/* ==========================================================================
   3. A CARTA NÁUTICA DAS ILHAS FLUTUANTES (TRANSPARÊNCIA TOTAL)
   ========================================================================== */
.tabletop-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.tabletop-header {
  text-align: center;
  max-width: 900px;
  margin-top: 6px;
}

.nautical-map-frame {
  position: relative;
  width: 100%;
  max-width: 1400px;
  aspect-ratio: 1600 / 1060;
  background: transparent !important;
}

#nautical-map-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: transparent !important;
  filter: drop-shadow(0 24px 35px rgba(0, 0, 0, 0.92));
}

.map-interactive-layer {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

.map-spot {
  position: absolute;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.map-spot::before {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229, 185, 92, 0.45) 0%, rgba(201, 147, 62, 0.15) 50%, transparent 75%);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.map-spot:hover::before {
  opacity: 1;
  transform: scale(1.18);
}

.spot-ancestral { top: 8%; left: 42%; width: 16%; height: 17%; }
.spot-cutelaria { top: 32%; left: 12%; width: 19%; height: 21%; }
.spot-cozinha   { top: 32%; left: 69%; width: 20%; height: 21%; }
.spot-grelha    { top: 40%; left: 42%; width: 16%; height: 18%; }
.spot-banquetes { top: 65%; left: 22%; width: 19%; height: 20%; }
.spot-taverna   { top: 65%; left: 59%; width: 20%; height: 20%; }

/* ==========================================================================
   4. A FOLHA DE PERGAMINHO LIMPA (ZERO CAIXAS, PURA LEITURA)
   ========================================================================== */
.viewport-stage {
  padding: 40px 20px 80px;
  max-width: 1400px;
  margin: 0 auto;
}

.stage-view {
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.stage-view.active {
  display: block;
  opacity: 1;
}

.parchment-sheet {
  max-width: 1040px;
  margin: 0 auto;
  background-color: var(--parchment-mid);
  background-image: 
    radial-gradient(ellipse at 50% 16%, var(--parchment-top) 0%, var(--parchment-mid) 58%, var(--parchment-base) 100%),
    url('assets/textura-marfim.png');
  color: var(--ink-primary);
  border-radius: 8px;
  box-shadow: 
    0 24px 70px var(--parchment-shadow),
    0 0 110px rgba(140, 95, 45, 0.28) inset;
  padding: 56px 72px 70px;
  position: relative;
}

.sheet-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(80, 50, 20, 0.25);
  margin-bottom: 36px;
}

.back-to-map-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: #4a280e;
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
}

.back-to-map-link:hover {
  color: #8c1e28;
  transform: translateX(-3px);
}

.lesson-tabs-wrapper {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.lesson-tab {
  background: rgba(190, 155, 110, 0.25);
  border: none;
  padding: 8px 16px;
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  color: #422612;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 2px;
}

.lesson-tab:hover {
  background: rgba(180, 130, 60, 0.35);
  color: #120a04;
}

.lesson-tab.active {
  background: #33190a;
  color: #fff6e8;
  border-bottom: 2px solid #c9933e;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   5. O MANUSCRITO LITERÁRIO (SILENCIAMENTO DA INTERFACE)
   ========================================================================== */
.manuscript-body p {
  font-family: var(--font-manuscript);
  font-size: 1.44rem;
  line-height: 1.86;
  color: var(--ink-primary);
  margin-bottom: 24px;
  letter-spacing: 0.012em;
}

.drop-cap {
  float: left;
  font-family: 'Cinzel', serif;
  font-size: 5rem;
  line-height: 0.8;
  padding-top: 6px;
  padding-right: 14px;
  padding-bottom: 2px;
  color: #7d0d1b;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
}

/* A Breguice do Dia (Pura Literatura, sem caixa) */
.breguice-entry {
  margin: 32px 0 38px;
  padding: 16px 24px;
  border-left: 3px solid var(--flame-orange);
  background: transparent !important;
}

.breguice-kicker {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  letter-spacing: 0.16em;
  color: var(--flame-orange);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 8px;
  display: block;
}

.breguice-poem {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.58rem;
  line-height: 1.72;
  color: #2b180a;
  margin-bottom: 8px;
}

.breguice-author {
  font-family: 'Caveat', cursive;
  font-size: 1.35rem;
  color: var(--pestaninha-ink);
  text-align: right;
  display: block;
}

/* As Falas dos Personagens (Sem Caixas, Sem Néon) */
.rubric-voice {
  margin: 24px 0;
  padding: 0 !important;
  background: transparent !important;
  display: block;
}

/* Dona Ana Maria Brega (Vinho Alquímico Denso, Elegância Literária) */
.rubric-brega {
  font-family: var(--font-brega) !important;
  font-style: italic !important;
  font-size: 1.58rem !important;
  line-height: 1.82 !important;
  color: var(--brega-ink) !important;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5) !important;
}

.rubric-brega strong {
  font-family: 'Cinzel', serif !important;
  font-weight: 700 !important;
  font-style: normal !important;
  letter-spacing: 0.04em !important;
  color: #9e2326 !important;
}

.rubric-brega em {
  font-style: italic !important;
}

/* Pestaninha (Anotação Manual em Ouro-Velho / Âmbar Escuro) */
.rubric-pestaninha {
  font-family: var(--font-pestaninha) !important;
  font-size: 1.84rem !important;
  line-height: 1.65 !important;
  color: var(--pestaninha-ink) !important;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5) !important;
}

.rubric-pestaninha strong {
  font-family: 'Cinzel', serif !important;
  font-weight: 700 !important;
  font-style: normal !important;
  color: #8c5504 !important;
}

.rubric-pestaninha em {
  font-style: normal !important;
}

/* Mestre Cuca Alerta */
.rubric-goyanoverso {
  font-family: var(--font-manuscript) !important;
  font-size: 1.48rem !important;
  line-height: 1.8 !important;
  color: #2b180a !important;
}

.rubric-goyanoverso strong {
  font-family: 'Cinzel', serif !important;
  font-weight: 700 !important;
  color: #7d0d1b !important;
}

/* ==========================================================================
   6. PASTILHAS RÚNICAS SONORAS (WEB AUDIO KARPLUS-STRONG)
   ========================================================================== */
.rune-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 28px;
}

.rune-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  background: rgba(140, 95, 45, 0.12);
  border: 1px solid rgba(120, 75, 25, 0.35);
  border-radius: 4px;
  color: #2b180a;
  font-family: 'Cinzel', serif;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rune-pill-btn:hover {
  background: rgba(199, 90, 16, 0.2);
  border-color: #c75a10;
  color: #c75a10;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(199, 90, 16, 0.25);
}

.rune-pill-btn:active {
  transform: translateY(1px);
  background: #c75a10;
  color: #fff;
}

.chapter-heading {
  font-family: 'Cinzel', serif;
  font-size: 1.7rem;
  color: #3b1804;
  margin: 36px 0 16px;
  border-bottom: 1px solid rgba(120, 75, 25, 0.25);
  padding-bottom: 6px;
}

.section-heading {
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  color: #7d0d1b;
  margin: 28px 0 14px;
}

/* ==========================================================================
   7. MECÂNICA LORE (AZUL) VS. LITERAL (LARANJA) COM TOOLTIPS
   ========================================================================== */
.term-lore {
  font-weight: 700;
  color: #1a5276 !important;
  cursor: pointer;
  position: relative;
  display: inline;
  border-bottom: 2px dotted #1a5276;
  text-shadow: 0 0 6px rgba(26, 82, 118, 0.35);
  transition: all 0.25s ease;
}

.term-lore:hover {
  color: #0d2f45 !important;
  text-shadow: 0 0 10px rgba(26, 82, 118, 0.65);
}

.term-literal {
  font-weight: 700;
  color: #c75a10 !important;
  cursor: pointer;
  position: relative;
  display: inline;
  border-bottom: 2px dotted #c75a10;
  text-shadow: 0 0 6px rgba(199, 90, 16, 0.35);
  transition: all 0.25s ease;
}

.term-literal:hover {
  color: #8c3804 !important;
  text-shadow: 0 0 10px rgba(199, 90, 16, 0.65);
}

/* Tooltip Dinâmico Puro via attr(data-tooltip) */
.term-lore[data-tooltip]::after,
.term-literal[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #211309;
  color: #f5edd8;
  font-family: var(--font-manuscript);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.45;
  padding: 8px 14px;
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.85);
  white-space: normal;
  width: max-content;
  max-width: 290px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.term-lore[data-tooltip]:hover::after,
.term-literal[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

/* ==========================================================================
   8. TABELA ALQUÍMICA & GLOSSÁRIO SOMNÍVORO NA TAVERNA
   ========================================================================== */
.alchemical-table-wrapper {
  margin: 32px 0 36px;
  overflow-x: auto;
  border-top: 2px solid #a68453;
  border-bottom: 2px solid #a68453;
}

.alchemical-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-manuscript);
  font-size: 1.35rem;
  color: var(--ink-primary);
}

.alchemical-table th {
  background: rgba(48, 22, 10, 0.09);
  color: #2b1407;
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  padding: 14px 18px;
  text-align: left;
}

.alchemical-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(166, 132, 83, 0.45);
}

.alchemical-table tr:hover td {
  background: rgba(201, 147, 62, 0.08);
}

/* O Glossário da Taverna */
.glossary-wrapper {
  margin: 48px 0 24px;
  padding-top: 28px;
  border-top: 2px dashed rgba(120, 75, 22, 0.35);
}

.glossary-title-bar {
  text-align: center;
  margin-bottom: 24px;
}

.glossary-main-title {
  font-family: 'Cinzel', serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: #7d0d1b;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.glossary-subtitle {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.3rem;
  font-style: italic;
  color: #694017;
  margin-top: 4px;
}

.glossary-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.glossary-table th {
  background: #33190a;
  color: #f4e8c1;
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 18px;
  text-align: left;
}

.glossary-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(140, 95, 45, 0.2);
  vertical-align: middle;
}

.glossary-table tr:hover td {
  background: rgba(201, 147, 62, 0.12);
}

.glossary-row-highlight {
  animation: glossaryGlow 2.5s ease-out;
}

@keyframes glossaryGlow {
  0% { background: rgba(199, 90, 16, 0.45); }
  50% { background: rgba(26, 82, 118, 0.35); }
  100% { background: transparent; }
}

.lore-term {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  color: var(--steel-blue);
  font-weight: 700;
}

.literal-term {
  font-family: 'Cinzel', serif;
  font-size: 1.12rem;
  color: var(--flame-orange);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.practical-application {
  font-family: var(--font-manuscript);
  font-size: 1.25rem;
  color: #2b180a;
  line-height: 1.5;
}

/* ==========================================================================
   9. INTERATIVIDADE DA GRELHA (FRETBOARD) & AFINADOR
   ========================================================================== */
.fretboard-wood-panel {
  margin: 32px 0;
  padding: 24px;
  background: rgba(33, 19, 10, 0.08);
  border-radius: 6px;
}

.fretboard-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.fretboard-now-playing {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #7d0d1b;
}

.fretboard-controls-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.fretboard-scroll-wrapper {
  overflow-x: auto;
  padding-bottom: 12px;
}

.fretboard-grid {
  display: flex;
  flex-direction: column;
  min-width: 900px;
  background: #2a1608;
  border-radius: 4px;
  padding: 12px 0;
  position: relative;
}

.fretboard-string-row {
  display: flex;
  height: 38px;
  align-items: center;
  position: relative;
  border-bottom: 1px solid rgba(180, 140, 80, 0.15);
}

.fret-cell {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 2px solid #c9b084;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease;
}

.fret-cell:hover {
  background: rgba(229, 185, 92, 0.22);
}

.fret-cell.nut-cell {
  border-right: 6px solid #eae2d0;
  background: rgba(0, 0, 0, 0.2);
}

.fret-wire {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  background: #c0b098;
  transform: translateY(-50%);
  pointer-events: none;
}

.fret-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #d4af37;
  color: #1a0f07;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
  z-index: 2;
}

.fret-active {
  background: rgba(199, 90, 16, 0.35) !important;
}

.fret-numbers-row {
  display: flex;
  min-width: 900px;
  padding-top: 8px;
}

.fret-numbers-row div {
  flex: 1;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  color: #694017;
  font-weight: 700;
}

/* ==========================================================================
   10. GRIMÓRIO DE BORDO (DRAWER LATERAL) & RODAPÉ
   ========================================================================== */
.grimorio-trigger {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(14, 8, 4, 0.94);
  border: none;
  padding: 10px 20px;
  color: #e5b95c;
  font-family: var(--font-chapter);
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.85);
  transition: all 0.3s ease;
  font-weight: 700;
  border-radius: 4px;
}

.grimorio-trigger:hover {
  background: rgba(28, 16, 9, 0.98);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(201, 147, 62, 0.45);
}

.grimorio-trigger svg {
  width: 20px;
  height: 20px;
  stroke: #e5b95c;
}

.grimorio-drawer {
  position: fixed;
  top: 0;
  left: -400px;
  width: 380px;
  height: 100vh;
  z-index: 200;
  background: rgba(12, 7, 4, 0.97);
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.grimorio-drawer.open {
  left: 0;
}

.grimorio-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.grimorio-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.grimorio-header {
  padding: 24px;
  border-bottom: 1px solid rgba(201, 147, 62, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grimorio-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.grimorio-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

.grimorio-title {
  font-family: var(--font-chapter);
  font-size: 1.35rem;
  color: #e5b95c;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.grimorio-sub {
  display: block;
  font-size: 0.95rem;
  color: #a8947d;
  font-family: var(--font-manuscript);
}

.grimorio-close-btn {
  background: transparent;
  border: none;
  color: #a8947d;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s;
}

.grimorio-close-btn:hover {
  color: #e5b95c;
}

.grimorio-nav {
  padding: 20px 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.grimorio-section-label {
  font-family: var(--font-chapter);
  font-size: 0.88rem;
  letter-spacing: 0.16em;
  color: rgba(201, 147, 62, 0.75);
  margin-top: 16px;
  margin-bottom: 6px;
  padding-left: 12px;
  font-weight: 700;
}

.grimorio-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 4px;
  text-decoration: none;
  color: #d1c5b4;
  transition: all 0.2s ease;
}

.grimorio-link:hover,
.grimorio-link.active {
  background: rgba(201, 147, 62, 0.16);
  color: #fff;
  transform: translateX(4px);
}

.grimorio-link svg {
  width: 22px;
  height: 22px;
  stroke: var(--flame-orange);
  flex-shrink: 0;
}

.grimorio-link strong {
  display: block;
  font-family: var(--font-chapter);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.grimorio-link small {
  display: block;
  font-size: 0.95rem;
  color: #9c8973;
  margin-top: 2px;
  font-family: var(--font-manuscript);
}

.grimorio-footer {
  padding: 18px 24px;
  border-top: 1px solid rgba(201, 147, 62, 0.15);
  font-size: 0.92rem;
  color: #8c7760;
  text-align: center;
  letter-spacing: 0.08em;
  font-family: var(--font-chapter);
  font-weight: 700;
}

.sheet-footer {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid rgba(80, 50, 20, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.selo-sagrado-marfim {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: sepia(0.3) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.master-signature {
  max-width: 260px;
  height: auto;
  opacity: 0.94;
  filter: contrast(1.15);
}

.homologation-text {
  font-family: var(--font-chapter);
  font-size: 0.88rem;
  letter-spacing: 0.14em;
  color: #694017;
  text-transform: uppercase;
  font-weight: 700;
}

@media (max-width: 768px) {
  .parchment-sheet {
    padding: 36px 24px 44px;
  }
  .manuscript-body p {
    font-size: 1.32rem;
  }
  .rubric-voice {
    font-size: 1.4rem;
  }
}

/* ==========================================================================
   ESTEIRA DA ESCALA CROMÁTICA & TOGGLES DE PERSPECTIVA
   ========================================================================== */
.chromatic-explorer {
  border: 1px solid rgba(166, 132, 83, 0.35);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

.chromatic-tile:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 6px 14px rgba(125, 13, 27, 0.18);
}


/* ==========================================================================
   PROVA DE BANCADA: QUEBRANDO O CUCA (TESTES INTERATIVOS)
   ========================================================================== */
.cuca-challenge-panel {
  position: relative;
}

.cuca-test-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cuca-test-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.cuca-options-grid {
  display: grid;
  gap: 12px;
}

.cuca-option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(140, 95, 45, 0.35);
  border-radius: 4px;
  font-family: var(--font-manuscript);
  font-size: 1.25rem;
  color: #2b180a;
  cursor: pointer;
  transition: all 0.22s ease;
  line-height: 1.5;
}

.cuca-option-btn:hover {
  background: rgba(199, 90, 16, 0.12);
  border-color: #c75a10;
  transform: translateX(4px);
  color: #7d0d1b;
}

.cuca-option-btn .opt-letter {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: #7d0d1b;
}

.cuca-option-btn.cuca-opt-correct {
  background: rgba(39, 103, 73, 0.18) !important;
  border-color: #276749 !important;
  color: #0d3822 !important;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(39, 103, 73, 0.35);
  transform: translateX(4px);
}

.cuca-option-btn.cuca-opt-correct .opt-letter {
  color: #1f5a34 !important;
}

.cuca-option-btn.cuca-opt-wrong {
  background: rgba(138, 28, 50, 0.15) !important;
  border-color: #8a1c32 !important;
  color: #540c18 !important;
  animation: cucaShake 0.35s ease;
}

.cuca-option-btn.cuca-opt-wrong .opt-letter {
  color: #8a1c32 !important;
}

@keyframes cucaShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.cuca-feedback {
  animation: fadeInFeedback 0.3s ease;
  font-family: var(--font-manuscript);
}

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



/* ==========================================================================
   SISTEMA DE DEGUSTAÇÃO, SELOS & PASSAPORTE DA TAVERNA
   ========================================================================== */

/* 1. BARRA SUTIL DE DEGUSTAÇÃO NO TOPO DAS LIÇÕES */
.module-progress-subtle-bar {
  margin-bottom: 24px;
  padding: 14px 20px;
  background: rgba(48, 22, 10, 0.05);
  border: 1px solid rgba(166, 132, 83, 0.35);
  border-radius: 6px;
}

.subtle-bar-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.subtle-bar-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #7d0d1b;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}

.subtle-bar-counter {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #c75a10;
  letter-spacing: 0.04em;
}

.subtle-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(60, 30, 10, 0.15);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.subtle-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #c75a10 0%, #d4af37 100%);
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}

/* 2. SELO DE AULA DEGUSTADA (FIM DA LIÇÃO) */
.lesson-degustation-wrapper {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px dashed rgba(166, 132, 83, 0.4);
}

.degustation-stamp-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding: 24px 28px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.degustation-stamp-panel.not-degusted {
  background: rgba(48, 22, 10, 0.04);
  border: 1px solid rgba(166, 132, 83, 0.3);
}

.degustation-stamp-panel.is-degusted {
  background: rgba(125, 13, 27, 0.07);
  border: 2px solid #7d0d1b;
  box-shadow: 0 8px 24px rgba(125, 13, 27, 0.15);
}

.degustation-stamp-info {
  flex: 1;
  min-width: 260px;
}

.degustation-kicker {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  color: #c75a10;
  text-transform: uppercase;
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.degustation-title {
  font-family: 'Cinzel', serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #2b1407;
  letter-spacing: 0.04em;
  margin: 0 0 6px 0;
}

.degustation-desc {
  font-family: var(--font-manuscript);
  font-size: 1.25rem;
  line-height: 1.6;
  color: #3b2010;
  margin: 0;
}

.stamp-seal-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #7d0d1b 0%, #9e1a2b 100%);
  color: #fff6e8;
  font-family: 'Cinzel', serif;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(125, 13, 27, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.stamp-seal-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(125, 13, 27, 0.55);
  background: linear-gradient(135deg, #9e1a2b 0%, #b82337 100%);
}

.stamp-seal-action-btn:active {
  transform: translateY(1px);
}

.wax-seal-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
}

.wax-seal-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #7d0d1b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 0 0 4px rgba(125, 13, 27, 0.25), 0 4px 14px rgba(0, 0, 0, 0.35);
}

.stamp-seal-undo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  color: #8c5504;
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid rgba(140, 85, 4, 0.35);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stamp-seal-undo-btn:hover {
  background: rgba(140, 85, 4, 0.1);
  color: #5c3802;
  border-color: #5c3802;
}

/* 3. O LIVRO DE REGISTRO & PASSAPORTE NA TAVERNA DOS SOMNÍVOROS */
.taverna-passport-section {
  margin: 54px 0 48px;
  padding: 40px 32px;
  background: rgba(48, 22, 10, 0.05);
  border: 2px solid rgba(166, 132, 83, 0.4);
  border-radius: 8px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.2);
}

.passport-header-bar {
  text-align: center;
  margin-bottom: 32px;
}

.overall-progress-card {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(166, 132, 83, 0.45);
  border-radius: 8px;
  padding: 24px 28px;
  margin-bottom: 36px;
}

.overall-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
}

.overall-title-block {
  display: flex;
  flex-direction: column;
}

.overall-kicker {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  letter-spacing: 0.16em;
  color: #c75a10;
  text-transform: uppercase;
  font-weight: 700;
}

.overall-value-display {
  font-family: 'Cinzel', serif;
  font-size: 2.8rem;
  font-weight: 900;
  color: #7d0d1b;
  line-height: 1;
  margin-top: 4px;
}

.overall-desc-block {
  font-family: var(--font-manuscript);
  font-size: 1.3rem;
  color: #3b2010;
  font-style: italic;
}

.overall-progress-track {
  width: 100%;
  height: 12px;
  background: rgba(48, 22, 10, 0.16);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

.overall-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7d0d1b 0%, #c75a10 50%, #d4af37 100%);
  border-radius: 6px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.6);
}

/* 4. SELOS DE VISITA AOS 6 TERRITÓRIOS (PASSAPORTE) */
.passport-islands-wrapper {
  margin-bottom: 36px;
}

.passport-sub-header {
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(166, 132, 83, 0.3);
  padding-bottom: 8px;
}

.passport-sub-title {
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  color: #7d0d1b;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.passport-sub-note {
  font-family: var(--font-manuscript);
  font-size: 1.15rem;
  font-style: italic;
  color: #694017;
  display: block;
  margin-top: 4px;
}

.island-seals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.island-passport-card {
  padding: 16px 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.island-passport-card.visited {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(199, 90, 16, 0.5);
  box-shadow: 0 4px 14px rgba(199, 90, 16, 0.15);
}

.island-passport-card.visited:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(199, 90, 16, 0.25);
  border-color: #c75a10;
}

.island-passport-card.unvisited {
  background: rgba(48, 22, 10, 0.03);
  border: 1px dashed rgba(166, 132, 83, 0.3);
  opacity: 0.65;
}

.island-passport-card.unvisited:hover {
  opacity: 0.9;
  border-color: #7d0d1b;
}

.passport-seal-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.island-passport-card.visited .passport-seal-icon {
  background: #7d0d1b;
  color: #fff6e8;
  box-shadow: 0 2px 8px rgba(125, 13, 27, 0.35);
}

.island-passport-card.unvisited .passport-seal-icon {
  background: rgba(60, 30, 10, 0.12);
  color: #694017;
}

.passport-seal-info {
  flex: 1;
}

.passport-island-name {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  display: block;
  color: #2b1407;
  letter-spacing: 0.04em;
}

.passport-island-sub {
  font-family: var(--font-manuscript);
  font-size: 1.05rem;
  color: #694017;
  font-style: italic;
  display: block;
}

.stamp-pill {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stamp-pill.visited {
  background: rgba(125, 13, 27, 0.12);
  color: #7d0d1b;
  border: 1px solid #7d0d1b;
}

.stamp-pill.unvisited {
  background: rgba(60, 30, 10, 0.08);
  color: #7a5024;
  border: 1px dashed rgba(166, 132, 83, 0.4);
}

/* 5. DEGUSTAÇÃO SEPARADA POR MÓDULO (CHECKLIST) */
.modules-progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}

.module-passport-card {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(166, 132, 83, 0.4);
  border-radius: 8px;
  padding: 22px 24px;
}

.module-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.module-card-tag {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #c75a10;
  display: block;
}

.module-card-title {
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  color: #7d0d1b;
  font-weight: 700;
  margin: 2px 0 2px 0;
}

.module-card-sub {
  font-family: var(--font-manuscript);
  font-size: 1.1rem;
  font-style: italic;
  color: #5c3814;
  display: block;
}

.module-card-badge {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #7d0d1b;
  background: rgba(125, 13, 27, 0.08);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(125, 13, 27, 0.3);
}

.module-card-track {
  width: 100%;
  height: 6px;
  background: rgba(48, 22, 10, 0.12);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 18px;
}

.module-card-fill {
  height: 100%;
  background: linear-gradient(90deg, #c75a10, #7d0d1b);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.taverna-lessons-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.taverna-lesson-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.taverna-lesson-item.done {
  background: rgba(125, 13, 27, 0.06);
  border-left: 3px solid #7d0d1b;
}

.taverna-lesson-item.pending {
  background: rgba(48, 22, 10, 0.02);
  border-left: 3px solid rgba(166, 132, 83, 0.3);
}

.taverna-lesson-item:hover {
  background: rgba(199, 90, 16, 0.12);
  transform: translateX(3px);
}

.item-check-icon {
  display: flex;
  align-items: center;
  color: #7d0d1b;
  flex-shrink: 0;
}

.taverna-lesson-item.pending .item-check-icon {
  color: rgba(140, 85, 4, 0.45);
}

.item-title {
  font-family: var(--font-manuscript);
  font-size: 1.15rem;
  color: #2b1407;
  flex: 1;
}

.item-status-pill {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
}

.taverna-lesson-item.done .item-status-pill {
  background: #7d0d1b;
  color: #fff6e8;
}

.taverna-lesson-item.pending .item-status-pill {
  background: rgba(60, 30, 10, 0.08);
  color: #694017;
}

.passport-footer-actions {
  text-align: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed rgba(166, 132, 83, 0.35);
}

.reset-progress-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: transparent;
  color: #694017;
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px dashed rgba(166, 132, 83, 0.4);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reset-progress-btn:hover {
  background: rgba(125, 13, 27, 0.08);
  color: #7d0d1b;
  border-color: #7d0d1b;
}


/* ==========================================================================
   O GRIMÓRIO DO ESCRIBA — WORKSPACE DO INSTRUTOR & LIVE PREVIEW
   ========================================================================== */

.escriba-split-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 1024px) {
  .escriba-split-workspace {
    grid-template-columns: 1fr;
  }
  .escriba-preview-column {
    position: static !important;
    max-height: none !important;
  }
}

.escriba-tool-btn {
  background: #3b2010;
  color: #f4eedc;
  border: 1px solid #a68453;
  border-radius: 4px;
  padding: 4px 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.escriba-tool-btn:hover {
  background: #7d0d1b;
  border-color: #d4b28c;
  color: #fff;
  transform: translateY(-1px);
}

.chord-card-wrapper {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chord-card-wrapper:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(48,22,10,0.14) !important;
}

.cuca-dica-box {
  transition: border-color 0.2s ease;
}

.cuca-dica-box:hover {
  border-left-color: #7d0d1b !important;
}

.alchemical-table-wrapper::-webkit-scrollbar {
  height: 6px;
}

.alchemical-table-wrapper::-webkit-scrollbar-thumb {
  background: #a68453;
  border-radius: 3px;
}

/* Teste Forja Goyanoverso OK */
.forja-teste-sucesso {
  color: #d29922;
}

.somnivoro-card-ativo {
  background-color: #7d0d1b;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.6);
}
