/* ===== «Белая тишина» — noir detective game ===== */

:root {
  --bg: #0a0c0f;
  --bg-2: #0f1319;
  --panel: #141a21;
  --panel-2: #1a222c;
  --line: #2a3440;
  --line-soft: #222a34;
  --text: #d8dde4;
  --muted: #8b95a3;
  --muted-2: #5d6775;
  --paper: #e9e2d2;
  --paper-2: #ded4bf;
  --ink: #241f18;
  --ink-soft: #5b5040;
  --red: #c8433b;
  --red-2: #e35b51;
  --red-dim: rgba(200, 67, 59, 0.14);
  --gold: #c9a44c;
  --green: #4f9d69;
  --shadow: 0 48px 120px rgba(0, 0, 0, 0.55);
  --radius: 28px;
  --serif: "Georgia", "Times New Roman", "PT Serif", serif;
  --mono: "Courier New", "Consolas", monospace;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(2400px 1400px at 80% -10%, rgba(200, 67, 59, 0.10), transparent 60%),
    radial-gradient(1800px 1200px at -10% 100%, rgba(201, 164, 76, 0.07), transparent 55%),
    linear-gradient(180deg, #0b0e12 0%, #090b0e 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 32px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

::selection { background: rgba(200, 67, 59, 0.35); color: #fff; }

a { color: var(--gold); }

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  border: 2px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 1.44rem 2.7rem;
  border-radius: 1998px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); border-color: var(--muted-2); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(180deg, var(--red-2), var(--red));
  border-color: #a8322b;
  color: #fff;
  box-shadow: 0 20px 52px rgba(200, 67, 59, 0.32);
}
.btn-primary:hover { box-shadow: 0 28px 68px rgba(200, 67, 59, 0.45); border-color: #8f2a24; }
.btn-gold {
  background: linear-gradient(180deg, #d8b562, var(--gold));
  border-color: #977629;
  color: #2a2110;
  box-shadow: 0 20px 52px rgba(201, 164, 76, 0.25);
}
.btn-ghost { background: transparent; }
.btn-small { padding: 0.84rem 1.8rem; font-size: 1.64rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding: 1.6rem clamp(2rem, 4vw, 5rem);
  background: rgba(9, 11, 14, 0.82);
  backdrop-filter: blur(28px);
  border-bottom: 2px solid var(--line-soft);
}
.brand {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  cursor: pointer;
  border: 0;
  background: none;
  color: var(--text);
  padding: 0;
}
.brand-mark {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(150deg, #232c37, #12171d);
  border: 2px solid var(--line);
  flex: none;
}
.brand-mark svg { width: 36px; height: 36px; }
.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  text-align: left;
}
.brand-name b {
  font-family: var(--serif);
  font-size: 2.04rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
}
.brand-name span {
  font-family: var(--mono);
  font-size: 1.16rem;
  letter-spacing: 0.32em;
  color: var(--red-2);
  text-transform: uppercase;
  white-space: nowrap;
}
.topbar-sep { flex: 1; }
.topbar-meta {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  font-family: var(--mono);
  font-size: 1.36rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.progress-track {
  width: 236px;
  height: 12px;
  border-radius: 198px;
  background: #202833;
  overflow: hidden;
  border: 2px solid #263039;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--red));
  transition: width 0.4s ease;
}
.progress-label { color: var(--gold); font-variant-numeric: tabular-nums; }
.icon-btn {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--muted-2); }
.icon-btn svg { width: 34px; height: 34px; }

/* ---------- hero / intro ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - 124px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(4rem, 6vw, 10rem) clamp(2rem, 4vw, 6rem);
  overflow: hidden;
}
.filmstrip {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 92px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 28px, rgba(233, 226, 210, 0.13) 28px 52px, transparent 52px 80px);
  pointer-events: none;
  opacity: 0.5;
}
.filmstrip.left { left: 0; border-right: 2px solid rgba(255,255,255,0.05); }
.filmstrip.right { right: 0; border-left: 2px solid rgba(255,255,255,0.05); }
.hero-inner {
  position: relative;
  z-index: 2;
  width: min(1800px, 100%);
  text-align: center;
  animation: fadeUp 0.7s ease both;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 1.4rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--red-2);
  margin-bottom: 2.4rem;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(5.2rem, 8vw, 10.8rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  text-shadow: 0 40px 120px rgba(0,0,0,0.6);
}
.hero h1 em {
  font-style: italic;
  color: var(--gold);
}
.hero-sub {
  max-width: 54ch;
  margin: 2.6rem auto 4rem;
  color: var(--muted);
  font-size: clamp(2rem, 2.2vw, 2.32rem);
  line-height: 1.7;
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 4rem;
}
.chip {
  font-family: var(--mono);
  font-size: 1.36rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 2px solid var(--line);
  background: rgba(20, 26, 33, 0.7);
  padding: 0.8rem 1.6rem;
  border-radius: 1998px;
}
.chip b { color: var(--text); font-weight: 600; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.6rem;
}
.hero-foot {
  margin-top: 4.8rem;
  font-family: var(--mono);
  font-size: 1.32rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.stamp {
  display: inline-block;
  border: 4px solid var(--red);
  color: var(--red-2);
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  transform: rotate(-6deg);
  opacity: 0.85;
}
.hero-stamp {
  position: absolute;
  top: clamp(2rem, 4vw, 5rem);
  right: clamp(1.6rem, 5vw, 8rem);
  font-size: clamp(1.2rem, 1.4vw, 1.56rem);
  transform: rotate(8deg);
  pointer-events: none;
}

/* ---------- game shell ---------- */
.game {
  max-width: 2440px;
  margin: 0 auto;
  padding: clamp(2rem, 3vw, 4rem) clamp(1.8rem, 4vw, 5rem) 8rem;
  animation: fadeUp 0.5s ease both;
}
.case-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.2rem 0 2.8rem;
  border-bottom: 2px solid var(--line-soft);
  margin-bottom: 3.2rem;
}
.case-head .eyebrow { margin-bottom: 1rem; }
.case-head h1 {
  font-family: var(--serif);
  font-size: clamp(3.4rem, 4vw, 5.2rem);
  margin: 0;
  line-height: 1.05;
}
.case-head .case-file {
  font-family: var(--mono);
  font-size: 1.4rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: right;
}
.case-file b { color: var(--red-2); }

.layout {
  display: grid;
  grid-template-columns: 500px minmax(0, 1fr);
  gap: clamp(2.4rem, 3vw, 4.2rem);
  align-items: start;
}

/* ---------- stage nav ---------- */
.stage-nav {
  position: sticky;
  top: 156px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.nav-label {
  font-family: var(--mono);
  font-size: 1.24rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 0 0 1rem 1.7rem;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  text-align: left;
  border: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 1.24rem 1.6rem;
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 1.8rem;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}
.nav-item .nav-num {
  font-family: var(--mono);
  font-size: 1.32rem;
  color: var(--muted-2);
  width: 3.2rem;
  flex: none;
  letter-spacing: 0.05em;
}
.nav-item .nav-titles { display: flex; flex-direction: column; line-height: 1.15; }
.nav-item .nav-titles small {
  font-family: var(--mono);
  font-size: 1.12rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-top: 0.24rem;
}
.nav-item:hover:not(.locked) { background: var(--panel); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(200, 67, 59, 0.16), rgba(200, 67, 59, 0.02));
  border-color: rgba(200, 67, 59, 0.4);
  color: #fff;
}
.nav-item.active .nav-num { color: var(--red-2); }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -2px; top: 18%; bottom: 18%;
  width: 6px;
  border-radius: 6px;
  background: var(--red);
}
.nav-item.done .nav-num { color: var(--green); }
.nav-item.locked { opacity: 0.32; cursor: not-allowed; }
.nav-item .nav-check {
  margin-left: auto;
  color: var(--green);
  display: none;
}
.nav-item.done .nav-check { display: block; }
.nav-check svg { width: 28px; height: 28px; display: block; }
.nav-item .lock-ico { margin-left: auto; color: var(--muted-2); }
.lock-ico svg { width: 26px; height: 26px; display: block; }

.nav-foot {
  margin-top: 2rem;
  padding: 1.8rem 1.7rem;
  border: 2px dashed var(--line);
  border-radius: 20px;
  font-family: var(--mono);
  font-size: 1.24rem;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  line-height: 1.6;
  text-transform: uppercase;
}
.nav-foot b { color: var(--muted); }

/* ---------- stage content ---------- */
.stage-content { min-width: 0; animation: fadeUp 0.4s ease both; }
.stage-head { margin-bottom: 3rem; }
.stage-head .eyebrow { margin-bottom: 1rem; }
.stage-head h2 {
  font-family: var(--serif);
  font-size: clamp(3.2rem, 3.4vw, 4.6rem);
  margin: 0 0 1rem;
  line-height: 1.1;
}
.stage-head p {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
  font-size: 1.96rem;
}

/* ---------- paper documents ---------- */
.paper {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.35), transparent 30%),
    radial-gradient(120% 90% at 10% 0%, #f1ecdf 0%, var(--paper) 45%, var(--paper-2) 100%);
  color: var(--ink);
  border-radius: 24px;
  padding: clamp(2.6rem, 3vw, 4.2rem);
  box-shadow: 0 36px 80px rgba(0,0,0,0.45), inset 0 0 120px rgba(120, 100, 60, 0.08);
  border: 2px solid #cfc4ad;
}
.paper + .paper { margin-top: 2rem; }
.paper::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 2px solid rgba(80, 65, 40, 0.12);
  border-radius: 14px;
  pointer-events: none;
}
.paper h3 {
  font-family: var(--serif);
  margin: 0 0 1.8rem;
  font-size: 2.48rem;
  line-height: 1.2;
}
.paper p { margin: 0 0 1.6rem; color: #3b3327; }
.paper p:last-child { margin-bottom: 0; }
.paper strong { color: #1b1710; }
.paper .doc-label {
  font-family: var(--mono);
  font-size: 1.2rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #8a7a5c;
  margin-bottom: 1.4rem;
  display: block;
}
.paper .hand {
  font-family: "Segoe Script", "Bradley Hand", cursive;
  color: #2d2a5a;
  font-size: 2.04rem;
  transform: rotate(-1deg);
  display: inline-block;
}
.doc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  border-bottom: 2px solid rgba(80, 65, 40, 0.18);
  padding-bottom: 1.6rem;
  margin-bottom: 2rem;
  font-family: var(--mono);
  font-size: 1.32rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7d6d51;
}
.doc-head b { color: #3b3327; }
.doc-head--stamped { padding-right: 13rem; }
.paper .red-stamp {
  position: absolute;
  top: 2.2rem;
  right: 2.2rem;
  border: 4px solid rgba(160, 40, 32, 0.75);
  color: rgba(160, 40, 32, 0.8);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.24rem;
  letter-spacing: 0.18em;
  padding: 0.48rem 1rem;
  border-radius: 6px;
  transform: rotate(-8deg);
  text-transform: uppercase;
  pointer-events: none;
}

.dossier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  background: rgba(80, 65, 40, 0.16);
  border: 2px solid rgba(80, 65, 40, 0.16);
  border-radius: 16px;
  overflow: hidden;
  margin: 2rem 0;
}
.dossier-cell {
  background: rgba(255,255,255,0.16);
  padding: 1.5rem 1.8rem;
}
.dossier-cell span {
  display: block;
  font-family: var(--mono);
  font-size: 1.12rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a7a5c;
  margin-bottom: 0.4rem;
}
.dossier-cell b { font-size: 1.88rem; color: #2c261d; font-weight: 600; }

.quote {
  border-left: 6px solid var(--red);
  padding: 0.3rem 0 0.3rem 2rem;
  margin: 2rem 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 2.12rem;
  color: #4a4031;
}

/* ---------- notice / warning ---------- */
.notice {
  display: flex;
  gap: 1.6rem;
  align-items: flex-start;
  border: 2px solid var(--line);
  background: var(--panel);
  border-radius: 20px;
  padding: 1.9rem 2.2rem;
  font-size: 1.8rem;
  color: var(--muted);
  margin-top: 2.4rem;
}
.notice b { color: var(--text); }
.notice.danger { border-color: rgba(200, 67, 59, 0.5); background: var(--red-dim); color: #e7b7b3; }
.notice.danger b { color: #ffd9d5; }
.notice .n-ico { flex: none; font-size: 2.1rem; line-height: 1.4; }

/* ---------- evidence grid / scene ---------- */
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.6rem;
  margin-top: 2.4rem;
}
.evidence {
  position: relative;
  border: 2px solid var(--line);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border-radius: 24px;
  padding: 2rem 2rem 2.1rem;
  transition: border-color 0.16s, transform 0.16s;
}
.evidence:hover { border-color: #3a4756; transform: translateY(-4px); }
.evidence .ev-ico {
  width: 76px; height: 76px;
  display: grid; place-items: center;
  font-size: 2.2rem;
  border-radius: 18px;
  background: #10151b;
  border: 2px solid var(--line);
  margin-bottom: 1.2rem;
}
.evidence h4 {
  margin: 0 0 0.6rem;
  font-size: 1.96rem;
  font-family: var(--serif);
  letter-spacing: 0.01em;
}
.evidence p { margin: 0; font-size: 1.72rem; color: var(--muted); line-height: 1.55; }
.evidence .tag {
  position: absolute;
  top: 1.7rem; right: 1.7rem;
  font-family: var(--mono);
  font-size: 1.04rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.36rem 0.84rem;
  border-radius: 8px;
  border: 2px solid var(--line);
  color: var(--muted-2);
}
.evidence .tag.hot { color: #f0b7b2; border-color: rgba(200,67,59,0.5); background: var(--red-dim); }

/* floor plan */
.plan-wrap {
  margin-top: 2.6rem;
  border: 2px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  padding: 2rem;
}
.plan-title {
  font-family: var(--mono);
  font-size: 1.2rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 1.4rem;
}
.plan {
  display: grid;
  grid-template-columns: 0.9fr 1.2fr 1.2fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  min-height: 360px;
  font-family: var(--mono);
  font-size: 1.24rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.plan-room {
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem;
  color: var(--muted);
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0 12px, transparent 12px 24px),
    #11161c;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
}
.plan-room.span2 { grid-column: span 2; }
.plan-room .plan-body {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: var(--red-2);
  border: 2px dashed var(--red);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  background: var(--red-dim);
  font-weight: 700;
  font-size: 1.16rem;
  white-space: nowrap;
}
.plan-room.booth { border-color: rgba(200,67,59,0.55); color: #e8c3bf; }

/* ---------- witnesses ---------- */
.witness-list { display: flex; flex-direction: column; gap: 1.7rem; margin-top: 2.4rem; }
.witness {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 1.8rem;
  border: 2px solid var(--line);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border-radius: 24px;
  padding: 2rem;
}
.avatar {
  width: 104px; height: 104px;
  border-radius: 20px;
  display: grid; place-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2.1rem;
  color: #fff;
  background: linear-gradient(150deg, #3a4652, #1e262f);
  border: 2px solid var(--line);
  flex: none;
}
.witness h4 { margin: 0 0 0.3rem; font-size: 1.96rem; }
.witness .role {
  font-family: var(--mono);
  font-size: 1.16rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 1.1rem;
}
.witness p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  color: #b9c1cb;
  font-size: 1.9rem;
  line-height: 1.6;
}

/* ---------- forensics ---------- */
.report-list { display: flex; flex-direction: column; gap: 1.7rem; margin-top: 2.4rem; }
.report {
  border: 2px solid var(--line);
  border-left: 6px solid var(--gold);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border-radius: 20px;
  padding: 1.9rem 2.2rem;
}
.report .r-head {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 0.8rem;
}
.report .r-code {
  font-family: var(--mono);
  font-size: 1.12rem;
  letter-spacing: 0.14em;
  color: #2a2110;
  background: var(--gold);
  padding: 0.28rem 0.8rem;
  border-radius: 6px;
  font-weight: 700;
}
.report h4 { margin: 0; font-size: 1.9rem; font-family: var(--serif); }
.report p { margin: 0; color: var(--muted); font-size: 1.8rem; line-height: 1.6; }
.report.hot { border-left-color: var(--red); }
.report.hot .r-code { background: var(--red); color: #fff; }
.report p b { color: #e6e9ee; }

/* ---------- phone / messages ---------- */
.phone {
  margin-top: 2.4rem;
  border: 2px solid #333c47;
  border-radius: 52px;
  background: linear-gradient(170deg, #11151a, #0b0e12);
  padding: 24px;
  box-shadow: var(--shadow), inset 0 0 0 2px rgba(255,255,255,0.03);
  max-width: 1760px;
}
.phone-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.4rem 1.2rem;
  font-family: var(--mono);
  font-size: 1.2rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.phone-top .signal { color: var(--green); }
.phone-body {
  display: grid;
  grid-template-columns: 480px minmax(0, 1fr);
  border: 2px solid var(--line-soft);
  border-radius: 32px;
  overflow: hidden;
  background: #0c1015;
  min-height: 860px;
}
.threads {
  border-right: 2px solid var(--line-soft);
  background: #0e1319;
  overflow-y: auto;
  max-height: 1040px;
}
.threads-head {
  padding: 1.5rem 1.8rem;
  font-family: var(--mono);
  font-size: 1.16rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
  border-bottom: 2px solid var(--line-soft);
  position: sticky;
  top: 0;
  background: #0e1319;
  z-index: 1;
}
.thread {
  display: flex;
  gap: 1.3rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 2px solid #161c23;
  background: transparent;
  color: var(--text);
  padding: 1.4rem 1.8rem;
  cursor: pointer;
  transition: background 0.14s;
  font-family: var(--sans);
}
.thread:hover { background: #141b22; }
.thread.active { background: #1a222c; box-shadow: inset 6px 0 0 var(--red); }
.thread .t-ava {
  width: 68px; height: 68px; flex: none;
  border-radius: 16px;
  display: grid; place-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.6rem;
  background: #232c36;
  border: 2px solid var(--line);
}
.thread .t-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.24rem;
  overflow: hidden;
}
.thread .t-name {
  display: block;
  font-size: 1.68rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread .t-sub {
  display: block;
  font-family: var(--mono);
  font-size: 1.04rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread .t-dot {
  margin-left: auto;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--red);
  flex: none;
  margin-top: 12px;
  opacity: 0;
}
.thread.unread .t-dot { opacity: 1; }

.chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background:
    radial-gradient(1200px 600px at 70% 0%, rgba(200,67,59,0.05), transparent 60%),
    #0c1015;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 1.4rem 1.9rem;
  border-bottom: 2px solid var(--line-soft);
  background: rgba(17, 22, 28, 0.7);
}
.chat-head .t-ava { width: 72px; height: 72px; }
.chat-head .ch-name { font-size: 1.8rem; font-weight: 600; }
.chat-head .ch-sub {
  font-family: var(--mono);
  font-size: 1.08rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.chat-head .ch-badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 1.04rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  border: 2px solid rgba(201,164,76,0.35);
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
}
.chat-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  overflow-y: auto;
  max-height: 860px;
  flex: 1;
}
.msg {
  max-width: 78%;
  padding: 1.1rem 1.5rem;
  border-radius: 24px;
  font-size: 1.76rem;
  line-height: 1.45;
  animation: fadeUp 0.25s ease both;
}
.msg .m-time {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.06em;
  opacity: 0.55;
}
.msg.them {
  align-self: flex-start;
  background: #1b232d;
  border: 2px solid #26313d;
  border-bottom-left-radius: 8px;
  color: #d3d9e1;
}
.msg.me {
  align-self: flex-end;
  background: linear-gradient(160deg, #8f2f2a, #74241f);
  border: 2px solid #a83a33;
  border-bottom-right-radius: 8px;
  color: #ffe9e6;
}
.chat-empty {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 4rem;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 1.28rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.8;
}

/* ---------- interrogation ---------- */
.suspect-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
  margin-top: 2.4rem;
}
.suspect-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  border: 2px solid var(--line);
  background: var(--panel);
  border-radius: 24px;
  padding: 1.6rem 1rem;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--sans);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.suspect-tab:hover { border-color: var(--muted-2); color: var(--text); }
.suspect-tab.active {
  border-color: rgba(200,67,59,0.55);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  color: #fff;
}
.suspect-tab .avatar { width: 92px; height: 92px; font-size: 1.9rem; }
.suspect-tab .st-name { font-size: 1.64rem; font-weight: 600; text-align: center; line-height: 1.2; }
.suspect-tab .st-role {
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  text-align: center;
}
.suspect-tab .st-count {
  font-family: var(--mono);
  font-size: 1.04rem;
  color: var(--gold);
}

.suspect-panel {
  margin-top: 2rem;
  border: 2px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(165deg, var(--panel-2), var(--panel));
  padding: clamp(2rem, 2.5vw, 3rem);
  animation: fadeUp 0.3s ease both;
}
.sp-head {
  display: flex;
  gap: 2rem;
  align-items: center;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--line-soft);
  margin-bottom: 2rem;
}
.sp-head .avatar { width: 128px; height: 128px; font-size: 2.5rem; }
.sp-head h3 { margin: 0; font-family: var(--serif); font-size: 2.8rem; }
.sp-head .sp-role {
  font-family: var(--mono);
  font-size: 1.16rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-top: 0.4rem;
}
.sp-alibi {
  margin-left: auto;
  text-align: right;
  font-family: var(--mono);
  font-size: 1.12rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  max-width: 40%;
}
.sp-alibi b { display: block; color: #e0b9b5; margin-top: 0.5rem; text-transform: none; letter-spacing: 0; font-family: var(--serif); font-style: italic; font-size: 1.72rem; }
.qa-list { display: flex; flex-direction: column; gap: 1.1rem; }
.qa {
  border: 2px solid var(--line-soft);
  border-radius: 20px;
  overflow: hidden;
  background: #11161c;
}
.qa-q {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 1.5rem 1.8rem;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 1.8rem;
  transition: background 0.14s;
}
.qa-q:hover { background: #161d25; }
.qa-q .q-mark {
  font-family: var(--mono);
  color: var(--red-2);
  font-weight: 700;
  flex: none;
}
.qa-q .q-plus { margin-left: auto; color: var(--muted-2); transition: transform 0.2s; }
.qa.open .q-plus { transform: rotate(45deg); color: var(--gold); }
.qa-a {
  display: none;
  padding: 0 1.9rem 1.7rem 4.2rem;
  font-family: var(--serif);
  font-style: italic;
  color: #b7c0ca;
  font-size: 1.86rem;
  line-height: 1.6;
  border-top: 2px solid transparent;
}
.qa.open .qa-a { display: block; animation: fadeUp 0.25s ease both; }
.qa-a .lie {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--mono);
  font-style: normal;
  font-size: 1.08rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f0b7b2;
  border: 2px solid rgba(200,67,59,0.45);
  padding: 0.32rem 0.8rem;
  border-radius: 8px;
  background: var(--red-dim);
}
.qa-hint {
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ---------- accusation ---------- */
.accuse-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.6rem;
  margin-top: 2.4rem;
}
.accuse-card {
  text-align: left;
  border: 2px solid var(--line);
  background: linear-gradient(165deg, var(--panel-2), var(--panel));
  border-radius: 28px;
  padding: 2.2rem;
  cursor: pointer;
  color: var(--text);
  font-family: var(--sans);
  display: flex;
  gap: 1.8rem;
  align-items: center;
  transition: border-color 0.16s, transform 0.16s, background 0.16s;
}
.accuse-card:hover { border-color: rgba(200,67,59,0.5); transform: translateY(-4px); background: linear-gradient(165deg, #1d2530, #141a21); }
.accuse-card .avatar { width: 116px; height: 116px; font-size: 2.2rem; }
.accuse-card h4 { margin: 0 0 0.3rem; font-size: 2.04rem; }
.accuse-card .ac-role {
  font-family: var(--mono);
  font-size: 1.08rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.accuse-card .ac-motive { display: block; margin-top: 0.7rem; font-size: 1.64rem; color: var(--muted); }

/* ---------- result ---------- */
.result { animation: fadeUp 0.5s ease both; }
.result-banner {
  position: relative;
  border: 2px solid var(--line);
  border-radius: 32px;
  padding: clamp(2.8rem, 4vw, 4.8rem);
  overflow: hidden;
  background:
    radial-gradient(1400px 600px at 80% 0%, rgba(200,67,59,0.14), transparent 60%),
    linear-gradient(165deg, var(--panel-2), #10151b);
}
.result-banner.win { background: radial-gradient(1400px 600px at 80% 0%, rgba(79,157,105,0.16), transparent 60%), linear-gradient(165deg, #18231c, #10151b); }
.result-banner .big-stamp {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  border: 4px solid var(--red);
  color: var(--red-2);
  display: inline-block;
  padding: 0.7rem 1.6rem;
  border-radius: 8px;
  transform: rotate(-4deg);
  margin-bottom: 2rem;
}
.result-banner.win .big-stamp { border-color: var(--green); color: #7fce9a; }
.result-banner h2 {
  font-family: var(--serif);
  font-size: clamp(3.6rem, 4.5vw, 6rem);
  margin: 0 0 1.2rem;
  line-height: 1.05;
}
.result-banner p { color: var(--muted); margin: 0; max-width: 60ch; }
.score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin: 2.8rem 0 0;
}
.score-box {
  border: 2px solid var(--line);
  background: rgba(10, 13, 17, 0.5);
  border-radius: 20px;
  padding: 1.4rem 2rem;
  min-width: 240px;
}
.score-box span {
  display: block;
  font-family: var(--mono);
  font-size: 1.08rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 0.3rem;
}
.score-box b { font-family: var(--serif); font-size: 2.8rem; }
.score-box b.gold { color: var(--gold); }
.score-box b.green { color: #7fce9a; }
.chain {
  list-style: none;
  padding: 0;
  margin: 1.6rem 0 0;
  counter-reset: chain;
}
.chain li {
  position: relative;
  padding: 1.1rem 0 1.1rem 4.4rem;
  border-bottom: 2px dashed rgba(80, 65, 40, 0.22);
  color: #3b3327;
  font-size: 1.84rem;
}
.chain li:last-child { border-bottom: 0; }
.chain li::before {
  counter-increment: chain;
  content: counter(chain);
  position: absolute;
  left: 0;
  top: 1.2rem;
  width: 3rem; height: 3rem;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 1.24rem;
  font-weight: 700;
  color: #fff;
  background: var(--red);
}
.result-actions { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 2.8rem; }

/* ---------- footer ---------- */
.site-foot {
  max-width: 2440px;
  margin: 0 auto;
  padding: 3.2rem clamp(2rem, 4vw, 5rem) 6rem;
  border-top: 2px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 3rem;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 1.16rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.site-foot b { color: var(--muted); }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: rgba(4, 6, 8, 0.78);
  backdrop-filter: blur(12px);
  animation: fadeIn 0.2s ease both;
}
.modal {
  width: min(920px, 100%);
  border: 2px solid var(--line);
  border-radius: 32px;
  background: linear-gradient(165deg, #1a212a, #11161c);
  box-shadow: var(--shadow);
  padding: 3rem;
  animation: fadeUp 0.25s ease both;
}
.modal .eyebrow { margin-bottom: 1.4rem; }
.modal h3 { font-family: var(--serif); font-size: 2.8rem; margin: 0 0 1.2rem; }
.modal p { color: var(--muted); margin: 0 0 2.4rem; font-size: 1.84rem; }
.modal-actions { display: flex; gap: 1.2rem; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- responsive ---------- */
@media (max-width: 1800px) {
  .topbar-meta .hide-sm { display: none; }
  .layout { grid-template-columns: 1fr; }
  .stage-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    gap: 1rem;
    padding-bottom: 0.8rem;
    scrollbar-width: thin;
  }
  .nav-label, .nav-foot { display: none; }
  .nav-item {
    flex: none;
    min-width: 240px;
    border: 2px solid var(--line);
    background: var(--panel);
  }
  .nav-item .nav-titles small { display: none; }
  .phone-body { grid-template-columns: 1fr; }
  .threads {
    border-right: 0;
    border-bottom: 2px solid var(--line-soft);
    display: flex;
    overflow-x: auto;
    max-height: none;
  }
  .threads-head { display: none; }
  .thread {
    flex: none;
    width: 380px;
    border-bottom: 0;
    border-right: 2px solid #161c23;
  }
  .suspect-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-body { max-height: 720px; min-height: 480px; }
}

@media (max-width: 1280px) {
  body { font-size: 30px; }
  .topbar { gap: 1.2rem; padding: 1.3rem 1.8rem; flex-wrap: wrap; }
  .topbar-sep { display: none; }
  .topbar-meta { width: 100%; justify-content: flex-end; }
  .brand-name b { font-size: 1.72rem; letter-spacing: 0.1em; }
  .brand-name span { font-size: 1rem; letter-spacing: 0.2em; }
  .topbar-meta .hide-sm { display: none; }
  .progress-track { width: 148px; }
  .filmstrip { display: none; }
  .paper .red-stamp { display: none; }
  .doc-head--stamped { padding-right: 0; }
  .dossier-grid { grid-template-columns: 1fr; }
  .evidence-grid { grid-template-columns: 1fr; }
  .accuse-grid { grid-template-columns: 1fr; }
  .sp-head { flex-wrap: wrap; }
  .sp-alibi { margin-left: 0; text-align: left; max-width: 100%; }
  .plan { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 1fr); }
  .plan-room.span2 { grid-column: span 2; }
  .case-head .case-file { text-align: left; }
  .msg { max-width: 88%; }
  .thread { width: 330px; }
  .hero-stamp { top: auto; bottom: 2rem; right: 2rem; opacity: 0.6; }
}

@media (max-width: 900px) {
  .topbar { padding: 1.1rem 1.2rem; }
  .brand-mark { width: 56px; height: 56px; }
  .brand-name b { font-size: 1.42rem; }
  .brand-name span { display: none; }
  .progress-track { width: 120px; }
  .suspect-tabs { grid-template-columns: 1fr; }
  .stage-foot .btn { min-width: 0; width: 100%; }
  .hero { padding-left: 1.4rem; padding-right: 1.4rem; }
  .game { padding-left: 1.2rem; padding-right: 1.2rem; }
  .plan { grid-template-rows: repeat(4, 1fr); }
}

/* ---------- misc additions ---------- */
.stage-foot {
  margin-top: 3.4rem;
  display: flex;
  justify-content: flex-end;
}
.stage-foot .btn { min-width: 400px; }

.notice .n-ico {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid currentColor;
  font-family: var(--mono);
  font-size: 1.36rem;
  font-weight: 700;
  line-height: 1;
  flex: none;
  margin-top: 2px;
  color: var(--gold);
}
.notice.danger .n-ico { color: var(--red-2); }

.evidence .ev-ico {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.56rem;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.ac-body { display: flex; flex-direction: column; min-width: 0; }
.ac-name {
  font-family: var(--serif);
  font-size: 2.12rem;
  font-weight: 700;
  line-height: 1.2;
}
.ac-role {
  display: block;
  font-family: var(--mono);
  font-size: 1.08rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-top: 0.36rem;
}
.ac-motive {
  display: block;
  font-size: 1.64rem;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 0.8rem;
}
.score-box small {
  font-size: 1.44rem;
  color: var(--muted-2);
  font-family: var(--mono);
}
.score-box b.small-b {
  font-size: 2.16rem;
  font-family: var(--sans);
  font-weight: 600;
}

/* ---------- case library (index.html) ---------- */
a.brand { text-decoration: none; }
.hero-back { color: var(--muted); text-decoration: none; }
.hero-back:hover { color: var(--gold); }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--gold); }

.library {
  max-width: 2440px;
  margin: 0 auto;
  padding: clamp(3rem, 5vw, 7rem) clamp(1.8rem, 4vw, 5rem) 8rem;
  animation: fadeUp 0.5s ease both;
}
.library-head { max-width: 1500px; margin-bottom: 4.4rem; }
.library-head h1 {
  font-family: var(--serif);
  font-size: clamp(4.4rem, 6vw, 8rem);
  line-height: 1;
  margin: 0 0 2rem;
}
.library-head h1 em { color: var(--gold); }
.library-head p { color: var(--muted); font-size: clamp(1.9rem, 2vw, 2.2rem); line-height: 1.65; margin: 0; max-width: 62ch; }

.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 620px), 1fr));
  gap: 2rem;
}
.case-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2.4rem;
  border: 2px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  overflow: hidden;
}
.case-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: var(--line);
}
.case-card:hover { transform: translateY(-3px); border-color: var(--muted-2); box-shadow: var(--shadow); }
.case-card.is-solved::before { background: var(--green); }
.case-card.is-failed::before { background: var(--red); }
.case-card.is-progress::before { background: var(--gold); }
.cc-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.cc-num {
  font-family: var(--mono);
  font-size: 1.3rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red-2);
}
.cc-status {
  font-family: var(--mono);
  font-size: 1.16rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  border: 2px solid var(--line);
  border-radius: 1998px;
  padding: 0.3rem 1rem;
}
.cc-status.win { color: #9fd8b1; border-color: rgba(79,157,105,0.55); }
.cc-status.fail { color: #f0b7b2; border-color: rgba(200,67,59,0.55); }
.cc-status.prog { color: var(--gold); border-color: rgba(201,164,76,0.5); }
.cc-status.lock { color: var(--text); border-color: var(--gold); background: rgba(201,164,76,0.12); }
.cc-status.free { color: #9fd8b1; border-color: rgba(79,157,105,0.55); }
.case-card.is-locked { cursor: pointer; }
.case-card.is-locked .cc-teaser { opacity: 0.7; }
.account { display: inline-flex; align-items: center; gap: 1rem; }
.account .btn-small { padding: 0.5rem 1.2rem; font-size: 1.3rem; }
.cc-title { font-family: var(--serif); font-size: 3.2rem; font-weight: 700; line-height: 1.1; }
.cc-setting {
  font-family: var(--mono);
  font-size: 1.24rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.cc-teaser { color: var(--muted); font-size: 1.8rem; line-height: 1.55; flex: 1; }
.cc-chips { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 0.6rem; }
.cc-chips .chip { font-size: 1.1rem; padding: 0.5rem 1.1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===== language switcher ===== */
.lang-select {
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .85rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  padding: .2rem .4rem;
  margin-left: .6rem;
  cursor: pointer;
}
.lang-select option { color: #111; background: #fff; }
#lang-switch { display: inline-flex; align-items: center; }
/* long brand name ("The Attic Files") must wrap on phones */
@media (max-width: 600px) {
  .brand, .brand-name { min-width: 0; }
  .brand-name b { white-space: normal; letter-spacing: 0.06em; }
  /* the language select shares the meta row with progress + reset */
  .topbar-meta { gap: 1rem; }
  .progress-track { width: 64px; }
  .lang-select { margin-left: 0; }
  /* translated titles have longer words than the Russian originals */
  .case-head > * { min-width: 0; }
  .case-head h1 { overflow-wrap: break-word; hyphens: auto; }
  .doc-head { flex-wrap: wrap; row-gap: 0.4rem; }
}

/* ---------- ratings ---------- */
.cc-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 1.24rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.cc-rating b { color: var(--gold); }
.rating-stars { display: inline-flex; gap: 0.15rem; line-height: 1; }
.rating-star {
  color: var(--muted-2);
  font-size: 1.5rem;
  border: 0;
  background: none;
  padding: 0;
  cursor: default;
}
.rating-star.on { color: var(--gold); }
button.rating-star { cursor: pointer; transition: transform 0.12s ease, color 0.12s ease; }
button.rating-star:hover { transform: translateY(-2px); }
.rating-box {
  margin-top: 2.4rem;
  border: 2px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  padding: 2rem 2.2rem;
}
.rating-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.rating-eyebrow {
  font-family: var(--mono);
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.rating-avg { font-family: var(--mono); font-size: 1.2rem; color: var(--muted); }
.rating-box h3 { font-family: var(--serif); font-size: 2.4rem; margin: 0 0 0.6rem; }
.rating-box p { color: var(--muted); margin: 0 0 1.4rem; }
.rating-choice .rating-star { font-size: 3rem; }
.rating-thanks { color: #9fd8b1; font-family: var(--mono); font-size: 1.2rem; margin-top: 1rem; }

/* ---------- admin ---------- */
.admin-page .library-head { margin-bottom: 2.4rem; }
.admin-section { margin-bottom: 3.6rem; }
.admin-section h2 { font-family: var(--serif); font-size: 2.8rem; margin: 0 0 1.6rem; }
.admin-note {
  color: var(--muted);
  border: 2px dashed var(--line);
  border-radius: 18px;
  padding: 1.6rem 2rem;
}
.admin-table-wrap { overflow-x: auto; border: 2px solid var(--line); border-radius: 20px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 1.5rem; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
.admin-table th {
  font-family: var(--mono);
  font-size: 1.1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  background: rgba(10, 13, 17, 0.5);
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td b { color: var(--text); }
.admin-code { color: var(--muted-2); font-family: var(--mono); font-size: 1.05rem; margin-left: 0.4rem; }
.admin-summary { margin-bottom: 2rem; }
.admin-summary .score-box b.small-b { font-size: 2.2rem; }

/* ---------- homepage SEO content ---------- */
.library-seo {
  margin-top: 6rem;
  display: flex;
  flex-direction: column;
  gap: 4.2rem;
}
.seo-head { max-width: 980px; margin-bottom: 2.6rem; }
.seo-head h2 {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 3vw, 4rem);
  line-height: 1.1;
  margin: 0 0 1.2rem;
}
.seo-head p {
  margin: 0;
  max-width: 70ch;
  color: var(--muted);
  font-size: 1.7rem;
  line-height: 1.65;
}
.seo-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
}
.seo-steps li {
  border: 2px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  padding: 2rem;
}
.seo-num {
  display: block;
  margin-bottom: 0.7rem;
  font-family: var(--mono);
  font-size: 1.3rem;
  letter-spacing: 0.18em;
  color: var(--red-2);
}
.seo-steps h3 {
  font-family: var(--serif);
  font-size: 1.9rem;
  margin: 0 0 0.6rem;
  line-height: 1.25;
}
.seo-steps p { margin: 0; color: var(--muted); font-size: 1.5rem; line-height: 1.55; }

.seo-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}
.seo-features article {
  border: 2px solid var(--line);
  border-left: 6px solid var(--gold);
  border-radius: 16px;
  background: var(--panel);
  padding: 1.7rem 1.9rem;
}
.seo-features h3 {
  font-family: var(--serif);
  font-size: 1.7rem;
  margin: 0 0 0.5rem;
}
.seo-features p { margin: 0; color: var(--muted); font-size: 1.45rem; line-height: 1.55; }

.seo-why {
  border: 2px dashed var(--line);
  border-radius: 24px;
  padding: 2.8rem;
  background: rgba(20, 26, 33, 0.45);
}
.seo-why h2 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 2.4vw, 3rem);
  margin: 0 0 1.6rem;
}
.seo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem 2.4rem;
}
.seo-list li {
  position: relative;
  padding-left: 2.6rem;
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1.5;
}
.seo-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(79, 157, 105, 0.14);
}

.seo-faq details {
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  margin-bottom: 1rem;
  overflow: hidden;
}
.seo-faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.4rem;
  cursor: pointer;
  list-style: none;
  padding: 1.5rem 1.9rem;
  font-family: var(--serif);
  font-size: 1.7rem;
  color: var(--text);
}
.seo-faq summary::-webkit-details-marker { display: none; }
.seo-faq summary::after {
  content: "+";
  font-family: var(--mono);
  font-size: 1.6rem;
  color: var(--gold);
}
.seo-faq details[open] summary::after { content: "−"; }
.seo-faq details p {
  margin: 0;
  padding: 0 1.9rem 1.7rem;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1.6;
}
.seo-cta { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: center; }

/* ===== phones: keep the noir look but scale it down to fit =====
   The layout is authored in rem while body text sits at 32px, which is far too
   large for a phone. Below tablet width we shrink the rem base and override the
   hand-tuned clamps so headings, cards and documents fit the viewport. */
@media (max-width: 720px) {
  html { font-size: 12px; }
  body { font-size: 16px; line-height: 1.6; }

  /* top bar */
  .topbar { gap: 0.6rem 1rem; padding: 0.9rem 1.1rem; }
  .brand { gap: 0.8rem; min-width: 0; }
  .brand-mark { width: 44px; height: 44px; border-radius: 12px; }
  .brand-mark svg { width: 24px; height: 24px; }
  .brand-name b { font-size: 1.5rem; letter-spacing: 0.05em; }
  .brand-name span { font-size: 1.05rem; letter-spacing: 0.16em; }
  .topbar-sep { display: none; }
  .topbar-meta { width: 100%; flex-wrap: wrap; gap: 0.5rem 0.9rem; font-size: 1.3rem; }
  .progress-track { width: 72px; height: 8px; }
  .lang-select { font-size: 1.15rem; padding: 0.25rem 0.45rem; }

  /* library / index */
  .library { padding: 2.6rem 1.3rem 5rem; }
  .library-head { margin-bottom: 2.6rem; }
  .eyebrow { font-size: 1.15rem; letter-spacing: 0.2em; margin-bottom: 1.2rem; }
  .library-head h1 { font-size: clamp(2.8rem, 10vw, 4.2rem); margin-bottom: 1.4rem; }
  .library-head p { font-size: 1.5rem; line-height: 1.6; }
  .case-grid { gap: 1.2rem; }
  .case-card { padding: 1.6rem; gap: 0.7rem; border-radius: 18px; }
  .cc-title { font-size: 2.3rem; }
  .cc-setting, .cc-teaser { font-size: 1.4rem; }
  .cc-num, .cc-status { font-size: 1.15rem; }
  .cc-chips .chip { font-size: 1.1rem; padding: 0.45rem 0.9rem; }

  /* game shell */
  .game { padding: 1.6rem 1.3rem 5rem; }
  .case-head { gap: 1.2rem; padding: 1.2rem 0 1.8rem; margin-bottom: 2rem; }
  .case-head h1 { font-size: clamp(2.4rem, 9vw, 3.4rem); }
  .case-head .case-file { font-size: 1.2rem; }
  .stage-head { margin-bottom: 2rem; }
  .stage-head h2 { font-size: clamp(2.2rem, 8vw, 3rem); }
  .stage-head p { font-size: 1.6rem; }

  /* case intro (hero) */
  .hero { min-height: 0; padding: 2.4rem 1.2rem 3rem; }
  .hero-inner { width: 100%; }
  .hero h1 { font-size: clamp(2.6rem, 10vw, 4rem); line-height: 1.02; }
  .hero-sub { font-size: 1.6rem; margin: 1.6rem auto 2.2rem; }
  .hero-chips { gap: 0.6rem; margin-bottom: 2.2rem; }
  .hero-foot { margin-top: 2.6rem; font-size: 1.05rem; }
  .stamp { font-size: 1rem; padding: 0.45rem 1rem; border-width: 3px; }

  /* horizontal stage nav */
  .nav-item { min-width: 180px; padding: 0.9rem 1rem; font-size: 1.5rem; gap: 0.9rem; }
  .nav-item .nav-num { width: 2.4rem; font-size: 1.1rem; }

  /* paper documents */
  .paper { padding: 1.8rem 1.5rem; border-radius: 18px; overflow-wrap: break-word; }
  .paper::before { inset: 9px; border-radius: 10px; }
  .paper h3 { font-size: 2rem; margin-bottom: 1.2rem; }
  .paper p { font-size: 1.5rem; }
  .paper .doc-label { font-size: 1.05rem; }
  .paper .hand { font-size: 1.6rem; }
  .doc-head { font-size: 1.15rem; gap: 0.8rem; flex-wrap: wrap; row-gap: 0.4rem; }
  .dossier-cell { padding: 1rem 1.2rem; }
  .dossier-cell b { font-size: 1.5rem; }
  .dossier-cell span { font-size: 1rem; }
  .quote { font-size: 1.7rem; padding-left: 1.2rem; margin: 1.4rem 0; }

  /* evidence / reports / witnesses */
  .evidence, .witness, .report, .notice, .plan-wrap, .suspect-panel,
  .accuse-card, .result-banner, .rating-box, .admin-note { border-radius: 18px; }
  .evidence-grid, .accuse-grid { gap: 1.1rem; }
  .evidence { padding: 1.4rem; overflow-wrap: break-word; }
  .evidence .ev-ico { width: 52px; height: 52px; font-size: 1.4rem; border-radius: 12px; margin-bottom: 0.8rem; }
  .evidence h4 { font-size: 1.6rem; }
  .evidence p { font-size: 1.4rem; }
  .evidence .tag { top: 1rem; right: 1rem; font-size: 0.95rem; }

  .witness { grid-template-columns: 56px minmax(0, 1fr); gap: 1rem; padding: 1.3rem; overflow-wrap: break-word; }
  .avatar { width: 56px; height: 56px; border-radius: 12px; font-size: 1.5rem; }
  .witness h4 { font-size: 1.6rem; }
  .witness .role { font-size: 1rem; margin-bottom: 0.7rem; }
  .witness p { font-size: 1.5rem; }

  .report { padding: 1.3rem 1.4rem; }
  .report .r-code { font-size: 1rem; }
  .report h4 { font-size: 1.55rem; }
  .report p { font-size: 1.45rem; }

  .notice { padding: 1.2rem 1.3rem; font-size: 1.45rem; gap: 0.9rem; }
  .notice .n-ico { width: 34px; height: 34px; font-size: 1.1rem; }

  .plan-wrap { padding: 1.2rem; }
  .plan-title { font-size: 1rem; }
  .plan { min-height: 250px; font-size: 1.05rem; gap: 8px; }
  .plan-room { padding: 0.7rem; }
  .plan-room .plan-body { font-size: 0.95rem; padding: 0.3rem 0.55rem; white-space: normal; }

  /* messages */
  .phone { padding: 12px; border-radius: 30px; }
  .phone-body { border-radius: 20px; min-height: 0; }
  .phone-top { padding: 0.5rem 0.8rem 0.8rem; font-size: 1.05rem; }
  .thread { width: 260px; padding: 1rem; gap: 0.8rem; }
  .thread .t-ava { width: 48px; height: 48px; font-size: 1.2rem; border-radius: 12px; }
  .thread .t-name { font-size: 1.4rem; }
  .thread .t-sub { font-size: 0.95rem; }
  .chat-head { padding: 1rem; gap: 0.9rem; flex-wrap: wrap; }
  .chat-head .t-ava { width: 48px; height: 48px; }
  .chat-head .ch-name { font-size: 1.4rem; }
  .chat-head .ch-sub { font-size: 0.95rem; }
  .chat-head .ch-badge { font-size: 0.9rem; padding: 0.3rem 0.6rem; }
  .chat-body { padding: 1.1rem; gap: 0.8rem; min-height: 320px; max-height: 62vh; }
  .msg { max-width: 92%; font-size: 1.45rem; padding: 0.8rem 1rem; }

  /* interrogation */
  .suspect-tabs { gap: 0.8rem; }
  .suspect-tab { padding: 1rem 0.6rem; gap: 0.6rem; border-radius: 16px; }
  .suspect-tab .avatar { width: 56px; height: 56px; font-size: 1.4rem; }
  .suspect-tab .st-name { font-size: 1.4rem; }
  .suspect-tab .st-role, .suspect-tab .st-count { font-size: 0.95rem; }
  .suspect-panel { padding: 1.4rem; }
  .sp-head { gap: 1rem; padding-bottom: 1.2rem; margin-bottom: 1.4rem; }
  .sp-head .avatar { width: 64px; height: 64px; font-size: 1.6rem; }
  .sp-head h3 { font-size: 2rem; }
  .sp-head .sp-role { font-size: 1rem; }
  .sp-alibi { font-size: 1rem; }
  .sp-alibi b { font-size: 1.4rem; }
  .qa-q { padding: 1rem 1.1rem; gap: 0.8rem; font-size: 1.5rem; }
  .qa-a { padding: 0 1.1rem 1.1rem 1.8rem; font-size: 1.5rem; }
  .qa-a .lie { font-size: 0.95rem; }

  /* accusation / result */
  .accuse-card { padding: 1.2rem; gap: 1rem; }
  .accuse-card .avatar { width: 60px; height: 60px; font-size: 1.5rem; }
  .accuse-card h4, .ac-name { font-size: 1.7rem; }
  .accuse-card .ac-role { font-size: 1rem; }
  .accuse-card .ac-motive, .ac-motive { font-size: 1.4rem; }
  .result-banner { padding: 1.8rem 1.4rem; border-radius: 22px; }
  .result-banner h2 { font-size: clamp(2.2rem, 8vw, 3.2rem); }
  .result-banner .big-stamp { font-size: 1.1rem; padding: 0.5rem 1rem; margin-bottom: 1.4rem; }
  .score-row { gap: 1rem; margin-top: 1.8rem; }
  .score-box { min-width: 0; flex: 1 1 100%; padding: 1rem 1.2rem; }
  .score-box b { font-size: 2rem; }
  .chain li { padding: 0.8rem 0 0.8rem 3rem; font-size: 1.5rem; }
  .chain li::before { width: 2.2rem; height: 2.2rem; font-size: 1rem; top: 0.9rem; }
  .result-actions, .hero-actions { gap: 0.8rem; }
  .result-actions .btn, .hero-actions .btn { width: 100%; }

  /* buttons */
  .btn { font-size: 1.6rem; padding: 0.9rem 1.6rem; gap: 0.6rem; }
  .btn-small { padding: 0.6rem 1.1rem; font-size: 1.3rem; }
  .stage-foot { margin-top: 2rem; }

  /* footer + modal */
  .site-foot { padding: 2rem 1.3rem 3rem; font-size: 1.05rem; gap: 0.8rem 1.6rem; }
  .modal-overlay { padding: 1rem; }
  .modal { padding: 1.6rem; border-radius: 20px; }
  .modal h3 { font-size: 2rem; }
  .modal p { font-size: 1.5rem; }
  .modal-actions { gap: 0.8rem; }
  .modal-actions .btn { width: 100%; }

  /* misc */
  .rating-box { padding: 1.4rem; }
  .rating-box h3 { font-size: 1.9rem; }
  .rating-choice .rating-star { font-size: 2.4rem; }
  .admin-section h2 { font-size: 2rem; }
  .admin-table { font-size: 1.2rem; }
}

@media (max-width: 420px) {
  .brand-name span { display: none; }
  .hero-stamp { display: none; }
  .plan { grid-template-columns: 1fr; grid-template-rows: none; }
  .plan-room.span2 { grid-column: auto; }
  .plan-room { min-height: 84px; }
}

@media (max-width: 720px) {
  .library-seo { margin-top: 3.2rem; gap: 2.6rem; }
  .seo-head { margin-bottom: 1.6rem; }
  .seo-head h2 { font-size: clamp(2rem, 8vw, 2.8rem); }
  .seo-head p, .seo-steps p, .seo-features p, .seo-list li, .seo-faq details p { font-size: 1.4rem; }
  .seo-steps { grid-template-columns: 1fr; gap: 1rem; }
  .seo-steps li { padding: 1.3rem; }
  .seo-steps h3, .seo-features h3, .seo-faq summary { font-size: 1.5rem; }
  .seo-features { grid-template-columns: 1fr; }
  .seo-features article { padding: 1.2rem 1.3rem; }
  .seo-why { padding: 1.4rem; }
  .seo-why h2 { font-size: 1.9rem; margin-bottom: 1.1rem; }
  .seo-list { grid-template-columns: 1fr; gap: 0.8rem; }
  .seo-faq summary { padding: 1.1rem 1.2rem; gap: 0.8rem; }
  .seo-faq details p { padding: 0 1.2rem 1.2rem; }
  .seo-cta .btn { width: 100%; }
}
