:root {
  --ink: #101419;
  --ink-soft: #171d23;
  --ink-raised: #202831;
  --paper: #eee9dd;
  --paper-muted: #b7b4ab;
  --paper-dim: #777b7a;
  --amber: #d7a451;
  --amber-bright: #f0c777;
  --amber-dark: #8b6430;
  --teal: #87b6ad;
  --teal-bright: #b8dbd2;
  --red: #a84c49;
  --line: rgba(238, 233, 221, 0.14);
  --line-strong: rgba(238, 233, 221, 0.26);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
  color-scheme: dark;
  font-family: var(--sans);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 74% 10%, rgba(62, 94, 97, 0.12), transparent 38%),
    var(--ink);
  color: var(--paper);
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--amber-bright);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.page-grain {
  position: fixed;
  z-index: 1000;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: soft-light;
  background-image:
    repeating-radial-gradient(circle at 22% 17%, transparent 0 2px, rgba(255, 255, 255, 0.09) 3px 4px),
    repeating-linear-gradient(91deg, transparent 0 4px, rgba(0, 0, 0, 0.08) 5px);
  background-size: 13px 17px, 19px 23px;
}

.kicker,
.eyebrow {
  margin: 0;
  color: var(--amber-bright);
  font-size: 0.63rem;
  font-weight: 750;
  letter-spacing: 0.19em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.eyebrow::before {
  width: 2.7rem;
  height: 1px;
  content: "";
  background: currentColor;
}

.primary-button,
.secondary-button,
.text-button,
.icon-button,
.think-button,
.notebook-think,
.footer-button,
.leave-thinking,
.hint-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 0.75rem 1.2rem;
  border: 1px solid var(--amber-bright);
  background: var(--amber);
  color: #18140d;
  font-size: 0.69rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--amber-bright);
  box-shadow: 0 12px 28px rgba(215, 164, 81, 0.17);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
  filter: saturate(0.4);
}

.secondary-button {
  min-height: 3rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--paper-muted);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--paper-muted);
  background: rgba(255, 255, 255, 0.035);
  color: var(--paper);
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.32;
}

/* Title */

.title-screen {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
}

.title-backdrop,
.ending-backdrop {
  position: absolute;
  background: url("assets/music-room.png") center / cover no-repeat;
}

.title-backdrop {
  inset: -12%;
  animation: room-survey 30s ease-in-out infinite alternate;
  animation-delay: -6s;
  backface-visibility: hidden;
  will-change: transform;
}

.ending-backdrop {
  inset: -2rem;
}

.title-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 9, 12, 0.94) 0%, rgba(6, 9, 12, 0.67) 48%, rgba(6, 9, 12, 0.35) 100%),
    linear-gradient(0deg, rgba(6, 9, 12, 0.8), transparent 42%);
}

.title-content {
  position: relative;
  width: min(1120px, calc(100% - 3rem));
  margin-top: -2vh;
  transition: opacity 700ms ease, filter 700ms ease, transform 700ms ease;
}

.title-screen.gated .title-content,
.title-screen.gated .title-credit {
  opacity: 0.13;
  filter: blur(7px);
  pointer-events: none;
  transform: scale(1.025);
}

.title-audio-gate {
  position: absolute;
  z-index: 5;
  display: flex;
  width: min(360px, calc(100% - 2rem));
  align-items: center;
  flex-direction: column;
  padding: 2rem 2.2rem 1.65rem;
  border: 1px solid rgba(215, 164, 81, 0.34);
  background: rgba(10, 13, 16, 0.88);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.68);
  text-align: center;
  backdrop-filter: blur(14px);
  transition: opacity 380ms ease, transform 380ms ease;
}

.case-seal {
  position: relative;
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  margin-bottom: 1.2rem;
  border: 1px solid var(--amber-dark);
  border-radius: 50%;
  color: var(--amber-bright);
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: -0.08em;
}

.case-seal::before,
.case-seal::after {
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(215, 164, 81, 0.22);
  border-radius: 50%;
  content: "";
}

.case-seal::after {
  inset: -5px;
  border-style: dashed;
  animation: seal-turn 24s linear infinite;
}

.case-seal i {
  position: absolute;
  right: -5px;
  bottom: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 14px rgba(215, 164, 81, 0.6);
}

@keyframes seal-turn {
  to { transform: rotate(360deg); }
}

.title-audio-gate .eyebrow {
  justify-content: center;
}

.title-audio-gate .eyebrow::before {
  display: none;
}

.title-audio-gate h2 {
  margin: 0.55rem 0 0.5rem;
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.title-audio-gate > p:not(.eyebrow) {
  margin: 0 0 1.3rem;
  color: var(--paper-muted);
  font-family: var(--serif);
  font-size: 0.78rem;
  font-style: italic;
}

.gate-button {
  width: 100%;
}

.title-audio-gate .text-button {
  margin-top: 0.65rem;
  border-bottom: 0;
  color: var(--paper-dim);
}

.title-content h1 {
  max-width: 760px;
  margin: 1.25rem 0 1rem;
  color: #f3eee3;
  font-family: var(--serif);
  font-size: clamp(4.4rem, 10.5vw, 9.4rem);
  font-weight: 400;
  letter-spacing: -0.075em;
  line-height: 0.73;
  text-shadow: 0 12px 44px #000;
}

.title-content h1 span {
  display: block;
  margin-left: -0.08em;
  font-size: 1em;
  font-style: italic;
}

.title-content h1::first-line {
  color: #f4ead7;
}

.title-deck {
  max-width: 480px;
  margin: 2.1rem 0 1.6rem;
  color: rgba(238, 233, 221, 0.83);
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  font-style: italic;
  line-height: 1.55;
}

.case-stamp {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 2.1rem;
  color: var(--paper-muted);
  font-size: 0.61rem;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.case-stamp i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--amber);
}

