/* case.css v6: кинозал -> рассекречивание -> камера/вспышка/проявка -> слэм + доска следователя с красной нитью */

@view-transition {
  navigation: auto;
}

.case-page-shell {
  --o: #ff5a1f;
  --o2: #ff7a47;
  --paper: #f3efe4;
  --card: #161614;
  --card-2: #1c1b18;
  --bg: #0f0f0e;
  --line: rgba(243, 239, 228, 0.12);
  --line-strong: rgba(243, 239, 228, 0.24);
  --soft: #a4a096;
  --m: var(--mono, ui-monospace, SFMono-Regular, Consolas, monospace);
  --d: 'Roboto Condensed', 'Arial Narrow', sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  min-height: 100vh;
  background: var(--bg);
  color: var(--paper);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  position: relative;
  z-index: 1;
}

/* 1. Открытие кинозала (Letterbox shutters) */
.cinema-curtain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cinema-bar {
  height: 50vh;
  background: #050504;
}

.cinema-bar--top {
  transform-origin: top;
}

.cinema-bar--bottom {
  transform-origin: bottom;
}

.cinema-aperture {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.cinema-aperture-tag {
  padding: 8px 16px;
  border: 1px solid rgba(255, 90, 31, 0.55);
  background: rgba(16, 16, 15, 0.92);
  color: var(--o2);
  font: 700 0.8rem/1 var(--m);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 3px;
}

.cinema-stage-root.is-skipped .cinema-curtain,
.cinema-stage-root.is-skipped .declassify-word-bar {
  display: none;
}

/* Шапка дела */
.case-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(28px, 4vw, 54px) clamp(26px, 3.4vw, 42px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 60% 130% at 88% -10%, rgba(255, 90, 31, 0.18), transparent 62%),
    radial-gradient(ellipse 40% 80% at 15% 110%, rgba(255, 90, 31, 0.06), transparent 60%),
    linear-gradient(180deg, #171715, var(--bg));
}

.case-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.022) 3px 4px);
}

.case-hero-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.case-hero-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.case-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 0.78rem/1 var(--m);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #adaea8;
  padding: 6px 0;
  transition: color 0.25s;
}

.case-back-arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease);
}

.case-back:hover {
  color: var(--o);
}

.case-back:hover .case-back-arrow {
  transform: translateX(-4px);
}

.cinema-pill-btn {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  font: 600 0.72rem/1 var(--m);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.cinema-pill-btn:hover,
.cinema-pill-btn.is-on {
  color: var(--o2);
  border-color: rgba(255, 90, 31, 0.5);
  background: rgba(255, 90, 31, 0.1);
}

.case-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 18px;
  font: 600 0.75rem/1.2 var(--m);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.case-badge,
.case-stamp,
.case-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 6px;
}

.case-badge {
  border: 1px solid rgba(255, 90, 31, 0.45);
  background: rgba(255, 90, 31, 0.12);
  color: var(--o2);
}

.case-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--o);
  display: inline-block;
}

.case-stamp {
  border: 1.5px solid rgba(244, 63, 94, 0.6);
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
  transform: rotate(-1.5deg);
  box-shadow: 0 4px 18px rgba(244, 63, 94, 0.12);
}

