/* ============================================================
   DESIGN TOKENS
============================================================ */
:root {
  --navy:        #0D1B2A;
  --navy-mid:    #1A2D3A;
  --navy-dark:   #0A1218;
  --navy-deepest: #060E18;
  --gold:        #C9A84C;
  --gold-light:  #E8C860;
  --gold-dark:   #8A6010;
  --gold-plate:  #7A5010;
  --brass-dark:  #6A4810;
  --brass-deep:  #3A2008;
  --cream:       #F5E8C0;
  --parchment:   #E8DCC8;
  --amber:       #EF9F27;
  --red-dark:    #8B1A1A;
  --red-alert:   #E63946;
  --gray:        #AAAAAA;
  --branch-bg:   #1A2A1A;
  --teal:        #2A9D8F;
  --font-head:   'Oswald', sans-serif;
  --font-body:   'Courier Prime', 'Courier New', monospace;
  --header-h:    84px;
  --shadow-deep: rgba(0,0,0,0.9);
  --shadow-mid:  rgba(0,0,0,0.6);
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ============================================================
   ACCESSIBILITY UTILITIES
============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

html, body {
  width: 100%;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--navy);
  color: var(--cream);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   UTILITY
============================================================ */
.hidden  { display: none !important; }
.visible { display: block; }

/* ============================================================
   GOLD BARS — top and bottom of simulation
============================================================ */
.gold-bar {
  position: fixed;
  left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, #5A3A08, var(--gold) 20%, var(--gold-light) 50%, var(--gold) 80%, #5A3A08);
  box-shadow: 0 2px 8px rgba(201,168,76,0.3);
  z-index: 9998;
  pointer-events: none;
}
.gold-bar--top    { top: 0; }
.gold-bar--bottom { bottom: 0; }

/* ============================================================
   SIMULATION OUTER BORDER
============================================================ */
.simulation-border-frame {
  position: fixed;
  inset: 5px;
  border: 4px solid #C9A84C;
  border-radius: 4px;
  pointer-events: none;
  z-index: 9997;
}

/* ============================================================
   SCREENS
============================================================ */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

.scene-bg {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.scene-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ============================================================
   FULL-SCREEN FADE OVERLAY
============================================================ */
.fade-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--navy);
  z-index: 9000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.transition-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--navy);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.transition-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ============================================================
   DASHBOARD HEADER
============================================================ */
.dashboard-header {
  position: fixed;
  top: 5px; left: 5px; right: 5px;
  height: var(--header-h);
  background: linear-gradient(180deg, var(--navy-mid), var(--navy));
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 2px 0 var(--brass-dark), 0 4px 16px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 52px; /* room for sound toggle on right */
  z-index: 1000;
}

.header-center {
  text-align: center;
  pointer-events: none;
}

.header-title {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  line-height: 1.2;
}

.header-tagline {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--gold);
  opacity: 0.7;
  letter-spacing: 0.1em;
  text-align: center;
}

.header-right {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sound-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #D4A840, #6A4808);
  border: 1px solid var(--brass-deep);
  box-shadow: 0 2px 6px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,220,100,0.3);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sound-toggle:hover {
  background: radial-gradient(circle at 38% 32%, #E8C060, #8A5810);
}

#sound-toggle-selector {
  position: absolute;
  top: 32px;
  right: 12px;
  z-index: 50;
}

.sound-icon { display: block; }

/* ============================================================
   TIMER CARD — embedded in decision-left panel
============================================================ */
.timer-card {
  background: linear-gradient(180deg, #0F1E2E, var(--navy-dark));
  border: 2px solid var(--brass-dark);
  border-radius: 4px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.8), inset 0 1px 0 rgba(201,168,76,0.08);
  width: 100%;
}

