/* ============================================================
   The Invitation: March 20, 1854 — Master Stylesheet
   ============================================================ */

/* ---- Fonts & Base ----------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=IM+Fell+English:ital@0;1&family=IM+Fell+English+SC&family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=Special+Elite&display=swap');

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

:root {
  --ink:         #1a1208;
  --ink-light:   #3b2a14;
  --parchment:   #e8dcc8;
  --parchment-dark: #c9b99a;
  --parchment-edge: #b89e7a;
  --gold:        #b8860b;
  --gold-light:  #d4a847;
  --sepia:       #704214;
  --sepia-dark:  #3d2005;
  --rust:        #8b3a1a;
  --forest:      #2d4a2a;
  --slate:       #2a3540;
  --candle:      #f5c842;
  --candle-glow: rgba(245, 200, 66, 0.15);

  --trust-color:      #4a7c59;
  --knowledge-color:  #4a5f7c;
  --discretion-color: #7c6a4a;
  --courage-color:    #7c4a4a;
  --suspicion-color:  #8b2020;

  --font-serif:    'Crimson Text', Georgia, serif;
  --font-display:  'IM Fell English', Georgia, serif;
  --font-display-sc: 'IM Fell English SC', Georgia, serif;
  --font-typeface: 'Special Elite', monospace;
  --font-sans:     Georgia, 'Times New Roman', serif;

  --shadow-parchment: 0 4px 20px rgba(60,30,0,0.35), 0 1px 3px rgba(0,0,0,0.2);
  --shadow-deep:      0 8px 40px rgba(0,0,0,0.7);
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --transition:  all 0.35s ease;
}

html, body {
  height: 100%;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink);
  background: #0d0a05;
  overflow-x: hidden;
}

/* ---- Background layers ------------------------------------ */
.bg-village {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(10,7,2,0.55) 0%, rgba(15,10,3,0.3) 40%, rgba(20,14,5,0.6) 100%),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><rect fill="%23111008" width="200" height="200"/><rect fill="%23161208" x="10" y="80" width="30" height="60" rx="2"/><rect fill="%23100e06" x="50" y="70" width="40" height="70" rx="2"/><rect fill="%231a1508" x="100" y="75" width="35" height="65" rx="2"/><rect fill="%23120f06" x="145" y="82" width="25" height="55" rx="2"/><polygon fill="%230d0b05" points="10,80 25,55 40,80"/><polygon fill="%230a0905" points="50,70 70,42 90,70"/><polygon fill="%230e0c05" points="100,75 117,48 135,75"/><polygon fill="%230b0a04" points="145,82 157,60 170,82"/></svg>') repeat-x bottom,
    radial-gradient(ellipse at center bottom, #2a1f08 0%, #0d0a04 60%, #050403 100%);
  background-size: auto, 800px 300px, auto;
  z-index: 0;
}

.game-bg {
  background:
    linear-gradient(to bottom, rgba(5,3,1,0.7) 0%, rgba(10,7,2,0.4) 30%, rgba(5,3,1,0.65) 100%),
    radial-gradient(ellipse at 50% 85%, #1e1608 0%, #080602 70%);
}

.bg-fog {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(40,30,10,0.0) 20%, rgba(15,10,3,0.5) 100%);
  animation: fogDrift 20s ease-in-out infinite alternate;
  z-index: 1;
  pointer-events: none;
}

.bg-vignette {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.75) 100%);
  z-index: 2;
  pointer-events: none;
}

@keyframes fogDrift {
  0%   { opacity: 0.6; transform: scale(1); }
  100% { opacity: 1;   transform: scale(1.05); }
}

/* ============================================================
   TITLE SCREEN
   ============================================================ */

.title-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.title-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1000px;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  animation: titleFadeIn 1.8s ease both;
}

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

/* Game Title */
.title-header {
  text-align: center;
}

.title-ornament {
  color: var(--gold);
  letter-spacing: 0.5rem;
  font-size: 0.9rem;
  opacity: 0.8;
  margin: 0.3rem 0;
}

.game-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  color: var(--parchment);
  text-shadow:
    0 0 40px rgba(180,130,30,0.6),
    0 2px 4px rgba(0,0,0,0.9),
    0 0 80px rgba(180,130,30,0.2);
  letter-spacing: 0.02em;
  line-height: 1;
  animation: titleGlow 4s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  from { text-shadow: 0 0 30px rgba(180,130,30,0.5), 0 2px 4px rgba(0,0,0,0.9); }
  to   { text-shadow: 0 0 60px rgba(200,150,40,0.8), 0 2px 4px rgba(0,0,0,0.9), 0 0 100px rgba(180,130,30,0.3); }
}

.game-subtitle-year {
  font-family: var(--font-display-sc);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--gold-light);
  letter-spacing: 0.15em;
  margin-top: 0.3rem;
}

.game-subtitle-place {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  color: var(--parchment-dark);
  margin-top: 0.4rem;
  opacity: 0.85;
}

/* Intro parchment */
.intro-parchment {
  background:
    linear-gradient(135deg, rgba(232,220,200,0.12) 0%, rgba(180,140,80,0.08) 100%);
  border: 1px solid rgba(184,134,11,0.3);
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  max-width: 600px;
  width: 100%;
  text-align: center;
  backdrop-filter: blur(2px);
  box-shadow: 0 0 30px rgba(180,130,20,0.1), inset 0 1px 0 rgba(255,255,255,0.05);
  animation: parchmentReveal 2s 0.5s ease both;
}

