/* === MURDER MYSTERY — Cartoon-Noir Theme === */

:root {
  /* Noir base */
  --bg-dark: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a25;
  --bg-input: #1e1e2a;
  --border: #2a2a3a;
  --text: #e0d8cc;
  --text-dim: #8a8478;
  --text-bright: #f5f0e8;

  /* Cartoon accents */
  --mustard: #d4a017;
  --blood-red: #c41e3a;
  --poison-green: #2ecc71;
  --electric-purple: #8b5cf6;
  --midnight-blue: #1a1a40;

  /* Functional */
  --accent: var(--mustard);
  --danger: var(--blood-red);
  --success: var(--poison-green);

  /* Shadows & glows */
  --shadow-noir: 0 4px 24px rgba(0, 0, 0, 0.6);
  --glow-mustard: 0 0 12px rgba(212, 160, 23, 0.3);
  --glow-red: 0 0 12px rgba(196, 30, 58, 0.3);

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-typewriter: 'Special Elite', 'Courier New', monospace;
  --font-ui: 'Inter', system-ui, sans-serif;
}

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

body {
  font-family: var(--font-ui);
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Noir vignette overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.5) 100%);
  pointer-events: none;
  z-index: 9999;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === Typography === */
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--text-bright);
  font-weight: 700;
}

h1 { font-size: 2.5rem; letter-spacing: 0.05em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; }

.typewriter {
  font-family: var(--font-typewriter);
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

/* === Layout === */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

.view-enter {
  animation: fadeIn 0.3s ease-out;
}

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

/* === Header === */
.header {
  text-align: center;
  padding: 2rem 1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--midnight-blue) 0%, var(--bg-dark) 100%);
}

.header h1 {
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--mustard);
  text-shadow: 0 0 20px rgba(212, 160, 23, 0.4);
}

.header .subtitle {
  font-family: var(--font-typewriter);
  color: var(--text-dim);
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.nav {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.nav a {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.4rem 1rem;
  border: 1px solid transparent;
  border-radius: 3px;
  transition: all 0.2s;
}

.nav a:hover {
  color: var(--text-bright);
  border-color: var(--border);
}

.nav a.active {
  color: var(--mustard);
  border-color: var(--mustard);
}

/* Language selector */
.lang-select {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color 0.2s, color 0.2s;
  margin-left: 0.25rem;
}

.lang-select:hover {
  color: var(--text-bright);
  border-color: var(--border);
}

.lang-select:focus {
  border-color: var(--mustard);
  color: var(--mustard);
}

.lang-select option {
  background: var(--bg-card);
  color: var(--text);
}

/* === Cards === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-noir);
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--mustard);
}

.card h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  color: var(--mustard);
}

/* === Forms === */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--mustard);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a8478' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2.2rem;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-primary {
  background: var(--mustard);
  color: var(--bg-dark);
  border-color: var(--mustard);
}

.btn-primary:hover {
  background: #e0ad1f;
  box-shadow: var(--glow-mustard);
}

.btn-danger {
  border-color: var(--blood-red);
  color: var(--blood-red);
}

.btn-danger:hover {
  background: var(--blood-red);
  color: white;
  box-shadow: var(--glow-red);
}

.btn-success {
  border-color: var(--poison-green);
  color: var(--poison-green);
}

.btn-success:hover {
  background: var(--poison-green);
  color: var(--bg-dark);
}

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

.btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* === Toast === */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.8rem 1.2rem;
  font-size: 0.85rem;
  box-shadow: var(--shadow-noir);
  animation: slideIn 0.3s ease-out;
  max-width: 350px;
}

.toast.success { border-left: 3px solid var(--poison-green); }
.toast.error { border-left: 3px solid var(--blood-red); }
.toast.info { border-left: 3px solid var(--mustard); }

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

/* === Status indicator === */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.status-dot.connected { background: var(--poison-green); }
.status-dot.disconnected { background: var(--blood-red); }