.timer-card-left {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-separator {
  width: 1px;
  height: 38px;
  background: linear-gradient(180deg, transparent, #6A4818 30%, #6A4818 70%, transparent);
  flex-shrink: 0;
}

.timer-card-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.timer-card-ondeck {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--gold);
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.timer-card-time {
  display: none; /* time shown via timer-card-message in new design */
}

.timer-card-message {
  font-family: var(--font-body);
  font-size: 16px;
  font-style: italic;
  color: var(--cream);
  line-height: 1.45;
}

/* ============================================================
   PIE TIMER
============================================================ */
.timer-wrapper {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid #7A5810;
  background: radial-gradient(circle at 40% 35%, #1E3050, #080F1A);
  box-shadow: inset 0 3px 10px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pie-timer-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@keyframes pie-ring-pulse {
  0%, 100% { stroke: #8B1A1A; }
  50%       { stroke: #E63946; }
}
.pie-ring-pulse {
  animation: pie-ring-pulse 1.2s ease-in-out infinite;
}

.timer-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  border: 1px solid var(--gold);
  color: #F5F0E8;
  font-family: 'Courier Prime', monospace;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 2px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 100;
}
.timer-wrapper:hover .timer-tooltip {
  opacity: 1;
}

@keyframes timer-pulse {
  0%, 100% { stroke: #8B1A1A; }
  50%       { stroke: #E63946; }
}
.timer-blinking {
  animation: timer-pulse 1.2s ease-in-out infinite;
}

/* ============================================================
   SCREEN 1: PERSONA SELECTOR
============================================================ */

.selector-layout {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 40px;
  box-sizing: border-box;
  gap: 28px;
}

.persona-selector-ui {
  text-align: center;
}

.main-title {
  font-family: var(--font-head);
  font-size: clamp(28px, 5vw, 68px);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.06em;
  line-height: 1.1;
}

.main-subtitle {
  font-family: var(--font-body);
  font-size: clamp(13px, 1.8vw, 20px);
  color: var(--cream);
  margin-top: 8px;
  letter-spacing: 0.04em;
}

.ship-diagram-container {
  position: relative;
  width: 100%;
  max-width: min(100%, calc((100vh - 200px) * 3.027));
  background: transparent;
  margin: 0 auto;
}


/* Persona dots */
.persona-dot-wrapper {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 30;
  outline: none;
}
.persona-dot-wrapper:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--gold);
}
.persona-dot-wrapper[data-active="true"]  { cursor: pointer; }
.persona-dot-wrapper[data-active="false"] { cursor: default; }

.persona-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--dot-color, var(--gold));
  border: 2px solid #ffffff;
  animation: pulse-dot-ring 2s ease-out infinite;
}

@keyframes pulse-dot-ring {
  0%   { box-shadow: 0 0 6px 2px var(--dot-color), 0 0 0 0   var(--dot-color); }
  70%  { box-shadow: 0 0 6px 2px var(--dot-color), 0 0 0 12px transparent; }
  100% { box-shadow: 0 0 6px 2px var(--dot-color), 0 0 0 0   transparent; }
}

/* SVG dot (Lowe) — glow + pulse via filter */
@keyframes pulse-svg-glow {
  0%   { filter: drop-shadow(0 0 4px var(--dot-color)) drop-shadow(0 0 2px var(--dot-color)); }
  50%  { filter: drop-shadow(0 0 12px var(--dot-color)) drop-shadow(0 0 6px var(--dot-color)); }
  100% { filter: drop-shadow(0 0 4px var(--dot-color)) drop-shadow(0 0 2px var(--dot-color)); }
}
.persona-dot-svg--active {
  animation: pulse-svg-glow 2s ease-in-out infinite;
}

.persona-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 11px;
  padding: 4px 10px;
  white-space: nowrap;
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.persona-dot-wrapper[data-active="false"]:hover .persona-tooltip {
  opacity: 1;
}

.persona-dot-wrapper[data-active="true"][data-open="true"] .persona-popup {
  opacity: 1;
  pointer-events: auto;
}
.persona-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  height: 12px;
}

.popup-name {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}
.popup-role {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--cream);
  opacity: 0.7;
  margin-bottom: 4px;
}
.popup-meta {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--gray);
  margin-bottom: 2px;
}
.popup-destination {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--cream);
  margin-bottom: 4px;
}
.popup-detail {
  font-family: var(--font-body);
  font-size: 16px;
  font-style: italic;
  color: var(--cream);
  opacity: 0.65;
  margin-bottom: 12px;
}

.btn-start-investigation {
  width: 100%;
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  color: #0A0C08;
  border: none;
  border-top: 1px solid var(--gold-light);
  border-radius: 3px;
  padding: 11px 28px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,230,140,0.3);
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-start-investigation:hover {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  transform: translateY(-1px);
}

/* ============================================================
   SCREEN 2: OPENING CABIN SCENE
============================================================ */
#screen-opening {
  background: var(--navy);
}

#opening-bg {
  background-image: url('assets/images/dp-0-cabin.png');
}

#screen-opening .scene-overlay {
  background: rgba(13, 27, 42, 0.6);
}

.cabin-card-wrapper {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 20px;
  padding-top: calc(var(--header-h) + 20px);
}

.cabin-card-wrapper .decision-card {
  max-width: 520px;
  width: 100%;
}


/* ============================================================
   SPLIT LAYOUT — parent container
============================================================ */
.decision-layout {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: calc(100vh - var(--header-h));
  margin-top: var(--header-h);
  overflow: hidden;
}

#screen-decision,
#screen-branch {
  overflow: hidden;
}

/* ============================================================
   LEFT PANEL — 43%
============================================================ */
.decision-left {
  flex: 0 0 43%;
  width: 43%;
  height: 100%;
  background: linear-gradient(160deg, var(--navy-mid) 0%, var(--navy) 100%);
  border-right: 2px solid #5A3A10;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 18px 16px;
  gap: 14px;
  order: 1;
}

