/* ── Nightledger — Stylesheet ───────────────────────────────────────
 *
 * Hybrid Sherlock Holmes / Film Noir aesthetic.
 * Palette: sepia, dark teal, parchment, muted gold, ink black.
 * Typography: atmospheric serifs.
 * ──────────────────────────────────────────────────────────────────── */

/* ── Fonts ────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=Special+Elite&display=swap');

/* ── Variables ────────────────────────────────────────────────────── */

:root {
  --bg-dark: #0d0d1a;
  --bg-panel: #151525;
  --bg-card: #1c1c32;
  --bg-parchment: #2a2a3e;
  --bg-input: #1a1a2e;

  --teal: #3d8b8b;
  --teal-light: #5ab5b5;
  --teal-dark: #2a6060;

  --gold: #c9a96e;
  --gold-light: #e8d5a3;
  --gold-dim: #7a6b4e;

  --sepia: #d4c5a0;
  --sepia-light: #e8dcc4;
  --sepia-dark: #a09070;

  --text-primary: #d4c5a0;
  --text-secondary: #9a8c70;
  --text-dim: #6a5e48;
  --text-bright: #f0e2b6;

  --red: #c44;
  --red-dim: #a03030;
  --green: #4a8;
  --green-dim: #386;

  --border: #3a3a5c;
  --border-light: #4a4a6c;

  --radius: 4px;
  --radius-lg: 8px;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Crimson Text', Georgia, serif;
  --font-mono: 'Special Elite', 'Courier New', monospace;
}

/* ── Reset ────────────────────────────────────────────────────────── */

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

html, body {
  height: 100%;
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow: hidden;
}

/* ── Utility ──────────────────────────────────────────────────────── */

.hidden { display: none !important; }
.text-muted { color: var(--text-secondary); font-style: italic; }

/* ── Buttons ──────────────────────────────────────────────────────── */