@keyframes parchmentReveal {
  from { opacity: 0; transform: scaleY(0.95); }
  to   { opacity: 1; transform: scaleY(1); }
}

.intro-line {
  font-family: var(--font-serif);
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  color: var(--parchment);
  line-height: 1.7;
  opacity: 0.9;
}

.intro-space { margin-top: 0.75rem; }

/* Role selection */
.role-section {
  width: 100%;
}

.role-label {
  text-align: center;
  font-family: var(--font-display-sc);
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 0.2em;
  margin-bottom: 0.75rem;
  opacity: 0.8;
}

.role-cards {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.role-card {
  background: linear-gradient(160deg, rgba(40,28,10,0.9), rgba(25,17,5,0.95));
  border: 1px solid rgba(184,134,11,0.25);
  border-radius: var(--radius-md);
  padding: 1rem;
  width: 210px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  outline: none;
}

.role-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(184,134,11,0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.role-card:hover,
.role-card:focus {
  border-color: rgba(184,134,11,0.6);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(180,130,20,0.25);
}

.role-card:hover::before,
.role-card:focus::before { opacity: 1; }

.role-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(184,134,11,0.4), 0 4px 20px rgba(0,0,0,0.5);
  transform: translateY(-3px);
}

.role-portrait {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.6rem;
}

.portrait-silhouette {
  width: 44px;
  height: 56px;
  background: rgba(180,140,60,0.2);
  border-radius: 50% 50% 40% 40%;
  border: 1px solid rgba(180,140,60,0.3);
  position: relative;
}

.portrait-silhouette::after {
  content: '&#9647;';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 20px;
  background: rgba(180,140,60,0.15);
  border-radius: 0 0 4px 4px;
}

.role-name {
  font-family: var(--font-display-sc);
  font-size: 0.9rem;
  color: var(--gold-light);
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}

.role-desc {
  font-size: 0.8rem;
  color: var(--parchment-dark);
  line-height: 1.4;
  font-style: italic;
  margin-bottom: 0.6rem;
}

.role-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.stat-pill {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 20px;
  letter-spacing: 0.03em;
  font-family: var(--font-typeface);
}

.stat-pill.trust      { background: rgba(74,124,89,0.3);  color: #8fcfa3; border: 1px solid rgba(74,124,89,0.4); }
.stat-pill.knowledge  { background: rgba(74,95,124,0.3);  color: #8faacc; border: 1px solid rgba(74,95,124,0.4); }
.stat-pill.discretion { background: rgba(124,106,74,0.3); color: #ccb88f; border: 1px solid rgba(124,106,74,0.4); }
.stat-pill.courage    { background: rgba(124,74,74,0.3);  color: #cc8f8f; border: 1px solid rgba(124,74,74,0.4); }

.role-selected-mark {
  display: none;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.7rem;
  color: var(--gold);
  background: rgba(184,134,11,0.15);
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  border: 1px solid rgba(184,134,11,0.3);
}

.role-card.selected .role-selected-mark { display: block; }

/* Begin button */
.begin-section { text-align: center; }

.btn-begin {
  background: linear-gradient(160deg, #8b6914, #5c4509);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 0.9rem 3rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-begin:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.btn-begin:not(:disabled):hover {
  background: linear-gradient(160deg, #a87920, #6e5210);
  box-shadow: 0 0 30px rgba(184,134,11,0.5), 0 4px 20px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}

.btn-begin-inner {
  font-family: var(--font-display-sc);
  font-size: 1.1rem;
  color: var(--parchment);
  letter-spacing: 0.12em;
}

.begin-hint {
  font-size: 0.8rem;
  color: rgba(232,220,200,0.45);
  margin-top: 0.5rem;
  font-style: italic;
  transition: opacity 0.3s;
}

/* Title nav */
.title-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.title-nav-btn {
  background: transparent;
  border: 1px solid rgba(184,134,11,0.25);
  border-radius: var(--radius-sm);
  padding: 0.45rem 1rem;
  color: var(--parchment-dark);
  font-family: var(--font-serif);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.title-nav-btn:hover {
  border-color: rgba(184,134,11,0.6);
  color: var(--gold-light);
  background: rgba(184,134,11,0.05);
}

/* Candle decorations */
.candle {
  position: fixed;
  bottom: 0;
  z-index: 5;
  pointer-events: none;
}

.candle-left  { left: 3vw; }
.candle-right { right: 3vw; }

.candle-body {
  width: 14px;
  height: 60px;
  background: linear-gradient(to right, #f0e0c0, #d4c090, #c0a870);
  border-radius: 2px 2px 0 0;
  margin: 0 auto;
}

.candle-flame {
  width: 12px;
  height: 20px;
  background: radial-gradient(ellipse at 50% 80%, #fff8e0 0%, #ffd040 40%, #ff8800 70%, transparent 100%);
  border-radius: 50% 50% 30% 30%;
  margin: 0 auto 2px;
  animation: candleFlicker 1.8s ease-in-out infinite;
  filter: blur(0.5px);
}

@keyframes candleFlicker {
  0%,100% { transform: scaleX(1)   scaleY(1)   rotate(0deg);   opacity: 1;    }
  20%      { transform: scaleX(0.9) scaleY(1.1) rotate(-3deg);  opacity: 0.95; }
  40%      { transform: scaleX(1.1) scaleY(0.95) rotate(2deg);  opacity: 1;    }
  60%      { transform: scaleX(0.95) scaleY(1.05) rotate(-1deg); opacity: 0.98; }
  80%      { transform: scaleX(1.05) scaleY(0.98) rotate(1deg); opacity: 1;    }
}

/* ============================================================
   MODALS (shared)
   ============================================================ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5,3,1,0.8);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(3px);
}

.modal-overlay.open {
  display: flex;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-parchment {
  background:
    linear-gradient(145deg, #e8dcc8, #d4c4a0, #c9b99a);
  border: 2px solid var(--parchment-edge);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-deep);
  animation: parchmentSlideIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes parchmentSlideIn {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(60,30,10,0.1);
  border: 1px solid var(--parchment-edge);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--sepia);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(60,30,10,0.2);
  color: var(--sepia-dark);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--sepia-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--parchment-edge);
}

.modal-body {
  font-family: var(--font-serif);
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.7;
}

.modal-body p { margin-bottom: 0.75rem; }
.modal-body h3 { font-family: var(--font-display-sc); color: var(--sepia); margin: 1rem 0 0.4rem; font-size: 1rem; }
.modal-body ul { padding-left: 1.5rem; }
.modal-body li { margin-bottom: 0.4rem; }

/* ============================================================
   GAME SCREEN
   ============================================================ */

.game-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Top Bar */
.top-bar {
  position: relative;
  z-index: 20;
  background: linear-gradient(to right, rgba(10,7,2,0.95), rgba(20,14,5,0.95), rgba(10,7,2,0.95));
  border-bottom: 1px solid rgba(184,134,11,0.3);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.top-bar-title {
  display: flex;
  flex-direction: column;
  min-width: 140px;
}

.top-game-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold-light);
  line-height: 1;
}

.top-year {
  font-size: 0.7rem;
  color: var(--parchment-dark);
  font-style: italic;
  opacity: 0.7;
}

.top-bar-meta {
  display: flex;
  gap: 1.2rem;
  flex: 1;
}

.top-meta-item { display: flex; flex-direction: column; }

.top-meta-label {
  font-size: 0.6rem;
  color: rgba(200,170,100,0.6);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.top-meta-value {
  font-size: 0.85rem;
  color: var(--parchment);
  font-family: var(--font-serif);
}

.time-badge {
  font-family: var(--font-display-sc);
  font-size: 0.8rem;
  color: var(--gold-light);
}

.invite-badge {
  font-size: 0.8rem;
  color: #a8d8a0;
  border: 1px solid rgba(168,216,160,0.4);
  border-radius: 20px;
  padding: 0.15rem 0.6rem;
  animation: invitePulse 3s ease-in-out infinite;
}

@keyframes invitePulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(168,216,160,0.3); }
  50%      { box-shadow: 0 0 0 6px rgba(168,216,160,0); }
}

.top-bar-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.top-btn {
  background: rgba(40,28,10,0.6);
  border: 1px solid rgba(184,134,11,0.25);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  color: var(--parchment-dark);
  font-size: 0.78rem;
  font-family: var(--font-serif);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.top-btn:hover {
  border-color: rgba(184,134,11,0.6);
  color: var(--gold-light);
  background: rgba(60,42,15,0.7);
}

.top-btn.danger { border-color: rgba(139,58,26,0.3); }
.top-btn.danger:hover { border-color: rgba(139,58,26,0.8); color: #cc8866; }

/* Main layout */
.game-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr 220px;
  grid-template-rows: 1fr;
  gap: 0;
  overflow: hidden;
  position: relative;
  z-index: 10;
}

/* Panels */
.panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(184,134,11,0.15);
}

.panel-map   { background: rgba(8,6,2,0.88); }
.panel-scene { background: rgba(12,9,3,0.82); border-right-color: rgba(184,134,11,0.15); }
.panel-stats { background: rgba(8,6,2,0.9);  border-right: none; border-left: 1px solid rgba(184,134,11,0.15); }

.panel-header {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid rgba(184,134,11,0.2);
  background: rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.panel-title {
  font-family: var(--font-display-sc);
  font-size: 0.75rem;
  color: var(--gold);
  letter-spacing: 0.12em;
  opacity: 0.8;
}

/* Map */
.map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.map-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20,14,5,0.15) 0%, rgba(10,7,2,0.35) 100%),
    url('../images/map-1854-ripon.png') center center / cover no-repeat;
  filter: sepia(0.35) contrast(1.05);
}

.map-pins {
  position: absolute;
  inset: 0;
}

.map-compass {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(184,134,11,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: rgba(184,134,11,0.6);
  font-family: var(--font-display-sc);
}

.map-legend {
  padding: 0.4rem 0.6rem;
  border-top: 1px solid rgba(184,134,11,0.15);
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.legend-item {
  font-size: 0.65rem;
  color: rgba(200,170,100,0.6);
  font-family: var(--font-serif);
}
.legend-available { color: rgba(100,180,100,0.7); }
.legend-locked    { color: rgba(180,100,100,0.6); }
.legend-current   { color: rgba(220,180,60,0.8); }

/* Map Pins */
.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: var(--transition);
  z-index: 5;
}

.map-pin .pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(100,180,100,0.9);
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 0 8px rgba(100,180,100,0.5);
  transition: var(--transition);
  position: relative;
}

.map-pin .pin-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(100,180,100,0.4);
  animation: pinPulse 2.5s ease-in-out infinite;
}

@keyframes pinPulse {
  0%,100% { opacity: 0.8; transform: scale(1); }
  50%     { opacity: 0;   transform: scale(1.8); }
}

.map-pin.locked .pin-dot {
  background: rgba(150,80,80,0.5);
  box-shadow: 0 0 6px rgba(150,80,80,0.3);
  border-color: rgba(150,80,80,0.3);
}

.map-pin.locked .pin-dot::after { display: none; }

.map-pin.current .pin-dot {
  background: rgba(220,180,60,1);
  box-shadow: 0 0 14px rgba(220,180,60,0.7);
  width: 18px;
  height: 18px;
}

.map-pin:hover .pin-dot {
  transform: scale(1.3);
}

.pin-label {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.7rem;
  color: var(--parchment);
  background: rgba(10,7,2,0.85);
  border: 1px solid rgba(184,134,11,0.3);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
  margin-bottom: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  font-family: var(--font-serif);
}

.map-pin:hover .pin-label { opacity: 1; }

/* Scene Panel */
.panel-scene {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scene-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(200,170,100,0.4);
  gap: 0.8rem;
}

.loading-quill {
  font-size: 2rem;
  animation: quillSpin 3s linear infinite;
}

@keyframes quillSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.scene-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.2rem;
  gap: 1rem;
}

.scene-location-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(184,134,11,0.15);
  padding-bottom: 0.5rem;
}

.scene-time-icon { font-size: 1.1rem; color: var(--gold); }

.scene-location-badge span:nth-child(2) {
  font-family: var(--font-display-sc);
  font-size: 0.85rem;
  color: var(--gold-light);
  flex: 1;
}

.scene-time-text {
  font-size: 0.7rem;
  color: rgba(200,170,100,0.5);
  font-style: italic;
  font-family: var(--font-serif);
}

.scene-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--parchment);
  line-height: 1.2;
}

.scene-body {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: rgba(232,220,200,0.85);
  line-height: 1.7;
  font-style: italic;
}

.scene-npcs {
  border-top: 1px solid rgba(184,134,11,0.15);
  padding-top: 0.8rem;
}

.npcs-label {
  font-family: var(--font-display-sc);
  font-size: 0.7rem;
  color: rgba(200,170,100,0.5);
  letter-spacing: 0.12em;
  margin-bottom: 0.6rem;
}

.npc-list { display: flex; flex-direction: column; gap: 0.5rem; }

.npc-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: rgba(30,22,8,0.5);
  border: 1px solid rgba(184,134,11,0.2);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.npc-card:hover {
  border-color: rgba(184,134,11,0.5);
  background: rgba(50,36,12,0.6);
  transform: translateX(3px);
}

.npc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(180,140,60,0.3), rgba(60,40,10,0.5));
  border: 1px solid rgba(184,134,11,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.npc-info { flex: 1; min-width: 0; }

.npc-name {
  font-family: var(--font-display-sc);
  font-size: 0.8rem;
  color: var(--parchment);
}

.npc-role {
  font-size: 0.72rem;
  color: rgba(200,170,100,0.55);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.npc-talk-icon {
  font-size: 0.9rem;
  color: rgba(184,134,11,0.5);
  transition: var(--transition);
}

.npc-card:hover .npc-talk-icon { color: var(--gold); }

.scene-no-npcs {
  font-size: 0.82rem;
  color: rgba(200,170,100,0.4);
  padding-top: 0.5rem;
}

/* Stats Panel */
.stats-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-group { display: flex; flex-direction: column; gap: 0.7rem; }

.stat-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-label {
  font-family: var(--font-typeface);
  font-size: 0.68rem;
  width: 72px;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

.trust-label      { color: #8fcfa3; }
.knowledge-label  { color: #8faacc; }
.discretion-label { color: #ccb88f; }
.courage-label    { color: #cc8f8f; }
.suspicion-label  { color: #cc7070; }

.stat-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(30,22,8,0.6);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(60,40,10,0.4);
}

.stat-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
}

.trust-bar      { background: linear-gradient(to right, #3a6b48, #5fa07a); }
.knowledge-bar  { background: linear-gradient(to right, #3a4f6b, #5f7aaa); }
.discretion-bar { background: linear-gradient(to right, #6b5a3a, #aa8f5f); }
.courage-bar    { background: linear-gradient(to right, #6b3a3a, #aa5f5f); }
.suspicion-bar  { background: linear-gradient(to right, #8b2020, #cc4040); }

.stat-value {
  font-family: var(--font-typeface);
  font-size: 0.7rem;
  color: rgba(200,170,100,0.6);
  width: 22px;
  text-align: right;
}

.suspicion-row .stat-value { color: rgba(200,100,100,0.7); }

/* Invite progress */
.invite-progress {
  border-top: 1px solid rgba(184,134,11,0.2);
  padding-top: 0.7rem;
}

.invite-progress-label {
  font-family: var(--font-display-sc);
  font-size: 0.68rem;
  color: rgba(200,170,100,0.5);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.invite-checklist { display: flex; flex-direction: column; gap: 0.3rem; }

.invite-check-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: rgba(200,170,100,0.5);
  font-family: var(--font-serif);
}

.invite-check-item.done { color: rgba(150,210,150,0.8); }
.invite-check-item.done .check-icon::before { content: '✓'; }
.invite-check-item:not(.done) .check-icon::before { content: '○'; }
.check-icon { font-size: 0.65rem; width: 12px; }

/* ============================================================
   DIALOGUE PANEL
   ============================================================ */

.dialogue-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5,3,1,0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 1rem 1rem;
  backdrop-filter: blur(2px);
}

.dialogue-panel {
  width: 100%;
  max-width: 800px;
  background: linear-gradient(160deg, rgba(22,14,4,0.98), rgba(12,8,2,0.99));
  border: 1px solid rgba(184,134,11,0.35);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-sm);
  box-shadow: 0 -10px 60px rgba(0,0,0,0.8), 0 0 30px rgba(180,130,20,0.1);
  animation: dialogueSlideUp 0.4s cubic-bezier(0.34,1.56,0.64,1);
  overflow: hidden;
}

@keyframes dialogueSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.dialogue-npc-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(184,134,11,0.2);
  background: rgba(0,0,0,0.25);
}

.dialogue-portrait {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(180,140,60,0.25), rgba(60,40,10,0.5));
  border: 2px solid rgba(184,134,11,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.dialogue-npc-info { flex: 1; }

.dialogue-npc-name {
  font-family: var(--font-display-sc);
  font-size: 0.95rem;
  color: var(--gold-light);
}

.dialogue-npc-role {
  font-size: 0.75rem;
  color: rgba(200,170,100,0.5);
  font-style: italic;
}

.dialogue-close {
  background: none;
  border: 1px solid rgba(184,134,11,0.2);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  color: rgba(200,170,100,0.5);
  cursor: pointer;
  font-size: 0.75rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialogue-close:hover { border-color: rgba(184,134,11,0.6); color: var(--gold); }

.dialogue-speech {
  padding: 1rem 1.2rem;
  min-height: 80px;
}

.dialogue-npc-text {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--parchment);
  line-height: 1.65;
  font-style: italic;
}

.typewriter { border-right: 2px solid rgba(200,170,100,0.6); animation: blink 0.75s step-end infinite; }
.typewriter.done { border-right: none; }

@keyframes blink {
  from, to { border-color: transparent; }
  50%      { border-color: rgba(200,170,100,0.6); }
}

.dialogue-choices {
  padding: 0.5rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 220px;
  overflow-y: auto;
}

.dialogue-choice-btn {
  background: rgba(30,22,8,0.6);
  border: 1px solid rgba(184,134,11,0.2);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  text-align: left;
  cursor: pointer;
  color: var(--parchment-dark);
  font-family: var(--font-serif);
  font-size: 0.88rem;
  line-height: 1.4;
  transition: var(--transition);
  position: relative;
}

.dialogue-choice-btn::before {
  content: '"';
  color: var(--gold);
  margin-right: 0.3rem;
  font-style: italic;
}

.dialogue-choice-btn:hover {
  border-color: rgba(184,134,11,0.5);
  background: rgba(50,36,12,0.7);
  color: var(--parchment);
  transform: translateX(4px);
}

.dialogue-effects {
  padding: 0.4rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.effect-pill {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-family: var(--font-typeface);
  animation: effectPop 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes effectPop {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

.effect-positive { background: rgba(74,124,89,0.3);  color: #8fcfa3; border: 1px solid rgba(74,124,89,0.4); }
.effect-negative { background: rgba(139,32,32,0.3);  color: #cc8888; border: 1px solid rgba(139,32,32,0.4); }
.effect-neutral  { background: rgba(74,95,124,0.3);  color: #8faacc; border: 1px solid rgba(74,95,124,0.4); }

/* ============================================================
   JOURNAL MODAL
   ============================================================ */

.journal-modal {
  max-width: 780px;
  max-height: 80vh;
}

.journal-tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.journal-tab {
  background: rgba(60,40,10,0.2);
  border: 1px solid var(--parchment-edge);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 0.4rem 0.9rem;
  font-family: var(--font-serif);
  font-size: 0.82rem;
  color: var(--sepia);
  cursor: pointer;
  transition: var(--transition);
}

.journal-tab:hover,
.journal-tab.active {
  background: rgba(60,40,10,0.35);
  color: var(--sepia-dark);
  border-bottom-color: transparent;
}

.journal-content {
  border: 1px solid var(--parchment-edge);
  border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
  padding: 1rem;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  background: rgba(255,255,255,0.1);
}

.journal-tab-content { display: none; }
.journal-tab-content.active { display: block; }

.journal-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.journal-card {
  background: rgba(255,255,255,0.15);
  border: 1px solid var(--parchment-edge);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.journal-card-title {
  font-family: var(--font-display-sc);
  font-size: 0.85rem;
  color: var(--sepia-dark);
  margin-bottom: 0.3rem;
}

.journal-card-body {
  font-size: 0.83rem;
  color: var(--ink);
  line-height: 1.5;
}

.journal-card-meta {
  font-size: 0.72rem;
  color: var(--sepia);
  margin-top: 0.4rem;
  font-style: italic;
}

.confidence-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  border: 1px solid;
  margin-left: 0.4rem;
}

.conf-confirmed  { color: #4a7c59; border-color: #4a7c59; background: rgba(74,124,89,0.1); }
.conf-likely     { color: #4a5f7c; border-color: #4a5f7c; background: rgba(74,95,124,0.1); }
.conf-inferred   { color: #7c6a4a; border-color: #7c6a4a; background: rgba(124,106,74,0.1); }
.conf-dramatized { color: #7c4a4a; border-color: #7c4a4a; background: rgba(124,74,74,0.1); }

.objective-card {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--parchment-edge);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.1);
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
}

.obj-status { font-size: 1rem; flex-shrink: 0; margin-top: 0.05rem; }
.obj-title  { font-family: var(--font-display-sc); font-size: 0.82rem; color: var(--sepia-dark); }
.obj-desc   { font-size: 0.78rem; color: var(--ink-light); line-height: 1.4; margin-top: 0.2rem; }

/* ============================================================
   CLUE POPUP
   ============================================================ */

.clue-popup {
  position: fixed;
  top: 5rem;
  right: 1.5rem;
  z-index: 200;
  max-width: 280px;
}

.clue-popup-inner {
  background: linear-gradient(160deg, #e8dcc8, #d4c4a0);
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: 0 0 30px rgba(184,134,11,0.4), var(--shadow-deep);
  animation: cluePopIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes cluePopIn {
  from { opacity: 0; transform: translateX(50px) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

.clue-popup-icon {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
  color: var(--gold);
}

.clue-popup-label {
  font-family: var(--font-display-sc);
  font-size: 0.68rem;
  color: var(--sepia);
  letter-spacing: 0.15em;
  margin-bottom: 0.4rem;
}

.clue-popup-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--sepia-dark);
  margin-bottom: 0.3rem;
}

.clue-popup-desc {
  font-size: 0.8rem;
  color: var(--ink);
  line-height: 1.4;
  font-style: italic;
}

/* ============================================================
   INVITATION CINEMATIC
   ============================================================ */

.invitation-cinematic {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: inviteFadeIn 1s ease;
}

@keyframes inviteFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.invitation-scroll {
  max-width: 500px;
  width: 90%;
  text-align: center;
  padding: 2rem;
}

.invitation-seal {
  font-size: 4rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
  animation: sealGlow 2s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 20px rgba(184,134,11,0.6));
}

@keyframes sealGlow {
  from { filter: drop-shadow(0 0 10px rgba(184,134,11,0.4)); }
  to   { filter: drop-shadow(0 0 30px rgba(184,134,11,0.8)); }
}

.invitation-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--parchment);
  line-height: 2;
  white-space: pre-line;
  margin-bottom: 2rem;
  text-shadow: 0 0 20px rgba(180,130,20,0.3);
}

.btn-invitation-continue {
  background: linear-gradient(160deg, #8b6914, #5c4509);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 0.7rem 2.5rem;
  color: var(--parchment);
  font-family: var(--font-display-sc);
  font-size: 0.9rem;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: var(--transition);
}

.btn-invitation-continue:hover {
  background: linear-gradient(160deg, #a87920, #6e5210);
  box-shadow: 0 0 20px rgba(184,134,11,0.4);
}

/* ============================================================
   FINAL ENDING
   ============================================================ */

.final-ending {
  position: absolute;
  inset: 0;
  background: rgba(2,1,0,0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  animation: endingFade 2s ease;
}

@keyframes endingFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ending-scroll {
  max-width: 560px;
  padding: 2rem 1.5rem;
  text-align: center;
}

.ending-scene1 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--parchment);
  line-height: 2;
  white-space: pre-line;
  margin-bottom: 1.5rem;
  animation: textReveal 3s ease;
}

.ending-divider {
  color: var(--gold);
  letter-spacing: 0.8rem;
  margin-bottom: 1.5rem;
  opacity: 0.6;
}

.ending-scene2 {
  font-family: var(--font-display-sc);
  font-size: 1.3rem;
  color: var(--gold-light);
  letter-spacing: 0.2em;
  margin-bottom: 1.5rem;
  animation: textReveal 3s 0.5s ease both;
}

.ending-historical {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: rgba(200,170,100,0.6);
  line-height: 1.7;
  font-style: italic;
  border-top: 1px solid rgba(184,134,11,0.2);
  padding-top: 1rem;
  margin-bottom: 1.5rem;
  animation: textReveal 3s 1s ease both;
}

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

.btn-ending {
  background: linear-gradient(160deg, #8b6914, #5c4509);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 0.7rem 2.5rem;
  color: var(--parchment);
  font-family: var(--font-display-sc);
  font-size: 0.9rem;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: var(--transition);
}

.btn-ending:hover {
  background: linear-gradient(160deg, #a87920, #6e5210);
  box-shadow: 0 0 20px rgba(184,134,11,0.4);
}

/* Toast */
.toast-message {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20,14,5,0.95);
  border: 1px solid rgba(184,134,11,0.4);
  border-radius: var(--radius-md);
  padding: 0.6rem 1.2rem;
  color: var(--parchment);
  font-family: var(--font-serif);
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 500;
  max-width: 350px;
  text-align: center;
}

.toast-message.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Scrollbars */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(10,7,2,0.5); }
::-webkit-scrollbar-thumb { background: rgba(184,134,11,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(184,134,11,0.5); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    overflow-y: auto;
  }

  .panel-map {
    height: 240px;
    border-right: none;
    border-bottom: 1px solid rgba(184,134,11,0.15);
  }

  .panel-stats {
    border-left: none;
    border-top: 1px solid rgba(184,134,11,0.15);
    max-height: 220px;
  }

  .stats-content { flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }
  .stat-group { flex: 1; min-width: 150px; }

  .game-layout { overflow-y: auto; }
}

@media (max-width: 640px) {
  .top-bar { padding: 0.4rem 0.6rem; }
  .top-bar-title { display: none; }
  .role-cards, .role-cards-v2 { flex-direction: column; align-items: center; }
  .role-card, .role-card-v2 { width: 100%; max-width: 340px; }
  .candle { display: none; }
  .title-hero { grid-template-columns: 1fr; }
  .hero-scene { min-height: 200px; }
}

/* ============================================================
   TITLE SCREEN V2 — Reference Interface
   ============================================================ */

.title-screen {
  min-height: 100vh;
  background:
    linear-gradient(180deg, #1a1208 0%, #0d0904 40%, #120d06 100%),
    url('../images/opening-screen-reference.png') center top / cover no-repeat;
}

.title-frame {
  position: relative;
  z-index: 10;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.title-header-v2 { text-align: center; }

.title-date {
  font-family: var(--font-display-sc);
  font-size: 0.75rem;
  letter-spacing: 0.35em;
  color: rgba(212,168,71,0.7);
  margin-bottom: 0.4rem;
}

.game-title-v2 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  color: #e8dcc8;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 0 40px rgba(180,130,30,0.3);
  letter-spacing: 0.04em;
  line-height: 1;
}

.title-divider {
  margin: 0.5rem 0;
  color: var(--gold);
  font-size: 0.7rem;
  letter-spacing: 0.6em;
}

.game-subtitle-v2 {
  font-family: var(--font-display-sc);
  font-size: clamp(0.75rem, 1.5vw, 0.95rem);
  letter-spacing: 0.18em;
  color: rgba(200,170,120,0.75);
}

.title-hero {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1rem;
  align-items: stretch;
}

.intro-frame {
  background:
    linear-gradient(145deg, rgba(30,22,10,0.95), rgba(18,12,5,0.98));
  border: 2px solid rgba(120,90,50,0.5);
  border-radius: 6px;
  padding: 1.25rem 1.4rem;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.5), 0 4px 20px rgba(0,0,0,0.4);
  font-family: var(--font-serif);
  font-size: 0.92rem;
  color: rgba(232,220,200,0.88);
  line-height: 1.65;
}

.intro-frame p { margin-bottom: 0.5rem; }
.intro-gap { margin-top: 0.6rem; }

.hero-scene {
  position: relative;
  border: 2px solid rgba(120,90,50,0.45);
  border-radius: 6px;
  overflow: hidden;
  min-height: 240px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.hero-village {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10,7,2,0.55) 0%, transparent 45%, rgba(10,7,2,0.35) 100%),
    url('../images/locations/fond-du-lac-street.jpg') center center / cover no-repeat;
  filter: sepia(0.45);
}

.hero-sign {
  position: absolute;
  top: 12%;
  left: 8%;
  font-family: var(--font-typeface);
  font-size: 0.65rem;
  color: rgba(232,220,200,0.7);
  background: rgba(40,28,12,0.7);
  border: 1px solid rgba(120,90,50,0.5);
  padding: 0.25rem 0.5rem;
  letter-spacing: 0.08em;
}

.hero-note {
  position: absolute;
  bottom: 12%;
  right: 6%;
  max-width: 200px;
  background: linear-gradient(135deg, #e8dcc8, #d4c4a0);
  padding: 0.7rem 0.9rem;
  transform: rotate(-2deg);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  border: 1px solid #b89e7a;
}

.note-hand {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.72rem;
  color: var(--ink);
  line-height: 1.45;
}

.note-sign {
  font-size: 0.65rem;
  color: var(--sepia);
  margin-top: 0.3rem;
  text-align: right;
}

.hero-lantern {
  position: absolute;
  bottom: 18%;
  right: 28%;
  width: 36px;
  height: 50px;
}

.lantern-glow {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  background: radial-gradient(circle, rgba(255,200,80,0.8) 0%, transparent 70%);
  animation: candleFlicker 2s ease-in-out infinite;
}

.lantern-body {
  width: 28px;
  height: 36px;
  margin: 8px auto 0;
  background: linear-gradient(135deg, #8b7355, #5c4a32);
  border-radius: 4px 4px 2px 2px;
  border: 1px solid rgba(184,134,11,0.4);
}

.begin-row { text-align: center; }

.btn-begin-v2 {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(180deg, #2a3548 0%, #1a2230 100%);
  border: 2px solid rgba(140,120,80,0.6);
  border-radius: 6px;
  padding: 0.85rem 2.2rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
}

.btn-begin-v2 span:first-child {
  font-family: var(--font-display-sc);
  font-size: 1rem;
  color: #e8dcc8;
  letter-spacing: 0.14em;
}

.btn-arrow { color: var(--gold-light); font-size: 1.1rem; }

.btn-begin-v2:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); }

.btn-begin-v2:not(:disabled):hover {
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(184,134,11,0.35), 0 4px 20px rgba(0,0,0,0.5);
  transform: translateY(-2px);
}

.role-section-v2 { width: 100%; }

.role-label-v2 {
  text-align: center;
  font-family: var(--font-display-sc);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: rgba(200,170,100,0.7);
  margin-bottom: 0.75rem;
}

.role-flourish { color: var(--gold); margin: 0 0.4rem; }

.role-cards-v2 {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
}

.role-card-v2 {
  width: 200px;
  padding: 0.9rem 0.75rem;
  border-radius: 6px;
  border: 2px solid rgba(100,80,50,0.4);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  text-align: center;
  background: rgba(20,14,6,0.85);
}

.role-card-v2.tint-green  { border-color: rgba(74,124,89,0.45);  background: linear-gradient(160deg, rgba(30,50,35,0.9), rgba(15,25,18,0.95)); }
.role-card-v2.tint-amber  { border-color: rgba(184,134,11,0.45); background: linear-gradient(160deg, rgba(50,38,15,0.9), rgba(25,18,6,0.95)); }
.role-card-v2.tint-blue   { border-color: rgba(74,95,124,0.45);  background: linear-gradient(160deg, rgba(25,35,50,0.9), rgba(12,18,28,0.95)); }
.role-card-v2.tint-rose   { border-color: rgba(124,74,74,0.45);  background: linear-gradient(160deg, rgba(50,28,28,0.9), rgba(25,12,12,0.95)); }

.role-card-v2:hover, .role-card-v2:focus {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
}

.role-card-v2.selected {
  border-color: var(--gold);
  box-shadow: 0 0 28px rgba(184,134,11,0.4);
  transform: translateY(-4px);
}

.role-silhouette {
  width: 48px;
  height: 58px;
  margin: 0 auto 0.5rem;
  background: rgba(180,140,60,0.15);
  border-radius: 50% 50% 35% 35%;
  border: 1px solid rgba(180,140,60,0.25);
}

.role-name-v2 {
  font-family: var(--font-display-sc);
  font-size: 0.82rem;
  color: var(--gold-light);
  margin-bottom: 0.35rem;
}

.role-desc-v2 {
  font-size: 0.72rem;
  color: rgba(200,180,150,0.75);
  line-height: 1.35;
  font-style: italic;
  margin-bottom: 0.5rem;
  min-height: 2.6em;
}

.role-stats-v2 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  justify-content: center;
  font-family: var(--font-typeface);
  font-size: 0.58rem;
  color: rgba(180,160,120,0.65);
}

.role-stats-v2 span {
  background: rgba(0,0,0,0.25);
  padding: 0.1rem 0.35rem;
  border-radius: 10px;
}

.role-selected-v2 {
  display: none;
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  font-size: 0.6rem;
  color: var(--gold);
  background: rgba(184,134,11,0.15);
  padding: 0.1rem 0.35rem;
  border-radius: 8px;
}

.role-card-v2.selected .role-selected-v2 { display: block; }

.title-nav-v2 {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.nav-btn-v2 {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(180deg, rgba(40,32,18,0.9), rgba(25,18,8,0.95));
  border: 1px solid rgba(120,90,50,0.45);
  border-radius: 5px;
  padding: 0.5rem 1rem;
  color: rgba(200,180,150,0.85);
  font-family: var(--font-serif);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.nav-btn-v2:hover {
  border-color: rgba(184,134,11,0.6);
  color: var(--gold-light);
}

.nav-icon { font-size: 0.9rem; opacity: 0.8; }

.modal-map { max-width: 900px; }
.historic-map-img {
  width: 100%;
  border: 2px solid var(--parchment-edge);
  border-radius: 4px;
  filter: sepia(0.25);
}
.map-caption {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--sepia);
}

.dialogue-revisit { opacity: 0.85; font-style: italic; }
.dialogue-revisit::after { content: ' ↺'; font-size: 0.75em; opacity: 0.6; }

.map-pin .pin-dot {
  width: 12px;
  height: 12px;
  background: rgba(220,180,60,0.95);
  border: 2px solid rgba(255,255,255,0.5);
  box-shadow: 0 0 10px rgba(220,180,60,0.6);
}

.map-pin.locked .pin-dot {
  background: rgba(100,60,60,0.6);
  box-shadow: none;
}

.map-pin.current .pin-dot {
  width: 16px;
  height: 16px;
  background: #fff8e0;
  box-shadow: 0 0 16px rgba(255,240,180,0.9);
}

.scene-image-wrap {
  margin: 0.6rem 0 0.8rem;
  border: 1px solid rgba(184,134,11,0.25);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0,0,0,0.3);
}

.scene-image {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  display: block;
  filter: sepia(0.35) contrast(1.05);
}

.scene-image-caption {
  font-size: 0.72rem;
  color: rgba(200,170,100,0.55);
  font-style: italic;
  padding: 0.35rem 0.6rem;
  border-top: 1px solid rgba(184,134,11,0.15);
}

.source-doc-card { display: flex; gap: 0.75rem; align-items: flex-start; }
.source-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--parchment-edge);
  flex-shrink: 0;
  filter: sepia(0.3);
}
.source-doc-body { flex: 1; min-width: 0; }
.source-file { font-family: var(--font-typeface); font-size: 0.68rem; }
.btn-source-view {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  background: rgba(184,134,11,0.15);
  border: 1px solid rgba(184,134,11,0.35);
  color: var(--gold);
  border-radius: 4px;
  cursor: pointer;
}
.btn-source-view:hover { background: rgba(184,134,11,0.28); }