.decision-left.branch-active {
  background: var(--branch-bg);
}

/* ============================================================
   PERSONA INFO UNIT — portrait + nameplate + timer
   Vertically centered above scenario card
============================================================ */
.persona-info-unit {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
}

.persona-info-row {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
}

.persona-info-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

/* ============================================================
   PORTRAIT FRAME
============================================================ */
.portrait-frame {
  position: relative;
  width: 108px;
  height: 116px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #8A6018, #5A3A08);
  border-radius: 4px;
  padding: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.9), inset 0 1px 0 rgba(255,220,100,0.2);
}

.portrait-inner {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1E3050, #0A1520);
  border: 1px solid #3A2808;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portrait-bolt {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #D4A840, #6A4808);
  box-shadow: 0 1px 3px rgba(0,0,0,0.8);
  z-index: 2;
}
.portrait-bolt--tl { top: 3px;  left: 3px; }
.portrait-bolt--tr { top: 3px;  right: 3px; }
.portrait-bolt--bl { bottom: 3px; left: 3px; }
.portrait-bolt--br { bottom: 3px; right: 3px; }

/* ============================================================
   NAMEPLATE
============================================================ */
.nameplate {
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  border-radius: 3px;
  padding: 8px 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,230,140,0.3), inset 0 -1px 0 rgba(0,0,0,0.3);
  border: 1px solid #4A2808;
}

.nameplate-name {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: #0A0C08;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 rgba(255,255,255,0.2);
  line-height: 1.2;
}

.nameplate-role {
  font-family: var(--font-body);
  font-size: 16px;
  color: #2A1808;
  opacity: 0.8;
  margin-top: 2px;
}

/* ============================================================
   SCENARIO CARD WRAPPER — outer gold-top border + corner brackets
============================================================ */
.scenario-card-outer {
  position: relative;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-plate) 4px, #1A2A3A 4px, #0D1820 100%);
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.9);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.scenario-card-inner {
  position: relative;
  background: linear-gradient(180deg, #0F1E2E, #0A1420);
  border-radius: 4px;
  border: 1px solid rgba(201,168,76,0.2);
  padding: 16px 14px;
  flex: 1;
  overflow-y: auto;
}

/* Corner bracket ornaments */
.corner-bracket {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}
.corner-bracket--tl { top: -6px;  left: -6px; }
.corner-bracket--tr { top: -6px;  right: -6px; }
.corner-bracket--bl { bottom: -6px; left: -6px; }
.corner-bracket--br { bottom: -6px; right: -6px; }

/* ============================================================
   RIGHT PANEL — 57%
============================================================ */
.decision-right {
  flex: 0 0 57%;
  width: 57%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background-color: var(--navy);
  order: 2;
}

.right-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 0.5s ease;
}


.right-image-fade {
  position: absolute;
  inset: 0;
  background: var(--navy);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 1;
}

.right-image.fading {
  opacity: 0;
}

/* ============================================================
   MOBILE LIFEBOAT STRIP
============================================================ */
.mobile-lifeboat-strip {
  display: none;
  order: 2;
  align-items: center;
  gap: 8px;
  background: rgba(13, 27, 42, 0.96);
  border-top: 1px solid rgba(201, 168, 76, 0.25);
  border-bottom: 1px solid rgba(201, 168, 76, 0.25);
  padding: 8px 20px;
  flex-shrink: 0;
  width: 100%;
}

.mobile-lb-icon { color: var(--cream); display: flex; align-items: center; flex-shrink: 0; }
.mobile-lb-count { font-family: var(--font-head); font-size: 16px; font-weight: 600; color: var(--cream); }
.mobile-lb-label { font-family: var(--font-head); font-size: 9px; font-weight: 500; color: var(--gray); letter-spacing: 0.1em; text-transform: uppercase; }

/* ============================================================
   DECISION CARD — inside .scenario-card-inner
============================================================ */
.decision-card {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Timestamp pill */
.timestamp-pill {
  display: inline-block;
  align-self: flex-start;
  background: linear-gradient(180deg, #A07828, var(--brass-dark));
  color: var(--cream);
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 2px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,220,100,0.2);
  border: 1px solid #4A2808;
  margin-bottom: 10px;
}

time.timestamp-pill {
  display: inline-block;
}

/* Situation text */
.situation-text {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--parchment);
  line-height: 1.8;
  margin-bottom: 14px;
}

/* Choice buttons */
fieldset.choices-container {
  border: none;
  padding: 0;
  margin: 0;
}
fieldset.choices-container > legend {
  padding: 0;
}

.choices-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
  margin-bottom: 0;
}