.title-actions {
  display: flex;
  align-items: center;
  gap: 1.3rem;
}

.title-button {
  min-width: 260px;
}

.text-button {
  padding: 0.5rem;
  border-bottom: 1px solid rgba(238, 233, 221, 0.4);
  background: transparent;
  color: var(--paper-muted);
  font-size: 0.69rem;
}

.text-button:hover {
  color: var(--paper);
}

.headphones-note {
  margin: 1.1rem 0 0 0.2rem;
  color: rgba(238, 233, 221, 0.46);
  font-size: 0.63rem;
  letter-spacing: 0.08em;
}

.headphones-note span {
  margin-right: 0.35rem;
  color: var(--amber);
}

.title-credit {
  position: absolute;
  right: 2rem;
  bottom: 1.5rem;
  margin: 0;
  color: rgba(238, 233, 221, 0.4);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

@keyframes room-survey {
  from { transform: translate3d(6.5%, 0, 0); }
  to { transform: translate3d(-6.5%, 0, 0); }
}

/* Investigation shell */

.game-shell {
  display: grid;
  min-height: 100svh;
  grid-template-rows: 78px minmax(0, 1fr) 34px;
  background:
    linear-gradient(rgba(12, 16, 20, 0.96), rgba(12, 16, 20, 0.98)),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(255, 255, 255, 0.02) 80px);
}

.topbar {
  position: relative;
  z-index: 4;
  display: grid;
  align-items: center;
  padding: 0 1.4rem;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 17, 21, 0.92);
  grid-template-columns: minmax(240px, 1fr) minmax(240px, 0.65fr) minmax(240px, 1fr);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-mark {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border: 1px solid var(--amber-dark);
  border-radius: 50%;
  color: var(--amber-bright);
  font-family: var(--serif);
  font-size: 0.8rem;
  letter-spacing: -0.1em;
}

.brand-name,
.brand-subtitle {
  display: block;
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.05rem;
}

.brand-subtitle {
  margin-top: 0.16rem;
  color: var(--paper-dim);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.case-progress {
  width: min(340px, 100%);
  justify-self: center;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  color: var(--paper-dim);
  font-size: 0.54rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.progress-copy strong {
  color: var(--amber-bright);
}

.progress-track {
  height: 2px;
  overflow: hidden;
  background: rgba(238, 233, 221, 0.12);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--amber-dark), var(--amber-bright));
  box-shadow: 0 0 12px var(--amber);
  transition: width 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
}

.icon-button {
  display: grid;
  width: 41px;
  height: 41px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  transition: border-color 160ms ease, background 160ms ease;
}

.icon-button:hover {
  border-color: var(--paper-dim);
  background: rgba(255, 255, 255, 0.04);
}

.audio-bars {
  display: flex;
  height: 14px;
  align-items: end;
  gap: 2px;
}

.audio-bars i {
  display: block;
  width: 2px;
  background: var(--teal-bright);
  animation: audio-bar 850ms ease-in-out infinite alternate;
}

.audio-bars i:nth-child(1) { height: 8px; }
.audio-bars i:nth-child(2) { height: 14px; animation-delay: -300ms; }
.audio-bars i:nth-child(3) { height: 10px; animation-delay: -600ms; }

.icon-button[aria-pressed="true"] .audio-bars i {
  height: 2px;
  animation: none;
  background: var(--paper-dim);
}

@keyframes audio-bar {
  to { height: 4px; }
}