.btn {
  font-family: var(--font-body);
  font-size: 16px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.btn:hover {
  background: var(--bg-parchment);
  border-color: var(--gold-dim);
  color: var(--text-bright);
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Loading Overlay ──────────────────────────────────────────────── */

.loading-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(13, 13, 26, 0.92);
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.loading-overlay.visible { opacity: 1; pointer-events: all; }
.loading-spinner {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--gold); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-message {
  margin-top: 16px; font-family: var(--font-display);
  font-style: italic; color: var(--text-secondary); font-size: 18px;
}

/* ── Notifications ────────────────────────────────────────────────── */

.notifications {
  position: fixed; top: 16px; right: 16px; z-index: 900;
  display: flex; flex-direction: column; gap: 8px;
}
.notification {
  padding: 12px 20px; border-radius: var(--radius); font-size: 15px;
  animation: slide-in 0.3s ease-out; max-width: 360px;
}
.notification-info { background: var(--bg-card); border-left: 3px solid var(--teal); color: var(--sepia-light); }
.notification-error { background: #2a1520; border-left: 3px solid var(--red); color: #e8a0a0; }
.notification.fade-out { opacity: 0; transition: opacity 0.5s; }
@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Start Screen ─────────────────────────────────────────────────── */

.start-screen {
  height: 100vh; height: 100dvh;
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 40px 20px;
  background: radial-gradient(ellipse at center, rgba(61, 139, 139, 0.08) 0%, transparent 70%), var(--bg-dark);
}
.start-content { text-align: center; max-width: 520px; margin: auto 0; }
.game-title {
  font-family: var(--font-display); font-size: 64px; font-weight: 700;
  color: var(--gold); letter-spacing: 4px; text-transform: uppercase;
  margin-bottom: 8px; text-shadow: 0 0 40px rgba(201, 169, 110, 0.2);
}
.game-subtitle {
  font-family: var(--font-display); font-style: italic;
  font-size: 19px; color: var(--text-secondary); margin-bottom: 40px;
}
.start-victim-card {
  padding: 24px; margin-bottom: 24px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg-panel);
  font-size: 16px; line-height: 1.8; color: var(--sepia);
}
.btn-start {
  font-family: var(--font-display); font-size: 20px; padding: 14px 48px;
  background: var(--teal-dark); border: 1px solid var(--teal);
  color: var(--gold-light); letter-spacing: 2px; text-transform: uppercase;
}
.btn-start:hover { background: var(--teal); box-shadow: 0 0 30px rgba(61, 139, 139, 0.3); }
.btn-how-to-play {
  display: block; margin: 12px auto 0; background: none; border: none;
  color: var(--text-secondary); font-family: var(--font-body); font-size: 15px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
  transition: color 0.2s;
}
.btn-how-to-play:hover { color: var(--gold); }

/* ── Start Screen Selectors ──────────────────────────────────────── */

.selector-section {
  margin-bottom: 20px; text-align: left; width: 100%;
}
.selector-label {
  font-family: var(--font-display); font-size: 13px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 2px; font-weight: 400;
  margin-bottom: 8px; text-align: center;
}
.selector-row {
  display: flex; gap: 8px; justify-content: center;
}
.selector-card {
  flex: 1; max-width: 170px; padding: 12px 10px;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  transition: all 0.2s; text-align: center;
  font-family: var(--font-body); color: var(--text-primary);
  display: flex; flex-direction: column; gap: 4px;
}
.selector-card:hover { border-color: var(--gold-dim); background: var(--bg-card); }
.selector-card.selected {
  border-color: var(--teal); background: rgba(61, 139, 139, 0.12);
  box-shadow: 0 0 12px rgba(61, 139, 139, 0.15);
}
.selector-card-title {
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
  color: var(--sepia-light);
}
.selector-card.selected .selector-card-title { color: var(--gold-light); }
.selector-card-desc {
  font-size: 12px; color: var(--text-dim); line-height: 1.4;
}
.selector-card.selected .selector-card-desc { color: var(--text-secondary); }

/* ── Briefing Screen ─────────────────────────────────────────────── */

.briefing-screen {
  height: 100vh; height: 100dvh;
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 40px 20px;
  padding-bottom: max(40px, env(safe-area-inset-bottom, 40px));
  background: radial-gradient(ellipse at top, rgba(61, 139, 139, 0.06) 0%, transparent 60%), var(--bg-dark);
}
.briefing-content { max-width: 640px; width: 100%; animation: fade-in 0.5s ease-out; }
.briefing-cover { margin-bottom: 24px; text-align: center; }
.briefing-cover-img {
  width: 100%; max-height: 320px; object-fit: cover;
  border-radius: var(--radius-lg); border: 1px solid var(--border);
}
.briefing-badge {
  display: inline-block; font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 3px; text-transform: uppercase; color: var(--gold);
  border: 1px solid var(--gold-dim); padding: 4px 14px; margin-bottom: 16px;
}
.briefing-title {
  font-family: var(--font-display); font-size: 38px; font-weight: 700;
  color: var(--gold); margin-bottom: 8px; line-height: 1.2;
  text-shadow: 0 0 30px rgba(201, 169, 110, 0.15);
}
.briefing-setting {
  font-style: italic; font-size: 17px; color: var(--sepia);
  margin-bottom: 32px; line-height: 1.7; padding-left: 16px;
  border-left: 2px solid var(--teal-dark);
}
.briefing-section { margin-bottom: 28px; }
.briefing-section h3 {
  font-family: var(--font-display); font-size: 15px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 2px; font-weight: 400;
  margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}

.briefing-victim-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
}
.briefing-victim-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.briefing-victim-initial {
  width: 42px; height: 42px; border-radius: 50%; background: var(--red-dim);
  color: var(--sepia-light); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.briefing-victim-header strong { color: var(--sepia-light); font-size: 17px; }
.briefing-victim-bg {
  font-size: 15px; color: var(--sepia); line-height: 1.7; margin-bottom: 12px;
  padding: 8px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.briefing-victim-details {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 15px; color: var(--text-secondary);
}
.briefing-victim-details strong { color: var(--sepia-light); }

.briefing-events-list {
  display: flex; flex-direction: column; gap: 6px;
}
.briefing-event-item {
  padding: 8px 14px; font-size: 15px; color: var(--sepia);
  background: var(--bg-card); border-left: 3px solid var(--teal-dark);
  border-radius: var(--radius); line-height: 1.5;
}

.briefing-suspects { display: flex; flex-direction: column; gap: 8px; }
.briefing-suspect {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
}
.briefing-suspect-initial {
  width: 34px; height: 34px; border-radius: 50%; background: var(--teal-dark);
  color: var(--gold-light); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 16px; font-weight: 700; flex-shrink: 0;
}
.briefing-suspect-avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  border: 1.5px solid var(--teal); flex-shrink: 0;
}
.briefing-suspect strong { color: var(--sepia-light); }

.briefing-locations { display: flex; flex-wrap: wrap; gap: 8px; }
.briefing-location-tag {
  padding: 6px 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 15px; color: var(--sepia);
}
.briefing-instructions {
  padding: 16px 20px; background: rgba(61, 139, 139, 0.06);
  border: 1px solid var(--teal-dark); border-radius: var(--radius);
  margin-bottom: 28px; font-size: 16px; color: var(--sepia); line-height: 1.7;
}
.briefing-instructions strong { color: var(--gold-light); }
.briefing-content .btn-start { display: block; width: 100%; text-align: center; }

/* ── Game Screen ──────────────────────────────────────────────────── */

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

/* ── Header ───────────────────────────────────────────────────────── */

.game-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px; background: var(--bg-panel);
  border-bottom: 1px solid var(--border); flex-shrink: 0; z-index: 20;
  gap: 16px;
}
.header-left { min-width: 0; flex: 1; }
.case-title {
  font-family: var(--font-display); font-size: 20px; color: var(--gold);
  font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.victim-info {
  font-size: 13px; color: var(--text-secondary); font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.btn-travel, .btn-accuse-header {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.btn-travel {
  background: var(--teal-dark); color: var(--sepia-light);
  border: 1px solid var(--teal);
}
.btn-travel:hover { background: var(--teal); }
.btn-accuse-header {
  background: var(--red-dim); color: var(--sepia-light);
  border: 1px solid var(--red);
}
.btn-accuse-header:hover { background: var(--red); }
.btn-exit-header {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-exit-header:hover { background: var(--bg-card); color: var(--sepia-light); border-color: var(--border-light); }

/* ── Sound Controls ──────────────────────────────────────────────── */

.btn-sound-toggle {
  background: none; border: 1px solid var(--border); color: var(--text-secondary);
  padding: 8px; border-radius: var(--radius); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.btn-sound-toggle:hover { color: var(--text-primary); border-color: var(--gold-dim); }
.btn-sound-toggle.muted { opacity: 0.4; }

.sound-panel {
  display: none; position: absolute; top: 52px; right: 12px;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px 24px 20px;
  min-width: 260px; z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.sound-panel.open { display: block; }

.sound-panel-row {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px; min-height: 44px;
}
.sound-panel-row:last-of-type { margin-bottom: 16px; }
.sound-panel-row label {
  font-size: 14px; color: var(--text-secondary); min-width: 72px;
  font-family: var(--font-body);
}

.volume-slider {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 6px; border-radius: 3px;
  background: var(--border); outline: none; cursor: pointer;
  min-width: 120px;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold); cursor: pointer;
  border: 3px solid var(--bg-panel);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.volume-slider::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold); cursor: pointer;
  border: 3px solid var(--bg-panel);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.btn-sound-mute {
  width: 100%; padding: 12px; margin-top: 4px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-secondary);
  font-size: 14px; font-family: var(--font-body);
  cursor: pointer; transition: all 0.2s;
}
.btn-sound-mute:hover { color: var(--text-primary); border-color: var(--gold-dim); }

/* ── Main Layout (split panels) ──────────────────────────────────── */

.game-main {
  flex: 1; display: flex; min-height: 0; overflow: clip;
}

/* Left panel — always-visible case notes */
.game-left-panel {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--bg-panel); border-right: 1px solid var(--border);
  overflow: hidden;
}

/* Right panel — slides between location & conversation via transform */
.game-right-panel {
  flex: 1; min-width: 0;
  overflow: clip;
}

.right-panel-inner {
  display: flex; width: 200%; height: 100%;
  transition: transform 0.4s ease;
}
.right-panel-inner.show-conversation {
  transform: translateX(-50%);
}

.location-view, .conversation-view {
  width: 50%; height: 100%; flex-shrink: 0;
  display: flex; flex-direction: column;
}
.location-view { overflow-y: auto; }
/* conversation-view: header + chat fill the space, only messages scroll */
.conversation-view { overflow: hidden; }

/* ── Map Modal ───────────────────────────────────────────────────── */

.map-modal {
  display: none; position: fixed; inset: 0; z-index: 300;
  align-items: center; justify-content: center;
}
.map-modal.open { display: flex; }

.map-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(13, 13, 26, 0.88);
  animation: fade-in 0.2s;
}

.map-modal-content {
  position: relative;
  width: 92vw; height: 88vh;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 48px rgba(0,0,0,0.7);
  overflow: hidden;
  animation: modal-in 0.25s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: scale(0.96) translateY(12px); } to { opacity: 1; transform: none; } }

.map-modal-content #map-container { width: 100%; height: 100%; overflow-y: auto; padding: 20px; }

/* ── Travel Grid (Location Cards) ──────────────────────────────────── */

.travel-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}

.location-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); cursor: pointer;
  transition: all 0.2s; overflow: hidden;
}
.location-card:hover {
  border-color: var(--gold-dim); transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.location-card.current {
  border-color: var(--teal); box-shadow: 0 0 16px rgba(61, 139, 139, 0.3);
}

.card-image {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  background: var(--bg-dark);
}
.card-image img { width: 100%; height: 100%; object-fit: contain; }
.card-image-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 48px; font-weight: 700;
  color: var(--text-dim);
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-card) 50%, var(--bg-parchment) 100%);
}