.choice-btn {
  background: linear-gradient(180deg, #1E3050 0%, var(--navy) 100%);
  color: var(--cream);
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 2px solid var(--gold);
  border-top: 2px solid var(--gold-light);
  border-radius: 3px;
  padding: 12px 8px;
  text-align: center;
  line-height: 1.35;
  box-shadow: 0 3px 10px rgba(0,0,0,0.6), inset 0 1px 0 rgba(201,168,76,0.15), inset 0 -2px 0 rgba(0,0,0,0.4);
  cursor: pointer;
  transition: all 0.15s ease;
}

.choice-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  color: #0A0C08;
  border-color: var(--gold-light);
}

.choice-btn.chosen {
  background: linear-gradient(180deg, var(--gold), var(--gold-dark)) !important;
  color: #0A0C08 !important;
  opacity: 1 !important;
}

.choice-btn:disabled:not(.chosen) {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Consequence text */
.consequence-text {
  font-family: var(--font-body);
  font-size: 16px;
  font-style: italic;
  color: var(--parchment);
  line-height: 1.8;
  margin-top: 16px;
  border-left: 3px solid var(--gold);
  padding-left: 14px;
  background: rgba(201,168,76,0.04);
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.consequence-text.fade-in {
  opacity: 0.9;
}

/* Reflection block */
.reflection-block {
  border-left: 3px solid var(--brass-dark);
  padding-left: 14px;
  margin-top: 14px;
  margin-bottom: 0;
}

.reflection-prompt {
  font-family: var(--font-body);
  font-size: 11px;
  font-style: italic;
  color: var(--gold);
  opacity: 0.8;
  margin-bottom: 8px;
  display: block;
}

.reflection-textarea {
  width: 100%;
  min-height: 80px;
  background: var(--navy-dark);
  border: 1px solid var(--brass-dark);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 10px;
  resize: vertical;
  border-radius: 3px;
  line-height: 1.6;
}

.reflection-textarea::placeholder {
  color: var(--gray);
  font-style: italic;
}

.reflection-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201,168,76,0.15);
  outline: none;
}

/* Card footer / Next button */
.card-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.btn-next {
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  color: #0A0C08;
  border: none;
  border-top: 1px solid var(--gold-light);
  border-radius: 3px;
  padding: 11px 28px;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,230,140,0.3);
  transition: all 0.15s ease;
  align-self: flex-end;
}

.btn-next:hover {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  transform: translateY(-1px);
}

/* ============================================================
   BRANCH SCENE
============================================================ */
.branch-card {
  border-color: rgba(201, 168, 76, 0.5);
}

.branch-text {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--cream);
  line-height: 1.9;
  margin-bottom: 24px;
  min-height: 60px;
}

/* ============================================================
   REVEAL SCREEN
============================================================ */
#screen-reveal .scene-overlay {
  background: rgba(13, 27, 42, 0.70);
}

.reveal-wrapper {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 60px;
}

.reveal-inner {
  width: 100%;
  max-width: 680px;
  background: rgba(13,27,42,0.92);
  border: 1px solid var(--brass-dark);
  border-radius: 6px;
  padding: 28px;
}

.reveal-label {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.reveal-narrative {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--cream);
  line-height: 1.8;
  margin-bottom: 32px;
}

.reveal-narrative p {
  margin-bottom: 14px;
  line-height: 1.8;
  opacity: 0;
  transition: opacity 0.4s;
}

.reveal-narrative p.visible-sentence {
  opacity: 1;
}

/* Comparison table */
.reveal-comparison {
  margin-top: 32px;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 13px;
}

.comparison-table th {
  text-align: left;
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  color: #0A0C08;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 10px 14px;
  width: 50%;
}

.comparison-table td {
  padding: 10px 14px;
  color: var(--cream);
  vertical-align: top;
  line-height: 1.6;
  border: 1px solid rgba(201,168,76,0.15);
}

.comparison-table tbody tr:nth-child(odd) td {
  background: #0F1E2E;
}
.comparison-table tbody tr:nth-child(even) td {
  background: var(--navy-dark);
}

.comparison-table .row-time {
  color: var(--gold);
  font-family: var(--font-head);
  font-size: 11px;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 3px;
}

.gold-divider {
  height: 1px;
  background: var(--gold);
  margin: 24px 0;
}

.source-citations {
  font-family: var(--font-body);
  font-size: 13px;
  font-style: italic;
  color: var(--gray);
  line-height: 1.7;
}

.source-citations span {
  display: block;
}

.reveal-cta {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ============================================================
   WRITING ACTIVITY SCREEN
============================================================ */
#screen-writing {
  background: var(--navy);
}

.writing-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 60px;
}

.writing-card {
  width: 100%;
  max-width: 680px;
}