.think-button {
  display: flex;
  min-width: 124px;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 1px solid rgba(135, 182, 173, 0.5);
  background: rgba(74, 117, 112, 0.13);
  color: var(--teal-bright);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.think-button:hover {
  transform: translateY(-1px);
  border-color: var(--teal-bright);
  background: rgba(74, 117, 112, 0.22);
}

.think-button > span:last-child {
  display: flex;
  flex-direction: column;
  align-items: start;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.1;
  text-transform: uppercase;
}

.think-button small {
  color: var(--paper-dim);
  font-size: 0.46rem;
  letter-spacing: 0.1em;
}

.thought-orbit {
  position: relative;
  display: block;
  width: 19px;
  height: 19px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.thought-orbit::before,
.thought-orbit::after,
.thought-orbit i {
  position: absolute;
  display: block;
  border-radius: 50%;
  content: "";
}

.thought-orbit::before {
  top: 2px;
  left: 2px;
  width: 3px;
  height: 3px;
  background: currentColor;
}

.thought-orbit::after {
  right: -3px;
  bottom: 1px;
  width: 5px;
  height: 5px;
  border: 1px solid currentColor;
  background: var(--ink);
}

.thought-orbit i {
  top: 6px;
  left: 6px;
  width: 5px;
  height: 5px;
  background: currentColor;
}

.investigation-view {
  display: grid;
  min-height: 0;
  grid-template-columns: 224px minmax(520px, 1fr) 242px;
}

.panel {
  min-height: 0;
  padding: 1.35rem 1.1rem;
  background: rgba(16, 20, 25, 0.72);
}

.people-panel {
  border-right: 1px solid var(--line);
}

.notebook-panel {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
}

.panel-heading {
  display: flex;
  align-items: start;
  gap: 0.7rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.section-number {
  color: var(--amber-dark);
  font-family: var(--serif);
  font-size: 0.68rem;
  font-style: italic;
}

.panel-heading h2,
.scene-toolbar h2,
.history-heading h2,
.question-rail-heading h2 {
  margin: 0.26rem 0 0;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 400;
}

.suspect-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.suspect-card {
  position: relative;
  display: grid;
  width: 100%;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.67rem 0.55rem;
  overflow: hidden;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.suspect-card:hover {
  transform: translateX(3px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.045);
}

.suspect-card.read {
  border-color: rgba(135, 182, 173, 0.22);
}

.suspect-avatar {
  display: grid;
  width: 42px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(215, 164, 81, 0.25);
  background:
    radial-gradient(circle at 50% 35%, rgba(215, 164, 81, 0.25) 0 19%, transparent 20%),
    radial-gradient(ellipse at 50% 105%, rgba(215, 164, 81, 0.18) 0 45%, transparent 46%),
    #151b21;
  color: var(--amber-bright);
  font-family: var(--serif);
  font-size: 0.75rem;
}

.suspect-copy strong,
.suspect-copy small {
  display: block;
}

.suspect-copy strong {
  font-family: var(--serif);
  font-size: 0.85rem;
  font-weight: 400;
}

.suspect-copy small {
  margin-top: 0.13rem;
  color: var(--paper-dim);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.suspect-status {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--paper-dim);
  font-size: 0.55rem;
}

.suspect-card.read .suspect-status {
  border-color: rgba(135, 182, 173, 0.55);
  background: rgba(135, 182, 173, 0.1);
  color: var(--teal-bright);
}

.panel-tip {
  margin: 1.1rem 0 0;
  padding: 0.9rem 0 0 0.75rem;
  border-left: 1px solid var(--amber-dark);
  color: var(--paper-dim);
  font-family: var(--serif);
  font-size: 0.72rem;
  font-style: italic;
  line-height: 1.5;
}

.room-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 1.15rem 1.3rem 0.75rem;
  background:
    linear-gradient(rgba(7, 10, 13, 0.27), rgba(7, 10, 13, 0.27)),
    radial-gradient(circle at center, rgba(135, 182, 173, 0.07), transparent 60%);
}

.scene-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.scene-toolbar h2 {
  font-size: 1.14rem;
}

.scene-count {
  color: var(--paper-dim);
  font-size: 0.58rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.scene-count span {
  color: var(--amber-bright);
}

.scene-scroll {
  min-height: 0;
  overflow: auto;
  scrollbar-color: var(--amber-dark) var(--ink-soft);
}

.scene-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1672 / 941;
  overflow: hidden;
  border: 1px solid rgba(215, 164, 81, 0.25);
  background: #090c0f;
  box-shadow: var(--shadow);
  isolation: isolate;
}

.scene-frame > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.84) contrast(1.04) brightness(0.84);
  transition: filter 350ms ease, transform 8s ease;
}

.scene-frame:hover > img {
  filter: saturate(0.92) contrast(1.03) brightness(0.88);
  transform: scale(1.006);
}

.scene-vignette {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(0deg, rgba(4, 6, 8, 0.8), transparent 34%),
    radial-gradient(ellipse at center, transparent 54%, rgba(4, 6, 8, 0.47) 100%);
}

.hotspot-layer {
  position: absolute;
  z-index: 3;
  inset: 0;
}

.hotspot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(240, 199, 119, 0.9);
  border-radius: 50%;
  background: rgba(8, 11, 14, 0.66);
  box-shadow: 0 0 0 5px rgba(215, 164, 81, 0.08), 0 0 24px rgba(215, 164, 81, 0.3);
  color: var(--amber-bright);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.hotspot::before,
.hotspot::after {
  position: absolute;
  content: "";
}

.hotspot::before {
  inset: 7px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.hotspot::after {
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: currentColor;
}

.hotspot:hover,
.hotspot:focus-visible {
  z-index: 4;
  transform: translate(-50%, -50%) scale(1.15);
  background: rgba(215, 164, 81, 0.2);
}

.hotspot:not(.found) {
  animation: hotspot-pulse 2.3s ease-out infinite;
}

.hotspot.found {
  border-color: rgba(135, 182, 173, 0.8);
  color: var(--teal-bright);
  box-shadow: 0 0 0 4px rgba(135, 182, 173, 0.06);
}

.hotspot-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.55rem);
  width: max-content;
  max-width: 150px;
  padding: 0.36rem 0.55rem;
  transform: translate(-50%, 5px);
  border: 1px solid rgba(240, 199, 119, 0.33);
  background: rgba(7, 10, 13, 0.92);
  color: var(--paper);
  font-size: 0.55rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  opacity: 0;
  pointer-events: none;
  text-transform: uppercase;
  transition: opacity 160ms ease, transform 160ms ease;
}

.hotspot:hover .hotspot-label,
.hotspot:focus-visible .hotspot-label {
  transform: translate(-50%, 0);
  opacity: 1;
}

@keyframes hotspot-pulse {
  0%, 48% { box-shadow: 0 0 0 4px rgba(215, 164, 81, 0.06), 0 0 14px rgba(215, 164, 81, 0.2); }
  72% { box-shadow: 0 0 0 12px rgba(215, 164, 81, 0), 0 0 30px rgba(215, 164, 81, 0.4); }
  100% { box-shadow: 0 0 0 4px rgba(215, 164, 81, 0.06), 0 0 14px rgba(215, 164, 81, 0.2); }
}

.location-plate {
  position: absolute;
  z-index: 2;
  top: 1rem;
  left: 1rem;
  padding: 0.5rem 0.65rem;
  border-left: 2px solid var(--amber);
  background: rgba(7, 10, 13, 0.65);
  backdrop-filter: blur(6px);
}

.location-plate span,
.location-plate strong {
  display: block;
}

