:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.92);
  background-color: #0b0d14;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
}

html,
body,
#root {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
}
:root {
  color: #f4f5f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 32px;
  background:
    radial-gradient(circle at top, rgba(115, 99, 255, 0.2), transparent 30%),
    linear-gradient(180deg, #12131d 0%, #0a0b12 100%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  align-items: flex-start;
}

.topbar h1 {
  margin: 4px 0 10px;
  font-size: 2.25rem;
}

.subtitle {
  max-width: 760px;
  margin: 0;
  color: #bdc4d7;
  line-height: 1.6;
}

.eyebrow {
  margin: 0;
  color: #97a1c1;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  min-width: min(560px, 100%);
}

.status-strip > div,
.stat-list > div {
  border: 1px solid rgba(145, 160, 214, 0.18);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(17, 20, 31, 0.7);
}

.label {
  display: block;
  margin-bottom: 6px;
  color: #8f99b3;
  font-size: 0.82rem;
}

.capture-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.capture-toolbar-copy {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.capture-toolbar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.capture-toggle {
  white-space: nowrap;
}

.capture-chip-active {
  background: rgba(255, 190, 92, 0.16);
  color: #ffe0a8;
  border-color: rgba(255, 190, 92, 0.24);
}

.hero-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.hero-card,
.highlight-card {
  border: 1px solid rgba(145, 160, 214, 0.16);
  border-radius: 20px;
  padding: 18px;
  background: rgba(17, 21, 33, 0.72);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.metric-value {
  display: block;
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.metric-detail {
  color: #9aa6c1;
  font-size: 0.88rem;
  line-height: 1.5;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(320px, 0.95fr);
  gap: 20px;
}

.panel {
  border: 1px solid rgba(145, 160, 214, 0.18);
  border-radius: 24px;
  padding: 24px;
  background: rgba(15, 18, 28, 0.88);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.24);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-head.compact {
  margin-bottom: 8px;
}

.panel-head h2,
.subpanel h3,
.sidebar-section h3,
.ending-card h3,
.companion-card h3 {
  margin: 4px 0 0;
}

.chip {
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(115, 99, 255, 0.15);
  color: #d9d3ff;
  font-size: 0.85rem;
  border: 1px solid rgba(151, 132, 255, 0.24);
  white-space: nowrap;
}

.risk-low {
  background: rgba(55, 197, 135, 0.16);
  color: #b5f7dd;
}

.risk-medium {
  background: rgba(255, 190, 92, 0.16);
  color: #ffe0a8;
}

.risk-high {
  background: rgba(255, 110, 110, 0.16);
  color: #ffd0d0;
}

.body-copy {
  margin: 0 0 20px;
  color: #cbd2e4;
  line-height: 1.7;
}

.node-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  color: #95a1bf;
  font-size: 0.92rem;
}

.companion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 18px;
}

.companion-card,
.preset-card,
.action-button,
.primary-button,
.secondary-button,
.suspect-button,
.intent-button {
  border: 1px solid rgba(145, 160, 214, 0.2);
  background: rgba(24, 29, 44, 0.9);
  color: #f4f5f7;
  border-radius: 18px;
}

.companion-card,
.preset-card {
  text-align: left;
  padding: 18px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.companion-card:hover,
.preset-card:hover,
.action-button:hover,
.primary-button:hover,
.secondary-button:hover,
.suspect-button:hover,
.intent-button:hover {
  transform: translateY(-1px);
  border-color: rgba(164, 177, 227, 0.42);
}

.companion-card.selected {
  border-color: rgba(155, 140, 255, 0.72);
  background: rgba(52, 46, 91, 0.92);
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.card-head p,
.muted,
.trust-line {
  margin: 6px 0 0;
  color: #9eabc9;
}

.preset-actions {
  margin-top: 12px;
}

.action-row,
.action-grid,
.intent-row,
.seed-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 18px;
}

.capture-callout {
  margin-bottom: 18px;
}

.capture-body-copy {
  margin-bottom: 14px;
}

.highlight-card strong {
  display: block;
  margin-bottom: 8px;
}

.highlight-card p {
  margin: 0;
  color: #c0c8dc;
  line-height: 1.6;
}

.expedition-brief-grid {
  margin-bottom: 20px;
}

.seed-row {
  margin: 0 0 16px;
}

.seed-field,
.seed-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.seed-field input,
.seed-field select {
  min-width: 240px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(145, 160, 214, 0.18);
  background: rgba(10, 12, 20, 0.95);
  color: #f4f5f7;
}

.intent-row {
  margin-bottom: 12px;
}

.action-grid {
  margin-bottom: 20px;
}

.final-grid {
  margin-bottom: 16px;
}

.action-button,
.primary-button,
.secondary-button,
.intent-button {
  padding: 14px 16px;
}

.intent-button.active {
  border-color: rgba(121, 205, 255, 0.72);
  background: rgba(28, 54, 86, 0.95);
}

.primary-button {
  background: linear-gradient(135deg, #7d6bff 0%, #4f74ff 100%);
  border-color: transparent;
  color: white;
}

.secondary-button {
  background: rgba(14, 19, 32, 0.88);
  border-color: rgba(155, 231, 255, 0.28);
  color: #d7ecff;
}

.primary-button:disabled,
.action-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.helper-text,
.empty-state {
  color: #93a0bd;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.decision-grid,
.review-grid {
  margin-bottom: 16px;
}

.subpanel,
.ending-card,
.fact-entry {
  border: 1px solid rgba(145, 160, 214, 0.14);
  border-radius: 18px;
  background: rgba(20, 24, 37, 0.72);
}

.subpanel {
  padding: 18px;
}

.lead-panel {
  margin-bottom: 18px;
}

.lead-copy {
  margin-bottom: 14px;
}

.route-panel {
  margin-bottom: 18px;
  border: 1px solid rgba(121, 205, 255, 0.28);
  background: rgba(16, 28, 44, 0.78);
}

.route-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.route-card {
  border-color: rgba(121, 205, 255, 0.22);
  background: rgba(21, 36, 58, 0.88);
}

.route-card .primary-button {
  width: 100%;
  margin-top: 12px;
}

.lead-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.action-deck-panel {
  margin-bottom: 18px;
}

.choice-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.choice-card,
.action-card {
  text-align: left;
  border: 1px solid rgba(145, 160, 214, 0.2);
  background: rgba(24, 29, 44, 0.9);
  color: #f4f5f7;
  border-radius: 18px;
  padding: 16px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.choice-card:hover,
.action-card:hover {
  transform: translateY(-1px);
  border-color: rgba(164, 177, 227, 0.42);
}

.choice-card strong,
.action-card strong {
  display: block;
  margin-bottom: 8px;
}

.choice-card small,
.action-card small {
  display: block;
  color: #9eabc9;
  line-height: 1.5;
}

.choice-card.active {
  border-color: rgba(121, 205, 255, 0.72);
  background: rgba(28, 54, 86, 0.95);
}

.action-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.primary-action-card {
  border-color: rgba(151, 132, 255, 0.34);
  background: rgba(42, 34, 78, 0.94);
}

.advance-action-card {
  border-color: rgba(121, 205, 255, 0.34);
  background: rgba(20, 42, 66, 0.94);
}

.action-card:disabled,
.choice-card:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.lead-button {
  min-height: 88px;
}

.subpanel ul,
.sidebar-section ul {
  padding-left: 20px;
  margin: 12px 0 0;
  color: #c5ccdf;
  line-height: 1.7;
}

.companion-inline-state {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  font-size: 0.84rem;
  color: #93a1bd;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 24px;
  align-self: start;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.suspicion-card {
  padding: 14px;
  border: 1px solid rgba(145, 160, 214, 0.16);
  border-radius: 16px;
  background: rgba(24, 29, 44, 0.78);
}

.suspicion-card span,
.suspicion-card small {
  display: block;
}

.suspicion-card small {
  margin-top: 6px;
  color: #96a3bf;
  line-height: 1.5;
}

.suspicion-card.active {
  border-color: rgba(255, 138, 152, 0.42);
  background: rgba(75, 31, 47, 0.6);
}

.stat-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.suspicion-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.suspect-button {
  padding: 14px;
  text-align: left;
}

.suspect-button span,
.suspect-button small {
  display: block;
}

.suspect-button small {
  margin-top: 6px;
  color: #96a3bf;
  line-height: 1.5;
}

.suspect-button.active {
  border-color: rgba(255, 138, 152, 0.72);
  background: rgba(75, 31, 47, 0.95);
}

.fact-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.fact-entry {
  padding: 14px;
}

.fact-head {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.fact-entry p {
  margin: 8px 0 0;
  color: #d7dced;
  line-height: 1.6;
}

.fact-tag,
.confidence-tag {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.78rem;
}

.fact-tag {
  background: rgba(255, 255, 255, 0.06);
  color: #b4bdd3;
}

.confidence-tag {
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.confidence-low {
  background: rgba(255, 190, 92, 0.14);
  color: #ffdfa7;
}

.confidence-medium {
  background: rgba(104, 180, 255, 0.14);
  color: #b9dcff;
}

.confidence-high {
  background: rgba(55, 197, 135, 0.14);
  color: #bff6df;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 140px;
  border-radius: 18px;
  border: 1px solid rgba(145, 160, 214, 0.18);
  background: rgba(10, 12, 20, 0.95);
  color: #f4f5f7;
  padding: 14px;
  line-height: 1.6;
}

.ending-card {
  padding: 18px;
}

.ending-card p {
  color: #d3d9eb;
  line-height: 1.7;
}

.review-card h4,
.battle-panel h4 {
  margin: 0 0 8px;
}

.underused-clue-block {
  margin-top: 12px;
}

.battle-panel {
  margin-top: 16px;
  padding: 18px;
}

.battle-tactic-row {
  margin-bottom: 12px;
}

.battle-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.battle-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.battle-lane {
  border: 1px solid rgba(145, 160, 214, 0.14);
  border-radius: 14px;
  padding: 12px;
  background: rgba(14, 18, 28, 0.72);
}

.lane-label {
  display: block;
  margin-bottom: 8px;
  color: #8fa0c2;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.lane-units {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lane-unit {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.ally-unit {
  background: rgba(73, 138, 255, 0.14);
  color: #c8deff;
}

.enemy-unit {
  background: rgba(255, 110, 110, 0.14);
  color: #ffd2d2;
}

.capture-mode .layout {
  grid-template-columns: minmax(0, 1.9fr) minmax(280px, 0.82fr);
}

.capture-mode .subtitle {
  max-width: 620px;
}

.capture-mode .panel {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }

  .status-strip,
  .stat-list,
  .companion-grid,
  .preset-grid,
  .notes-grid,
  .hero-strip,
  .highlight-grid,
  .lead-grid,
  .route-grid,
  .choice-card-grid,
  .action-card-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 18px;
  }

  .panel {
    padding: 18px;
  }

  .topbar h1 {
    font-size: 1.8rem;
  }
}

.playable-shell {
  display: grid;
  gap: 18px;
  margin: 0 0 22px;
  border: 1px solid rgba(132, 210, 255, 0.22);
  border-radius: 28px;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, rgba(92, 219, 255, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(16, 25, 38, 0.94), rgba(10, 12, 20, 0.96));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.playable-copy h2 {
  margin: 4px 0 10px;
  font-size: clamp(1.7rem, 4vw, 3rem);
}

.playable-copy p {
  max-width: 980px;
  margin: 0;
  color: #cbd6ec;
  line-height: 1.7;
}

.control-strip,
.discovery-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.control-strip span {
  border: 1px solid rgba(132, 210, 255, 0.2);
  border-radius: 999px;
  padding: 8px 12px;
  color: #d7f2ff;
  background: rgba(67, 160, 218, 0.12);
  font-size: 0.9rem;
}

.game-board-wrap {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.tile-map {
  display: grid;
  gap: 4px;
  align-self: start;
  border: 1px solid rgba(203, 214, 236, 0.18);
  border-radius: 20px;
  padding: 12px;
  background: rgba(4, 7, 12, 0.72);
}

.tile {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 9px;
  min-width: 0;
  font-size: clamp(0.68rem, 1.5vw, 0.95rem);
  font-weight: 800;
  color: #5f6a7b;
  user-select: none;
}

.tile-wall {
  color: #2f3745;
  background: linear-gradient(145deg, #1c2432, #101722);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.tile-floor {
  background: rgba(118, 133, 162, 0.08);
}

.tile-facing {
  outline: 2px solid rgba(255, 221, 128, 0.7);
  outline-offset: -2px;
}

.tile-player {
  color: #061018;
  background: linear-gradient(135deg, #8ee7ff, #fff2a8);
  box-shadow: 0 0 18px rgba(142, 231, 255, 0.36);
}

.tile-clue,
.tile-companion,
.tile-exit,
.tile-threat {
  color: #f7fbff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tile-clue {
  background: rgba(255, 205, 96, 0.22);
}

.tile-companion {
  background: rgba(115, 99, 255, 0.28);
}

.tile-exit {
  background: rgba(55, 197, 135, 0.24);
}

.tile-threat {
  background: rgba(255, 110, 110, 0.22);
}

.tile-discovered {
  box-shadow: inset 0 0 0 2px rgba(142, 231, 255, 0.4);
}

.interaction-panel,
.mafia-run-panel,
.run-vision-grid article {
  border: 1px solid rgba(203, 214, 236, 0.16);
  border-radius: 20px;
  padding: 18px;
  background: rgba(9, 13, 22, 0.68);
}

.interaction-panel p,
.mafia-run-panel p,
.run-vision-grid p,
.log-box p {
  color: #c8d1e4;
  line-height: 1.65;
}

.compact-card-head {
  margin: 6px 0 10px;
}

.prompt-line {
  color: #fff0b5 !important;
}

.log-box {
  margin-top: 16px;
  border-top: 1px solid rgba(203, 214, 236, 0.12);
  padding-top: 14px;
}

.run-vision-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mafia-run-panel {
  display: grid;
  gap: 14px;
  border-color: rgba(255, 190, 92, 0.2);
  background: rgba(18, 14, 24, 0.72);
}

.mafia-run-panel > div:first-child strong {
  display: block;
  color: #ffe2ad;
  font-size: 1.1rem;
}

.suspicion-meter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.suspicion-meter-grid .suspect-button {
  min-height: 118px;
}

.run-vision-grid strong {
  display: block;
  margin: 4px 0 8px;
  color: #eef5ff;
}

@media (max-width: 1080px) {
  .game-board-wrap,
  .run-vision-grid,
  .suspicion-meter-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .playable-shell {
    padding: 16px;
  }

  .game-board-wrap {
    grid-template-columns: 1fr;
  }

  .tile-map {
    gap: 3px;
    padding: 8px;
  }
}

.game-shell {
  min-height: 100vh;
  padding: 24px;
  color: #f4f5f7;
  background:
    radial-gradient(circle at 20% 10%, rgba(85, 134, 255, 0.24), transparent 28%),
    radial-gradient(circle at 82% 24%, rgba(255, 122, 98, 0.16), transparent 26%),
    linear-gradient(180deg, #070910 0%, #0c101a 54%, #05060a 100%);
}

.game-top-hud {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
}

.game-top-hud h1 {
  margin: 6px 0 0;
  font-size: clamp(2rem, 5vw, 4.2rem);
  letter-spacing: -0.06em;
}


.game-stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(112px, 1fr));
  gap: 10px;
  min-width: min(640px, 100%);
}

.game-stat-row > div,
.game-side-hud > section,
.game-canvas-card {
  border: 1px solid rgba(179, 205, 255, 0.16);
  background: rgba(9, 13, 24, 0.78);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
}

.game-stat-row > div {
  border-radius: 16px;
  padding: 12px 14px;
}

.game-stat-row span,
.game-stat-row strong {
  display: block;
}

.game-stat-row span {
  color: #8d9bb7;
  font-size: 0.78rem;
  margin-bottom: 5px;
}

.game-screen-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  gap: 18px;
  align-items: stretch;
}

.game-canvas-card {
  min-height: calc(100vh - 156px);
  border-radius: 28px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.phaser-host {
  width: 100%;
  height: 100%;
  min-height: 640px;
  display: grid;
  place-items: center;
  background: #05060b;
}

.phaser-host canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

.game-side-hud {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.game-side-hud > section {
  border-radius: 22px;
  padding: 18px;
}

.game-side-hud h2 {
  margin: 4px 0 10px;
  font-size: 1.2rem;
}

.game-side-hud p {
  color: #c2ccdf;
  line-height: 1.65;
}

.hud-log-card strong {
  display: block;
  margin: 4px 0 8px;
  color: #ffe3a8;
}

.hud-suspect-list {
  display: grid;
  gap: 10px;
}

.hud-suspect {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  width: 100%;
  border: 1px solid rgba(179, 205, 255, 0.16);
  border-radius: 16px;
  padding: 13px;
  color: #f4f5f7;
  background: rgba(24, 31, 48, 0.8);
  text-align: left;
}

.hud-suspect strong {
  color: #ffcf7a;
}

.hud-suspect small {
  grid-column: 1 / -1;
  color: #9ba9c4;
  line-height: 1.45;
}

.hud-suspect.active {
  border-color: rgba(255, 120, 132, 0.72);
  background: rgba(83, 34, 49, 0.76);
}

.hud-suspect:disabled {
  cursor: not-allowed;
}

.hud-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hud-controls span {
  border-radius: 999px;
  padding: 8px 10px;
  color: #d7ecff;
  background: rgba(110, 176, 255, 0.12);
  border: 1px solid rgba(110, 176, 255, 0.18);
  font-size: 0.86rem;
}

@media (max-width: 1180px) {
  .game-top-hud {
    align-items: stretch;
    flex-direction: column;
  }

  .game-screen-grid {
    grid-template-columns: 1fr;
  }

  .game-stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .game-shell {
    padding: 14px;
  }

  .game-stat-row {
    grid-template-columns: 1fr;
  }

  .phaser-host {
    min-height: 420px;
  }
}

/* Main Phaser play screen redesign */
.game-shell-redesign {
  padding: 14px 18px 18px;
}

.play-status-bar {
  display: grid;
  grid-template-columns: auto minmax(170px, 1.35fr) repeat(5, minmax(96px, 1fr));
  gap: 10px;
  align-items: stretch;
  margin-bottom: 12px;
}

.play-status-bar > div,
.play-status-bar .compact-link {
  border: 1px solid rgba(179, 205, 255, 0.16);
  border-radius: 14px;
  background: rgba(9, 13, 24, 0.74);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(10px);
}

.play-status-bar > div {
  padding: 10px 13px;
}

.play-status-bar span,
.side-section-head .label {
  display: block;
  color: #8f9fbd;
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.play-status-bar strong {
  display: block;
  color: #f5f8ff;
  font-size: 1rem;
}

.compact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  margin: 0;
  color: #c7f1ff;
  background: rgba(53, 143, 185, 0.14);
}

.play-layout-redesign {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: 12px;
}

.play-canvas-card {
  min-height: calc(100vh - 92px);
  border-radius: 22px;
}

.play-canvas-card .phaser-host {
  min-height: calc(100vh - 92px);
}

.play-side-hud {
  gap: 10px;
}

.play-side-hud > section {
  border-radius: 18px;
  padding: 15px;
}

.mission-card h1 {
  margin: 2px 0 8px;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.mission-card p,
.deduction-card p,
.suspect-panel p {
  margin: 0;
  line-height: 1.55;
}

.seal-pressure-note {
  margin-top: 10px !important;
  border: 1px solid rgba(255, 227, 168, 0.18);
  border-radius: 12px;
  padding: 9px 10px;
  color: #ffe8ba;
  background: rgba(255, 190, 92, 0.1);
}

.seal-pressure-note.calm {
  border-color: rgba(111, 240, 168, 0.24);
  color: #c8ffe4;
  background: rgba(37, 100, 70, 0.16);
}

.seal-pressure-note.critical {
  border-color: rgba(255, 107, 119, 0.32);
  color: #ffd0d5;
  background: rgba(133, 38, 52, 0.2);
}

.objective-list {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.objective-list li {
  position: relative;
  border: 1px solid rgba(179, 205, 255, 0.13);
  border-radius: 12px;
  padding: 8px 10px 8px 30px;
  color: #c9d3e8;
  background: rgba(20, 27, 42, 0.62);
}

.objective-list li::before {
  content: '□';
  position: absolute;
  left: 10px;
  color: #8795b4;
}

.objective-list li.done {
  color: #c8ffe4;
  border-color: rgba(73, 211, 138, 0.32);
  background: rgba(37, 100, 70, 0.22);
}

.objective-list li.done::before {
  content: '✓';
  color: #6ff0a8;
}

.deduction-note {
  margin-top: 12px;
  border-top: 1px solid rgba(179, 205, 255, 0.12);
  padding-top: 10px;
}

.deduction-note span {
  display: block;
  margin-bottom: 5px;
  color: #ffe3a8;
  font-size: 0.84rem;
  font-weight: 700;
}

.seal-pressure-event-log {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 119, 139, 0.28);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 102, 122, 0.16), rgba(255, 196, 111, 0.08)),
    rgba(24, 13, 22, 0.62);
  color: #ffe6db;
  box-shadow: inset 0 0 18px rgba(255, 102, 122, 0.08);
}

.seal-pressure-event-log span {
  display: block;
  margin-bottom: 4px;
  color: #ffcf7a;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.seal-pressure-event-log p {
  margin: 0;
  color: #ffe6db;
  font-size: 0.9rem;
  line-height: 1.5;
}

.side-section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 10px;
}

.side-section-head strong {
  color: #ffe3a8;
  font-size: 0.92rem;
}

.hud-suspect {
  position: relative;
  overflow: hidden;
  padding-bottom: 18px;
}

.hud-suspect i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  display: block;
  background: linear-gradient(90deg, #ffcf7a, #ff667a);
  opacity: 0.95;
}

.hud-suspect:disabled {
  opacity: 0.86;
}

.hud-suspect:disabled:hover {
  transform: none;
}

.ready-text {
  color: #baffd5 !important;
}

.run-result-card {
  border-color: rgba(118, 232, 164, 0.32) !important;
  background:
    radial-gradient(circle at top left, rgba(118, 232, 164, 0.18), transparent 34%),
    rgba(13, 23, 25, 0.86) !important;
}

.run-result-card.collapsed {
  border-color: rgba(255, 108, 124, 0.34) !important;
  background:
    radial-gradient(circle at top left, rgba(255, 108, 124, 0.18), transparent 34%),
    rgba(28, 13, 22, 0.86) !important;
}

.run-result-card h2 {
  margin: 0 0 8px;
  color: #f5f8ff;
  font-size: 1.25rem;
}

.result-fact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.result-grade-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 8px;
  border: 1px solid rgba(255, 218, 121, 0.24);
  border-radius: 14px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(255, 218, 121, 0.14), rgba(110, 176, 255, 0.08));
}

.result-grade-row strong {
  color: #ffe08a;
  font-size: 1.08rem;
}

.result-grade-row span,
.route-summary {
  color: #c8d7ff;
  font-size: 0.86rem;
}

.route-summary {
  margin: 0 0 8px;
}

.result-fact-grid div {
  border: 1px solid rgba(179, 205, 255, 0.14);
  border-radius: 12px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.05);
}

.result-fact-grid span {
  display: block;
  margin-bottom: 4px;
  color: #9aa8c4;
  font-size: 0.78rem;
}

.run-result-next {
  margin: 0 0 12px;
  color: #c8d7ff;
  font-size: 0.86rem;
}

.result-evidence-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}

.result-evidence-columns div {
  border: 1px solid rgba(179, 205, 255, 0.12);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(4, 9, 18, 0.26);
}

.result-evidence-columns span {
  display: block;
  margin-bottom: 5px;
  color: #9aa8c4;
  font-size: 0.78rem;
  font-weight: 800;
}

.result-evidence-columns ul {
  margin: 0;
  padding-left: 16px;
  color: #e5ecff;
  font-size: 0.8rem;
}

.result-evidence-columns li + li {
  margin-top: 3px;
}

.run-result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.restart-run-button,
.new-run-button {
  width: 100%;
  padding: 11px 14px;
  font-weight: 800;
}

.restart-run-button {
  color: #d7ecff;
}

.new-run-button {
  color: #071018;
  background: linear-gradient(135deg, #9be7ff, #7dffb2);
  border-color: rgba(255, 255, 255, 0.35);
}

.play-control-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.play-control-bar span {
  border: 1px solid rgba(110, 176, 255, 0.18);
  border-radius: 999px;
  padding: 7px 11px;
  color: #d7ecff;
  background: rgba(110, 176, 255, 0.1);
  font-size: 0.84rem;
}

@media (max-width: 1180px) {
  .play-status-bar,
  .play-layout-redesign {
    grid-template-columns: 1fr;
  }

  .play-canvas-card,
  .play-canvas-card .phaser-host {
    min-height: 560px;
  }
}

.play-layout-redesign {
  align-items: start;
}

.play-canvas-card,
.play-canvas-card .phaser-host {
  min-height: 720px;
}

.play-side-hud > section {
  padding: 13px 14px;
}

.play-side-hud p,
.objective-list li,
.hud-suspect small {
  font-size: 0.92rem;
}

@media (min-height: 980px) and (min-width: 1181px) {
  .play-canvas-card,
  .play-canvas-card .phaser-host {
    min-height: 760px;
  }
}

.play-side-hud {
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  padding-right: 3px;
}

.play-canvas-card,
.play-canvas-card .phaser-host {
  min-height: 680px;
}

@media (min-height: 980px) and (min-width: 1181px) {
  .play-canvas-card,
  .play-canvas-card .phaser-host {
    min-height: 720px;
  }
}

.play-side-hud {
  gap: 7px;
}

.play-side-hud > section {
  padding: 10px 12px;
}

.mission-card h1 {
  font-size: clamp(1.18rem, 1.7vw, 1.45rem);
  margin-bottom: 6px;
}

.objective-list {
  gap: 5px;
  margin-top: 8px;
}

.objective-list li {
  padding-top: 6px;
  padding-bottom: 6px;
}

.deduction-note {
  margin-top: 8px;
  padding-top: 8px;
}

.hud-suspect {
  padding-top: 8px;
  padding-bottom: 14px;
}

.suspect-panel .helper-text {
  margin-top: 8px;
}

.deduction-board-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 6, 14, 0.72);
  backdrop-filter: blur(8px);
}

.deduction-board-card {
  width: min(780px, 94vw);
  max-height: min(760px, 90vh);
  overflow: auto;
  border: 1px solid rgba(170, 207, 255, 0.24);
  border-radius: 24px;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 0%, rgba(94, 166, 255, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(13, 18, 32, 0.98), rgba(5, 8, 17, 0.98));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.48);
}

.board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.board-head h2 {
  margin: 4px 0 0;
  color: #f6f8ff;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  letter-spacing: -0.04em;
}

.board-head button {
  border: 1px solid rgba(179, 205, 255, 0.2);
  border-radius: 999px;
  padding: 8px 13px;
  color: #e6f1ff;
  background: rgba(110, 176, 255, 0.12);
}

.board-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.board-summary-grid div {
  border: 1px solid rgba(179, 205, 255, 0.15);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.board-summary-grid span,
.evidence-board-entry span {
  display: block;
  color: #93a4c0;
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.board-summary-grid strong {
  color: #ffe3a8;
  font-size: 1.12rem;
}

.evidence-board-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.evidence-board-entry {
  border: 1px solid rgba(179, 205, 255, 0.13);
  border-radius: 16px;
  padding: 12px;
  background: rgba(12, 17, 29, 0.86);
}

.evidence-board-entry.found {
  border-color: rgba(102, 235, 162, 0.34);
  background: rgba(30, 82, 59, 0.36);
}

.evidence-board-entry strong {
  display: block;
  color: #f3f6ff;
  margin-bottom: 5px;
}

.evidence-board-entry small {
  color: #b8c5db;
  line-height: 1.4;
}

.board-footer-note {
  margin: 14px 0 0;
  color: #cbd8f0;
  line-height: 1.55;
}

@media (max-width: 720px) {
  .board-summary-grid,
  .evidence-board-list {
    grid-template-columns: 1fr;
  }

  .deduction-board-overlay {
    padding: 12px;
  }
}

.investigation-detail-card {
  border-color: rgba(255, 211, 128, 0.26) !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 207, 122, 0.14), transparent 42%),
    rgba(17, 15, 25, 0.82) !important;
}

.investigation-detail-card h2 {
  margin: 2px 0 8px;
  color: #f8f1df;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.detail-deduction-line {
  margin-top: 8px;
  border-left: 3px solid rgba(255, 207, 122, 0.58);
  padding: 7px 9px;
  color: #ffe6ae;
  background: rgba(255, 207, 122, 0.08);
  border-radius: 0 10px 10px 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.detail-impact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.detail-impact-row span {
  border: 1px solid rgba(255, 124, 139, 0.26);
  border-radius: 999px;
  padding: 5px 8px;
  color: #ffd8dc;
  background: rgba(255, 124, 139, 0.12);
  font-size: 0.78rem;
  font-weight: 700;
}

.evidence-board-entry {
  display: block;
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.evidence-board-entry:hover,
.evidence-board-entry.active {
  border-color: rgba(255, 207, 122, 0.54);
  transform: translateY(-1px);
}

.board-detail-panel {
  margin-top: 12px;
  border: 1px solid rgba(255, 207, 122, 0.24);
  border-radius: 18px;
  padding: 13px;
  background: rgba(255, 207, 122, 0.08);
}

.board-detail-panel span,
.board-detail-panel small {
  display: block;
  color: #bfcbe2;
  line-height: 1.45;
}

.board-detail-panel strong {
  display: block;
  margin: 4px 0 7px;
  color: #ffe3a8;
  font-size: 1.05rem;
}

.board-detail-panel p {
  margin: 0 0 7px;
  color: #eef3ff;
  line-height: 1.55;
}
/* Solo mafia deduction feel redesign */
.case-brief-card {
  border-color: rgba(255, 207, 122, 0.2) !important;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 207, 122, 0.12), transparent 42%),
    rgba(12, 16, 27, 0.84) !important;
}

.case-thread-panel,
.psychology-panel,
.accusation-brief-card {
  border: 1px solid rgba(131, 164, 255, 0.22) !important;
  background:
    radial-gradient(circle at 8% 0%, rgba(101, 133, 255, 0.12), transparent 40%),
    rgba(10, 15, 28, 0.86) !important;
}

.case-thread-list,
.board-thread-list,
.psychology-read-list {
  display: grid;
  gap: 8px;
}

.board-thread-list {
  margin-bottom: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.case-thread {
  border: 1px solid rgba(179, 205, 255, 0.13);
  border-radius: 14px;
  padding: 10px 11px;
  background: rgba(11, 17, 31, 0.82);
}

.case-thread div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.case-thread strong {
  color: #f4f8ff;
  font-size: 0.9rem;
}

.case-thread span {
  border-radius: 999px;
  padding: 4px 7px;
  color: #c7d6f4;
  background: rgba(179, 205, 255, 0.1);
  font-size: 0.72rem;
  white-space: nowrap;
}

.case-thread p {
  margin: 0;
  color: #b9c5dd;
  font-size: 0.82rem;
  line-height: 1.42;
}

.case-thread small {
  display: block;
  margin-top: 6px;
  color: #ffe3a8;
  font-size: 0.76rem;
  line-height: 1.35;
}

.case-thread.open {
  border-color: rgba(255, 207, 122, 0.28);
  background: rgba(42, 31, 16, 0.48);
}

.case-thread.resolved {
  border-color: rgba(116, 241, 170, 0.36);
  background: rgba(20, 62, 44, 0.5);
}

.case-thread.resolved span {
  color: #baffd5;
  background: rgba(116, 241, 170, 0.12);
}

.psychology-read {
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  min-height: 108px;
  border-left: 4px solid rgba(145, 160, 214, 0.22);
}

.psychology-read strong {
  color: #d8e3ff;
  font-size: 0.9rem;
}

.psychology-read em {
  grid-column: 1 / -1;
  color: #ffe3a8;
  font-size: 0.78rem;
  font-style: normal;
  line-height: 1.35;
}

.psychology-read.guarded {
  border-left-color: rgba(255, 207, 122, 0.72);
}

.psychology-read.cornered {
  border-left-color: rgba(255, 102, 122, 0.84);
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 102, 122, 0.16), transparent 38%),
    rgba(52, 22, 34, 0.82);
}

.psychology-read.cornered strong {
  color: #ffd0d5;
}

.accusation-brief-card {
  display: grid;
  gap: 10px;
}

.accusation-brief-card > p {
  margin: 0;
  color: #b9c5dd;
  font-size: 0.84rem;
  line-height: 1.45;
}

.accusation-brief-card label {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #cbd8f0;
  font-size: 0.78rem;
}

.accusation-brief-card select {
  width: 100%;
  border: 1px solid rgba(179, 205, 255, 0.18);
  border-radius: 10px;
  padding: 8px 10px;
  color: #eef4ff;
  background: rgba(6, 10, 20, 0.86);
}

.brief-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.brief-status-list span,
.brief-warning-list li {
  border-radius: 999px;
  padding: 5px 8px;
  color: #dce7ff;
  background: rgba(179, 205, 255, 0.1);
  font-size: 0.72rem;
}

.brief-warning-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.brief-warning-list li {
  border: 1px solid rgba(255, 207, 122, 0.24);
  color: #ffe3a8;
  background: rgba(75, 50, 17, 0.38);
}

.accusation-submit-button {
  width: 100%;
}

@media (max-width: 720px) {
  .board-thread-list {
    grid-template-columns: 1fr;
  }
}
.psychology-thread-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.thread-chip {
  border: 1px solid rgba(179, 205, 255, 0.14);
  border-radius: 999px;
  padding: 5px 8px;
  color: #cbd8f0;
  background: rgba(179, 205, 255, 0.08);
  font-size: 0.72rem;
  line-height: 1.2;
}

.thread-chip.open {
  border-color: rgba(255, 207, 122, 0.3);
  color: #ffe3a8;
  background: rgba(255, 207, 122, 0.1);
}

.thread-chip.resolved {
  border-color: rgba(116, 241, 170, 0.34);
  color: #baffd5;
  background: rgba(116, 241, 170, 0.1);
}
.psychology-read {
  min-height: 94px;
}

.psychology-read small {
  font-size: 0.84rem;
  line-height: 1.32;
}

.psychology-read em {
  font-size: 0.74rem;
}

/* Game client UI reset: make Phaser the screen, not a card in a webpage. */
.game-client-shell {
  min-height: 100vh;
  overflow: hidden;
  color: #f4f5f7;
  background: #03050b;
}

.game-stage {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 16%, rgba(66, 96, 163, 0.28), transparent 38%),
    linear-gradient(180deg, #050711 0%, #02030a 100%);
}

.game-stage .phaser-host {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  display: block;
  background: #03050b;
}

.game-stage .phaser-host canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

.game-stage-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.scene-plate,
.seal-plate,
.objective-plate,
.investigation-dock,
.stage-action-stack button,
.game-modal-card {
  border: 1px solid rgba(181, 211, 255, 0.18);
  background: rgba(4, 8, 17, 0.68);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
}

.scene-plate,
.seal-plate,
.objective-plate {
  position: absolute;
  pointer-events: auto;
  border-radius: 18px;
  padding: 12px 15px;
}

.scene-plate {
  top: 18px;
  left: 18px;
  max-width: min(420px, calc(100vw - 36px));
}

.seal-plate {
  top: 18px;
  right: 18px;
  min-width: 164px;
  text-align: right;
}

.objective-plate {
  top: 18px;
  left: 50%;
  width: min(420px, 42vw);
  transform: translateX(-50%);
  text-align: center;
}

.scene-plate span,
.seal-plate span,
.objective-plate span,
.dock-speaker span,
.modal-head .label {
  display: block;
  margin-bottom: 4px;
  color: #8ea0bf;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scene-plate strong,
.seal-plate strong,
.objective-plate strong,
.dock-speaker strong {
  display: block;
  color: #f7fbff;
  line-height: 1.12;
}

.scene-plate strong {
  font-size: clamp(1.25rem, 2.5vw, 2.15rem);
  letter-spacing: -0.05em;
}

.scene-plate small,
.seal-plate small {
  display: block;
  margin-top: 5px;
  color: #b7c6df;
  line-height: 1.35;
}

.seal-plate.calm {
  border-color: rgba(105, 238, 164, 0.28);
}

.seal-plate.warning {
  border-color: rgba(255, 208, 112, 0.34);
}

.seal-plate.critical {
  border-color: rgba(255, 105, 126, 0.46);
  background: rgba(43, 10, 20, 0.72);
}

.stage-action-stack {
  position: absolute;
  right: 18px;
  top: 132px;
  display: grid;
  gap: 10px;
  pointer-events: auto;
}

.stage-action-stack button {
  min-width: 142px;
  border-radius: 999px;
  padding: 10px 13px;
  color: #e6f4ff;
  font-weight: 800;
  text-align: left;
}

.stage-action-stack button span {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  margin-right: 8px;
  border-radius: 999px;
  padding: 3px 7px;
  color: #08111c;
  background: #9be7ff;
  font-size: 0.78rem;
}

.investigation-dock {
  position: absolute;
  left: 50%;
  bottom: 20px;
  width: min(880px, calc(100vw - 40px));
  transform: translateX(-50%);
  border-radius: 24px;
  padding: 16px 18px 14px;
  pointer-events: auto;
}

.investigation-dock p {
  margin: 8px 0 12px;
  color: #eef3ff;
  font-size: clamp(1rem, 1.45vw, 1.24rem);
  line-height: 1.55;
}

.dock-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.dock-meta-row span {
  border: 1px solid rgba(155, 231, 255, 0.18);
  border-radius: 999px;
  padding: 5px 8px;
  color: #c8eaff;
  background: rgba(155, 231, 255, 0.08);
  font-size: 0.78rem;
  font-weight: 700;
}

.game-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(1, 3, 9, 0.72);
  backdrop-filter: blur(8px);
}

.result-backdrop {
  z-index: 55;
}

.game-modal-card {
  width: min(780px, 94vw);
  max-height: min(820px, 92vh);
  overflow: auto;
  border-radius: 28px;
  padding: 22px;
  background:
    radial-gradient(circle at 12% 0%, rgba(111, 167, 255, 0.16), transparent 38%),
    rgba(6, 10, 20, 0.94);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.modal-head h2 {
  margin: 2px 0 0;
  color: #f6f8ff;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  letter-spacing: -0.05em;
}

.modal-head button {
  border: 1px solid rgba(179, 205, 255, 0.2);
  border-radius: 999px;
  padding: 8px 13px;
  color: #e6f1ff;
  background: rgba(110, 176, 255, 0.12);
}

.accusation-dossier-card > p,
.accusation-dossier-card .helper-text {
  color: #cbd8f0;
  line-height: 1.6;
}

.accusation-dossier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.accusation-dossier-grid label {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(179, 205, 255, 0.13);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.accusation-dossier-grid label span {
  color: #ffe3a8;
  font-size: 0.84rem;
  font-weight: 800;
}

.accusation-dossier-grid select {
  width: 100%;
  border: 1px solid rgba(179, 205, 255, 0.18);
  border-radius: 12px;
  padding: 10px 11px;
  color: #eef4ff;
  background: rgba(6, 10, 20, 0.9);
}

.dossier-selected-list {
  margin-bottom: 12px;
}

.case-file-card {
  width: min(1040px, 94vw);
}

@media (max-width: 900px) {
  .objective-plate {
    display: none;
  }

  .seal-plate {
    top: 96px;
    left: 18px;
    right: auto;
    text-align: left;
  }

  .stage-action-stack {
    top: 18px;
  }

  .investigation-dock {
    bottom: 14px;
  }

  .accusation-dossier-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .scene-plate,
  .seal-plate,
  .stage-action-stack {
    left: 12px;
    right: 12px;
  }

  .seal-plate {
    top: 96px;
  }

  .stage-action-stack {
    top: auto;
    bottom: 178px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage-action-stack button {
    min-width: 0;
    text-align: center;
  }

  .stage-action-stack button span {
    display: none;
  }

  .investigation-dock {
    width: calc(100vw - 24px);
    padding: 13px;
  }
}

/* Finished game UI layer: dossier cards, case-file polish, and modal presentation. */
.game-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.36), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.34)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.22), transparent 26%, transparent 66%, rgba(0, 0, 0, 0.42));
}