.writing-title {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.06em;
  margin-bottom: 24px;
}

.raft-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.raft-table td {
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.2);
}

.raft-label {
  color: var(--gold);
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  width: 80px;
  white-space: nowrap;
}

.raft-value { color: var(--cream); }

.writing-textarea {
  width: 100%;
  min-height: 160px;
  background: rgba(13, 27, 42, 0.6);
  border: 1px solid var(--gold);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.8;
  padding: 14px;
  resize: vertical;
  margin-bottom: 16px;
}

.writing-textarea::placeholder {
  color: var(--gray);
  font-style: italic;
}

.writing-textarea:focus {
  border-color: #e8c96a;
}

.sentence-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.starter-chip {
  background: none;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 20px;
  transition: background 0.15s, color 0.15s;
}

.starter-chip:hover {
  background: var(--gold);
  color: var(--navy);
}

.student-name-block { margin-bottom: 24px; }

.name-label {
  display: block;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.name-input {
  width: 100%;
  max-width: 320px;
  background: rgba(13, 27, 42, 0.6);
  border: 1px solid rgba(201, 168, 76, 0.5);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 12px;
}

.name-input:focus { border-color: var(--gold); }

.export-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   SHARED BUTTONS
============================================================ */
.btn-gold {
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  color: #0A0C08;
  border: none;
  border-top: 1px solid var(--gold-light);
  border-radius: 3px;
  padding: 11px 28px;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,230,140,0.3);
  transition: all 0.15s ease;
}
.btn-gold:hover {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--navy);
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 12px 24px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-radius: 3px;
}
.btn-outline:hover {
  background: rgba(201, 168, 76, 0.1);
}


/* ============================================================
   RESUME MODAL
============================================================ */
.resume-modal {
  position: fixed;
  inset: 0;
  background: rgba(13, 27, 42, 0.88);
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resume-modal.hidden { display: none; }

.resume-modal-card {
  background: rgba(14,26,42,0.97);
  border: 2px solid var(--gold);
  border-radius: 6px;
  padding: 40px 48px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.8), inset 0 1px 0 rgba(201,168,76,0.12);
}

.resume-modal-eyebrow {
  font-family: var(--font-head);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin: 0 0 12px;
  opacity: 0.7;
}

.resume-modal-title {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 600;
  color: var(--cream);
  margin: 0 0 8px;
  line-height: 1.3;
}

.resume-modal-subtitle {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--gray);
  margin: 0 0 28px;
}

.resume-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.resume-modal-actions .btn-gold,
.resume-modal-actions .btn-outline {
  min-width: 120px;
}

/* ============================================================
   TOAST
============================================================ */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: 0.05em;
  padding: 10px 24px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  border-radius: 2px;
}
.toast.show { opacity: 1; }

/* ============================================================
   PRINT STYLES
============================================================ */
@media print {
  body > *:not(#print-content) { display: none !important; }

  #print-content {
    display: block !important;
    color: #000;
    background: #fff;
    font-family: 'Courier New', monospace;
    font-size: 12pt;
    line-height: 1.7;
    padding: 1in;
  }

  .print-section { margin-bottom: 24pt; }
  .print-heading {
    font-size: 14pt;
    font-weight: bold;
    margin-bottom: 6pt;
    border-bottom: 1pt solid #000;
    padding-bottom: 4pt;
  }
  .print-table { width: 100%; border-collapse: collapse; margin-bottom: 12pt; }
  .print-table th, .print-table td {
    border: 1pt solid #888;
    padding: 6pt 8pt;
    font-size: 11pt;
    text-align: left;
    vertical-align: top;
  }
  .print-table th { background: #eee; }
  .print-label { font-weight: bold; }
  .print-citations { font-style: italic; font-size: 10pt; color: #444; }
}

.print-only { display: none; }

/* ============================================================
   RESPONSIVE — BELOW 1024px
============================================================ */
@media (max-width: 1023px) {
  #screen-decision,
  #screen-branch {
    overflow-y: auto;
    overflow-x: hidden;
  }

  .decision-layout {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - var(--header-h));
    overflow: visible;
  }

  .decision-right {
    flex: none;
    width: 100%;
    height: 40vh;
    order: 1;
  }

  .mobile-lifeboat-strip {
    display: flex;
    order: 2;
  }

  .decision-left {
    flex: none;
    width: 100%;
    height: auto;
    order: 3;
    padding: 16px 16px 90px;
    overflow-y: visible;
    border-right: none;
    border-top: 2px solid #5A3A10;
  }

  .choices-container {
    grid-template-columns: 1fr;
  }

.sound-toggle { padding: 2px; }

  /* Persona info unit stacks on mobile */
  .persona-info-row {
    flex-direction: column;
    align-items: center;
  }

  .portrait-frame {
    width: 90px;
    height: 96px;
  }

  .nameplate-name { font-size: 14px; }

  .situation-text { font-size: 13px; }
  .choice-btn     { font-size: 9.5px; }
  .btn-next       { font-size: 11px; }
}