.location-plate span {
  color: var(--amber-bright);
  font-size: 0.43rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.location-plate strong {
  margin-top: 0.12rem;
  font-family: var(--serif);
  font-size: 0.78rem;
  font-weight: 400;
}

.scene-caption {
  position: absolute;
  z-index: 2;
  right: 1.3rem;
  bottom: 1.1rem;
  left: 1.3rem;
  display: grid;
  grid-template-columns: 34px minmax(0, 500px);
  align-items: start;
  gap: 0.7rem;
  pointer-events: none;
}

.caption-rule {
  height: 1px;
  margin-top: 0.65rem;
  background: var(--amber);
}

.scene-caption p {
  margin: 0;
  color: rgba(248, 243, 232, 0.92);
  font-family: var(--serif);
  font-size: clamp(0.72rem, 1.1vw, 0.95rem);
  font-style: italic;
  line-height: 1.45;
  text-shadow: 0 2px 8px #000;
}

.scene-instruction {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0.72rem 0 0;
  color: var(--paper-dim);
  font-size: 0.55rem;
  letter-spacing: 0.06em;
}

.pulse-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(215, 164, 81, 0.08);
}

.evidence-list {
  min-height: 0;
  flex: 1;
  margin-top: 0.8rem;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--amber-dark) transparent;
}

.empty-notebook {
  display: grid;
  min-height: 150px;
  place-items: center;
  align-content: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px dashed var(--line);
  color: var(--paper-dim);
  text-align: center;
}

.empty-notebook span {
  color: var(--amber-dark);
  font-family: var(--serif);
  font-size: 1.5rem;
}

.empty-notebook p {
  max-width: 150px;
  margin: 0;
  font-family: var(--serif);
  font-size: 0.72rem;
  font-style: italic;
  line-height: 1.45;
}

.evidence-entry {
  display: grid;
  width: 100%;
  grid-template-columns: 28px 1fr auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.57rem 0.3rem;
  border: 0;
  border-bottom: 1px solid rgba(238, 233, 221, 0.08);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease;
}

.evidence-entry:hover {
  background: rgba(255, 255, 255, 0.03);
}

.evidence-entry > span:first-child {
  color: var(--amber-dark);
  font-family: var(--serif);
  font-size: 0.58rem;
  font-style: italic;
}

.evidence-entry strong,
.evidence-entry small {
  display: block;
}

.evidence-entry strong {
  font-family: var(--serif);
  font-size: 0.75rem;
  font-weight: 400;
}

.evidence-entry small {
  margin-top: 0.12rem;
  color: var(--paper-dim);
  font-size: 0.44rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.evidence-entry > b {
  color: var(--teal);
  font-size: 0.57rem;
}

.notebook-think {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.8rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--teal-bright);
  font-family: var(--serif);
  font-size: 0.78rem;
  font-style: italic;
  text-align: left;
}

.notebook-think:hover {
  color: #d9f4ed;
}

.game-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  border-top: 1px solid var(--line);
  color: rgba(238, 233, 221, 0.38);
  font-size: 0.49rem;
  letter-spacing: 0.05em;
}

.game-footer p {
  margin: 0;
}

kbd {
  padding: 0.1rem 0.27rem;
  border: 1px solid rgba(238, 233, 221, 0.22);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper-muted);
  font-family: var(--sans);
  font-size: 0.48rem;
}

.footer-button {
  position: absolute;
  right: 1.2rem;
  padding: 0.25rem;
  background: transparent;
  color: rgba(238, 233, 221, 0.35);
  font-size: 0.48rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-button:hover {
  color: var(--paper-muted);
}

/* Evidence and suspect details */

.modal-shell {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 9, 0.82);
  backdrop-filter: blur(8px);
  animation: fade-in 180ms ease both;
}

.detail-card {
  position: relative;
  display: grid;
  width: min(810px, 100%);
  max-height: min(680px, calc(100svh - 3rem));
  grid-template-columns: minmax(230px, 0.72fr) minmax(320px, 1fr);
  overflow: auto;
  border: 1px solid rgba(215, 164, 81, 0.34);
  background: #141a20;
  box-shadow: 0 35px 110px rgba(0, 0, 0, 0.7);
  animation: card-enter 240ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.modal-close {
  position: absolute;
  z-index: 2;
  top: 0.7rem;
  right: 0.7rem;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(10, 13, 17, 0.75);
  color: var(--paper-muted);
  font-family: var(--serif);
  font-size: 1.1rem;
  cursor: pointer;
}

.modal-close:hover {
  border-color: var(--paper-muted);
  color: var(--paper);
}

.detail-visual {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  background-image:
    linear-gradient(0deg, rgba(9, 12, 15, 0.55), transparent 48%),
    var(--detail-image, url("assets/music-room.png"));
  background-position: var(--detail-position, center);
  background-size: var(--detail-size, cover);
  filter: saturate(0.72) contrast(1.08);
}

.detail-visual::after {
  position: absolute;
  inset: 0;
  border: 10px solid rgba(6, 8, 10, 0.22);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.48);
  content: "";
}

.detail-visual.suspect-visual {
  display: grid;
  place-items: center;
  background-image:
    linear-gradient(0deg, rgba(9, 12, 15, 0.82), rgba(9, 12, 15, 0.18)),
    url("assets/music-room.png");
}

.detail-visual.suspect-visual::before {
  position: absolute;
  width: 58%;
  aspect-ratio: 0.72;
  border: 1px solid rgba(215, 164, 81, 0.22);
  border-radius: 48% 48% 8% 8%;
  background:
    radial-gradient(circle at 50% 28%, rgba(13, 18, 22, 0.92) 0 16%, transparent 16.5%),
    radial-gradient(ellipse at 50% 88%, rgba(13, 18, 22, 0.94) 0 39%, transparent 39.5%);
  content: "";
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.45));
}

.profile-monogram {
  position: relative;
  z-index: 2;
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 1px solid rgba(240, 199, 119, 0.55);
  border-radius: 50%;
  background: rgba(10, 14, 17, 0.68);
  box-shadow: 0 0 0 8px rgba(10, 14, 17, 0.25);
  color: var(--amber-bright);
  font-family: var(--serif);
  font-size: 1.45rem;
  letter-spacing: 0.08em;
}

.detail-copy {
  align-self: center;
  padding: 3.2rem 2.7rem 2.5rem;
}

