/* ==========================================================================
   Wake Green 1340 — Medieval Living Chronicle & Manor Map
   ========================================================================== */

:root {
  --parchment-bg: #f5eedb;
  --parchment-dark: #e8d9b8;
  --parchment-deep: #d8c39b;
  --parchment-border: #8b6d43;
  
  --ink-primary: #2a1f17;
  --ink-secondary: #4a3828;
  --ink-muted: #725943;
  
  --gold-accent: #c49a45;
  --gold-bright: #e5b853;
  --gold-glow: rgba(196, 154, 69, 0.4);
  
  --rubric-red: #8f1d1d;
  --rubric-bright: #b82b2b;
  
  --forest-green: #25482e;
  --forest-moss: #385d38;
  --cole-blue: #2d506d;
  --cole-cyan: #4a7599;
  
  --shadow-warm: 0 8px 24px rgba(42, 31, 23, 0.18);
  --shadow-deep: 0 14px 40px rgba(26, 17, 10, 0.28);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --font-medieval: 'MedievalSharp', 'Cinzel', serif;
  --font-heading: 'Cinzel', serif;
  --font-body: 'EB Garamond', Georgia, serif;
}

/* Base & Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-primary);
  background-color: #1a120c;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(94, 68, 41, 0.4) 0%, transparent 70%),
    radial-gradient(circle at 20% 90%, rgba(37, 72, 46, 0.3) 0%, transparent 60%),
    linear-gradient(to bottom, #170f08, #23160e, #120b06);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Parchment Container & Filigree Border */
.app-container {
  max-width: 1360px;
  margin: 16px auto;
  padding: 0 16px;
}

.parchment-sheet {
  background: 
    radial-gradient(circle at 10% 20%, rgba(255, 250, 238, 0.8), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(225, 205, 170, 0.7), transparent 50%),
    linear-gradient(135deg, #f8f3e5 0%, #f1e4c7 50%, #e8d5ae 100%);
  border: 4px double var(--parchment-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-deep), inset 0 0 60px rgba(139, 109, 67, 0.25);
  position: relative;
  overflow: hidden;
  padding: 24px;
}

/* Corner Ornaments */
.parchment-sheet::before,
.parchment-sheet::after {
  content: "✤";
  position: absolute;
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--gold-accent);
  opacity: 0.8;
  pointer-events: none;
}
.parchment-sheet::before { top: 12px; left: 14px; }
.parchment-sheet::after { top: 12px; right: 14px; }

/* ==========================================================================
   Header & Atmosphere Bar
   ========================================================================== */

.site-header {
  border-bottom: 2px solid var(--parchment-border);
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.title-badge {
  display: flex;
  align-items: center;
  gap: 14px;
}

.crest-seal {
  width: 48px;
  height: 48px;
  background: var(--rubric-red);
  color: var(--gold-bright);
  border: 2px solid var(--gold-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-medieval);
  font-size: 22px;
  font-weight: bold;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
  flex-shrink: 0;
}

.title-texts h1 {
  font-family: var(--font-heading);
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--rubric-red);
  text-shadow: 1px 1px 0 rgba(255,255,255,0.7);
  line-height: 1.1;
}

.title-texts p {
  font-size: 0.95rem;
  color: var(--ink-muted);
  font-style: italic;
  font-family: var(--font-body);
}