.case-meta-item {
  color: var(--soft);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.case-title {
  font: 800 clamp(2.5rem, 6.8vw, 5.2rem) / 0.92 var(--d);
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin: 0;
  text-wrap: balance;
}

.case-title span {
  color: var(--o);
}

/* 2. Рассекречивание абзаца (по случайным словам) */
.declassify-wrap {
  position: relative;
  margin-top: 18px;
  max-width: 68ch;
}

.case-summary {
  margin: 0;
  font-size: clamp(1rem, 1.18vw, 1.12rem);
  line-height: 1.65;
  color: #d6d3c9;
  white-space: pre-line;
  text-wrap: pretty;
}

.declassify-word {
  position: relative;
  display: inline-block;
}

.declassify-word-bar {
  position: absolute;
  top: 0.12em;
  bottom: 0.08em;
  left: -2px;
  right: -2px;
  border-radius: 2px;
  background: linear-gradient(180deg, #0a0a09 0%, #161614 100%);
  transform-origin: right center;
  transform: scaleX(0);
  opacity: 0;
  pointer-events: none;
}

/* Основная сцена */
.case-stage {
  padding-block: clamp(26px, 3.5vw, 46px) clamp(36px, 4.5vw, 56px);
}

.case-stage-grid.is-single {
  grid-template-columns: 1fr;
}

@media (min-width: 961px) {
  .case-stage-grid.is-single .stage-primary {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(24px, 3.2vw, 44px);
    align-items: start;
  }
}

.stage-primary {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

/* 3 & 4. Камера видеонаблюдения + Вспышка затвора и Проявка */
.stage-featured-card {
  margin: 0;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  overflow: hidden;
  box-shadow: 0 26px 70px -24px rgba(0, 0, 0, 0.85);
}

.stage-featured-frame {
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
  background: #060605;
  --px: 0px;
  --py: 0px;
  --cb: linear-gradient(rgba(243, 239, 228, 0.82), rgba(243, 239, 228, 0.82));
}

.stage-featured-frame::after {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: 2;
  pointer-events: none;
  background:
    var(--cb) 0 0 / 18px 2px no-repeat,
    var(--cb) 0 0 / 2px 18px no-repeat,
    var(--cb) 100% 0 / 18px 2px no-repeat,
    var(--cb) 100% 0 / 2px 18px no-repeat,
    var(--cb) 0 100% / 18px 2px no-repeat,
    var(--cb) 0 100% / 2px 18px no-repeat,
    var(--cb) 100% 100% / 18px 2px no-repeat,
    var(--cb) 100% 100% / 2px 18px no-repeat;
  opacity: 0.78;
}

.shutter-flash {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #f8f6ef;
  opacity: 0;
  pointer-events: none;
}

.cctv-scanline {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(0, 0, 0, 0.22) 2px 4px);
  opacity: 0.45;
}

.stage-hud {
  position: absolute;
  inset: 22px 24px;
  z-index: 3;
  pointer-events: none;
  font: 600 0.74rem/1 var(--m);
  letter-spacing: 0.1em;
  color: rgba(243, 239, 228, 0.92);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.95);
}

.stage-hud-rec {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.stage-hud-rec b {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--o);
  display: inline-block;
}

.stage-hud-cam {
  position: absolute;
  top: 0;
  right: 0;
}

.stage-hud-tc {
  position: absolute;
  bottom: 0;
  left: 0;
  font-variant-numeric: tabular-nums;
}

.stage-hud-signal {
  position: absolute;
  bottom: 0;
  right: 0;
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.stage-hud-signal i {
  width: 3px;
  background: rgba(243, 239, 228, 0.88);
  height: 25%;
}
.stage-hud-signal i:nth-child(2) { height: 45%; }
.stage-hud-signal i:nth-child(3) { height: 65%; }
.stage-hud-signal i:nth-child(4) { height: 82%; }
.stage-hud-signal i:nth-child(5) { height: 100%; }

.evidence-zoom-btn {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.stage-featured-frame img,
.stage-featured-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stage-featured-frame video {
  object-fit: contain;
  background: #050505;
}

.stage-featured-frame img {
  transform: translate(var(--px), var(--py)) scale(1.03);
  transition: transform 0.6s var(--ease), filter 0.4s;
}

.stage-featured-card:hover .stage-featured-frame img {
  transform: translate(var(--px), var(--py)) scale(1.06);
}

.stage-zoom-hint {
  position: absolute;
  right: 22px;
  bottom: 44px;
  z-index: 4;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(16, 16, 15, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-strong);
  font: 600 0.72rem/1 var(--m);
  color: var(--paper);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s, transform 0.3s var(--ease);
}

.evidence-zoom-btn:hover .stage-zoom-hint {
  opacity: 1;
  transform: translateY(0);
}

.evidence-caption {
  padding: 13px 16px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #cbc8be;
  border-top: 1px solid var(--line);
}

.stage-caption-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stage-media-counter {
  font: 600 0.74rem/1 var(--m);
  color: var(--o2);
  white-space: nowrap;
}

/* Кинолента миниатюр с перфорацией */
.filmstrip {
  margin-top: 14px;
  background: #0c0c0b;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.filmstrip-sprockets {
  height: 12px;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 8px,
    rgba(243, 239, 228, 0.18) 8px 16px,
    transparent 16px 24px
  );
  border-block: 1px solid rgba(243, 239, 228, 0.06);
}

.filmstrip-track {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #3a3934 transparent;
}

.filmstrip-frame {
  position: relative;
  flex: none;
  width: 112px;
  height: 68px;
  padding: 0;
  border: 1.5px solid rgba(243, 239, 228, 0.18);
  border-radius: 3px;
  background: #161614;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.62;
  transition: opacity 0.25s, border-color 0.25s, transform 0.3s var(--ease);
}

.filmstrip-frame:hover {
  opacity: 0.95;
  transform: translateY(-2px) scale(1.03);
}

.filmstrip-frame.is-active {
  opacity: 1;
  border-color: var(--o);
  box-shadow: 0 0 0 2px rgba(255, 90, 31, 0.28);
}

.filmstrip-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.filmstrip-num {
  position: absolute;
  bottom: 3px;
  right: 5px;
  z-index: 2;
  padding: 1px 4px;
  background: rgba(10, 10, 9, 0.8);
  font: 700 0.62rem/1.1 var(--m);
  color: var(--o2);
  border-radius: 2px;
}

.stage-thumb-video {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font: 700 0.7rem/1 var(--m);
  color: var(--o2);
  background: var(--bg);
}

/* Заключение следствия */
.stage-verdict {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)), var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(22px, 2.8vw, 34px);
  box-shadow: 0 22px 55px -26px rgba(0, 0, 0, 0.75);
}