/* === Helpers === */
.text-dim { color: var(--text-dim); }
.text-mustard { color: var(--mustard); }
.text-red { color: var(--blood-red); }
.text-green { color: var(--poison-green); }
.text-sm { font-size: 0.8rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* === Intro Screen === */
.intro-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #050510 0%, var(--bg-dark) 50%, #0a0a1a 100%);
  padding: 2rem;
}

.intro-content {
  max-width: 650px;
  width: 100%;
}

.intro-setting {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
  min-height: 200px;
}

.victim-card {
  background: var(--bg-card);
  border: 1px solid var(--blood-red);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 2rem;
  box-shadow: var(--glow-red);
}

.victim-card h3 {
  color: var(--blood-red);
  font-family: var(--font-display);
  font-size: 1.2rem;
}

/* === Game phase badges === */
.badge-intro { color: var(--mustard); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }
.badge-playing { color: var(--poison-green); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }
.badge-accusation { color: var(--electric-purple); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }
.badge-finished { color: var(--text-dim); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }
.badge-generating { color: var(--mustard); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }
.badge-won { color: var(--poison-green); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }
.badge-lost { color: var(--blood-red); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }

.card--generating {
  border-color: rgba(212, 160, 23, 0.3);
  cursor: default;
}

.card--generating:hover {
  border-color: rgba(212, 160, 23, 0.3);
}

/* === Game Screen === */
.game-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.game-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem 1rem;
  padding: 0.6rem 1.2rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.game-bar__back {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 1.2rem;
  line-height: 1;
}

.game-bar__back:hover { color: var(--text-bright); }

.game-bar__title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--mustard);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-bar__stats {
  display: flex;
  gap: 0.5rem 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.game-stat {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.game-stat b { color: var(--text-bright); }

.game-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* --- Map Sidebar --- */
.game-sidebar {
  width: 280px;
  min-width: 280px;
  padding: 1rem;
  border-right: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.map-label {
  font-family: var(--font-typewriter);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.map-wrap {
  position: relative;
}

.room-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.room-lines line {
  stroke: var(--border);
  stroke-width: 2;
  stroke-dasharray: 6 4;
}

.room-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.room-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.4rem;
  text-align: center;
  transition: all 0.2s;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
}

.room-tile__name {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.2;
  color: var(--text);
}

.room-tile__tokens {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
}

.room-tile--current {
  border-color: var(--mustard);
  box-shadow: var(--glow-mustard);
  background: rgba(212, 160, 23, 0.08);
}

.room-tile--current .room-tile__name {
  color: var(--mustard);
}

.room-tile--adjacent {
  cursor: pointer;
  border-color: var(--text-dim);
}

.room-tile--adjacent:hover {
  border-color: var(--mustard);
  background: var(--bg-card-hover);
}

.room-tile--far {
  opacity: 0.35;
}

/* Tokens on map tiles */
.token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.55rem;
  font-weight: 700;
}

.token--detective {
  background: var(--mustard);
  color: var(--bg-dark);
}

.token--suspect {
  background: var(--electric-purple);
  color: white;
}

.map-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.6rem;
  color: var(--text-dim);
}

/* --- Game Panel (right side) --- */
.game-panel {
  flex: 1;
  overflow-y: auto;
}

/* Room detail view */
.room-detail {
  padding: 1.5rem;
}

.room-detail__name {
  font-size: 1.3rem;
  color: var(--text-bright);
  margin-bottom: 0.75rem;
}

.room-detail__desc {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.room-section {
  margin-bottom: 1.5rem;
}

.room-section__title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  font-family: var(--font-ui);
  font-weight: 600;
}

/* Item buttons */
.item-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 0.4rem;
  text-align: left;
}

.item-btn:hover {
  border-color: var(--mustard);
  background: var(--bg-card-hover);
}

.item-btn--loading {
  opacity: 0.5;
  pointer-events: none;
}