/* Header Controls & Atmosphere */
.atmosphere-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(139, 109, 67, 0.12);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(139, 109, 67, 0.35);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-label {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.season-btn-group, .time-btn-group {
  display: flex;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--parchment-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.season-pill, .time-pill {
  background: transparent;
  border: none;
  padding: 5px 9px;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.season-pill:hover, .time-pill:hover {
  background: rgba(196, 154, 69, 0.2);
  color: var(--ink-primary);
}

.season-pill.active {
  background: var(--rubric-red);
  color: #fff;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.time-pill.active {
  background: var(--ink-secondary);
  color: #fff;
}

.audio-toggle-btn {
  background: var(--parchment-dark);
  border: 1px solid var(--parchment-border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.audio-toggle-btn:hover {
  background: var(--gold-accent);
  color: #fff;
}

.audio-toggle-btn.playing {
  background: var(--forest-green);
  color: #fff;
  border-color: var(--forest-moss);
}

/* Ambient Banner */
.season-banner {
  margin-top: 14px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.45);
  border-left: 4px solid var(--gold-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--ink-secondary);
}

.banner-season-tag {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  font-style: normal;
  text-transform: uppercase;
  color: var(--rubric-red);
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Navigation Tabs
   ========================================================================== */

.manuscript-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--parchment-border);
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.tab-btn {
  background: var(--parchment-dark);
  border: 1px solid var(--parchment-border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 8px 14px;
  font-family: var(--font-heading);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  top: 2px;
  flex-shrink: 0;
}

.tab-btn:hover {
  background: #f1e4c7;
  color: var(--rubric-red);
}

.tab-btn.active {
  background: #f8f3e5;
  color: var(--rubric-red);
  border-top: 3px solid var(--rubric-red);
  border-bottom: 2px solid #f8f3e5;
  padding-bottom: 11px;
  box-shadow: 0 -3px 8px rgba(0,0,0,0.06);
  z-index: 2;
}

/* ==========================================================================
   Tab View Content
   ========================================================================== */

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

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

/* ==========================================================================
   Tab 1: Living Manor Map
   ========================================================================== */

.map-layout {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1024px) {
  .map-layout {
    grid-template-columns: 1fr;
  }
}

.map-stage-wrapper {
  background: #1d251d;
  border: 3px double var(--parchment-border);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.6), var(--shadow-warm);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.map-header-bar {
  background: rgba(30, 20, 10, 0.85);
  border-bottom: 1px solid var(--parchment-border);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--gold-bright);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  z-index: 10;
}

.map-svg-container {
  width: 100%;
  aspect-ratio: 16 / 10;
  position: relative;
  background: #2a3c26;
  cursor: grab;
  user-select: none;
}

.map-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Map Location Pins / Interactive Hotspots */
.location-hotspot {
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.location-hotspot:hover {
  transform: scale(1.12);
}

.location-hotspot.selected circle.pin-outer {
  stroke: var(--gold-bright);
  stroke-width: 4px;
  animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
  0%, 100% { stroke-opacity: 1; transform: scale(1); }
  50% { stroke-opacity: 0.5; transform: scale(1.08); }
}

.pin-label {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  fill: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 6px rgba(0,0,0,0.8);
  pointer-events: none;
}

.pin-label-bg {
  fill: rgba(26, 18, 12, 0.75);
  rx: 3px;
  ry: 3px;
  stroke: rgba(196, 154, 69, 0.5);
  stroke-width: 1px;
}

/* Map Quick-Bar Below Canvas */
.map-quick-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background: rgba(35, 24, 15, 0.95);
  border-top: 1px solid var(--parchment-border);
}

.quick-loc-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(196, 154, 69, 0.4);
  color: #e5d5be;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.quick-loc-btn:hover {
  background: rgba(196, 154, 69, 0.25);
  color: #fff;
  border-color: var(--gold-bright);
}

.quick-loc-btn.active {
  background: var(--rubric-red);
  color: #fff;
  border-color: var(--gold-bright);
}

/* Location Detail Panel (Sidebar) */
.location-panel {
  background: #fbf7ed;
  border: 2px solid var(--parchment-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  box-shadow: var(--shadow-warm);
}

.loc-header {
  border-bottom: 2px solid var(--parchment-border);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.loc-category {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--rubric-red);
  letter-spacing: 0.08em;
  font-weight: 700;
}

.loc-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  color: var(--ink-primary);
  margin: 4px 0;
  line-height: 1.2;
}

.loc-sound-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--forest-green);
  background: rgba(37, 72, 46, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

.loc-lore {
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--ink-secondary);
  margin-bottom: 16px;
}

.loc-details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  background: var(--parchment-dark);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(139, 109, 67, 0.4);
  margin-bottom: 16px;
}

.detail-row {
  display: flex;
  font-size: 0.88rem;
  line-height: 1.4;
}

.detail-label {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--ink-primary);
  width: 110px;
  flex-shrink: 0;
}

.detail-val {
  color: var(--ink-secondary);
}

.loc-action-box {
  background: rgba(196, 154, 69, 0.15);
  border: 1px dashed var(--gold-accent);
  padding: 12px;
  border-radius: var(--radius-sm);
}

.loc-action-box h4 {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  color: var(--rubric-red);
  margin-bottom: 4px;
}

.loc-action-box p {
  font-size: 0.88rem;
  color: var(--ink-secondary);
  margin-bottom: 10px;
}

.action-trigger-btn {
  background: var(--rubric-red);
  color: #fff;
  border: 1px solid #6b1414;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: center;
}