/* ============================================================
   RESPONSIVE — 767px and below
============================================================ */
@media (max-width: 767px) {
  .export-buttons { flex-direction: column; }
  .btn-gold, .btn-outline { width: 100%; }

  .persona-popup {
    width: 240px;
    left: auto;
    right: 0;
    transform: none;
  }

  @media (max-width: 600px) {
    .selector-layout {
      padding: 32px 16px 24px;
      gap: 20px;
    }
    .ship-diagram-container { max-width: 100%; }
  }
}

/* ============================================================
   REDUCED MOTION
============================================================ */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ============================================================
   RIVET ROWS — shared by title and selector screens
============================================================ */
.rivet-row {
  background: var(--navy-deepest);
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
  z-index: 2;
}

.rivet-row--bottom {
  margin-top: auto;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Show rivet rows inside title and selector screens, within the gold border */
.title-screen .rivet-row,
#screen-persona-selector .rivet-row {
  display: flex;
  position: relative;
  z-index: 2;
}

.title-screen .rivet-row--top,
#screen-persona-selector .rivet-row--top {
  margin-top: 9px;
}

.title-screen .rivet-row--bottom,
#screen-persona-selector .rivet-row--bottom {
  margin-bottom: 9px;
}

.rivet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--gold-light), #6A4008);
  box-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 0 6px rgba(201,168,76,0.15), inset 0 1px 0 rgba(255,230,140,0.3);
  flex-shrink: 0;
}

/* ============================================================
   TITLE SCREEN ENTRANCE ANIMATIONS
============================================================ */

/* Base state — hidden before animating in */
.title-reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: title-fade-up 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes title-fade-up {
  to { opacity: 1; transform: translateY(0); }
}

/* Staggered delays */
.title-reveal--1 { animation-delay: 0.3s; }
.title-reveal--2 { animation-delay: 0.7s; }
.title-reveal--3 { animation-delay: 1.1s; }
.title-reveal--4 { animation-delay: 1.5s; }
.title-reveal--5 { animation-delay: 1.8s; }
.title-reveal--6 { animation-delay: 2.1s; }
.title-reveal--7 { animation-delay: 2.4s; }
.title-reveal--8 { animation-delay: 2.8s; }
.title-reveal--9 { animation-delay: 3.0s; }

/* TITANIC — hard cut flash on entrance */
@keyframes title-hard-cut {
  0%   { opacity: 0; transform: translateY(18px); }
  58%  { opacity: 1; transform: translateY(0); }
  61%  { opacity: 0; }
  64%  { opacity: 1; }
  66%  { opacity: 0; }
  70%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(0); }
}
.title-sub {
  animation: title-hard-cut 1.0s cubic-bezier(0.16, 1, 0.3, 1) 1.1s forwards;
}

/* Year — subtle flicker after entrance */
@keyframes title-flicker {
  0%, 95%, 100% { opacity: 1; }
  96%            { opacity: 0.6; }
  97%            { opacity: 1; }
  98%            { opacity: 0.7; }
}
.title-year {
  animation: title-fade-up 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 1.5s forwards,
             title-flicker 8s ease-in-out 3s infinite;
}

/* Board button — gentle pulse to draw the eye */
@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(201,168,76,0.3), inset 0 1px 0 rgba(255,230,140,0.3); }
  50%       { box-shadow: 0 4px 32px rgba(201,168,76,0.7), inset 0 1px 0 rgba(255,230,140,0.5); }
}
.btn-board {
  animation: title-fade-up 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 2.8s forwards,
             btn-pulse 2.5s ease-in-out 4s infinite;
}

/* ============================================================
   TITLE SCREEN
============================================================ */
.title-screen {
  background: var(--navy-deepest);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
}

/* Background video */
.title-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.title-bg-video.loaded {
  opacity: 1;
}

/* Dark overlay so text remains legible over video */
.title-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(5, 10, 20, 0.65) 0%,
    rgba(5, 10, 20, 0.45) 50%,
    rgba(5, 10, 20, 0.75) 100%
  );
  z-index: 1;
}

.title-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  position: relative;
  overflow: hidden;
  min-height: 0;
  padding: 40px 24px 36px;
  z-index: 2;
}

/* Ship silhouette watermarks */
.title-ship-watermark {
  position: absolute;
  bottom: -20px;
  left: 0;
  width: 100%;
  height: 45%;
  pointer-events: none;
  display: none;
}

