#date {
  text-align: center;
  font-style: italic;
  color: #6b5744;
  margin: 0.8rem 0 2.5rem 0;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

#sections {
  margin-top: 2rem;
}

section {
  margin-bottom: 2rem;
  line-height: 1.7;
  position: relative;
}

/* Narrative sections */
section.narrative {
  padding: 0.5rem 0;
}

section.narrative p {
  margin: 0 0 1rem 0;
  text-align: justify;
  hyphens: auto;
  white-space: pre-line;
}

section.narrative p:first-letter {
  font-size: 3.5em;
  font-weight: bold;
  float: left;
  line-height: 0.85;
  margin-right: 0.08em;
  margin-top: 0.05em;
  color: #8b0000;
}

/* Combat sections */
section.combat {
  background: linear-gradient(to right, rgba(139, 0, 0, 0.08), transparent);
  border-left: 5px solid #8b0000;
  border-right: 1px solid rgba(139, 0, 0, 0.2);
  padding: 1rem 1rem 0.5rem 1.5rem;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  position: relative;
}

section.combat .combat-header {
  text-align: center;
  margin-bottom: 0;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(139, 0, 0, 0.3);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

section.combat .combat-header:hover {
  background-color: rgba(139, 0, 0, 0.05);
}

section.combat .combat-title {
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
  font-size: 1.2rem;
  color: #8b0000;
  letter-spacing: 0.15em;
  margin: 0 0 0.5rem 0;
  position: relative;
}

section.combat .combat-title::before {
  content: '⚔';
  margin-right: 0.5rem;
}

section.combat .combat-title::after {
  content: '⚔';
  margin-left: 0.5rem;
}

section.combat .combat-expand-icon {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.8rem;
  transition: transform 0.3s ease;
  color: #8b0000;
}

section.combat.expanded .combat-expand-icon {
  transform: rotate(180deg);
}

section.combat .combat-location {
  font-size: 1.1rem;
  font-weight: bold;
  color: #5a0000;
  margin: 0.3rem 0;
}

section.combat .combat-participants {
  font-size: 0.95rem;
  color: #6b4444;
  margin: 0.3rem 0;
}

section.combat .combat-participants::before {
  content: '';
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  background: #8b0000;
  border-radius: 50%;
  margin: 0 0.4rem;
  vertical-align: middle;
}

section.combat .combat-participants::after {
  content: '';
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  background: #8b0000;
  border-radius: 50%;
  margin: 0 0.4rem;
  vertical-align: middle;
}

section.combat .combat-enemy {
  font-size: 1.2rem;
  color: #8b0000;
  margin: 0.5rem 0 0 0;
  font-weight: bold;
}

section.combat .combat-tags {
  font-size: 0.85rem;
  color: #8b0000;
  font-style: italic;
  margin: 0.3rem 0 0 0;
}

section.combat .combat-highlights {
  display: none;
  padding-top: 1rem;
}

section.combat.expanded .combat-highlights {
  display: block;
}

section.combat.expanded .combat-header {
  margin-bottom: 1rem;
}

section.combat::before {
  display: none;
}

section.combat p {
  margin: 0 0 0.8rem 0;
  color: #4a0000;
  font-weight: 500;
  padding-left: 1.5rem;
}

section.combat p::before {
  content: '◆';
  position: absolute;
  left: 1.5rem;
  color: #8b0000;
  opacity: 0.6;
  font-size: 0.8rem;
}

section.combat p:last-child {
  margin-bottom: 0.3rem;
}

/* Offscreen sections */
section.offscreen {
  font-style: italic;
  color: #7a6a55;
  text-align: center;
  padding: 0.8rem 1.5rem;
  background: rgba(139, 115, 85, 0.08);
  border-top: 1px dashed #b8a98a;
  border-bottom: 1px dashed #b8a98a;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

section.offscreen::before {
  content: '〔';
  margin-right: 0.3rem;
  opacity: 0.6;
}

section.offscreen::after {
  content: '〕';
  margin-left: 0.3rem;
  opacity: 0.6;
}

section.offscreen.expandable {
  cursor: pointer;
  user-select: none;
}

section.offscreen.expandable:hover {
  background: rgba(139, 115, 85, 0.12);
}

section.offscreen .offscreen-header {
  display: inline;
}

section.offscreen .offscreen-expand-icon {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.8rem;
  transition: transform 0.3s ease;
  color: #7a6a55;
}

section.offscreen.expanded .offscreen-expand-icon {
  transform: rotate(180deg);
}

section.offscreen .offscreen-references {
  display: none;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed #b8a98a;
}

section.offscreen.expanded .offscreen-references {
  display: block;
}

section.offscreen .offscreen-reference-link {
  display: block;
  margin: 0.4rem 0;
  color: #5a0000;
  text-decoration: none;
  font-weight: 500;
}

section.offscreen .offscreen-reference-link:hover {
  text-decoration: underline;
  color: #8b0000;
}

/* ==================== NOTE SECTIONS ==================== */

/* Base note styles (shared by all) */
section.note {
  padding: 1.5rem;
  margin: 2rem 1rem;
  position: relative;
}

section.note .note-header {
  font-size: 1.1rem;
  text-align: center;
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  letter-spacing: 0.1em;
}

section.note .note-language {
  font-size: 0.85rem;
  text-align: center;
  /*font-style: italic;*/
  /*opacity: 0.7;*/
  margin: -0.7rem 0 0.8rem 0;
  letter-spacing: 0.05em;
}

section.note .note-content {
  line-height: 1.8;
  white-space: pre-line;
  text-align: left;
  padding: 0.5rem;
}

section.note .blur {
  filter: blur(4px);
  user-select: none;
}

/* PARCHMENT STYLE (Default) */
section.note.note-parchment,
section.note:not([class*="note-"]) {
  background: 
    linear-gradient(135deg, rgba(139, 115, 85, 0.1) 0%, transparent 100%),
    linear-gradient(to bottom, #faf5e8 0%, #f3ead8 100%);
  border: 2px solid #b89655;
  box-shadow: 
    0 0 0 1px #d4c4a8 inset,
    0 4px 8px rgba(0, 0, 0, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.2);
  transform: rotate(-0.5deg);
}

section.note.note-parchment::before,
section.note:not([class*="note-"])::before {
  content: '✦';
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  font-size: 1rem;
  color: #8b7355;
  opacity: 0.5;
}

section.note.note-parchment::after,
section.note:not([class*="note-"])::after {
  content: '✦';
  position: absolute;
  bottom: 0.8rem;
  right: 0.8rem;
  font-size: 1rem;
  color: #8b7355;
  opacity: 0.5;
}

section.note.note-parchment .note-header,
section.note:not([class*="note-"]) .note-header {
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
  color: #5a0000;
  border-bottom: 1px solid #b89655;
}

section.note.note-parchment .note-language,
section.note:not([class*="note-"]) .note-language {
  color: #5a0000;
}

section.note.note-parchment .note-content,
section.note:not([class*="note-"]) .note-content {
  font-family: "Caveat", cursive;
  font-size: 1.2rem;
  color: #2d1810;
}

section.note.note-parchment .note-seal,
section.note:not([class*="note-"]) .note-seal {
  position: absolute;
  top: -0.5rem;
  right: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  background: radial-gradient(circle, #8b0000 0%, #5a0000 100%);
  border-radius: 50%;
  border: 2px solid #3a0000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d4a574;
  font-size: 1.2rem;
  font-weight: bold;
  user-select: none;
}

/* TABLET STYLE - Primitive Stone */
section.note.note-tablet {
  background: 
    radial-gradient(ellipse at 30% 40%, rgba(74, 74, 74, 0.9) 0%, rgba(58, 58, 58, 1) 100%),
    linear-gradient(to bottom, #4a4a4a 0%, #3a3a3a 100%);
  border: 5px solid #2a2a2a;
  box-shadow: 
    0 0 0 1px #1a1a1a inset,
    0 6px 12px rgba(0, 0, 0, 0.6),
    0 2px 6px rgba(0, 0, 0, 0.4);
  transform: none;
  
  /* Stone texture */
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent 0px,
      rgba(80, 80, 80, 0.05) 1px,
      transparent 2px,
      transparent 4px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent 0px,
      rgba(80, 80, 80, 0.05) 1px,
      transparent 2px,
      transparent 4px
    ),
    radial-gradient(ellipse at 30% 40%, rgba(74, 74, 74, 0.9) 0%, rgba(58, 58, 58, 1) 100%);
}

section.note.note-tablet::before {
  content: '▪';
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  font-size: 1rem;
  color: #1a1a1a;
  opacity: 0.8;
}

section.note.note-tablet::after {
  content: '▪';
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  font-size: 1rem;
  color: #1a1a1a;
  opacity: 0.8;
}

section.note.note-tablet .note-header {
  font-family: "Skranji", cursive;
  font-size: 1.4rem;
  font-variant: small-caps;
  font-weight: normal;
  color: #222222;
  border-bottom: 2px solid #2a2a2a;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
}

section.note.note-tablet .note-language {
  font-family: "Skranji", cursive;
  color: #222222;
}

section.note.note-tablet .note-content {
  font-family: "Skranji", cursive;
  font-size: 1.2rem;
  font-variant: small-caps;
  font-weight: normal;
  color: #222222;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
}

section.note.note-tablet .note-decoration {
  position: absolute;
  top: -0.6rem;
  right: 1.5rem;
  width: 3rem;
  height: 0.8rem;
  background: linear-gradient(to bottom, #2a2a2a 0%, #1a1a1a 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  border-radius: 2px;
}

/* CARVING STYLE - Carved Wood */
section.note.note-carving {
  background: 
    linear-gradient(135deg, #6b5444 0%, #5c4033 50%, #8b6f47 100%);
  border: 8px double #4a3525;
  box-shadow: 
    0 0 0 2px #3a2515 inset,
    0 4px 10px rgba(60, 40, 20, 0.5),
    0 2px 5px rgba(0, 0, 0, 0.3);
  transform: rotate(-0.3deg);
  
  /* Wood grain texture */
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent 0px,
      rgba(45, 30, 20, 0.1) 1px,
      transparent 2px,
      transparent 8px
    ),
    repeating-linear-gradient(
      91deg,
      transparent 0px,
      rgba(45, 30, 20, 0.05) 1px,
      transparent 3px,
      transparent 12px
    ),
    linear-gradient(135deg, #6b5444 0%, #5c4033 50%, #8b6f47 100%);
}

section.note.note-carving::before {
  content: '◆';
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  font-size: 1rem;
  color: #3a2515;
  opacity: 0.7;
}

section.note.note-carving::after {
  content: '◆';
  position: absolute;
  bottom: 0.6rem;
  right: 0.6rem;
  font-size: 1rem;
  color: #3a2515;
  opacity: 0.7;
}

section.note.note-carving .note-header {
  font-family: "Skranji", cursive;
  font-variant: small-caps;
  font-weight: 700;
  color: #2d1810;
  border-bottom: 2px solid #4a3525;
  text-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.6),
    0 -1px 1px rgba(255, 255, 255, 0.1);
}

section.note.note-carving .note-language {
  font-family: "Skranji", cursive;
  color: #2d1810;
}

section.note.note-carving .note-content {
  font-family: "Skranji", cursive;
  font-variant: small-caps;
  font-size: 1.15rem;
  color: #2d1810;
  text-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.6),
    0 -1px 1px rgba(255, 255, 255, 0.1);
}

section.note.note-carving .note-decoration {
  position: absolute;
  top: -0.4rem;
  right: 1.5rem;
  width: 1.2rem;
  height: 1.2rem;
  background: radial-gradient(circle, #3a2515 0%, #2a1810 100%);
  border-radius: 50%;
  border: 2px solid #4a3525;
  box-shadow: 
    0 0 0 2px #5c4033,
    0 2px 4px rgba(0, 0, 0, 0.5);
}

section.note.note-carving .note-decoration::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0.6rem;
  height: 0.6rem;
  background: radial-gradient(circle, #2a1810 0%, #1a0f08 100%);
  border-radius: 50%;
}

/* PLATE STYLE - Classical Stone */
section.note.note-plate {
  background: 
    linear-gradient(135deg, rgba(232, 228, 220, 1) 0%, rgba(212, 207, 196, 1) 100%);
  border: 3px solid #a39d8f;
  box-shadow: 
    0 0 0 1px #b8b2a3 inset,
    0 0 0 6px #e8e4dc inset,
    0 0 0 7px #a39d8f inset,
    0 3px 8px rgba(0, 0, 0, 0.25),
    0 1px 3px rgba(0, 0, 0, 0.15);
  transform: none;
  padding: 2rem 2rem;
  
  /* Marble veining */
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent 0px,
      rgba(163, 157, 143, 0.1) 1px,
      transparent 2px,
      transparent 80px
    ),
    repeating-linear-gradient(
      -20deg,
      transparent 0px,
      rgba(163, 157, 143, 0.08) 1px,
      transparent 3px,
      transparent 120px
    ),
    linear-gradient(135deg, rgba(232, 228, 220, 1) 0%, rgba(212, 207, 196, 1) 100%);
}

section.note.note-plate::before {
  content: '◇';
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  font-size: 1.2rem;
  color: #a39d8f;
  opacity: 0.6;
}

section.note.note-plate::after {
  content: '◇';
  position: absolute;
  bottom: 0.8rem;
  right: 0.8rem;
  font-size: 1.2rem;
  color: #a39d8f;
  opacity: 0.6;
}

section.note.note-plate .note-header {
  font-family: "Julius Sans One", sans-serif;
  font-weight: normal;
  color: #3a342a;
  border-bottom: 2px solid #a39d8f;
  text-shadow: 
    0 1px 1px rgba(255, 255, 255, 0.3),
    0 -1px 0 rgba(0, 0, 0, 0.2);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

section.note.note-plate .note-language {
  font-family: "Julius Sans One", sans-serif;
  color: #6a6458;
  text-shadow: 
    0 1px 1px rgba(255, 255, 255, 0.3),
    0 -1px 0 rgba(0, 0, 0, 0.2);
  text-transform: none;
}

section.note.note-plate .note-content {
  font-family: "Julius Sans One", sans-serif;
  font-size: 1.1rem;
  color: #3a342a;
  text-align: center;
  text-shadow: 
    0 1px 1px rgba(255, 255, 255, 0.3),
    0 -1px 0 rgba(0, 0, 0, 0.2);
}

section.note.note-plate .note-decoration {
  position: absolute;
  top: -0.8rem;
  left: 50%;
  transform: translateX(-50%);
  width: 3rem;
  height: 1.5rem;
  background: linear-gradient(to bottom, #d4cfc4 0%, #a39d8f 100%);
  border: 2px solid #a39d8f;
  border-radius: 2px;
  box-shadow: 
    0 0 0 2px #e8e4dc,
    0 2px 4px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3a342a;
  font-size: 0.9rem;
  font-weight: bold;
}

section.note.note-plate .note-decoration::before {
  content: '◆';
}

/* Entity links in narrative */
.entity-link {
  text-decoration: underline dashed;
  text-underline-offset: 2px;
  cursor: help;
}

.entity-link.character {
  text-decoration-color: #e80000;
}

.entity-link.place {
  text-decoration-color: #2e50e0;
}

/* Session-specific sidebar styles */
.session-title {
  font-weight: bold;
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
}

.session-date {
  font-size: 0.8rem;
  font-style: italic;
  opacity: 0.8;
}

.session-tooltip .tooltip-date {
  font-size: 0.9rem;
  color: #5d4a33;
  margin-bottom: 0.3rem;
  text-align: center;
}

.session-tooltip .tooltip-ingame {
  font-size: 0.9rem;
  color: #5d4a33;
  text-align: center;
}

.entity-tooltip .tooltip-type {
  font-size: 0.85rem;
  color: #5d4a33;
  font-style: italic;
  text-align: center;
  margin-bottom: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  section.combat {
    margin-left: 0;
    margin-right: 0;
  }
  
  section.note {
    margin: 2rem 0;
  }
}

@media (max-width: 480px) {
  section.narrative p {
    text-align: left;
  }
  
  section.note {
    padding: 1.2rem;
  }
  
  section.note .note-content {
    font-size: 1rem !important;
  }
}

/* ==================== SPEECH SECTIONS ==================== */

section.speech {
  background: 
    linear-gradient(135deg, rgba(212, 196, 168, 0.15) 0%, transparent 100%),
    linear-gradient(to bottom, #f9f4e8 0%, #f5ede0 100%);
  border: 2px solid #8b7355;
  border-left: 5px solid #8b7355;
  padding: 1.5rem 1.5rem 1.5rem 5rem;
  margin: 2rem 1rem;
  position: relative;
  box-shadow: 
    0 0 0 1px #d4c4a8 inset,
    0 4px 8px rgba(0, 0, 0, 0.2),
    -2px 0 6px rgba(139, 115, 85, 0.3);
  transform: rotate(0.3deg);
}

section.speech::before {
  content: '🗩';
  position: absolute;
  top: 0.5rem;
  right: 0.8rem;
  font-size: 3rem;
  color: #8b7355;
  opacity: 0.2;
  font-family: Georgia, serif;
  line-height: 1;
}

section.speech::after {
  content: '🗨';
  position: absolute;
  bottom: 0.5rem;
  right: 0.8rem;
  font-size: 3rem;
  color: #8b7355;
  opacity: 0.2;
  font-family: Georgia, serif;
  line-height: 1;
}

.speech-portrait {
  position: absolute;
  top: -0.8rem;
  left: -0.8rem;
  width: 4rem;
  height: 4rem;
  border: 3px solid #8b7355;
  border-radius: 50%;
  box-shadow: 
    0 0 0 2px #d4c4a8,
    0 4px 8px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  background: linear-gradient(to bottom, #d4c4a8 0%, #b8a98a 100%);
  z-index: 10;
}

.speech-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.speech-portrait-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #8b7355;
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
}

.speech-header {
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
  font-size: 1.1rem;
  color: #5a0000;
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #b89655;
  letter-spacing: 0.05em;
}

.speech-content {
  font-family: "Caveat", cursive;
  font-size: 1.25rem;
  line-height: 1.8;
  color: #2d1810;
  white-space: pre-line;
  text-align: left;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  section.speech {
    margin: 2rem 0;
    padding-left: 4.5rem;
  }
  
  .speech-portrait {
    width: 3.5rem;
    height: 3.5rem;
  }
}

@media (max-width: 480px) {
  section.speech {
    padding: 1.5rem 1rem 1.5rem 4rem;
  }
  
  .speech-portrait {
    width: 3rem;
    height: 3rem;
    top: -0.6rem;
    left: -0.6rem;
    border-width: 2px;
  }
  
  .speech-content {
    font-size: 1.15rem;
  }
}