.incident-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--red-dim); color: #e8a0a0;
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 3px 8px; border-radius: 2px;
  border: 1px solid var(--red);
}
.current-badge {
  position: absolute; bottom: 8px; right: 8px;
  background: var(--teal-dark); color: var(--gold-light);
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 3px 8px; border-radius: 2px;
  border: 1px solid var(--teal);
}

.card-body { padding: 12px 14px; }
.card-title {
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
  color: var(--sepia-light); margin-bottom: 6px;
}

.card-status { display: flex; gap: 6px; margin-bottom: 6px; }
.badge {
  font-size: 14px; line-height: 1;
}
.badge-examined { color: var(--teal-light); }
.badge-evidence { color: var(--gold); }
.badge-visited { color: var(--green); }

.card-characters { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.card-char-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px 2px 2px; border-radius: 20px;
  background: rgba(61, 139, 139, 0.12); border: 1px solid var(--border);
}
.card-char-avatar {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--teal);
}
.card-char-initial {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--teal-dark); color: var(--gold-light);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
}
.card-char-name {
  font-size: 11px; color: var(--text-secondary);
  font-family: var(--font-body); white-space: nowrap;
}

/* ── Location Hero Image (right panel) ─────────────────────────────── */

.location-hero {
  margin-bottom: 12px; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border); max-height: 200px;
}
.location-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }

.location-incident-tag {
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 1px;
  color: #e8a0a0; background: var(--red-dim);
  padding: 2px 8px; border-radius: 2px;
  border: 1px solid var(--red);
}

/* ── Location View (right panel content) ─────────────────────────── */

.location-view { padding: 24px 28px; }

.location-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.location-title {
  font-family: var(--font-display); font-size: 26px; color: var(--gold); font-weight: 700;
}
.location-atmosphere {
  font-style: italic; color: var(--sepia); font-size: 15px; line-height: 1.7;
  margin-bottom: 16px;
}

.location-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.btn-examine {
  background: var(--teal-dark); border-color: var(--teal);
  color: var(--sepia-light); font-size: 14px;
  padding: 6px 14px;
}
.btn-examine:hover { background: var(--teal); }
.btn-wait {
  background: transparent; border-color: var(--border);
  color: var(--text-secondary); font-size: 14px;
  padding: 6px 14px;
}
.btn-wait:hover { border-color: var(--text-secondary); color: var(--text-primary); }

.location-characters {
  display: flex; flex-direction: column; gap: 6px; margin-top: 16px;
}
.location-characters-label {
  font-family: var(--font-display); font-size: 13px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 2px; font-weight: 400;
  margin-bottom: 4px;
}

/* ── Character Cards ──────────────────────────────────────────────── */

.character-card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 16px; margin-bottom: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; transition: all 0.2s;
  text-align: left; font-family: var(--font-body); color: var(--text-primary);
}
.character-card:hover { background: var(--bg-parchment); border-color: var(--gold-dim); }
.character-initial {
  width: 40px; height: 40px; border-radius: 50%; background: var(--teal-dark);
  color: var(--gold-light); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.character-avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  border: 1.5px solid var(--teal); flex-shrink: 0;
}
.character-info { display: flex; flex-direction: column; }
.character-name { font-weight: 600; color: var(--sepia-light); font-size: 17px; }
.character-role { font-size: 14px; color: var(--text-secondary); }

/* ── Evidence Results ─────────────────────────────────────────────── */

.evidence-result { margin-top: 20px; }
.evidence-result.hidden { display: none; }
.evidence-result h4 { font-family: var(--font-display); color: var(--gold); margin-bottom: 8px; }
.evidence-item {
  padding: 12px 16px; background: var(--bg-card);
  border: 1px solid var(--teal-dark); border-radius: var(--radius); margin-bottom: 8px;
}
.evidence-new { border-color: var(--gold-dim); animation: flash-gold 0.6s ease-out; }
@keyframes flash-gold { 0% { background: rgba(201, 169, 110, 0.2); } 100% { background: var(--bg-card); } }
.evidence-item strong { color: var(--gold-light); }
.evidence-item p { margin-top: 4px; font-size: 15px; color: var(--sepia); }

/* ── Modal Close (shared by map modal + accusation) ──────────────── */

.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--text-secondary);
  font-size: 28px; cursor: pointer; line-height: 1; z-index: 5;
}
.modal-close:hover { color: var(--text-primary); }

/* ── Conversation View (right panel) ─────────────────────────────── */

.conversation-view { background: var(--bg-panel); }

.conversation-header {
  display: flex; align-items: flex-end; gap: 16px;
  padding: 16px 24px; min-height: 180px;
  flex-shrink: 0; background: var(--bg-card);
  position: relative;
}
.conversation-header::before {
  content: ''; position: absolute;
  left: 0; right: 0; top: 0; height: 42px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}
.btn-back {
  background: none; border: none; color: var(--text-secondary);
  font-size: 15px; cursor: pointer; padding: 10px 12px;
  font-family: var(--font-body); transition: color 0.2s;
  position: absolute; top: 0; left: 0; z-index: 2;
}
.btn-back:hover { color: var(--text-primary); }
.conv-header-avatar,
.conv-header-initial {
  width: 200px; height: 200px; border-radius: 50%;
  flex-shrink: 0; position: absolute;
  right: 10px; top: 10px;
  opacity: 0.9; pointer-events: none;
}
.conv-header-avatar {
  object-fit: cover; border: 3px solid var(--teal);
}
.conv-header-initial {
  background: var(--teal-dark); border: 3px solid var(--teal);
  color: var(--gold-light); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 72px; font-weight: 700;
}
.conv-header-info {
  display: flex; flex-direction: column; z-index: 1;
}
.conv-header-name {
  font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--gold);
}
.conv-header-role {
  font-size: 14px; color: var(--text-secondary); font-style: italic;
}