.stage-verdict::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 10px 0 0 10px;
  background: linear-gradient(180deg, var(--o), rgba(255, 90, 31, 0.2));
}

.dossier-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.dossier-num {
  font: 700 0.84rem/1 var(--m);
  color: var(--o);
}

.dossier-title {
  font: 800 clamp(1.85rem, 3.2vw, 2.65rem) / 0.96 var(--d);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin: 0;
}

.stage-verdict-text {
  margin: 0;
  font-size: clamp(1.04rem, 1.2vw, 1.15rem);
  line-height: 1.66;
  color: #e6e3d8;
  white-space: pre-line;
  text-wrap: pretty;
}

.case-highlight-box {
  position: relative;
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px dashed rgba(255, 90, 31, 0.55);
  background: rgba(255, 90, 31, 0.09);
  border-radius: 6px;
  transform: rotate(-0.4deg);
  transition: border-color 0.25s, background-color 0.25s;
}

.case-highlight-box:hover {
  border-color: rgba(255, 90, 31, 0.8);
  background: rgba(255, 90, 31, 0.13);
}

.case-highlight-label {
  display: inline-block;
  font: 700 0.72rem/1 var(--m);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #10100f;
  background: var(--o);
  padding: 4px 8px;
  border-radius: 3px;
  margin-bottom: 9px;
}

.case-highlight-box p {
  margin: 0;
  font-size: clamp(1.03rem, 1.18vw, 1.12rem);
  line-height: 1.55;
  color: var(--paper);
}

.case-quote {
  margin: 18px 0 0;
  padding: 13px 16px;
  border-left: 2px solid var(--o);
  background: rgba(0, 0, 0, 0.28);
  border-radius: 0 6px 6px 0;
  color: #d6d3c9;
  font: 500 0.94rem/1.55 var(--m);
}

.case-empty {
  padding: 40px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  text-align: center;
  color: var(--soft);
}

/* 5. Доска следователя с кнопками и красной нитью */
.detective-board-section {
  padding-block: clamp(20px, 3vw, 32px) clamp(56px, 7vw, 90px);
  border-top: 1px solid var(--line);
}