.item-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--mustard);
  color: var(--bg-dark);
  font-weight: 700;
  font-size: 0.7rem;
  flex-shrink: 0;
}

/* Suspect buttons */
.suspect-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 0.4rem;
  text-align: left;
}

.suspect-btn:hover {
  border-color: var(--electric-purple);
  background: var(--bg-card-hover);
}

.suspect-btn__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--electric-purple);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.suspect-btn__info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.suspect-btn__info strong {
  color: var(--text-bright);
  font-size: 0.85rem;
}

.suspect-btn__info small {
  color: var(--text-dim);
  font-size: 0.7rem;
}

.suspect-btn__cta {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--electric-purple);
  font-weight: 600;
}

/* Examine result / Clue found */
.examine-note {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  animation: fadeIn 0.3s;
}

.clue-found {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--blood-red);
  border-radius: 6px;
  box-shadow: var(--glow-red);
  animation: fadeIn 0.3s;
}

.clue-found__badge {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--blood-red);
  margin-bottom: 0.5rem;
}

/* === Interrogation / Talk === */
.talk {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.talk__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}

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

.talk__who strong {
  color: var(--text-bright);
  font-size: 0.9rem;
}

.talk__who small {
  display: block;
  font-size: 0.7rem;
}

.talk__hint {
  text-align: center;
  padding: 2rem 1rem;
}

.talk__log {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Chat bubbles */
.chat-bubble {
  max-width: 80%;
  animation: fadeIn 0.2s;
}

.chat-bubble--detective {
  align-self: flex-end;
}

.chat-bubble--suspect {
  align-self: flex-start;
}

.chat-bubble__who {
  display: block;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.15rem;
}

.chat-bubble--detective .chat-bubble__who {
  text-align: right;
}

.chat-bubble__text {
  display: block;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.chat-bubble--detective .chat-bubble__text {
  background: var(--midnight-blue);
  border: 1px solid #2a2a5a;
  color: var(--text);
  border-bottom-right-radius: 2px;
}

.chat-bubble--suspect .chat-bubble__text {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 2px;
}

.talk__form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}

.talk__input {
  flex: 1;
}

/* Typing indicator */
.dot-pulse {
  display: inline-block;
}

.dot-pulse::after {
  content: '...';
  animation: dotBlink 1s infinite;
}

@keyframes dotBlink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Sound toggle button */
.btn-sound {
  border-color: var(--text-dim);
  color: var(--text-dim);
  font-size: 0.65rem;
}

.btn-sound--on {
  border-color: var(--poison-green);
  color: var(--poison-green);
}

/* Notebook button in game bar */
.btn-notebook {
  border-color: var(--mustard);
  color: var(--mustard);
}

.btn-notebook:hover {
  background: var(--mustard);
  color: var(--bg-dark);
}

/* === Notebook Screen === */
.notebook-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.notebook-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.nb-section {
  margin-bottom: 2rem;
}

.nb-heading {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-bright);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nb-empty {
  text-align: center;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* Clue cards */
.clue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.clue-pin {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  transition: border-color 0.2s;
}

.clue-pin:hover {
  border-color: var(--mustard);
}

.clue-pin__type {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-bottom: 0.5rem;
}

.clue-pin__type--physical {
  background: rgba(46, 204, 113, 0.15);
  color: var(--poison-green);
}

.clue-pin__type--testimony {
  background: rgba(139, 92, 246, 0.15);
  color: var(--electric-purple);
}

.clue-pin__type--document {
  background: rgba(212, 160, 23, 0.15);
  color: var(--mustard);
}

.clue-pin__type--forensic {
  background: rgba(92, 171, 255, 0.15);
  color: #5cabff;
}

.clue-pin__desc {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.clue-pin__sig {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-style: italic;
}

/* Suspect dossiers */
.dossier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
}

.dossier {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  transition: border-color 0.2s;
}

.dossier:hover {
  border-color: var(--electric-purple);
}

.dossier__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--electric-purple);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.dossier__body {
  flex: 1;
}

.dossier__name {
  color: var(--text-bright);
  font-size: 0.9rem;
}

.dossier__role {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}

.dossier__relation {
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.4;
}

/* Notebook progress stats */
.nb-progress {
  display: flex;
  gap: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  flex-wrap: wrap;
}

/* Clue attribution */
.clue-pin__found {
  margin-top: 0.3rem;
}

/* Dossier metadata */
.dossier__meta {
  margin-top: 0.3rem;
}

/* Notes form */
.nb-note-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.nb-note-form input {
  flex: 1;
}

/* Notes list */
.nb-notes {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.nb-note {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
}

.nb-note__del {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 0.3rem;
  line-height: 1;
  width: auto;
}

.nb-note__del:hover {
  color: var(--blood-red);
}

/* Examined items on board */
.item-btn--examined {
  opacity: 0.55;
}

.item-btn--examined .item-btn__icon {
  background: var(--poison-green);
}

/* Mood display in talk bar */
.talk__mood {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-left: auto;
  text-transform: capitalize;
}

/* Accusation section in notebook */
.nb-accuse {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
}

/* === Accusation Screen === */
.accuse-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(180deg, #050510 0%, var(--bg-dark) 40%);
}

.accuse-top {
  width: 100%;
  padding: 1rem 1.5rem;
}

.accuse-center {
  text-align: center;
  padding: 1rem 2rem 3rem;
  max-width: 700px;
  width: 100%;
}

.accuse-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--blood-red);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 20px rgba(196, 30, 58, 0.4);
}