.detail-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
  color: var(--paper-dim);
  font-size: 0.49rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.detail-meta span:last-child {
  color: var(--teal);
}

.detail-copy h2 {
  margin: 0.45rem 0 1rem;
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
}

.detail-description {
  margin: 0;
  color: var(--paper-muted);
  font-family: var(--serif);
  font-size: 0.93rem;
  line-height: 1.65;
}

.detail-quote {
  margin: 1.35rem 0;
  padding: 0.8rem 0 0.8rem 1rem;
  border-left: 2px solid var(--amber-dark);
  color: #d8cdbb;
  font-family: var(--serif);
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.55;
}

.unlocked-words {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin: 1.25rem 0;
}

.unlocked-words::before {
  width: 100%;
  margin-bottom: 0.1rem;
  color: var(--paper-dim);
  content: "CONCEPTS SURFACED";
  font-size: 0.45rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.unlocked-words:empty {
  display: none;
}

.unlocked-word {
  padding: 0.28rem 0.42rem;
  border: 1px solid rgba(135, 182, 173, 0.3);
  background: rgba(135, 182, 173, 0.07);
  color: var(--teal-bright);
  font-size: 0.48rem;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.detail-action {
  width: 100%;
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes card-enter {
  from { transform: translateY(18px) scale(0.985); opacity: 0; }
}

/* Thinking Mode */

.thinking-mode {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  min-height: 100svh;
  grid-template-rows: 86px minmax(0, 1fr);
  overflow: hidden;
  background:
    radial-gradient(circle at 58% 43%, rgba(50, 98, 95, 0.22), transparent 36%),
    radial-gradient(circle at 82% 83%, rgba(118, 80, 42, 0.12), transparent 28%),
    #0b1115;
}

.thinking-mode.entering {
  animation: thinking-enter 420ms cubic-bezier(0.16, 0.84, 0.25, 1) both;
}

@keyframes thinking-enter {
  from { clip-path: circle(3% at 88% 5%); }
  to { clip-path: circle(145% at 88% 5%); }
}

.thought-atmosphere {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.thought-atmosphere::before,
.thought-atmosphere::after {
  position: absolute;
  width: 32vw;
  height: 32vw;
  border: 1px solid rgba(135, 182, 173, 0.08);
  border-radius: 50%;
  content: "";
}

.thought-atmosphere::before {
  top: 18%;
  left: 30%;
  animation: thought-ring 18s linear infinite;
}

.thought-atmosphere::after {
  right: -10%;
  bottom: -16%;
  width: 48vw;
  height: 48vw;
  border-color: rgba(215, 164, 81, 0.06);
  animation: thought-ring 26s linear infinite reverse;
}

.thought-atmosphere i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(184, 219, 210, 0.42);
  box-shadow: 0 0 16px rgba(184, 219, 210, 0.65);
  animation: mote 8s ease-in-out infinite alternate;
}

.thought-atmosphere i:nth-child(1) { top: 24%; left: 38%; }
.thought-atmosphere i:nth-child(2) { top: 68%; left: 72%; animation-delay: -3s; }
.thought-atmosphere i:nth-child(3) { top: 42%; left: 91%; animation-delay: -6s; }

@keyframes thought-ring {
  to { transform: rotate(360deg) scale(1.08); }
}

@keyframes mote {
  to { transform: translate(38px, -28px); opacity: 0.25; }
}

.thinking-header {
  position: relative;
  z-index: 2;
  display: grid;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid rgba(135, 182, 173, 0.16);
  background: rgba(8, 13, 17, 0.72);
  grid-template-columns: 1fr auto 1fr;
}

.thinking-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.thought-orbit.large {
  width: 39px;
  height: 39px;
  color: var(--teal-bright);
}

.thought-orbit.large::before { top: 5px; left: 5px; width: 5px; height: 5px; }
.thought-orbit.large::after { right: -3px; bottom: 3px; width: 8px; height: 8px; background: #0b1115; }
.thought-orbit.large i { top: 13px; left: 13px; width: 10px; height: 10px; }

.thinking-brand h1 {
  margin: 0.15rem 0 0;
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 400;
}

.three-word-rule {
  margin: 0;
  color: var(--paper-dim);
  font-family: var(--serif);
  font-size: 0.73rem;
  font-style: italic;
}

.three-word-rule b {
  margin-right: 0.55rem;
  color: var(--teal);
  font-family: var(--sans);
  font-size: 0.48rem;
  font-style: normal;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.leave-thinking {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  justify-self: end;
  padding: 0.5rem 0;
  background: transparent;
  color: var(--paper-muted);
  font-size: 0.63rem;
}

.leave-thinking:hover {
  color: var(--paper);
}

.leave-thinking kbd {
  margin-left: 0.25rem;
}

.thinking-layout {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 0;
  grid-template-columns: 246px minmax(480px, 1fr) 224px;
}

.question-rail,
.thought-history {
  min-height: 0;
  padding: 1.35rem 1rem;
  background: rgba(9, 14, 18, 0.52);
}

.question-rail {
  border-right: 1px solid rgba(135, 182, 173, 0.14);
}

.thought-history {
  border-left: 1px solid rgba(135, 182, 173, 0.14);
}

.question-list {
  display: grid;
  max-height: calc(100% - 115px);
  gap: 0.45rem;
  margin-top: 1rem;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(135, 182, 173, 0.3) transparent;
}

.question-card {
  position: relative;
  width: 100%;
  padding: 0.75rem 0.7rem 0.75rem 2rem;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.022);
  color: var(--paper-muted);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.question-card:hover {
  border-color: rgba(135, 182, 173, 0.18);
  background: rgba(135, 182, 173, 0.04);
}

.question-card.active {
  border-color: rgba(135, 182, 173, 0.42);
  background: rgba(135, 182, 173, 0.09);
  color: var(--paper);
}

.question-card.solved {
  color: var(--teal-bright);
}

.question-index {
  position: absolute;
  top: 0.82rem;
  left: 0.65rem;
  color: var(--paper-dim);
  font-family: var(--serif);
  font-size: 0.58rem;
  font-style: italic;
}

.question-card strong,
.question-card small {
  display: block;
}

.question-card strong {
  font-family: var(--serif);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.35;
}

.question-card small {
  margin-top: 0.28rem;
  color: var(--paper-dim);
  font-size: 0.43rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.question-card.solved small {
  color: rgba(135, 182, 173, 0.7);
}

.question-card.solved::after {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  color: var(--teal);
  content: "✓";
  font-size: 0.63rem;
  transform: translateY(-50%);
}

.question-rail-note {
  margin: 0.9rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(135, 182, 173, 0.1);
  color: var(--paper-dim);
  font-family: var(--serif);
  font-size: 0.65rem;
  font-style: italic;
  line-height: 1.45;
}

.thought-workbench {
  width: min(780px, calc(100% - 2.5rem));
  min-width: 0;
  align-self: center;
  justify-self: center;
  padding: 1.3rem 0;
}

.question-heading-block {
  min-height: 76px;
  text-align: center;
}

.question-heading-block .question-type {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: var(--teal);
  font-size: 0.49rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.question-type::before,
.question-type::after {
  width: 22px;
  height: 1px;
  content: "";
  background: rgba(135, 182, 173, 0.35);
}

.question-heading-block h2 {
  margin: 0.6rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.question-heading-block .question-context {
  max-width: 590px;
  margin: 0.5rem auto 0;
  color: var(--paper-dim);
  font-family: var(--serif);
  font-size: 0.72rem;
  font-style: italic;
}

.support-board {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.9rem 0 0;
  padding: 0.6rem;
  border-top: 1px solid rgba(135, 182, 173, 0.1);
  border-bottom: 1px solid rgba(135, 182, 173, 0.1);
}

.support-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.43rem;
  color: var(--paper-dim);
  font-size: 0.45rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.support-item i {
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 0.42rem;
  font-style: normal;
}

.support-item.ready {
  color: var(--teal-bright);
}

.support-item.ready i {
  border-color: var(--teal);
  background: rgba(135, 182, 173, 0.12);
}

.sentence-area {
  margin-top: 1.1rem;
}

.sentence-label {
  margin: 0 0 0.45rem;
  color: var(--paper-dim);
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}

.sentence-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.sentence-slot {
  position: relative;
  display: grid;
  min-height: 67px;
  place-items: center;
  padding: 0.65rem;
  border: 1px solid rgba(135, 182, 173, 0.25);
  background:
    linear-gradient(135deg, rgba(135, 182, 173, 0.045), transparent),
    rgba(7, 11, 14, 0.38);
  color: rgba(238, 233, 221, 0.25);
  font-family: var(--serif);
  font-size: clamp(0.85rem, 1.6vw, 1.2rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease;
}

.sentence-slot::before {
  position: absolute;
  top: 0.35rem;
  left: 0.45rem;
  color: rgba(135, 182, 173, 0.38);
  content: attr(data-index);
  font-family: var(--sans);
  font-size: 0.42rem;
  font-weight: 800;
}

button.sentence-slot {
  cursor: pointer;
}

.sentence-slot.filled {
  border-color: rgba(240, 199, 119, 0.54);
  background: rgba(215, 164, 81, 0.07);
  color: var(--paper);
  animation: word-land 220ms ease both;
}

.sentence-slot.filled:hover {
  transform: translateY(-2px);
  border-color: var(--amber);
}

.sentence-slot.shake {
  animation: slot-shake 320ms ease both;
}

@keyframes word-land {
  from { transform: translateY(7px); opacity: 0; }
}

@keyframes slot-shake {
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

.sentence-meter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 0.42rem;
  color: var(--paper-dim);
  font-size: 0.46rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sentence-meter > i {
  display: block;
  width: 58px;
  height: 2px;
  overflow: hidden;
  background: rgba(238, 233, 221, 0.12);
}

.sentence-meter b {
  display: block;
  width: 0;
  height: 100%;
  background: var(--amber);
  transition: width 180ms ease;
}

.word-bank-block {
  margin-top: 1rem;
  padding: 0.85rem 0.9rem 0.9rem;
  border: 1px solid rgba(135, 182, 173, 0.13);
  background: rgba(6, 10, 13, 0.26);
}

.word-bank-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(135, 182, 173, 0.1);
}

.word-bank-heading p,
.word-bank-heading span {
  margin: 0;
  font-size: 0.46rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.word-bank-heading p {
  color: var(--paper-muted);
}

.word-bank-heading span {
  color: var(--paper-dim);
  font-weight: 600;
  text-transform: none;
}

.word-bank {
  display: flex;
  min-height: 84px;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 0.48rem;
  padding-top: 0.75rem;
}

.word-button {
  position: relative;
  min-width: 72px;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(238, 233, 221, 0.2);
  background: rgba(238, 233, 221, 0.035);
  color: var(--paper-muted);
  font-family: var(--serif);
  font-size: 0.68rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.word-button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--amber);
  background: rgba(215, 164, 81, 0.08);
  color: var(--paper);
}

.word-button.selected {
  opacity: 0.25;
  cursor: default;
}

.word-button.locked {
  padding-left: 1.5rem;
  border-style: dashed;
  color: rgba(238, 233, 221, 0.27);
  cursor: not-allowed;
}

.word-button.locked::before {
  position: absolute;
  left: 0.58rem;
  content: "◇";
  color: var(--teal);
  font-size: 0.6rem;
}

.word-button.just-unlocked {
  animation: unlock-word 900ms ease both;
}

@keyframes unlock-word {
  0%, 100% { box-shadow: none; }
  38% { border-color: var(--teal-bright); box-shadow: 0 0 22px rgba(135, 182, 173, 0.35); }
}

.thought-actions {
  display: grid;
  grid-template-columns: 94px 94px minmax(190px, 1fr);
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.hint-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid rgba(135, 182, 173, 0.22);
  background: transparent;
  color: var(--teal);
  font-size: 0.56rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hint-button span {
  display: grid;
  width: 15px;
  height: 15px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 0.55rem;
  font-style: italic;
}

.hint-button:hover {
  border-color: var(--teal);
  background: rgba(135, 182, 173, 0.06);
  color: var(--teal-bright);
}

.monologue {
  display: grid;
  min-height: 98px;
  grid-template-columns: 32px 1fr;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.8rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid rgba(215, 164, 81, 0.28);
  border-bottom: 1px solid rgba(215, 164, 81, 0.12);
  background: linear-gradient(90deg, rgba(215, 164, 81, 0.05), transparent);
}

.monologue-mark {
  color: var(--amber-dark);
  font-family: var(--serif);
  font-size: 3rem;
  line-height: 1;
}

.monologue p:last-child {
  margin: 0.28rem 0 0;
  color: #d6cdbc;
  font-family: var(--serif);
  font-size: clamp(0.8rem, 1.3vw, 0.96rem);
  font-style: italic;
  line-height: 1.48;
}

.monologue.responding p:last-child {
  animation: response-in 300ms ease both;
}

.monologue.success {
  border-top-color: rgba(135, 182, 173, 0.62);
  background: linear-gradient(90deg, rgba(135, 182, 173, 0.09), transparent);
}

.monologue.success .monologue-mark {
  color: var(--teal);
}

@keyframes response-in {
  from { transform: translateY(5px); opacity: 0; }
}

.history-heading {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(135, 182, 173, 0.1);
}

.thought-history-list {
  max-height: calc(100% - 68px);
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  scrollbar-width: thin;
}

.thought-history-item {
  position: relative;
  padding: 0.75rem 0 0.75rem 1.15rem;
  border-bottom: 1px solid rgba(135, 182, 173, 0.07);
}

.thought-history-item::before {
  position: absolute;
  top: 0.9rem;
  left: 0;
  width: 5px;
  height: 5px;
  border: 1px solid var(--paper-dim);
  border-radius: 50%;
  content: "";
}

.thought-history-item.correct::before {
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: 0 0 8px rgba(135, 182, 173, 0.45);
}

.thought-history-item strong,
.thought-history-item small {
  display: block;
}

.thought-history-item strong {
  color: var(--paper-muted);
  font-family: var(--serif);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.thought-history-item.correct strong {
  color: var(--teal-bright);
}

.thought-history-item small {
  margin-top: 0.22rem;
  color: var(--paper-dim);
  font-size: 0.41rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-empty {
  padding: 1.2rem 0.5rem;
  color: var(--paper-dim);
  font-family: var(--serif);
  font-size: 0.68rem;
  font-style: italic;
  line-height: 1.5;
  text-align: center;
}

/* Ending */

.ending-screen {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  overflow: auto;
}

.ending-backdrop {
  inset: 0;
  filter: grayscale(0.25) brightness(0.55);
  animation: none;
}

.ending-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 50%, rgba(7, 10, 13, 0.58), rgba(7, 10, 13, 0.94) 68%),
    linear-gradient(90deg, rgba(7, 10, 13, 0.96), rgba(7, 10, 13, 0.65));
  backdrop-filter: blur(5px);
}

.ending-card {
  position: relative;
  width: min(820px, 100%);
  padding: 2rem 2.4rem;
  border: 1px solid rgba(215, 164, 81, 0.32);
  background: rgba(12, 16, 20, 0.91);
  box-shadow: var(--shadow);
  animation: ending-enter 700ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

@keyframes ending-enter {
  from { transform: translateY(24px); opacity: 0; }
}

.ending-card h1 {
  margin: 0.75rem 0 0.55rem;
  color: #f1eadc;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.045em;
}

.ending-lead {
  max-width: 600px;
  margin: 0;
  color: #c9bead;
  font-family: var(--serif);
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.55;
}

.reconstruction {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1.55rem 0;
  padding: 1.2rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.reconstruction::before {
  position: absolute;
  top: 2rem;
  right: 5%;
  left: 5%;
  height: 1px;
  background: rgba(215, 164, 81, 0.22);
  content: "";
}

.reconstruction li {
  position: relative;
}

.reconstruction time {
  position: relative;
  z-index: 1;
  display: table;
  padding-right: 0.45rem;
  background: #11171c;
  color: var(--amber-bright);
  font-family: var(--serif);
  font-size: 0.9rem;
  font-style: italic;
}

.reconstruction span {
  display: block;
  margin-top: 0.7rem;
  color: var(--paper-muted);
  font-family: var(--serif);
  font-size: 0.67rem;
  line-height: 1.45;
}

.ending-dialogue {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 0.45rem 0.75rem;
  padding: 0.7rem 0;
}

.ending-dialogue .speaker {
  color: var(--red);
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ending-dialogue .speaker.detective {
  color: var(--teal);
}

.ending-dialogue p {
  margin: 0;
  color: var(--paper-muted);
  font-family: var(--serif);
  font-size: 0.75rem;
  font-style: italic;
}

.case-closed {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.75rem;
  padding: 0.6rem 1.1rem 0.6rem 0.7rem;
  border: 1px solid rgba(135, 182, 173, 0.35);
  background: rgba(135, 182, 173, 0.07);
}

.case-closed > span {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: var(--ink);
}

.case-closed small,
.case-closed strong {
  display: block;
}

.case-closed small {
  color: var(--paper-dim);
  font-size: 0.4rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.case-closed strong {
  color: var(--teal-bright);
  font-family: var(--serif);
  font-size: 0.9rem;
  font-weight: 400;
}

.ending-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1rem;
}

.secondary-button.light {
  color: var(--paper-muted);
}

/* Toasts */

.toast-region {
  position: fixed;
  z-index: 500;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  width: min(340px, calc(100% - 2rem));
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0.65rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(135, 182, 173, 0.34);
  background: rgba(14, 22, 26, 0.96);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
  animation: toast-enter 280ms ease both;
}

.toast.leaving {
  animation: toast-leave 240ms ease both;
}

.toast-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(135, 182, 173, 0.45);
  border-radius: 50%;
  color: var(--teal-bright);
  font-size: 0.7rem;
}

.toast strong,
.toast small {
  display: block;
}

.toast strong {
  color: var(--paper);
  font-family: var(--serif);
  font-size: 0.73rem;
  font-weight: 400;
}

.toast small {
  margin-top: 0.12rem;
  color: var(--paper-dim);
  font-size: 0.44rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

@keyframes toast-enter {
  from { transform: translateX(16px); opacity: 0; }
}

@keyframes toast-leave {
  to { transform: translateX(16px); opacity: 0; }
}

/* Responsive */

@media (max-width: 1180px) {
  .investigation-view {
    grid-template-columns: 190px minmax(500px, 1fr) 205px;
  }

  .thinking-layout {
    grid-template-columns: 220px minmax(470px, 1fr);
  }

  .thought-history {
    display: none;
  }

  .detail-card {
    width: min(760px, 100%);
  }
}

@media (max-width: 920px) {
  .game-shell {
    grid-template-rows: 70px auto 32px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .case-progress {
    display: none;
  }

  .investigation-view {
    display: flex;
    flex-direction: column;
  }

  .people-panel,
  .notebook-panel {
    border: 0;
  }

  .people-panel {
    order: 2;
  }

  .room-panel {
    order: 1;
    min-height: 540px;
  }

  .notebook-panel {
    order: 3;
  }

  .suspect-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .panel-tip {
    display: none;
  }

  .evidence-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 0.6rem;
  }

  .thinking-mode {
    overflow: auto;
  }

  .thinking-header {
    grid-template-columns: 1fr auto;
  }

  .three-word-rule {
    display: none;
  }

  .thinking-layout {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .question-rail {
    border: 0;
    border-bottom: 1px solid rgba(135, 182, 173, 0.14);
  }

  .question-rail-heading,
  .question-rail-note {
    display: none;
  }

  .question-list {
    display: flex;
    max-height: none;
    margin: 0;
    overflow-x: auto;
  }

  .question-card {
    min-width: 170px;
  }

  .thought-workbench {
    width: min(760px, calc(100% - 2rem));
    margin: auto;
  }
}

@media (max-width: 650px) {
  .title-content {
    width: calc(100% - 2rem);
  }

  .title-content h1 {
    font-size: clamp(3.5rem, 20vw, 6rem);
  }

  .title-deck {
    font-size: 1rem;
  }

  .title-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.7rem;
  }

  .title-button {
    width: 100%;
  }

  .title-credit {
    display: none;
  }

  .brand-subtitle,
  .icon-button {
    display: none;
  }

  .topbar {
    padding: 0 0.75rem;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .think-button {
    min-width: 105px;
  }

  .room-panel {
    width: 100%;
    max-width: 100vw;
    min-height: 430px;
    padding: 1rem 0 0.7rem;
    overflow: hidden;
  }

  .scene-toolbar,
  .scene-instruction {
    margin-right: 1rem;
    margin-left: 1rem;
  }

  .scene-scroll {
    width: 100vw;
    max-width: 100vw;
    padding-bottom: 0.35rem;
    overflow-x: auto;
  }

  .scene-frame {
    width: 760px;
  }

  .suspect-list,
  .evidence-list {
    grid-template-columns: 1fr;
  }

  .game-footer p {
    display: none;
  }

  .footer-button {
    position: static;
  }

  .thinking-header {
    min-height: 72px;
    padding: 0 0.85rem;
  }

  .thinking-brand .large {
    display: none;
  }

  .thinking-brand h1 {
    font-size: 1.05rem;
  }

  .leave-thinking {
    font-size: 0;
  }

  .leave-thinking > span {
    font-size: 1rem;
  }

  .leave-thinking kbd {
    display: none;
  }

  .thought-workbench {
    width: calc(100% - 1.2rem);
  }

  .question-heading-block h2 {
    font-size: 1.45rem;
  }

  .sentence-slots {
    gap: 0.35rem;
  }

  .sentence-slot {
    min-height: 58px;
    padding: 0.5rem 0.2rem;
    font-size: 0.77rem;
  }

  .word-bank {
    gap: 0.35rem;
  }

  .word-button {
    min-width: 62px;
    padding: 0.5rem 0.55rem;
    font-size: 0.58rem;
  }

  .thought-actions {
    grid-template-columns: 70px 74px 1fr;
    gap: 0.4rem;
  }

  .hint-button,
  .secondary-button,
  .primary-button {
    padding-right: 0.55rem;
    padding-left: 0.55rem;
    letter-spacing: 0.08em;
  }

  .detail-card {
    display: block;
  }

  .detail-visual {
    min-height: 190px;
  }

  .detail-copy {
    padding: 1.6rem 1.25rem 1.25rem;
  }

  .detail-meta {
    margin-bottom: 1.2rem;
  }

  .ending-card {
    padding: 1.4rem;
  }

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

  .reconstruction::before {
    display: none;
  }

  .ending-dialogue {
    grid-template-columns: 1fr;
  }

  .ending-actions {
    flex-direction: column-reverse;
  }

  .ending-actions > * {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