.board-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.board-title {
  font: 800 clamp(1.9rem, 3.6vw, 2.9rem) / 0.95 var(--d);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin: 6px 0 0;
}

.board-title span {
  color: var(--o);
}

.board-count {
  font: 600 0.78rem/1 var(--m);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--soft);
}

.detective-board {
  position: relative;
  padding: clamp(22px, 3vw, 36px);
  border-radius: 12px;
  border: 1px solid rgba(243, 239, 228, 0.14);
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 90, 31, 0.06), transparent 48%),
    radial-gradient(circle at 80% 75%, rgba(220, 38, 38, 0.07), transparent 52%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 28px),
    #131210;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.board-threads {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: visible;
}

.board-thread-path {
  fill: none;
  stroke: #e12d1c;
  stroke-width: 2;
  stroke-linecap: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.8));
  opacity: 0.88;
}

.board-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(20px, 2.8vw, 32px);
  align-items: start;
}

.board-pin-card {
  position: relative;
  background: #1b1a17;
  border: 1px solid rgba(243, 239, 228, 0.16);
  border-radius: 4px;
  padding: 22px 14px 14px;
  box-shadow: 0 18px 34px -14px rgba(0, 0, 0, 0.85);
  transform-origin: 50% 4px;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.35s var(--ease), border-color 0.25s, box-shadow 0.35s;
}

.board-pin-card.is-text-only {
  padding: 24px 18px 18px;
  background: linear-gradient(180deg, #211f1b, #181714);
}

.board-pin-card.is-text-only .board-card-caption {
  font-size: 0.96rem;
  line-height: 1.58;
  color: var(--paper);
}

.board-pin-card:hover {
  transform: rotate(0deg) translateY(-4px) scale(1.02);
  border-color: rgba(255, 90, 31, 0.55);
  box-shadow: 0 24px 44px -16px rgba(0, 0, 0, 0.95);
  z-index: 4;
}

.board-pin {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff7666, #c81e1e 65%, #7a0c0c);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.8);
  z-index: 4;
}

.board-card-label {
  font: 700 0.7rem/1 var(--m);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--o2);
  margin-bottom: 10px;
}

.board-card-photo {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid rgba(243, 239, 228, 0.12);
  background: #0a0a09;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 2px;
  cursor: zoom-in;
  margin-bottom: 10px;
}

.board-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease);
}

.board-pin-card:hover .board-card-photo img {
  transform: scale(1.06);
}

.board-card-note {
  aspect-ratio: 16 / 7;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(243, 239, 228, 0.14);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 2px;
  margin-bottom: 10px;
  font: 600 0.72rem/1 var(--m);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7c7970;
}

.board-card-caption {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #dcd9ce;
}

/* Нативный <dialog> лайтбокс */
.case-lightbox {
  border: 0;
  padding: 24px;
  margin: auto;
  max-width: 94vw;
  max-height: 92vh;
  background: transparent;
  color: var(--paper);
}

.case-lightbox::backdrop {
  background: rgba(8, 8, 8, 0.92);
  backdrop-filter: blur(10px);
}

.case-lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--paper);
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.25s, color 0.25s, transform 0.2s;
}

.case-lightbox-close:hover {
  background: var(--paper);
  color: var(--bg);
  transform: rotate(90deg);
}

.case-lightbox-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-lightbox-figure img {
  max-width: 88vw;
  max-height: 80vh;
  object-fit: contain;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.85);
}

.case-lightbox-figure figcaption {
  text-align: center;
  font-size: 0.92rem;
  color: #d6d3c9;
}

.case-page-shell :focus-visible {
  outline: 2px solid #ffd29e;
  outline-offset: 3px;
}

@media (max-width: 560px) {
  .case-title {
    font-size: clamp(2.1rem, 11vw, 3.2rem);
  }
  .filmstrip-frame {
    width: 88px;
    height: 54px;
  }
}