.accuse-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 2rem 0;
}

.accuse-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.2rem 0.8rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-ui);
  color: var(--text);
}

.accuse-card:hover {
  border-color: var(--text-dim);
  background: var(--bg-card-hover);
}

.accuse-card--selected {
  border-color: var(--blood-red);
  box-shadow: var(--glow-red);
  background: rgba(196, 30, 58, 0.06);
}

.accuse-card__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--electric-purple);
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
}

.accuse-card--selected .accuse-card__avatar {
  background: var(--blood-red);
}

.accuse-card__name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-bright);
}

.accuse-card__role {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.accuse-confirm {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--blood-red);
  border-radius: 8px;
  animation: fadeIn 0.3s;
}

/* === Reveal Screen === */
.reveal-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #030308 0%, var(--bg-dark) 50%, #050510 100%);
  padding: 2rem;
}

.reveal-inner {
  max-width: 650px;
  width: 100%;
}

.reveal-verdict {
  text-align: center;
  margin-bottom: 2rem;
}

.reveal-verdict h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.reveal-verdict--won h1 {
  color: var(--mustard);
  text-shadow: 0 0 30px rgba(212, 160, 23, 0.5);
}

.reveal-verdict--lost h1 {
  color: var(--blood-red);
  text-shadow: 0 0 30px rgba(196, 30, 58, 0.5);
}

.reveal-summary {
  font-size: 1.1rem;
  line-height: 1.8;
  text-align: center;
  margin-bottom: 2rem;
}

.reveal-body {
  text-align: center;
}

.reveal-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  margin-bottom: 1rem;
  text-align: left;
}

.reveal-block h3 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mustard);
  margin-bottom: 0.5rem;
}

.reveal-block p {
  font-size: 0.9rem;
  line-height: 1.6;
}

.reveal-clue {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.reveal-clue:last-child {
  border-bottom: none;
}

.reveal-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.reveal--animate .reveal-verdict {
  animation: revealFade 1s ease-out;
}

.reveal--animate .reveal-body {
  animation: revealFade 1.5s ease-out;
}

@keyframes revealFade {
  0% { opacity: 0; transform: translateY(20px); }
  40% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* === Phase 5 — Visual Polish === */

/* Enhanced clue discovery animation */
.clue-found {
  animation: clueReveal 0.5s ease-out;
}

@keyframes clueReveal {
  0% { opacity: 0; transform: scale(0.95); box-shadow: 0 0 0 rgba(196, 30, 58, 0); }
  50% { box-shadow: 0 0 30px rgba(196, 30, 58, 0.5); }
  100% { opacity: 1; transform: scale(1); box-shadow: var(--glow-red); }
}

/* Map tile hover micro-animation */
.room-tile {
  transition: all 0.2s, transform 0.15s;
}

.room-tile--adjacent:hover {
  transform: scale(1.04);
}

/* Interrogation spotlight atmosphere */
.talk {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.2) 100%);
}