/* Right chat area — fills remaining space below the header */
.conversation-chat {
  flex: 1; display: flex; flex-direction: column;
  min-height: 0; min-width: 0;
  background: var(--bg-panel);
}

.conversation-messages {
  flex: 1; overflow-y: auto; padding: 20px 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.system-message {
  text-align: center; color: var(--text-dim); font-style: italic;
  font-size: 15px; padding: 8px;
}
.message {
  max-width: 80%; padding: 12px 18px; border-radius: var(--radius-lg);
  font-size: 16px; line-height: 1.6; animation: msg-in 0.2s ease-out;
}
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.message-player {
  align-self: flex-end; background: var(--teal-dark);
  color: var(--sepia-light); border-bottom-right-radius: 2px;
}
.message-character {
  align-self: flex-start; background: var(--bg-card);
  color: var(--sepia); border: 1px solid var(--border); border-bottom-left-radius: 2px;
}

/* Typing indicator */
.message.typing { display: flex; gap: 4px; padding: 14px 20px; }
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-dim); animation: blink 1.4s infinite;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

/* Investigative notes shown after character response */
.message-notes {
  align-self: flex-start;
  background: rgba(61, 139, 139, 0.1);
  border: 1px solid var(--teal-dark);
  border-radius: 6px;
  padding: 8px 14px;
  margin-top: -4px;
  font-size: 13px;
  color: var(--teal-light);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.notes-label {
  font-family: 'Special Elite', cursive;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--teal);
  margin-bottom: 2px;
}
.note-item {
  display: block;
  padding-left: 10px;
  border-left: 2px solid var(--teal-dark);
  color: var(--sepia);
  font-size: 13px;
  line-height: 1.4;
}

.conversation-input {
  display: flex; gap: 8px; padding: 14px 20px;
  border-top: 1px solid var(--border); background: var(--bg-card);
  flex-shrink: 0;
}
.conversation-input input {
  flex: 1; padding: 12px 16px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-primary); font-family: var(--font-body); font-size: 16px;
}
.conversation-input input::placeholder { color: var(--text-dim); }
.conversation-input input:focus { outline: none; border-color: var(--teal); }
.btn-send { background: var(--teal-dark); border-color: var(--teal); color: var(--gold-light); }
.btn-send:hover { background: var(--teal); }

/* ── Time Display ─────────────────────────────────────────────────── */

.time-container { flex-shrink: 0; }
.time-placeholder { font-size: 13px; color: var(--text-dim); }
.time-line {
  font-size: 13px; color: var(--text-secondary);
  white-space: nowrap;
}
.time-phase { font-size: 13px; }
.time-sep { color: var(--text-dim); font-size: 11px; margin: 0 2px; }
.time-moves {
  font-weight: 700; color: var(--gold);
}
.time-low .time-moves { color: var(--red); }
.time-low { color: var(--red); }
.pulse { animation: pulse-red 1s infinite; }
@keyframes pulse-red { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── Notebook (left panel) ───────────────────────────────────────── */

.notebook-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notebook-header h2 { font-family: var(--font-display); color: var(--gold); font-size: 20px; }
.notebook-tabs {
  display: flex; border-bottom: 1px solid var(--border); overflow-x: auto;
  flex-shrink: 0;
}
.tab {
  padding: 8px 10px; font-family: var(--font-body); font-size: 13px;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-secondary); cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.notebook-content { flex: 1; overflow-y: auto; padding: 16px 18px; }
.notebook-entry {
  padding: 12px 16px; margin-bottom: 10px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
}
.evidence-entry.critical { border-color: var(--gold-dim); }
.evidence-entry strong { color: var(--gold-light); }
.evidence-entry p { font-size: 15px; margin-top: 4px; }
.evidence-meta, .clue-meta {
  display: block; margin-top: 6px; font-size: 13px; color: var(--text-dim);
}
.statement-group h4 { font-family: var(--font-display); color: var(--sepia-light); margin-bottom: 8px; }
.statement-item { padding: 8px 12px; margin-bottom: 6px; border-left: 2px solid var(--teal-dark); font-size: 15px; }
.statement-item p { font-style: italic; }
.timeline-entries { position: relative; padding-left: 20px; }
.timeline-entries::before {
  content: ''; position: absolute; left: 4px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-entry { position: relative; padding: 8px 0 8px 12px; font-size: 15px; }
.timeline-entry::before {
  content: ''; position: absolute; left: -20px; top: 14px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal); border: 2px solid var(--bg-panel);
}
.timeline-time { display: block; font-size: 13px; color: var(--text-dim); font-family: var(--font-mono); }
.timeline-event { color: var(--sepia); }

/* ── Suspect Cards (Notebook) ─────────────────────────────────────── */

.suspect-card .suspect-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
}
.suspect-avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  border: 1.5px solid var(--teal); flex-shrink: 0;
}
.suspect-initial {
  width: 44px; height: 44px; border-radius: 50%; background: var(--teal-dark);
  color: var(--gold-light); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.suspect-name { color: var(--sepia-light); font-size: 17px; }
.suspect-appearance { font-size: 14px; color: var(--sepia); line-height: 1.6; margin-bottom: 8px; }
.suspect-meta {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 13px; color: var(--text-dim);
}

/* ── Accusation Modal ─────────────────────────────────────────────── */

.accusation-container:not(.open) { display: none; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(13, 13, 26, 0.9);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in 0.3s;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  max-width: 540px; width: 90%; max-height: 85vh; overflow-y: auto;
  position: relative;
}
.btn-modal-close {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none; color: var(--text-secondary);
  font-size: 24px; cursor: pointer; padding: 4px 10px;
  line-height: 1; border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
}
.btn-modal-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.accusation-form h2 { font-family: var(--font-display); color: var(--gold); margin-bottom: 8px; }
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 15px; color: var(--sepia-light); margin-bottom: 6px; font-weight: 600;
}
.form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-primary); font-family: var(--font-body); font-size: 16px;
}
.form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--teal); }
.evidence-checklist { display: flex; flex-direction: column; gap: 6px; }
.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; cursor: pointer; padding: 4px 0;
}
.checkbox-label input[type="checkbox"] { accent-color: var(--teal); }
.btn-accuse {
  background: var(--red-dim); border-color: var(--red);
  color: var(--sepia-light); font-size: 16px; width: 100%; padding: 12px;
}
.btn-accuse:hover { background: var(--red); }