/* Кинематографичные анимации */
@media (prefers-reduced-motion: no-preference) {
  @keyframes cin-bar-open {
    0%, 28% { transform: scaleY(1); }
    100% { transform: scaleY(0); }
  }
  @keyframes cin-aperture {
    0% { opacity: 0; transform: scale(0.95); }
    20%, 60% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; visibility: hidden; }
  }
  @keyframes cin-word-declassify {
    0% { transform: scaleX(1); opacity: 1; }
    82% { transform: scaleX(0); opacity: 1; }
    100% { transform: scaleX(0); opacity: 0; }
  }
  @keyframes cin-crt-on {
    0% {
      opacity: 0;
      transform: scaleX(0.3) scaleY(0.012);
      filter: brightness(3) contrast(1.6);
    }
    38% {
      opacity: 1;
      transform: scaleX(1) scaleY(0.018);
      filter: brightness(2.4) contrast(1.4);
    }
    76% {
      opacity: 1;
      transform: scaleX(1) scaleY(1.01);
      filter: brightness(1.15) contrast(1.05);
    }
    100% {
      opacity: 1;
      transform: scaleX(1) scaleY(1);
      filter: brightness(1) contrast(1);
    }
  }
  @keyframes cin-flash {
    0% { opacity: 0.88; }
    100% { opacity: 0; }
  }
  @keyframes cin-develop {
    0% {
      filter: brightness(0.18) contrast(1.45) grayscale(1);
    }
    45% {
      filter: brightness(0.75) contrast(1.2) grayscale(0.6);
    }
    100% {
      filter: brightness(1) contrast(1) grayscale(0);
    }
  }
  @keyframes cin-slam {
    0% { opacity: 0; transform: scale(1.45) rotate(-5deg); }
    65% { opacity: 1; transform: scale(0.97) rotate(0.3deg); }
    100% { opacity: 1; transform: scale(1) rotate(-0.4deg); }
  }
  @keyframes cin-leaf-sway-a {
    0% {
      opacity: 0;
      transform: translateY(-14px) rotate(-6.5deg);
    }
    24% {
      opacity: 1;
      transform: translateY(0) rotate(5deg);
    }
    42% {
      transform: rotate(-3.6deg);
    }
    58% {
      transform: rotate(2.3deg);
    }
    74% {
      transform: rotate(-1.2deg);
    }
    88% {
      transform: rotate(0.5deg);
    }
    100% {
      opacity: 1;
      transform: rotate(var(--tilt, 0deg));
    }
  }
  @keyframes cin-leaf-sway-b {
    0% {
      opacity: 0;
      transform: translateY(-14px) rotate(6.5deg);
    }
    24% {
      opacity: 1;
      transform: translateY(0) rotate(-5deg);
    }
    42% {
      transform: rotate(3.6deg);
    }
    58% {
      transform: rotate(-2.3deg);
    }
    74% {
      transform: rotate(1.2deg);
    }
    88% {
      transform: rotate(-0.5deg);
    }
    100% {
      opacity: 1;
      transform: rotate(var(--tilt, 0deg));
    }
  }
  @keyframes cin-thread-draw {
    from { stroke-dashoffset: var(--len, 400); }
    to { stroke-dashoffset: 0; }
  }
  @keyframes c-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes c-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 90, 31, 0.55); }
    50% { box-shadow: 0 0 0 6px rgba(255, 90, 31, 0); }
  }
  @keyframes c-rec {
    50% { opacity: 0.25; }
  }
  @keyframes c-pop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
  }

  .cinema-stage-root.is-playing .cinema-bar {
    animation: cin-bar-open 0.85s var(--ease) both;
  }
  .cinema-stage-root.is-playing .cinema-aperture {
    animation: cin-aperture 0.75s var(--ease) both;
  }
  .cinema-stage-root.is-playing .case-hero .case-meta-row {
    animation: c-up 0.6s 0.32s var(--ease) both;
  }
  .cinema-stage-root.is-playing .case-hero .case-title {
    animation: c-up 0.65s 0.42s var(--ease) both;
  }
  .cinema-stage-root.is-playing .declassify-word-bar {
    animation: cin-word-declassify 0.44s var(--ease) both;
  }
  .cinema-stage-root.is-playing .cctv-power .stage-featured-frame {
    animation: cin-crt-on 0.9s 0.82s var(--ease) both;
  }
  .cinema-stage-root.is-playing .verdict-enter {
    animation: c-up 0.65s 1.2s var(--ease) both;
  }
  .cinema-stage-root.is-playing .slam-stamp {
    animation: cin-slam 0.55s 1.55s var(--ease) both;
  }
  .cinema-stage-root.is-playing .filmstrip {
    animation: c-up 0.55s 1.35s var(--ease) both;
  }
  .cinema-stage-root.is-playing .board-pin-card:nth-child(odd) {
    animation: cin-leaf-sway-a 3.8s ease-in-out both;
  }
  .cinema-stage-root.is-playing .board-pin-card:nth-child(even) {
    animation: cin-leaf-sway-b 3.8s ease-in-out both;
  }
  .cinema-stage-root.is-playing .board-thread-path {
    stroke-dasharray: var(--len, 400);
    stroke-dashoffset: var(--len, 400);
    animation: cin-thread-draw 0.65s var(--ease) forwards;
  }

  .shutter-flash {
    animation: cin-flash 0.5s var(--ease) both;
  }
  .photo-develop img {
    animation: cin-develop 0.95s var(--ease) both;
  }
  .case-badge i,
  .stage-hud-rec b {
    animation: c-pulse 2s ease-out infinite;
  }
  .stage-hud-rec {
    animation: c-rec 2.2s ease-in-out infinite;
  }
  .case-lightbox[open] {
    animation: c-pop 0.26s var(--ease) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cinema-curtain,
  .declassify-word-bar,
  .shutter-flash {
    display: none !important;
  }
  .case-page-shell *,
  .case-page-shell *::before,
  .case-page-shell *::after {
    animation: none !important;
    transition: none !important;
  }
}
/* === Единый бумажный стиль для всех карточек на доске следователя === */
.board-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 310px));
  justify-content: start;
  align-items: stretch;
}