.talk__hint {
  animation: fadeIn 0.8s ease-out;
}

/* Notebook pin-card rotation */
.clue-pin {
  transition: all 0.2s;
}

.clue-pin:nth-child(odd) { transform: rotate(-0.5deg); }
.clue-pin:nth-child(even) { transform: rotate(0.4deg); }
.clue-pin:nth-child(3n) { transform: rotate(-0.8deg); }
.clue-pin:hover { transform: rotate(0) scale(1.01); }

/* Dossier card hover */
.dossier {
  transition: all 0.15s;
}

/* Interactive element transitions */
.item-btn, .suspect-btn, .accuse-card {
  transition: all 0.15s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* Chat bubble entrance animation */
.chat-bubble {
  animation: bubbleIn 0.25s ease-out;
}

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

/* Connection lines glow for current room */
.room-lines line {
  transition: stroke 0.3s;
}

/* Suspect card hover glow */
.accuse-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Loading spinner utility */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--mustard);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Responsive === */
@media (max-width: 768px) {
  .game-body {
    flex-direction: column;
  }
  .game-sidebar {
    width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 220px;
    flex-shrink: 0;
  }
  .room-grid {
    gap: 0.3rem;
  }
  .room-tile {
    min-height: 45px;
    padding: 0.3rem;
  }
  .room-tile__name { font-size: 0.55rem; }
}

@media (max-width: 600px) {
  .container { padding: 1rem; }
  h1 { font-size: 1.5rem; }
  .nav { flex-wrap: wrap; }
  .btn-group { flex-direction: column; }
  .game-bar { padding: 0.5rem 0.8rem; gap: 0.4rem 0.5rem; }
  .game-bar__title { font-size: 0.85rem; min-width: 0; }
  .game-bar__stats { gap: 0.4rem 0.5rem; }
}

/* === Multiplayer === */

/* Player tokens on map tiles */
.token--player {
  background: #5cabff;
  color: white;
  font-size: 0.5rem;
}

/* Fellow detective badges in room panel */
.player-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  color: var(--text);
}

.player-badge__dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Join code display */
.join-code {
  display: inline-block;
  font-family: var(--font-typewriter);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--mustard);
  background: rgba(212, 160, 23, 0.1);
  border: 1px solid rgba(212, 160, 23, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Join screen */
.join-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #050510 0%, var(--bg-dark) 50%, #0a0a1a 100%);
  padding: 2rem;
}

.join-inner {
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.join-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--mustard);
  text-shadow: 0 0 20px rgba(212, 160, 23, 0.4);
  margin-bottom: 0.5rem;
}

.join-form {
  text-align: left;
}

.join-form input {
  font-size: 1.1rem;
  padding: 0.8rem;
  text-align: center;
}

/* === Generation progress steps === */
.gen-progress {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.gen-step {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  opacity: 0.4;
  transition: all 0.3s;
}

.gen-step--active {
  color: var(--mustard);
  opacity: 1;
}

.gen-step--done {
  color: var(--poison-green);
  opacity: 0.8;
}

.gen-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: all 0.3s;
}

.gen-step--active .gen-dot {
  background: var(--mustard);
  box-shadow: 0 0 6px rgba(212, 160, 23, 0.6);
  animation: dotPulse 1s ease-in-out infinite;
}

.gen-step--done .gen-dot {
  background: var(--poison-green);
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.4); }
}