/* ── Verdict Screen ───────────────────────────────────────────────── */

.verdict-screen { text-align: center; }
.verdict-screen h2 { font-family: var(--font-display); font-size: 28px; margin-bottom: 12px; }
.verdict-brilliant { color: var(--gold); }
.verdict-solid { color: var(--teal-light); }
.verdict-partial { color: var(--sepia); }
.verdict-wrong { color: var(--red); }
.verdict-feedback { font-style: italic; color: var(--sepia); margin-bottom: 24px; line-height: 1.8; }
.score-breakdown { margin-bottom: 24px; }
.score-total { font-family: var(--font-display); font-size: 48px; font-weight: 700; color: var(--gold); }
.score-total span { font-size: 16px; color: var(--text-secondary); }
.score-details { margin-top: 16px; text-align: left; display: inline-block; }
.score-row { padding: 4px 0; font-size: 15px; color: var(--text-secondary); }
.score-row.correct { color: var(--green); }
.score-row.wrong { color: var(--red); }
.ground-truth {
  text-align: left; padding: 16px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px;
}
.ground-truth h3 { font-family: var(--font-display); color: var(--gold-dim); margin-bottom: 8px; }
.ground-truth p { font-size: 15px; margin-bottom: 4px; }
.btn-new-game {
  background: var(--teal-dark); border: 1px solid var(--teal);
  color: var(--gold-light); padding: 12px 32px; font-size: 16px;
  font-family: var(--font-body); cursor: pointer; border-radius: var(--radius);
}
.btn-new-game:hover { background: var(--teal); }
.verdict-actions { display: flex; gap: 12px; justify-content: center; }
.btn-back-library {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); padding: 12px 32px; font-size: 16px;
  font-family: var(--font-body); cursor: pointer; border-radius: var(--radius);
}
.btn-back-library:hover { border-color: var(--sepia); color: var(--sepia-light); }

/* ── Case Library ─────────────────────────────────────────────────── */

.case-library { margin-top: 40px; text-align: left; max-width: 520px; width: 100%; }
.library-heading {
  font-family: var(--font-display); font-size: 16px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 2px; font-weight: 400;
  margin-bottom: 12px; text-align: center;
}
.library-sort {
  display: flex; justify-content: center; gap: 4px;
  margin-bottom: 16px; border-bottom: 1px solid var(--border);
}
.case-list { max-height: 320px; overflow-y: auto; }
.case-card {
  padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px; transition: border-color 0.2s;
}
.case-card:hover { border-color: var(--gold-dim); }
.case-card-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.case-card-title { font-family: var(--font-display); font-size: 16px; color: var(--sepia-light); font-weight: 600; }
.case-card-score { font-family: var(--font-mono); font-size: 14px; color: var(--text-dim); }
.case-card-score.positive { color: var(--green); }
.case-card-score.negative { color: var(--red); }
.case-card-meta { font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.case-card-actions { display: flex; gap: 6px; align-items: center; }
.btn-replay {
  font-size: 13px; padding: 4px 14px;
  background: var(--teal-dark); border-color: var(--teal); color: var(--gold-light);
}
.btn-replay:hover { background: var(--teal); }
.btn-rate-up, .btn-rate-down {
  font-size: 11px; padding: 3px 8px;
  background: var(--bg-parchment); border-color: var(--border); line-height: 1;
}
.btn-rate-up:hover { color: var(--green); border-color: var(--green); }
.btn-rate-down:hover { color: var(--red); border-color: var(--red); }

/* ── Active Sessions ─────────────────────────────────────────────── */

.active-sessions { margin-top: 32px; text-align: left; max-width: 520px; width: 100%; }
.session-list { display: flex; flex-direction: column; gap: 8px; }
.session-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); transition: border-color 0.2s; cursor: default;
}
.session-card:hover { border-color: var(--gold-dim); }
.session-card-cover {
  width: 48px; height: 64px; border-radius: 4px; object-fit: cover; flex-shrink: 0;
}
.session-card-cover-placeholder {
  width: 48px; height: 64px; border-radius: 4px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-panel); border: 1px solid var(--border);
  font-family: var(--font-display); font-size: 20px; color: var(--gold-dim);
}
.session-card-body { flex: 1; min-width: 0; }
.session-card-title {
  font-family: var(--font-display); font-size: 15px; color: var(--sepia-light);
  font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-card-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.session-card-time { font-size: 12px; color: var(--gold-dim); margin-top: 2px; }
.btn-resume {
  font-size: 13px; padding: 6px 16px; white-space: nowrap; flex-shrink: 0;
  background: var(--teal-dark); border-color: var(--teal); color: var(--gold-light);
}
.btn-resume:hover { background: var(--teal); }

/* ── Tutorial Modal ───────────────────────────────────────────────── */

.tutorial-modal {
  display: none; position: fixed; inset: 0; z-index: 300;
  align-items: center; justify-content: center;
}
.tutorial-modal.open { display: flex; }

.tutorial-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(13, 13, 26, 0.88);
  animation: fade-in 0.2s;
}