.action-trigger-btn:hover {
  background: var(--rubric-bright);
}

/* ==========================================================================
   Tab 2: Villagers & Roles (Roleplay / Characters)
   ========================================================================== */

.villagers-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  align-items: start;
}

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

.character-roster {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.roster-card {
  background: #fdfaf2;
  border: 1px solid var(--parchment-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.roster-card:hover {
  background: var(--parchment-dark);
  transform: translateX(4px);
}

.roster-card.active {
  background: var(--parchment-dark);
  border-left: 5px solid var(--rubric-red);
  box-shadow: var(--shadow-warm);
}

.roster-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink-secondary);
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 2px solid var(--gold-accent);
  flex-shrink: 0;
}

.roster-info h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--ink-primary);
  line-height: 1.2;
}

.roster-info span {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

/* Character Profile Sheet */
.character-profile {
  background: #fdfbf5;
  border: 2px double var(--parchment-border);
  border-radius: var(--radius-sm);
  padding: 24px;
  box-shadow: var(--shadow-warm);
}

.char-header {
  border-bottom: 2px solid var(--parchment-border);
  padding-bottom: 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.char-name-group h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--rubric-red);
  line-height: 1.1;
}

.char-sub {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  color: var(--ink-secondary);
  font-weight: 600;
}

.char-status-badge {
  background: var(--parchment-dark);
  border: 1px solid var(--parchment-border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: var(--font-heading);
  color: var(--ink-primary);
}

.char-quote {
  font-size: 1.08rem;
  font-style: italic;
  color: var(--ink-secondary);
  border-left: 3px solid var(--gold-accent);
  padding-left: 14px;
  margin-bottom: 18px;
}

.char-description {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-secondary);
  margin-bottom: 20px;
}

.char-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}

@media (max-width: 700px) {
  .char-sections-grid {
    grid-template-columns: 1fr;
  }
}

.schedule-box, .possessions-box {
  background: var(--parchment-dark);
  border: 1px solid rgba(139, 109, 67, 0.4);
  padding: 14px;
  border-radius: var(--radius-sm);
}

.schedule-box h4, .possessions-box h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--rubric-red);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.schedule-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-item {
  font-size: 0.85rem;
  line-height: 1.4;
}

.schedule-time {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--ink-primary);
  display: block;
}

.possessions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.possessions-list li {
  font-size: 0.88rem;
  padding-left: 16px;
  position: relative;
}

.possessions-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--gold-accent);
  font-size: 0.75rem;
}

/* Character Dilemma (Roleplay Encounter) */
.char-dilemma-card {
  background: rgba(143, 29, 29, 0.06);
  border: 2px solid rgba(143, 29, 29, 0.3);
  border-radius: var(--radius-sm);
  padding: 18px;
}

.dilemma-header {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--rubric-red);
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dilemma-prompt {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink-primary);
  margin-bottom: 16px;
  font-style: italic;
}

.dilemma-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dilemma-btn {
  background: #fdfaf2;
  border: 1px solid var(--parchment-border);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.dilemma-btn:hover {
  background: var(--gold-accent);
  color: #fff;
  border-color: var(--gold-accent);
}

.dilemma-outcome-box {
  margin-top: 14px;
  padding: 12px;
  background: #fff;
  border-left: 4px solid var(--forest-green);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  animation: fadeIn 0.3s ease;
}

.outcome-text {
  font-size: 0.92rem;
  color: var(--ink-secondary);
  margin-bottom: 6px;
}

.consequence-tag {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--forest-green);
}

/* ==========================================================================
   Tab 3: Medieval Hearth & Workshop (Interactive Pottage / Ale)
   ========================================================================== */

.hearth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

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