.game-stage-overlay {
  z-index: 6;
}

.scene-plate,
.seal-plate,
.objective-plate,
.investigation-dock {
  border-color: rgba(214, 226, 255, 0.2);
  background:
    linear-gradient(135deg, rgba(11, 18, 32, 0.78), rgba(4, 7, 15, 0.62));
}

.objective-plate {
  border-color: rgba(255, 210, 124, 0.22);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 210, 124, 0.1), transparent 60%),
    rgba(5, 8, 15, 0.68);
}

.stage-action-stack button:hover,
.modal-head button:hover,
.evidence-token:hover,
.dossier-suspect-card:hover {
  transform: translateY(-1px);
  border-color: rgba(155, 231, 255, 0.52);
}

.investigation-dock {
  border-color: rgba(255, 224, 160, 0.2);
  background:
    linear-gradient(180deg, rgba(17, 22, 34, 0.9), rgba(5, 8, 16, 0.82));
}

.investigation-dock::before {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 230, 174, 0.55), transparent);
}

.accusation-dossier-card {
  width: min(1120px, 96vw);
  padding: 26px;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 210, 124, 0.16), transparent 32%),
    radial-gradient(circle at 100% 8%, rgba(116, 151, 255, 0.18), transparent 34%),
    rgba(5, 8, 17, 0.96);
}