.board-pin-card {
  display: flex;
  flex-direction: column;
  padding: 24px 16px 18px;
  background:
    radial-gradient(circle at 86% 12%, rgba(160, 145, 115, 0.14), transparent 55%),
    linear-gradient(175deg, #ece7d8 0%, #dfd8c5 100%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 18px 34px -14px rgba(0, 0, 0, 0.9),
    inset 0 0 24px rgba(120, 108, 82, 0.12);
}

.board-pin-card.is-text-only {
  min-height: 210px;
  padding: 24px 18px 20px;
  background:
    radial-gradient(circle at 86% 12%, rgba(160, 145, 115, 0.14), transparent 55%),
    linear-gradient(175deg, #ece7d8 0%, #dfd8c5 100%);
}

/* Шапка карточки (заголовок) всегда прижата к верху и хорошо читается */
.board-card-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #181714;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding-bottom: 9px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(24, 23, 20, 0.18);
}

.board-card-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--o);
  flex: none;
}

/* Фото внутри бумажной карточки как вклеенный снимок */
.board-card-photo {
  border: 3px solid #f7f4eb;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  margin-bottom: 12px;
}

.board-card-caption,
.board-pin-card.is-text-only .board-card-caption {
  color: #1f1e1a;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.5;
  margin: 0;
}

/* В текстовой карточке текст не уезжает в середину, а начинается под шапкой */
.board-pin-card.is-text-only .board-card-caption {
  font-size: 0.96rem;
  line-height: 1.55;
}

.board-pin-card:hover {
  border-color: var(--o);
  box-shadow:
    0 24px 44px -16px rgba(0, 0, 0, 0.95),
    0 0 0 2px rgba(255, 90, 31, 0.45);
}

.board-pin-card .redact {
  background: #181714;
  color: transparent;
}

.board-pin-card .redact:is(:hover, :focus-visible, .is-open) {
  background: rgba(255, 90, 31, 0.25);
  color: #181714;
}

@media (max-width: 600px) {
  .board-grid {
    grid-template-columns: 1fr;
  }
  .board-pin-card.is-text-only {
    min-height: 150px;
  }
}