.title-ship-svg {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.title-ship-svg--back {
  width: 95%;
  opacity: 0.06;
}

.title-ship-svg--front {
  width: 88%;
  opacity: 0.1;
  filter: blur(3px);
}

/* Atmospheric glow */
.title-atmo-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  max-width: min(500px, 90%);
  height: 200px;
  background: radial-gradient(ellipse, rgba(201,168,76,0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* Date badge */
.title-date-badge {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, var(--navy-mid), var(--navy-dark));
  border: 1px solid #8A6020;
  border-radius: 2px;
  padding: 5px 20px;
  margin-bottom: 24px;
  box-shadow: inset 0 1px 0 rgba(201,168,76,0.2), 0 2px 8px rgba(0,0,0,0.6);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--gold-light);
  opacity: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* Main title */
.title-main {
  position: relative;
  z-index: 1;
  font-family: var(--font-head);
  font-size: clamp(72px, 12vw, 120px);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
  text-shadow:
    0 1px 0 var(--gold-light),
    0 2px 0 var(--gold),
    0 3px 0 #A07830,
    0 4px 0 var(--gold-dark),
    0 5px 0 #6A4808,
    0 6px 0 #4A2808,
    0 8px 16px rgba(0,0,0,0.9),
    0 12px 32px rgba(0,0,0,0.7),
    0 0 40px rgba(201,168,76,0.2);
  margin-bottom: 0;
}

/* Subtitle */
.title-sub {
  position: relative;
  z-index: 1;
  font-family: var(--font-head);
  font-size: clamp(48px, 9vw, 96px);
  font-weight: 700;
  color: var(--cream);
  letter-spacing: 0.18em;
  opacity: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9), 0 1px 0 rgba(255,255,255,0.08);
  margin-bottom: 0;
}

/* Year */
.title-year {
  position: relative;
  z-index: 1;
  font-family: var(--font-body);
  font-size: 28px;
  color: var(--gold);
  letter-spacing: 0.4em;
  opacity: 0.8;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
  margin-bottom: 0;
}

/* Divider with center diamond */
.title-divider {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  width: min(260px, 80%);
  margin: 14px auto 10px;
}

.title-divider-line {
  flex: 1;
  height: 1px;
}

.title-divider-line--left {
  background: linear-gradient(90deg, transparent, var(--gold));
}

.title-divider-line--right {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.title-divider-diamond {
  width: 8px;
  height: 8px;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 6px rgba(201,168,76,0.5);
  flex-shrink: 0;
  margin: 0 6px;
}

/* Tagline */
.title-tagline {
  position: relative;
  z-index: 1;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--cream);
  opacity: 0.85;
  letter-spacing: 0.12em;
  margin-bottom: 0;
}

/* Anchor ornament */
.title-anchor {
  position: relative;
  z-index: 1;
  font-size: 26px;
  color: var(--gold);
  opacity: 0.3;
  text-shadow: 0 2px 8px rgba(201,168,76,0.3);
  margin-bottom: 22px;
  margin-top: 10px;
}

/* Board button */
.btn-board {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #0A0C08;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 2px solid #ffffff;
  border-top: 3px solid var(--gold-light);
  border-bottom: 3px solid #4A2808;
  border-radius: 3px;
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  padding: 15px 52px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.8), 0 2px 0 #3A1808, inset 0 1px 0 rgba(255,230,140,0.4), inset 0 -2px 0 rgba(0,0,0,0.3);
  text-shadow: 0 1px 0 rgba(255,255,255,0.2);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 10px;
}

.btn-board:hover {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 100%);
  box-shadow: 0 8px 28px rgba(201,168,76,0.4), 0 2px 0 #3A1808, inset 0 1px 0 rgba(255,240,160,0.5);
}

.title-sub-label {
  position: relative;
  z-index: 1;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--cream);
  opacity: 0.55;
  letter-spacing: 0.08em;
}

/* ============================================================
   PERSONA SELECTOR — updated layout
============================================================ */
#screen-persona-selector {
  background: radial-gradient(ellipse at 30% 60%, #1a3a5c 0%, #0d1f35 35%, #080f1a 70%, #040810 100%);
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  overflow: hidden;
  padding-bottom: 0;
}

#screen-persona-selector::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(201,168,76,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 20%, rgba(13,31,53,0.8) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.selector-inner-header {
  height: 84px;
  background: transparent;
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 2px 0 var(--brass-dark), 0 4px 16px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: calc(100% - 18px);
  margin: 0 9px;
  flex-shrink: 0;
}

.selector-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  overflow: hidden;
  min-height: 0;
}

/* Atmospheric layers inside ship container */
.ship-atmo {
  position: absolute;
  pointer-events: none;
  z-index: 2;
  display: none;
}

.ship-atmo--water-glow {
  bottom: 0;
  left: 10%;
  width: 80%;
  height: 40px;
  background: radial-gradient(ellipse, rgba(20,60,90,0.6) 0%, transparent 70%);
}