.accusation-dossier-card > p {
  margin: 0 0 18px;
  max-width: 760px;
  color: #d2ddf4;
  font-size: 1rem;
}

.dossier-section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.dossier-section-title span {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  border: 1px solid rgba(255, 224, 160, 0.22);
  border-radius: 999px;
  padding: 3px 7px;
  color: #ffe3a8;
  background: rgba(255, 207, 122, 0.08);
  font-size: 0.72rem;
  font-weight: 900;
}

.dossier-section-title strong {
  color: #f7fbff;
  font-size: 1rem;
}

.dossier-section-title small {
  margin-left: auto;
  color: #95a7c4;
  font-size: 0.78rem;
}

.culprit-select-board,
.proof-slot-card {
  border: 1px solid rgba(179, 205, 255, 0.13);
  border-radius: 22px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.suspect-card-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dossier-suspect-card {
  min-height: 142px;
  border: 1px solid rgba(179, 205, 255, 0.16);
  border-left: 4px solid rgba(155, 169, 214, 0.35);
  border-radius: 18px;
  padding: 13px;
  color: #eaf1ff;
  background: rgba(12, 18, 32, 0.84);
  text-align: left;
}

.dossier-suspect-card.guarded {
  border-left-color: rgba(255, 207, 122, 0.82);
}

.dossier-suspect-card.cornered {
  border-left-color: rgba(255, 102, 122, 0.92);
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 102, 122, 0.14), transparent 40%),
    rgba(36, 18, 30, 0.88);
}