.tutorial-modal-content {
  position: relative;
  width: min(92vw, 520px); max-height: 88vh;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 48px rgba(0,0,0,0.7);
  overflow: hidden;
  animation: modal-in 0.25s ease-out;
}

.tutorial-modal-body {
  padding: 32px 28px; overflow-y: auto; max-height: 86vh;
}

.tutorial-modal-title {
  font-family: var(--font-display); font-size: 24px; color: var(--gold);
  text-align: center; margin: 0 0 8px; font-weight: 400;
}
.tutorial-modal-subtitle {
  text-align: center; color: var(--text-secondary); font-size: 14px;
  margin: 0 0 24px; line-height: 1.5;
}

.tutorial-sections { display: flex; flex-direction: column; gap: 16px; }

.tutorial-section {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); transition: border-color 0.2s;
}
.tutorial-section:hover { border-color: var(--teal-dark); }

.tutorial-section-icon {
  font-size: 22px; flex-shrink: 0; width: 32px; text-align: center;
  line-height: 1.4;
}
.tutorial-section-body h3 {
  font-family: var(--font-display); font-size: 16px; color: var(--sepia-light);
  margin: 0 0 4px; font-weight: 600;
}
.tutorial-section-body p {
  font-size: 14px; color: var(--text-secondary); margin: 0; line-height: 1.55;
}

.tutorial-modal-tip {
  margin-top: 20px; text-align: center;
  font-family: var(--font-mono); font-size: 13px; color: var(--gold-dim);
  font-style: italic;
}

.tutorial-modal-footer {
  margin-top: 20px; text-align: center;
  border-top: 1px solid var(--border); padding-top: 16px;
}

.tutorial-restart-link {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 13px;
  color: var(--teal-light); text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.tutorial-restart-link:hover { color: var(--gold-light); }

/* ── Tutorial Hints ──────────────────────────────────────────────── */

.tutorial-hint {
  position: fixed; z-index: 500;
  max-width: 280px; padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--teal-dark);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 16px rgba(61, 139, 139, 0.15);
  animation: hint-in 0.25s ease-out;
}
.tutorial-hint.hint-out { animation: hint-out 0.2s ease-in forwards; }

.tutorial-hint::before {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%);
  bottom: -6px; width: 12px; height: 12px;
  background: var(--bg-card); border-right: 1px solid var(--teal-dark);
  border-bottom: 1px solid var(--teal-dark);
  transform: translateX(-50%) rotate(45deg);
}
.tutorial-hint.hint-below::before {
  bottom: auto; top: -6px;
  border-right: none; border-bottom: none;
  border-left: 1px solid var(--teal-dark); border-top: 1px solid var(--teal-dark);
  transform: translateX(-50%) rotate(45deg);
}

.tutorial-hint-text {
  font-size: 14px; color: var(--text-primary); line-height: 1.5;
  margin-bottom: 10px;
}

.tutorial-hint-actions { display: flex; gap: 8px; align-items: center; }

.tutorial-hint-dismiss {
  font-size: 13px; padding: 4px 14px; cursor: pointer;
  background: var(--teal-dark); border: 1px solid var(--teal); color: var(--gold-light);
  border-radius: var(--radius); font-family: var(--font-body); transition: background 0.2s;
}
.tutorial-hint-dismiss:hover { background: var(--teal); }