.ship-atmo--fog-left {
  left: 0;
  top: 20%;
  width: 25%;
  height: 60%;
  background: linear-gradient(90deg, rgba(6,14,24,0.7), transparent);
}

.ship-atmo--fog-right {
  right: 0;
  top: 20%;
  width: 25%;
  height: 60%;
  background: linear-gradient(270deg, rgba(6,14,24,0.7), transparent);
}

.ship-atmo--bottom-fade {
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(0deg, rgba(6,14,24,0.8), transparent);
}

.ship-atmo--glow {
  top: 10%;
  left: 15%;
  right: 15%;
  bottom: 20%;
  background: radial-gradient(ellipse, rgba(180,130,40,0.06) 0%, transparent 70%);
}

/* Ship diagram */
.ship-diagram-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.6)) drop-shadow(0 0 24px rgba(160,120,48,0.12));
}

/* SVG dot for active persona */
.persona-dot-svg {
  display: block;
  cursor: pointer;
}

/* pulse-svg-glow handles the SVG dot animation (see above) */

/* ============================================================
   PERSONA CARD — redesigned popup
============================================================ */
.persona-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: clamp(260px, 32vw, 320px);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.9)) drop-shadow(0 0 16px rgba(201,168,76,0.15));
}

.persona-card-border {
  background: linear-gradient(180deg, var(--gold), var(--gold-plate) 5px, transparent 5px);
  border: 2px solid var(--gold);
  border-radius: 6px;
  padding: 3px;
  box-shadow: 0 0 0 1px var(--brass-deep), 0 12px 40px rgba(0,0,0,0.95), inset 0 1px 0 rgba(255,220,100,0.15);
}

.persona-card-inner {
  background: linear-gradient(160deg, #0E1E30 0%, #080F1A 100%);
  border-radius: 4px;
  border: 1px solid rgba(201,168,76,0.15);
  padding: 14px;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 60vh;
}

.persona-card-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(201,168,76,0.01) 2px, rgba(201,168,76,0.01) 4px);
  pointer-events: none;
}

/* Top row: portrait + info */
.persona-card-top-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

/* Portrait frame in selector card (62×62) */
.persona-portrait-frame {
  width: 62px;
  height: 62px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #8A6018, #4A2808);
  border-radius: 4px;
  padding: 3px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.9), inset 0 1px 0 rgba(255,220,100,0.15);
}

.persona-portrait-inner {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1A2D40, var(--navy-deepest));
  border: 1px solid #2A1808;
  border-radius: 2px;
  overflow: hidden;
}

.persona-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Card info column */
.persona-card-info {
  flex: 1;
  min-width: 0;
}

/* Override popup-name for card design */
.persona-card-inner .popup-name {
  font-size: 20px;
  color: var(--gold);
  text-shadow: 0 1px 4px rgba(0,0,0,0.9), 0 0 12px rgba(201,168,76,0.2);
  margin-bottom: 4px;
}

.persona-card-inner .popup-role {
  font-size: 16px;
  opacity: 0.8;
  margin-bottom: 4px;
}

.persona-card-inner .popup-meta {
  border-left: 2px solid #4A2808;
  padding-left: 7px;
  font-size: 16px;
  color: var(--cream);
  opacity: 0.75;
}

/* Gold divider in card */
.persona-card-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #7A5818 20%, var(--gold) 50%, #7A5818 80%, transparent);
  box-shadow: 0 1px 4px rgba(201,168,76,0.2);
  margin-bottom: 8px;
}

.persona-card-inner .popup-detail {
  font-size: 16px;
  opacity: 0.75;
  margin-bottom: 12px;
}

/* Portrait bolts inside persona portrait (reuse existing .portrait-bolt classes) */
.persona-portrait-inner .portrait-bolt {
  position: absolute;
  width: 6px;
  height: 6px;
}
.persona-portrait-inner .portrait-bolt--tl { top: 2px;  left: 2px; }
.persona-portrait-inner .portrait-bolt--tr { top: 2px;  right: 2px; }
.persona-portrait-inner .portrait-bolt--bl { bottom: 2px; left: 2px; }
.persona-portrait-inner .portrait-bolt--br { bottom: 2px; right: 2px; }

/* ============================================================
   RIVET BORDER RING
============================================================ */
.rivet-ring {
  position: fixed;
  inset: 40px;
  pointer-events: none;
  z-index: 9996;
}

.rivet-ring::before,
.rivet-ring::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: none;
}

.rivet-ring-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--gold-light), #6A4008);
  box-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 0 6px rgba(201,168,76,0.15), inset 0 1px 0 rgba(255,230,140,0.3);
  transform: translate(-50%, -50%);
}