.dossier-suspect-card.selected,
.evidence-token.selected {
  border-color: rgba(125, 255, 178, 0.66);
  box-shadow:
    0 0 0 1px rgba(125, 255, 178, 0.16),
    0 16px 36px rgba(37, 190, 120, 0.16);
}

.dossier-suspect-card span,
.dossier-suspect-card small,
.evidence-token span,
.evidence-token small {
  display: block;
  color: #97a8c4;
  font-size: 0.76rem;
  line-height: 1.35;
}

.dossier-suspect-card strong,
.evidence-token strong {
  display: block;
  margin: 7px 0;
  color: #fff5d8;
  font-size: 1.08rem;
}

.proof-chain-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.proof-slot-card.filled {
  border-color: rgba(125, 255, 178, 0.28);
  background:
    radial-gradient(circle at 0% 0%, rgba(125, 255, 178, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.045);
}

.evidence-token-list {
  display: grid;
  gap: 8px;
}

.evidence-token {
  width: 100%;
  min-height: 94px;
  border: 1px solid rgba(179, 205, 255, 0.13);
  border-radius: 15px;
  padding: 11px;
  color: #edf4ff;
  background: rgba(8, 13, 24, 0.82);
  text-align: left;
}

.evidence-token.증언 {
  border-color: rgba(145, 133, 255, 0.26);
}

.evidence-token.단서 {
  border-color: rgba(255, 211, 102, 0.24);
}

.evidence-token.출구 {
  border-color: rgba(73, 211, 138, 0.28);
}

.empty-proof-note {
  margin: 0;
  border: 1px dashed rgba(179, 205, 255, 0.2);
  border-radius: 14px;
  padding: 13px;
  color: #9facbf;
  background: rgba(5, 8, 16, 0.42);
  line-height: 1.45;
}

.proof-chain-summary {
  border: 1px solid rgba(255, 224, 160, 0.16);
  border-radius: 16px;
  padding: 10px;
  background: rgba(255, 207, 122, 0.06);
}

.case-file-card {
  padding: 24px;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 210, 124, 0.12), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(110, 176, 255, 0.14), transparent 32%),
    linear-gradient(145deg, rgba(11, 15, 27, 0.98), rgba(4, 7, 14, 0.98));
}