.tutorial-hint-skip {
  font-size: 12px; background: none; border: none;
  color: var(--text-dim); cursor: pointer; font-family: var(--font-body);
  text-decoration: underline; text-underline-offset: 2px;
}
.tutorial-hint-skip:hover { color: var(--text-secondary); }

/* Highlight glow on target element */
.tutorial-highlight {
  box-shadow: 0 0 0 3px rgba(61, 139, 139, 0.4), 0 0 16px rgba(61, 139, 139, 0.2) !important;
  animation: tutorial-pulse 2s ease-in-out infinite;
}

@keyframes tutorial-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(61, 139, 139, 0.4), 0 0 16px rgba(61, 139, 139, 0.2); }
  50% { box-shadow: 0 0 0 5px rgba(61, 139, 139, 0.5), 0 0 24px rgba(61, 139, 139, 0.3); }
}
@keyframes hint-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes hint-out { to { opacity: 0; transform: translateY(-4px); } }

/* ── Empty State ──────────────────────────────────────────────────── */

.location-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--text-dim); font-style: italic;
  font-size: 18px; font-family: var(--font-display);
}

/* ── Scrollbars ───────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ── Case Brief (inside notebook) ────────────────────────────────── */

.case-brief { display: flex; flex-direction: column; gap: 20px; }
.case-brief-section h4 {
  font-family: var(--font-display); font-size: 14px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 2px; font-weight: 400;
  margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.case-brief-victim {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.case-brief-victim-initial {
  width: 48px; height: 48px; border-radius: 50%; background: var(--red-dim);
  color: var(--sepia-light); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 22px; font-weight: 700; flex-shrink: 0;
}
.case-brief-detail {
  font-size: 15px; color: var(--sepia); line-height: 1.7;
}
.case-brief-detail strong { color: var(--sepia-light); }

.case-brief-events {
  display: flex; flex-direction: column; gap: 4px;
}
.case-brief-event {
  padding: 6px 12px; font-size: 14px; color: var(--sepia);
  border-left: 2px solid var(--teal-dark); line-height: 1.5;
}

.suspects-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px;
}

/* ── Responsive ───────────────────────────────────────────────────── */

/* Map panel — hidden on desktop, swipeable on mobile */
.game-map-panel { display: none; }

/* Mobile: swipeable panels — Map, Notes, Location, Chat */
@media (max-width: 768px) {
  .game-main {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .game-main::-webkit-scrollbar { display: none; }

  /* Map panel — first swipeable screen */
  .game-map-panel {
    display: flex; flex-direction: column;
    flex: none; width: 100vw; min-width: 100vw;
    scroll-snap-align: start;
    overflow-y: auto; padding: 16px;
    background: var(--bg-panel);
  }

  .game-left-panel {
    flex: none;
    width: 100vw; min-width: 100vw;
    scroll-snap-align: start;
    border-right: none;
  }

  /* Flatten the right-panel hierarchy so location & conversation
     become direct scroll children of game-main */
  .game-right-panel { display: contents; }
  .right-panel-inner { display: contents; }

  .location-view, .conversation-view {
    width: 100vw; min-width: 100vw;
    scroll-snap-align: start;
  }

  .location-view { padding: 16px; }

  .travel-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  .suspects-grid { grid-template-columns: 1fr; }

  /* Hide header buttons on mobile — nav bar handles these */
  .header-right { display: none; }

  /* Mobile header — just title + time */
  .game-header { padding: 8px 12px; gap: 4px; }
  .case-title { font-size: 16px; }
  .time-line { font-size: 12px; }

  /* Taller notebook tabs for thumb-friendly tapping */
  .notebook-tabs .tab {
    padding: 14px 14px; font-size: 14px;
  }

  /* Conversation: hero portrait — fully visible */
  .conversation-header {
    min-height: 200px; padding: 14px 16px;
    align-items: flex-end;
  }
  .conv-header-avatar,
  .conv-header-initial {
    width: 220px; height: 220px; right: 10px; top: 10px;
  }
  .conv-header-initial { font-size: 80px; }
  .conv-header-name { font-size: 20px; }
  .conv-header-role { font-size: 13px; }
}

@media (max-width: 600px) {
  .game-title { font-size: 40px; }
}

/* ── Mobile Bottom Nav ──────────────────────────────────────────────── */

.mobile-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 100;
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .mobile-nav-btn {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: none; border: none;
    color: var(--text-dim);
    font-family: var(--font-body); font-size: 11px;
    cursor: pointer; padding: 6px 0;
    transition: color 0.2s;
  }
  .mobile-nav-btn.active { color: var(--gold); }
  .mobile-nav-btn:hover { color: var(--text-primary); }

  /* Exit nav button — dim, unobtrusive */
  .mobile-nav-exit { opacity: 0.5; }
  .mobile-nav-exit:hover { opacity: 0.8; }

  /* Accuse nav button — red accent */
  .mobile-nav-accuse { color: var(--red); }
  .mobile-nav-accuse.active { color: var(--red); }

  /* Give game-screen room for the nav bar */
  .game-screen { padding-bottom: 60px; }
}