.workshop-column {
  background: #fdfbf5;
  border: 2px solid var(--parchment-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  box-shadow: var(--shadow-warm);
}

.workshop-column h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--rubric-red);
  border-bottom: 2px solid var(--parchment-border);
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.cauldron-stage {
  background: radial-gradient(circle at 50% 70%, #54220b 0%, #1f1107 80%);
  border-radius: var(--radius-sm);
  padding: 20px;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  border: 2px solid #54371d;
}

.cauldron-pot {
  width: 130px;
  height: 100px;
  background: #111;
  border: 4px solid #444;
  border-radius: 0 0 60px 60px;
  margin: 0 auto;
  position: relative;
  box-shadow: 0 10px 20px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cauldron-soup {
  position: absolute;
  top: 15px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  background: #7a5024;
  border-radius: 0 0 50px 50px;
  overflow: hidden;
  transition: background 0.5s ease;
}

.bubble {
  position: absolute;
  background: rgba(255, 200, 100, 0.4);
  border-radius: 50%;
  animation: bubbling 2s infinite ease-in;
}

@keyframes bubbling {
  0% { transform: translateY(50px) scale(0.4); opacity: 0; }
  50% { opacity: 0.8; }
  100% { transform: translateY(-10px) scale(1.2); opacity: 0; }
}

.fire-embers {
  margin-top: 10px;
  font-size: 24px;
  letter-spacing: 4px;
}

.cauldron-status {
  margin-top: 12px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--gold-bright);
}

.ingredients-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.ingredient-btn {
  background: var(--parchment-dark);
  border: 1px solid var(--parchment-border);
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--ink-primary);
  text-align: center;
  transition: all 0.2s ease;
}

.ingredient-btn:hover {
  background: var(--gold-accent);
  color: #fff;
}

.ingredient-btn.added {
  background: var(--forest-green);
  color: #fff;
  border-color: var(--forest-moss);
}

/* Recipe Book (Right side) */
.recipe-book {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.recipe-card {
  background: #fcf8ee;
  border: 1px solid var(--parchment-border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.recipe-card h4 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--rubric-red);
  margin-bottom: 4px;
}

.recipe-meta {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.recipe-ing-list {
  font-size: 0.88rem;
  list-style: none;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recipe-ing-list li strong {
  color: var(--ink-primary);
}

.recipe-hist-note {
  font-size: 0.85rem;
  font-style: italic;
  background: rgba(139, 109, 67, 0.1);
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
}

/* ==========================================================================
   Tab 4: Medieval Calendar & Seasons
   ========================================================================== */

.calendar-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline-event {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  background: #fdfbf5;
  border: 1px solid var(--parchment-border);
  border-left: 6px solid var(--rubric-red);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow-warm);
}

@media (max-width: 700px) {
  .timeline-event {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.event-date-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.event-date {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--rubric-red);
}

.event-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--ink-primary);
}

.event-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-secondary);
}

/* ==========================================================================
   Tab 5: Illuminated Codex & Middle English Lexicon
   ========================================================================== */

.codex-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.codex-section {
  background: #fdfbf5;
  border: 2px solid var(--parchment-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  box-shadow: var(--shadow-warm);
}

.codex-section h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--rubric-red);
  border-bottom: 2px solid var(--parchment-border);
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.codex-essay {
  font-size: 0.96rem;
  line-height: 1.7;
  color: var(--ink-secondary);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.codex-essay .drop-cap {
  float: left;
  font-family: var(--font-heading);
  font-size: 3.2rem;
  line-height: 0.8;
  padding-top: 4px;
  padding-right: 8px;
  padding-bottom: 2px;
  color: var(--rubric-red);
  font-weight: 800;
}

.lexicon-search-box {
  margin-bottom: 14px;
}

.lexicon-input {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1px solid var(--parchment-border);
  background: #fff;
  border-radius: var(--radius-sm);
  color: var(--ink-primary);
}

.lexicon-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 6px;
}

.lexicon-card {
  background: var(--parchment-dark);
  border: 1px solid rgba(139, 109, 67, 0.4);
  padding: 12px;
  border-radius: var(--radius-sm);
}

.lexicon-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.term-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--rubric-red);
}

.term-pronounce {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--ink-muted);
}

.term-def {
  font-size: 0.92rem;
  color: var(--ink-secondary);
  line-height: 1.45;
}

/* ==========================================================================
   Modals & Interaction Overlays
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(18, 11, 6, 0.75);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: 
    radial-gradient(circle at 10% 20%, rgba(255, 250, 238, 0.9), transparent 40%),
    linear-gradient(135deg, #f8f3e5 0%, #f1e4c7 100%);
  border: 3px double var(--parchment-border);
  border-radius: var(--radius-md);
  padding: 24px;
  max-width: 580px;
  width: 100%;
  box-shadow: var(--shadow-deep);
  position: relative;
  transform: translateY(10px);
  transition: transform 0.25s ease;
}

.modal-backdrop.open .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--parchment-border);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--rubric-red);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 0 4px;
}

.modal-close-btn:hover {
  color: var(--rubric-red);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--parchment-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--parchment-border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--rubric-red);
}