.case-file-card .board-summary-grid div,
.case-file-card .case-thread,
.case-file-card .evidence-board-entry,
.case-file-card .board-detail-panel {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.case-file-card .evidence-board-entry.missing {
  opacity: 0.62;
}

.game-modal-card.run-result-card {
  width: min(920px, 94vw);
  padding: 28px;
}

.game-modal-card.run-result-card h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -0.06em;
}

@media (max-width: 980px) {
  .suspect-card-row,
  .proof-chain-board {
    grid-template-columns: 1fr;
  }

  .dossier-section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .dossier-section-title small {
    margin-left: 0;
  }
}

/* Compact dossier fit for 16:9 captures and gamepad-distance readability. */
.accusation-dossier-card {
  max-height: min(700px, 92vh);
  padding: 22px;
}

.accusation-dossier-card .modal-head {
  margin-bottom: 10px;
}

.accusation-dossier-card .modal-head h2 {
  font-size: clamp(1.45rem, 3vw, 2.45rem);
}

.accusation-dossier-card > p {
  margin-bottom: 12px;
}

.culprit-select-board,
.proof-slot-card {
  padding: 12px;
}

.dossier-suspect-card {
  min-height: 118px;
  padding: 11px;
}

.dossier-suspect-card strong,
.evidence-token strong {
  margin: 5px 0;
  font-size: 1rem;
}

.proof-chain-board {
  gap: 10px;
  margin: 12px 0 10px;
}

.evidence-token-list {
  max-height: 250px;
  overflow: auto;
  padding-right: 2px;
}

.evidence-token {
  min-height: 72px;
  padding: 9px 10px;
}

.proof-chain-summary {
  margin-bottom: 8px;
  padding: 8px;
}

.accusation-dossier-card .helper-text {
  margin: 8px 0;
}

/* Keep the final accusation action visible even when the dossier scrolls. */
.accusation-dossier-card .accusation-submit-button {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin-top: 8px;
  box-shadow: 0 -12px 28px rgba(5, 8, 17, 0.72);
}

.accusation-dossier-card .brief-warning-list,
.accusation-dossier-card .helper-text,
.accusation-dossier-card .proof-chain-summary {
  font-size: 0.82rem;
}

@media (min-width: 1100px) {
  .accusation-dossier-card {
    max-height: 86vh;
  }
}
