/* ───────────────────────────────────────────────────────────
   «Город теней»: тёмная нуар-тема, новые экраны и общие ассистенты
   ─────────────────────────────────────────────────────────── */

:root {
  --n-bg0: #0e0b1b;
  --n-bg1: #171230;
  --n-card: #221b3d;
  --n-card2: #2b2349;
  --n-line: rgba(255, 255, 255, 0.11);
  --n-text: #f4eddd;
  --n-soft: #aaa2c6;
  --n-gold: #eab24d;
  --n-gold-deep: #c88a2a;
  --n-pink: #ff5fa2;
  --n-teal: #3ee0d0;
  --n-red: #ff5468;
}

/* ───────── общие ассистенты (работают во всех кампаниях) ───────── */

.cell-cross.auto {
  opacity: 0.5;
}

.cell-cross.auto::before,
.cell-cross.auto::after {
  height: clamp(3px, 7%, 8px);
}

.cell.conflict::before {
  position: absolute;
  z-index: 12;
  inset: 0;
  content: "";
  border: 3px solid rgba(255, 74, 92, 0.92);
  background: rgba(255, 74, 92, 0.16);
  box-shadow: 0 0 14px rgba(255, 74, 92, 0.55);
  pointer-events: none;
  animation: conflict-pulse 1.3s ease-in-out infinite;
}

@keyframes conflict-pulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

.cell.lens-hit::after {
  position: absolute;
  z-index: 11;
  inset: 2px;
  content: "";
  border: 2px solid rgba(62, 224, 208, 0.9);
  border-radius: 6px;
  background: radial-gradient(circle, rgba(62, 224, 208, 0.34), rgba(62, 224, 208, 0.06) 75%);
  box-shadow: 0 0 12px rgba(62, 224, 208, 0.6);
  pointer-events: none;
  animation: lens-breathe 1.8s ease-in-out infinite;
}

@keyframes lens-breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.clue-line {
  cursor: pointer;
  border-radius: 6px;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.clue-line.clue-bad {
  margin: 0 -2px;
  padding: 1px 3px;
  color: #b3242f;
  background: rgba(255, 74, 92, 0.14);
  box-shadow: inset 2px 0 0 #ff4a5c;
}

.clue-line.clue-ok::after {
  margin-left: 3px;
  color: #3fa35f;
  content: "✓";
  font-weight: 900;
}

.suspect-card.has-conflict {
  border-color: #ff4a5c;
}

.home-gear,
.mobile-gear-button {
  cursor: pointer;
}

.home-gear {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-left: 8px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: #fff7e8;
  background: rgba(18, 10, 10, 0.5);
  backdrop-filter: blur(10px);
  font-size: 20px;
}

.home-gear:hover {
  background: rgba(18, 10, 10, 0.72);
}

.mobile-gear-button {
  display: none;
}

/* ───────── настройки ───────── */

.settings-card {
  width: min(100%, 440px);
  text-align: left;
}

.settings-card h2 {
  margin-bottom: 14px;
  text-align: center;
}

.settings-list {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(40, 31, 43, 0.1);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(40, 31, 43, 0.045);
  cursor: pointer;
  text-align: left;
}

.setting-copy {
  display: grid;
  gap: 2px;
}

.setting-copy strong {
  font-size: 14px;
}

.setting-copy small {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
}

.switch {
  position: relative;
  width: 46px;
  height: 27px;
  border-radius: 99px;
  background: rgba(40, 31, 43, 0.2);
  transition: background 0.18s ease;
}

.switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: transform 0.18s ease;
}

.switch.on {
  background: #3fa35f;
}

.switch.on i {
  transform: translateX(19px);
}

/* ───────── окно победы ───────── */

.win-card {
  position: relative;
  overflow: hidden;
}

.win-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: -4px 0 6px;
}

.win-stars span {
  color: rgba(40, 31, 43, 0.16);
  font-size: 46px;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.06);
}

.win-stars span.on {
  color: #f1b936;
  text-shadow: 0 2px 0 #b9801a, 0 0 22px rgba(241, 185, 54, 0.6);
  animation: star-pop 0.6s cubic-bezier(0.2, 0.9, 0.25, 1.4) both;
  animation-delay: calc(var(--i) * 0.18s);
}

@keyframes star-pop {
  0% { opacity: 0; transform: scale(0.2) rotate(-40deg); }
  70% { transform: scale(1.25) rotate(8deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

.win-killer {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 14px 0 4px;
  padding: 12px 14px;
  border: 1px solid rgba(200, 77, 66, 0.28);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(200, 77, 66, 0.12), rgba(200, 77, 66, 0.03));
  text-align: left;
  animation: killer-reveal 0.7s 0.5s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

@keyframes killer-reveal {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
}

.win-killer-photo {
  display: block;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 3px solid #c84d42;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(200, 77, 66, 0.18);
}

.win-killer-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.win-killer-copy {
  display: grid;
  gap: 1px;
}

.win-killer-copy small {
  color: #b2392f;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.win-killer-copy strong {
  font-family: Georgia, serif;
  font-size: 21px;
}

.win-killer-copy em {
  color: var(--ink-soft);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.win-news {
  margin: 12px 0 0 !important;
  padding: 8px 12px;
  border-radius: 12px;
  color: #6a4b00 !important;
  background: #ffe9a8;
  font-size: 13px !important;
  font-weight: 850 !important;
}

.win-tip {
  margin: 12px 0 16px !important;
  font-size: 12px !important;
}

.win-actions {
  display: grid;
  gap: 9px;
}

.win-actions .secondary-button {
  width: 100%;
  min-height: 46px;
}

/* ───────────────────────────────────────────────────────────
   Экраны раздела «Город теней»
   ─────────────────────────────────────────────────────────── */

.noir-screen,
.game-screen.campaign-noir,
.noir-modal {
  --paper: #120e24;
  --paper-2: #221b3d;
  --paper-3: #2b2349;
  --ink: #f4eddd;
  --ink-soft: #aaa2c6;
  --accent: #eab24d;
  --accent-deep: #c88a2a;
}

.noir-screen {
  position: relative;
  color: var(--n-text);
  background:
    radial-gradient(circle at 12% -8%, rgba(255, 95, 162, 0.22), transparent 38%),
    radial-gradient(circle at 92% 6%, rgba(62, 224, 208, 0.14), transparent 34%),
    linear-gradient(180deg, #120d26, #0b0818 70%);
}

.noir-screen .topbar {
  background: rgba(14, 10, 28, 0.78);
  border-bottom-color: var(--n-line);
}

@media (max-width: 680px) {
  .game-screen.campaign-noir .topbar {
    background: rgba(14, 10, 28, 0.78);
    border-bottom-color: var(--n-line);
  }
}

.noir-screen .icon-button,
.noir-screen .pill,
.game-screen.campaign-noir .icon-button {
  border-color: var(--n-line);
  color: var(--n-text);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
}

.noir-screen .eyebrow {
  color: var(--n-soft);
}

.noir-screen .section-intro {
  color: var(--n-soft);
}

.noir-pill {
  padding: 0 14px;
  border-radius: 99px;
  color: var(--n-gold) !important;
  font-size: 13px;
  font-weight: 900;
}

.noir-shell {
  display: grid;
  gap: 18px;
}

/* — шапка раздела — */

.noir-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  overflow: hidden;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--n-line);
  border-radius: 26px;
  background:
    linear-gradient(120deg, rgba(255, 95, 162, 0.16), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.noir-hero::after {
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 220px;
  height: 220px;
  content: "";
  border-radius: 50%;
  background: radial-gradient(circle, rgba(62, 224, 208, 0.22), transparent 70%);
  pointer-events: none;
}

.noir-hero-kicker {
  margin: 0 0 6px;
  color: var(--n-pink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.noir-hero h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1;
  text-shadow: 0 0 24px rgba(255, 95, 162, 0.35);
}

.noir-hero p {
  max-width: 540px;
  margin: 0;
  color: var(--n-soft);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
}

.noir-hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, auto));
  gap: 8px;
}

.noir-hero-stats > * {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--n-line);
  border-radius: 16px;
  color: var(--n-text);
  background: rgba(10, 7, 22, 0.55);
  text-align: center;
}

.noir-hero-stats strong {
  color: var(--n-gold);
  font-size: 22px;
  line-height: 1;
}

.noir-hero-stats span {
  color: var(--n-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.noir-dossier-button {
  cursor: pointer;
  font: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.noir-dossier-button:hover {
  border-color: rgba(234, 178, 77, 0.55);
  transform: translateY(-2px);
}

/* — районы — */

.noir-districts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
  gap: 14px;
}

.noir-district {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 112px;
  padding: 0 16px 0 0;
  overflow: hidden;
  border: 1px solid var(--n-line);
  border-radius: 22px;
  color: var(--n-text);
  background:
    linear-gradient(110deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%),
    var(--n-card);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.noir-district:hover:not(.locked) {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 26px color-mix(in srgb, var(--accent) 25%, transparent);
  transform: translateY(-2px);
}

.noir-district.locked {
  cursor: not-allowed;
  filter: saturate(0.4) brightness(0.72);
}

.noir-district-art {
  position: relative;
  align-self: stretch;
  overflow: hidden;
}

.noir-district-art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.noir-district-art::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent 60%, var(--n-card));
}

.noir-district-icon {
  position: absolute;
  z-index: 2;
  bottom: 8px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: 14px;
  background: rgba(10, 7, 22, 0.72);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 40%, transparent);
  font-size: 22px;
}

.noir-district-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.noir-district-copy small {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.noir-district-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.1;
}

.noir-district-copy em {
  color: var(--n-soft);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.noir-district-side {
  display: grid;
  justify-items: end;
  gap: 4px;
  min-width: 64px;
  text-align: right;
}

.noir-district-side b {
  font-size: 20px;
}

.noir-stars-mini {
  color: var(--n-gold);
  font-size: 11px;
  font-weight: 900;
}

.noir-lock {
  font-size: 22px;
}

.noir-need {
  max-width: 96px;
  color: var(--n-soft);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.25;
}

.noir-district-bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.07);
}

.noir-district-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 50%, white));
  box-shadow: 0 0 12px var(--accent);
}

.noir-district.complete {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
}

/* — район: список дел — */

.noir-chapter-banner {
  position: relative;
  min-height: 150px;
  overflow: hidden;
  border: 1px solid var(--n-line);
  border-radius: 24px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
}

.noir-chapter-banner svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.noir-chapter-banner::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 20%, rgba(8, 5, 18, 0.86));
}

.noir-chapter-banner p {
  position: absolute;
  z-index: 2;
  right: 18px;
  bottom: 14px;
  left: 18px;
  margin: 0;
  color: #efe6d2;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.noir-chapter-icon {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 16px;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: 18px;
  background: rgba(10, 7, 22, 0.7);
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 45%, transparent);
  font-size: 28px;
}

.noir-case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 14px;
}

.noir-case {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  gap: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--n-line);
  border-radius: 20px;
  color: var(--n-text);
  background: var(--n-card);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.noir-case:hover {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 24px color-mix(in srgb, var(--accent) 24%, transparent);
  transform: translateY(-3px);
}

.noir-case.solved {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}

.noir-mini {
  display: grid;
  aspect-ratio: 1.55;
  width: 100%;
  padding: 14px 40px;
  background: linear-gradient(180deg, #181232, #110c24);
}

.noir-mini i {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
}

.noir-mini i b {
  position: absolute;
  inset: 22%;
  border-radius: 2px;
  background: rgba(8, 5, 18, 0.62);
}

.noir-case-num {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 26px;
  padding: 0 7px;
  border-radius: 9px;
  color: #1a1330;
  background: var(--accent);
  font-size: 12px;
  font-weight: 950;
}

.noir-case-size {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  border-radius: 99px;
  color: var(--n-text);
  background: rgba(8, 5, 18, 0.7);
  font-size: 11px;
  font-weight: 900;
}

.noir-case-copy {
  display: grid;
  gap: 5px;
  padding: 12px 14px 14px;
}

.noir-case-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.15;
}

.noir-case-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 18px;
}

.noir-stars {
  display: inline-flex;
  gap: 1px;
  color: rgba(255, 255, 255, 0.18);
  font-size: 15px;
  letter-spacing: 0;
}

.noir-stars span.on {
  color: var(--n-gold);
  text-shadow: 0 0 10px rgba(234, 178, 77, 0.5);
}

.noir-time,
.noir-new {
  color: var(--n-soft);
  font-size: 11px;
  font-weight: 800;
}

.noir-new {
  color: var(--n-teal);
}

/* — картотека — */

.noir-files {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 132px), 1fr));
  gap: 12px;
}

.noir-file {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 14px 8px 12px;
  border: 1px solid var(--n-line);
  border-radius: 18px;
  background: var(--n-card);
  text-align: center;
  opacity: 0.55;
}

.noir-file.known {
  background: linear-gradient(170deg, var(--n-card2), var(--n-card));
  opacity: 1;
}

.noir-file-photo {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  overflow: hidden;
  border: 2px solid var(--n-line);
  border-radius: 50%;
  color: var(--n-soft);
  background: rgba(255, 255, 255, 0.05);
  font-size: 30px;
  font-weight: 900;
}

.noir-file.known .noir-file-photo {
  border-color: var(--n-gold);
  box-shadow: 0 0 18px rgba(234, 178, 77, 0.3);
}

.noir-file-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.noir-file strong {
  font-size: 13px;
  line-height: 1.15;
}

.noir-file small {
  color: var(--n-soft);
  font-size: 11px;
  font-weight: 700;
}

/* ───────────────────────────────────────────────────────────
   Игровой экран в теме «Город теней»
   ─────────────────────────────────────────────────────────── */

.game-screen.campaign-noir {
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 100%, rgba(255, 95, 162, 0.16), transparent 34%),
    radial-gradient(circle at 96% 0%, rgba(62, 224, 208, 0.1), transparent 30%),
    linear-gradient(180deg, #130e27, #0b0818);
}

.campaign-noir .board-wrap {
  border: 3px solid #0a0713;
  border-radius: 12px;
  background: #0a0713;
  box-shadow: 0 0 0 1px rgba(234, 178, 77, 0.45), 0 22px 54px rgba(0, 0, 0, 0.6), 0 0 70px rgba(255, 95, 162, 0.14);
}

.campaign-noir .board-grid {
  background: #0a0713;
}

.campaign-noir .cell {
  background-color: #1b1530;
  background-image: var(--floor-image);
  background-position: center;
  background-size: 100% 100%;
  border-color: rgba(10, 7, 19, 0.36);
}

.campaign-noir .cell.wall-top {
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.07);
}

.campaign-noir .cell.wall-left {
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.07);
}

.campaign-noir .cell.wall-top.wall-left {
  box-shadow: inset 3px 3px 0 rgba(255, 255, 255, 0.07);
}

.campaign-noir .cell:hover:not(.blocked) {
  filter: brightness(1.14);
}

.campaign-noir .cell-dot {
  background: rgba(255, 255, 255, 0.2);
}

.campaign-noir .object-image {
  width: 94%;
  height: 94%;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.5));
  transform: none;
}

.campaign-noir .object-image.multi-cell-object {
  top: 2%;
  left: 2%;
  width: calc(var(--object-cols, 1) * 96%);
  height: calc(var(--object-rows, 1) * 96%);
  object-fit: fill;
  transform: none;
}

.campaign-noir .cell.object-anchor:hover .object-image,
.campaign-noir .cell.object-anchor:hover .object-image.multi-cell-object {
  transform: none;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.5)) brightness(1.1);
}

.campaign-noir .shareable-object .object-image:not(.multi-cell-object) {
  width: 94%;
  height: 94%;
}

.campaign-noir .cell.object-footprint-rug {
  z-index: 3;
}

.campaign-noir .cell.object-footprint-rug.object-anchor {
  z-index: 4;
}

.campaign-noir .cell.object-footprint {
  z-index: 2;
}

.campaign-noir .placed-portrait {
  border: 2.5px solid #f3d27c;
  background: #1b1530;
  box-shadow: 0 0 0 1.5px rgba(10, 7, 19, 0.85), 0 4px 10px rgba(0, 0, 0, 0.55);
}

.campaign-noir .placed-portrait img {
  transform: none;
}

.campaign-noir .placed-portrait.victim {
  border-color: var(--n-red);
  box-shadow: 0 0 0 1.5px rgba(10, 7, 19, 0.85), 0 0 14px rgba(255, 84, 104, 0.6);
}

.campaign-noir .placed-portrait.on-object {
  width: 70%;
  height: 70%;
  transform: translateY(-4%);
}

.campaign-noir .placed-portrait.on-rug {
  width: 62%;
  height: 62%;
}

.campaign-noir .cell.conflict .placed-portrait {
  border-color: #ff4a5c;
}

.campaign-noir .cell-cross::before,
.campaign-noir .cell-cross::after {
  background: #f6efe0;
  box-shadow: 0 0 0 1.5px rgba(10, 7, 19, 0.85);
}

.campaign-noir .room-label {
  color: #f4eddd;
  background: rgba(10, 7, 19, 0.82);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
  letter-spacing: 0.02em;
}

.campaign-noir .icon-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* панель справа */

.campaign-noir .tool-button {
  border-color: var(--n-line);
  color: var(--n-text);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.campaign-noir .tool-button.active {
  border-color: transparent;
  color: #1a1330;
  background: linear-gradient(160deg, #f6c667, #d9902a);
  box-shadow: 0 6px 18px rgba(217, 144, 42, 0.35);
}

.campaign-noir .tool-button.rewarded {
  color: #ffe7a8;
  border-color: rgba(255, 95, 162, 0.5);
  background: linear-gradient(160deg, rgba(255, 95, 162, 0.22), rgba(255, 95, 162, 0.08));
}

.campaign-noir .ad-badge {
  border-color: #130e27;
  background: var(--n-pink);
}

.campaign-noir .tool-button .hint-count {
  border-color: #130e27;
  background: var(--n-gold-deep);
}

.campaign-noir .suspects-heading h2 {
  color: var(--n-text);
}

.campaign-noir .sound-toggle {
  border-color: var(--n-line);
  color: var(--n-text);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.campaign-noir .sound-toggle.active {
  border-color: rgba(62, 224, 208, 0.7);
  color: var(--n-teal);
  background: rgba(62, 224, 208, 0.12);
}

.campaign-noir .suspect-card {
  border: 1.5px solid var(--n-line);
  color: var(--n-text);
  background: linear-gradient(165deg, #261e45, #1a1432);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
}

.campaign-noir .suspect-card.selected {
  border-color: var(--n-gold);
  background: linear-gradient(165deg, #2f2554, #1e1739);
  box-shadow: 0 0 0 2px rgba(234, 178, 77, 0.22), 0 0 24px rgba(234, 178, 77, 0.2), 0 8px 18px rgba(0, 0, 0, 0.4);
}

.campaign-noir .suspect-card.has-conflict {
  border-color: #ff4a5c;
  box-shadow: 0 0 0 2px rgba(255, 74, 92, 0.2), 0 8px 18px rgba(0, 0, 0, 0.4);
}

.campaign-noir .suspect-card.validation-correct {
  border-color: #3fd6a4;
  background: linear-gradient(165deg, #1d3a42, #162a36);
  box-shadow: 0 0 0 2px rgba(63, 214, 164, 0.28), 0 8px 18px rgba(0, 0, 0, 0.4);
}

.campaign-noir .suspect-card.validation-wrong {
  border-color: #ff4a5c;
  background: linear-gradient(165deg, #46203a, #2a1530);
  box-shadow: 0 0 0 3px rgba(255, 74, 92, 0.24), 0 8px 18px rgba(0, 0, 0, 0.4);
}

.campaign-noir .suspect-portrait {
  border-color: rgba(255, 255, 255, 0.2);
  background: #1b1530;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

.campaign-noir .suspect-portrait img {
  transform: none;
}

.campaign-noir .suspect-chip.selected .suspect-portrait {
  border: 3px solid var(--n-gold);
  box-shadow: 0 0 0 3px rgba(234, 178, 77, 0.2), 0 0 18px rgba(234, 178, 77, 0.35);
}

.campaign-noir .suspect-chip.victim .suspect-portrait {
  border: 3px solid var(--n-red);
}

.campaign-noir .suspect-chip.victim .suspect-name {
  color: var(--n-red);
}

.campaign-noir .suspect-check,
.campaign-noir .victim-badge {
  border-color: #1a1432;
}

.campaign-noir .suspect-testimony {
  color: #ece4d2;
  font-weight: 640;
}

.campaign-noir .rule-term {
  color: #ffe2a0;
  text-decoration-color: rgba(234, 178, 77, 0.85);
}

.campaign-noir .clue-line.clue-bad {
  color: #ffb8c0;
  background: rgba(255, 74, 92, 0.18);
}

.campaign-noir .clue-line.clue-ok::after {
  color: #5fe0a2;
}

.campaign-noir .case-brief {
  border-color: var(--n-line);
  color: var(--n-text);
  background: linear-gradient(160deg, #261e45, #1a1432);
  box-shadow: 0 13px 34px rgba(0, 0, 0, 0.4);
}

.campaign-noir .case-brief > h2 {
  color: #fff4da;
}

.campaign-noir .brief-kicker {
  color: var(--n-pink);
}

.campaign-noir .brief-section {
  border-top-color: var(--n-line);
}

.campaign-noir .brief-section h3 {
  color: var(--n-text);
}

.campaign-noir .brief-section p {
  color: #cdc5e2;
}

.campaign-noir .brief-object {
  border-color: var(--n-line);
  color: var(--n-text);
  background: rgba(255, 255, 255, 0.06);
}

.campaign-noir .secondary-button {
  border-color: var(--n-line);
  color: var(--n-text);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
}

.campaign-noir .submit-button {
  color: #1a1330;
  background: linear-gradient(160deg, #f6c667, #d9902a);
  box-shadow: 0 10px 26px rgba(217, 144, 42, 0.32);
}

.campaign-noir .submit-button:disabled {
  color: rgba(244, 237, 221, 0.4);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
}

.campaign-noir .mismatch-message {
  border-color: rgba(255, 74, 92, 0.3);
  color: #ffb8c0;
  background: rgba(255, 74, 92, 0.12);
}

.campaign-noir .tutorial-button {
  color: var(--n-soft);
}

/* окна в теме «Город теней» */

.campaign-noir .modal-card {
  border-color: var(--n-line);
  color: var(--n-text);
  background: linear-gradient(170deg, #2a2150, #1a1432);
}

.campaign-noir .modal-card p {
  color: #cdc5e2;
}

.campaign-noir .modal-art {
  background: rgba(234, 178, 77, 0.16);
}

.campaign-noir .win-stars span {
  color: rgba(255, 255, 255, 0.14);
}

.campaign-noir .win-stars span.on {
  color: #f6c667;
}

.campaign-noir .win-killer {
  border-color: rgba(255, 84, 104, 0.4);
  background: linear-gradient(135deg, rgba(255, 84, 104, 0.18), rgba(255, 84, 104, 0.04));
}

.campaign-noir .win-killer-copy small {
  color: var(--n-red);
}

.campaign-noir .win-killer-copy em,
.campaign-noir .win-tip {
  color: var(--n-soft) !important;
}

.campaign-noir .setting-row {
  border-color: var(--n-line);
  color: var(--n-text);
  background: rgba(255, 255, 255, 0.05);
}

.campaign-noir .setting-copy small {
  color: var(--n-soft);
}

.campaign-noir .switch {
  background: rgba(255, 255, 255, 0.18);
}

.campaign-noir .tutorial-board-example,
.campaign-noir .tutorial-neighbor-example {
  border-color: var(--n-line);
  background: rgba(255, 255, 255, 0.05);
}

.campaign-noir .tutorial-mini-grid {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
}

.campaign-noir .tutorial-mini-grid span {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--n-text);
}

/* ───────── главный экран: карточка «Город теней» ───────── */

.secondary-button.noir-campaign-button {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 118px 34px;
  align-items: center;
  column-gap: 13px;
  width: 100%;
  min-height: 96px;
  padding: 13px 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 130, 190, 0.5);
  border-radius: 20px;
  color: #fff5de;
  background:
    radial-gradient(circle at 10% 50%, rgba(255, 95, 162, 0.28), transparent 32%),
    linear-gradient(120deg, rgba(31, 18, 62, 0.96), rgba(76, 28, 84, 0.9));
  box-shadow: 0 10px 28px rgba(8, 4, 22, 0.4), 0 0 28px rgba(255, 95, 162, 0.16), inset 0 1px 0 rgba(255, 220, 240, 0.12);
  backdrop-filter: blur(12px);
  text-align: left;
}

.secondary-button.noir-campaign-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 150, 200, 0.8);
  box-shadow: 0 12px 30px rgba(8, 4, 22, 0.5), 0 0 36px rgba(255, 95, 162, 0.3), inset 0 1px 0 rgba(255, 220, 240, 0.16);
}

.home-noir-art {
  display: block;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 1px solid rgba(255, 150, 200, 0.45);
  border-radius: 16px;
  box-shadow: 0 0 18px rgba(255, 95, 162, 0.3);
}

.home-noir-art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.noir-campaign-button .home-campaign-button-copy strong {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff4da;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
}

.noir-campaign-button .home-campaign-button-copy small {
  color: rgba(255, 238, 250, 0.78);
}

.new-badge {
  padding: 2px 7px;
  border-radius: 99px;
  color: #230b2f;
  background: linear-gradient(120deg, #ff8cc4, #ffb86b);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  font-size: 9px;
  font-style: normal;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-noir-progress {
  grid-column: 3;
  border: 1px solid rgba(255, 150, 200, 0.3);
  background: rgba(20, 8, 38, 0.4);
}

.home-noir-progress strong {
  color: #ffd9ec;
  font-size: 14px;
  line-height: 1;
}

.home-noir-progress small {
  color: rgba(255, 238, 250, 0.8);
  font-size: 8px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.home-noir-arrow {
  grid-column: 4;
  background: #ffb0d4;
}

.noir-campaign-button:hover .home-campaign-arrow {
  transform: translateX(2px);
}

/* ───────── адаптив ───────── */

@media (max-width: 680px) {
  .mobile-gear-button {
    display: inline-flex;
  }

  .gear-toggle,
  .lens-toggle {
    display: none;
  }

  .noir-hero {
    grid-template-columns: 1fr;
  }

  .noir-hero-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .noir-district {
    grid-template-columns: 84px minmax(0, 1fr) auto;
    min-height: 98px;
  }

  .noir-district-copy strong {
    font-size: 18px;
  }

  .noir-case-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .noir-mini {
    padding: 10px 24px;
  }

  .noir-case-copy {
    padding: 10px 11px 12px;
  }

  .noir-case-copy strong {
    font-size: 14px;
  }

  .secondary-button.noir-campaign-button {
    grid-template-columns: 52px minmax(0, 1fr) 92px 26px;
    column-gap: 8px;
    min-height: 92px;
    padding: 10px;
  }

  .home-noir-art {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
  }
}

@media (max-width: 400px) {
  .noir-campaign-button .home-campaign-button-copy strong {
    font-size: 17px;
  }

  .noir-campaign-button .home-campaign-button-copy small {
    font-size: 10px;
    line-height: 1.15;
  }

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

@media (prefers-reduced-motion: reduce) {
  .cell.conflict::before,
  .cell.lens-hit::after,
  .win-stars span.on,
  .win-killer {
    animation: none;
  }
}

/* ───────── общее: кнопка «назад» больше не перекрывает поле ───────── */

@media (min-width: 681px) {
  .game-layout .board-column {
    padding-left: 52px;
  }
}

/* Планшет в портретной ориентации: поле сверху на всю ширину, панель — под ним. */
@media (min-width: 681px) and (max-width: 1100px) and (orientation: portrait) {
  .game-screen {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .game-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    height: auto;
    min-height: 100dvh;
    padding-top: 56px;
  }

  .game-layout .board-column {
    padding-left: 0;
    overflow: visible;
  }

  .game-layout .board-wrap {
    width: min(100%, 640px);
  }

  .game-panel {
    grid-template-rows: auto auto auto;
    width: min(100%, 640px);
    margin: 0 auto;
  }

  .suspects-section {
    overflow: visible;
  }
}

/* ───────── архив основной кампании: иконки и звёзды ───────── */

.difficulty-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  row-gap: 14px;
}

.difficulty-side {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: end;
  gap: 3px;
}

.difficulty-side .difficulty-progress {
  font-size: 18px;
}

.difficulty-stars {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 850;
}

.home-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.home-stars-chip strong {
  color: #f6c667;
}

.noir-resume {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  max-width: 100%;
  margin-top: 16px;
  padding: 11px 12px 11px 18px;
  border: 0;
  border-radius: 18px;
  color: #1a1330;
  background: linear-gradient(120deg, #ffcf70, #eaa23f);
  box-shadow: 0 10px 26px rgba(234, 162, 63, 0.3);
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.noir-resume:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
}

.noir-resume span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.noir-resume small {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.72;
}

.noir-resume strong {
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.noir-resume i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #eaa23f;
  background: #1a1330;
  font-size: 18px;
  font-style: normal;
  font-weight: 900;
}

/* ───────── план в стиле Murdoku: толстые стены, свет из окон, полароиды ───────── */

.campaign-noir .board-wrap {
  border: 7px solid #140d12;
  border-radius: 14px;
  background: #140d12;
  box-shadow: 0 0 0 2px rgba(234, 178, 77, 0.35), 0 24px 56px rgba(0, 0, 0, 0.6);
  container-type: inline-size;
}

.campaign-noir .board-grid {
  background: #140d12;
}

.campaign-noir .cell {
  border-top-color: rgba(20, 13, 18, 0.3) !important;
  border-left-color: rgba(20, 13, 18, 0.3) !important;
  container-type: inline-size;
}

/* стены между комнатами — сплошные и толстые; без светлой фаски старой темы */
.campaign-noir .cell.wall-top {
  border-top-width: 8px !important;
  border-top-color: #140d12 !important;
  box-shadow: none;
}

.campaign-noir .cell.wall-left {
  border-left-width: 8px !important;
  border-left-color: #140d12 !important;
  box-shadow: none;
}

.campaign-noir .cell.wall-top.wall-left {
  box-shadow: none;
}

/* косые полосы света поверх плана */
.campaign-noir .board-wrap::after {
  position: absolute;
  z-index: 30;
  inset: 0;
  content: "";
  background: linear-gradient(118deg,
    transparent 0 14%, rgba(255, 250, 235, 0.13) 14% 27%, transparent 27% 47%,
    rgba(255, 250, 235, 0.1) 47% 56%, transparent 56% 74%,
    rgba(255, 250, 235, 0.12) 74% 86%, transparent 86%);
  pointer-events: none;
}

/* предметы отбрасывают жёсткую тень вправо-вниз, как в настольной игре */
.campaign-noir .object-image,
.campaign-noir .cell.object-anchor:hover .object-image,
.campaign-noir .cell.object-anchor:hover .object-image.multi-cell-object {
  filter: drop-shadow(3px 4px 0 rgba(20, 10, 16, 0.32));
}

.campaign-noir .cell-dot {
  background: rgba(20, 13, 18, 0.22);
}

.campaign-noir .cell-cross::before,
.campaign-noir .cell-cross::after {
  background: #24151b;
  box-shadow: 0 0 0 1.5px rgba(255, 250, 240, 0.85);
}

/* таблички комнат — белые «пилюли» с засечками */
.campaign-noir .room-label {
  margin: 0 5% 5% 0;
  padding: 2px 8px 1px;
  border: 2px solid #24151b;
  border-radius: 999px;
  color: #24151b;
  background: #fbf6ec;
  box-shadow: 0 2px 0 rgba(20, 10, 16, 0.35);
  font-family: "PT Serif", Georgia, "Times New Roman", serif;
  font-size: clamp(8px, 2.3cqw, 15px);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* герой на плане — полароид с подписью от руки */
.campaign-noir .placed-portrait,
.campaign-noir .placed-portrait.on-object,
.campaign-noir .placed-portrait.on-rug {
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 76%;
  height: 92%;
  padding: 6% 6% 0;
  overflow: visible;
  border: 1.5px solid #24151b;
  border-radius: 2px;
  background: #fbf8f1;
  box-shadow: 2px 4px 0 rgba(20, 10, 16, 0.38);
  transform: rotate(var(--tilt, -4deg));
}

.campaign-noir .placed-portrait img {
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border: 1.5px solid #24151b;
  object-fit: cover;
  transform: none;
}

.campaign-noir .polaroid-name {
  overflow: hidden;
  color: #24151b;
  font-family: "Segoe Script", "Bradley Hand", "Marker Felt", "Comic Sans MS", cursive;
  font-size: clamp(6px, 15cqw, 16px);
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
}

.campaign-noir .placed-portrait[data-suspect-id="1"] { --tilt: 5deg; }
.campaign-noir .placed-portrait[data-suspect-id="2"] { --tilt: -6deg; }
.campaign-noir .placed-portrait[data-suspect-id="3"] { --tilt: 3deg; }
.campaign-noir .placed-portrait[data-suspect-id="4"] { --tilt: -3deg; }
.campaign-noir .placed-portrait[data-suspect-id="5"] { --tilt: 6deg; }
.campaign-noir .placed-portrait[data-suspect-id="6"] { --tilt: -5deg; }
.campaign-noir .placed-portrait[data-suspect-id="7"] { --tilt: 4deg; }
.campaign-noir .placed-portrait[data-suspect-id="8"] { --tilt: -2deg; }

/* жертва — красная рамка и капля крови у подписи */
.campaign-noir .placed-portrait.victim {
  border-color: #b3202f;
  background: radial-gradient(circle at 16% 90%, #b3202f 0 5%, transparent 5.5%), #fbf8f1;
  box-shadow: 0 0 0 2px rgba(179, 32, 47, 0.45), 2px 4px 0 rgba(20, 10, 16, 0.38);
}

.campaign-noir .cell.conflict .placed-portrait {
  border-color: #ff4a5c;
  box-shadow: 0 0 0 2px rgba(255, 74, 92, 0.6), 2px 4px 0 rgba(20, 10, 16, 0.38);
}

/* карточки подозреваемых — тоже полароиды */
.campaign-noir .suspect-portrait {
  padding: 5px 5px 12px;
  border: 1.5px solid #24151b;
  border-radius: 2px;
  background: #fbf8f1;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.45);
  transform: rotate(-3deg);
}

.campaign-noir .suspect-chip:nth-child(even) .suspect-portrait {
  transform: rotate(3deg);
}

.campaign-noir .suspect-portrait img {
  border: 1.5px solid #24151b;
  border-radius: 0;
}

.campaign-noir .suspect-chip.selected .suspect-portrait {
  border: 1.5px solid #24151b;
  box-shadow: 0 0 0 3px var(--n-gold), 0 0 18px rgba(234, 178, 77, 0.45);
}

.campaign-noir .suspect-chip.victim .suspect-portrait {
  border: 1.5px solid #24151b;
  background: radial-gradient(circle at 18% 88%, #b3202f 0 6%, transparent 6.5%), #fbf8f1;
}

/* ═════════ «Город теней»: экран дела — поле главное, интерфейс спокойный ═════════
   Акценты: жёлтый — активный инструмент и выбор, розовый — только подсказка,
   красный — только ошибка, зелёный — подтверждение. */

.noir-game {
  --ng-paper: #f3ead7;
  --ng-paper-2: #e9dcc2;
  --ng-ink: #2b1f22;
  --ng-ink-soft: #5b4a44;
  --ng-cream: #f4eddd;
  --ng-gold: #f2bf4a;
  --ng-pink: #e2558f;
  --ng-red: #e5414f;
  --ng-green: #49c486;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "top" "actions" "board" "suspects";
  width: 100%;
  gap: 8px;
  padding: calc(10px + var(--safe-top, 0px)) 12px 0;
  overflow: hidden;
  color: var(--ng-cream);
  background:
    radial-gradient(circle at 50% 38%, rgba(120, 92, 170, 0.18), transparent 55%),
    linear-gradient(180deg, #17122b, #0f0b1d);
}

.noir-game :where(button) {
  font-family: inherit;
  cursor: pointer;
}

.noir-game svg {
  width: 20px;
  height: 20px;
  flex: none;
}

/* ── верхняя панель ── */
.ng-top {
  grid-area: top;
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.ng-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ng-cream);
  background: rgba(255, 255, 255, 0.07);
  font-size: 22px;
}

.ng-icon svg {
  width: 22px;
  height: 22px;
}

.ng-icon:hover {
  background: rgba(255, 255, 255, 0.13);
}

.ng-tools {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  min-width: 0;
  padding: 3px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.ng-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  padding: 3px 2px;
  border: 0;
  border-radius: 11px;
  color: #c9c0dd;
  background: transparent;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.1;
  transition: background 0.12s ease, color 0.12s ease;
}

.ng-tool span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ng-tool:hover:not(.active) {
  color: var(--ng-cream);
  background: rgba(255, 255, 255, 0.07);
}

.ng-tool.active {
  color: #2b1d0c;
  background: linear-gradient(180deg, #f8cf63, #e9a93a);
  box-shadow: 0 3px 10px rgba(242, 191, 74, 0.28);
}

.ng-hint {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  padding: 0 14px 0 10px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(160deg, #8a2f6b, #5b1f4d);
  box-shadow: inset 0 0 0 1.5px rgba(226, 85, 143, 0.65);
}

.ng-hint:disabled {
  opacity: 0.5;
  cursor: default;
}

.ng-hint-bulb {
  font-size: 22px;
}

.ng-hint-copy {
  display: grid;
  justify-items: start;
  line-height: 1.1;
}

.ng-hint-copy b {
  font-size: 14px;
}

.ng-hint-copy small {
  margin-top: 2px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--ng-pink);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ng-hint-count {
  position: absolute;
  top: -6px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #2b1d0c;
  background: var(--ng-gold);
  font-size: 11px;
  font-weight: 900;
}

/* ── тонкая строка действий ── */
.ng-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 38px;
}

.ng-chip,
.ng-submit,
.ng-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: #d9d1ea;
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.ng-chip svg,
.ng-submit svg,
.ng-timer svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ng-chip:hover:not(:disabled) {
  color: var(--ng-cream);
  background: rgba(255, 255, 255, 0.12);
}

.ng-chip:disabled {
  opacity: 0.4;
  cursor: default;
}

.ng-submit {
  flex: 1;
  min-width: 0;
  color: #8f86a8;
}

.ng-submit:disabled {
  cursor: default;
}

.ng-submit.ready {
  color: #0f2a1d;
  background: linear-gradient(180deg, #5fd696, #39b072);
  box-shadow: 0 4px 14px rgba(73, 196, 134, 0.28);
}

.ng-submit span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.ng-timer {
  padding: 0 8px;
  background: transparent;
  color: #cfc6e2;
  font-variant-numeric: tabular-nums;
}

.ng-help span:first-child {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

/* ── поле ── */
.ng-board {
  grid-area: board;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  container-type: size;
}

.noir-game .board-wrap {
  container-type: inline-size;
  width: min(100cqw, 100cqh);
  max-width: none;
  height: auto;
  aspect-ratio: 1;
  margin: 0;
  border: 5px solid #6b4126;
  border-radius: 12px;
  background: #140d12;
  box-shadow: 0 0 0 2px #24140c, 0 18px 40px rgba(0, 0, 0, 0.5);
}

.noir-game .board-wrap::after {
  opacity: 0.55;
}

.ng-mismatch {
  position: absolute;
  bottom: 6px;
  left: 50%;
  z-index: 50;
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  color: #fff;
  background: rgba(229, 65, 79, 0.92);
  font-size: 13px;
  font-weight: 700;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* таблички комнат — лёгкие бумажные бирки */
.noir-game .room-label {
  margin: 0 4% 4% 0;
  padding: 1px 6px;
  border: 1.5px solid rgba(36, 21, 27, 0.85);
  border-radius: 4px;
  color: #2b1f22;
  background: rgba(246, 238, 220, 0.94);
  box-shadow: 1px 2px 0 rgba(20, 10, 16, 0.3);
  font-size: clamp(7px, 1.9cqw, 12px);
  letter-spacing: 0.05em;
}

/* скотч на полароидах */
.noir-game.campaign-noir .placed-portrait::before {
  position: absolute;
  top: -7%;
  left: 50%;
  width: 38%;
  height: 11%;
  content: "";
  background: rgba(214, 208, 192, 0.78);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
  transform: translateX(-50%) rotate(-4deg);
}

/* ── подозреваемые: отдельная тёмная подложка и лента бумажных карточек ── */
.ng-suspects {
  grid-area: suspects;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0 -12px;
  padding: 10px 0 calc(12px + var(--safe-bottom, 0px));
  border-radius: 22px 22px 0 0;
  background: #0b0815;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
}

.ng-suspects h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0 16px;
  color: #d8cff0;
  font-size: 17px;
  font-weight: 800;
}

.ng-strip {
  display: flex;
  gap: 12px;
  min-height: 0;
  padding: 6px 16px 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding: 16px;
  scrollbar-width: none;
}

.ng-strip::-webkit-scrollbar {
  display: none;
}

.noir-game .suspect-card.ng-card {
  position: relative;
  display: grid;
  flex: 0 0 min(76vw, 330px);
  grid-template-columns: clamp(96px, 30vw, 130px) minmax(0, 1fr);
  grid-template-rows: none;
  align-items: start;
  justify-items: stretch;
  gap: 10px;
  min-height: 0;
  margin: 0;
  padding: 10px 12px 12px 10px;
  border: 0;
  border-radius: 6px;
  color: var(--ng-ink);
  background:
    repeating-linear-gradient(0deg, rgba(120, 90, 50, 0.035) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 80% 10%, #faf3e3, transparent 60%),
    var(--ng-paper);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 10px 20px rgba(0, 0, 0, 0.25);
  text-align: left;
  scroll-snap-align: start;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  animation: none;
}

/* булавка */
.noir-game .suspect-card.ng-card::after {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 9px;
  height: 9px;
  content: "";
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #b9b2a8 45%, #6d665e);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.noir-game .suspect-card.ng-card:hover {
  transform: translateY(-2px);
}

.noir-game .suspect-card.ng-card.selected {
  border: 0;
  background:
    repeating-linear-gradient(0deg, rgba(120, 90, 50, 0.035) 0 1px, transparent 1px 4px),
    #fbf1d8;
  box-shadow: 0 0 0 3px var(--ng-gold), 0 0 22px rgba(242, 191, 74, 0.35), 0 4px 0 rgba(0, 0, 0, 0.35);
}

.noir-game .suspect-card.ng-card.has-conflict {
  box-shadow: 0 0 0 3px var(--ng-red), 0 4px 0 rgba(0, 0, 0, 0.35);
}

.noir-game .suspect-card.ng-card.validation-correct {
  box-shadow: 0 0 0 3px var(--ng-green), 0 4px 0 rgba(0, 0, 0, 0.35);
}

.noir-game .suspect-card.ng-card.validation-wrong {
  box-shadow: 0 0 0 3px var(--ng-red), 0 4px 0 rgba(0, 0, 0, 0.35);
}

.ng-polaroid {
  display: block;
  align-self: start;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: none;
  font: inherit;
  text-align: left;
}

.ng-portrait-name,
.ng-portrait-badge,
.ng-portrait-check { display: none; }

.ng-polaroid .ng-portrait-check { display: none; }

.ng-photo {
  position: relative;
  display: block;
  padding: 5px 5px 16px;
  background: #fffdf7;
  box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.28);
  transform: rotate(-3deg);
}

.ng-card:nth-child(even) .ng-photo {
  transform: rotate(2.5deg);
}

.ng-photo::before {
  position: absolute;
  top: -6px;
  left: 10%;
  width: 34%;
  height: 12px;
  content: "";
  background: rgba(205, 196, 176, 0.85);
  transform: rotate(-8deg);
}

.ng-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid rgba(43, 31, 34, 0.5);
}

.ng-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding-top: 4px;
}

.ng-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0 12px 5px 0;
  border-bottom: 1px solid rgba(43, 31, 34, 0.18);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
}

.ng-name-text {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.ng-name em {
  flex: none;
  white-space: nowrap;
  padding: 1px 6px;
  border-radius: 4px;
  color: #fff;
  background: #8a3b44;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ng-check {
  display: grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: auto;
  border-radius: 50%;
  color: #fff;
  background: var(--ng-green);
  font-size: 11px;
  font-style: normal;
}

.ng-clues {
  display: grid;
  gap: 5px;
}

.noir-game .ng-clue {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  padding: 2px 3px;
  border-radius: 5px;
  color: var(--ng-ink-soft);
  width: 100%;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  font-weight: 600;
  line-height: 1.3;
}

.ng-clue-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #7a5a3a;
}

.ng-clue-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.ng-clue-icon svg {
  width: 18px;
  height: 18px;
}

.noir-game .ng-clue .rule-term {
  color: var(--ng-ink);
  font-weight: 800;
  text-decoration: none;
}

.noir-game .ng-clue.clue-bad {
  color: #a3121f;
  background: rgba(229, 65, 79, 0.13);
}

.noir-game .ng-clue.clue-bad .rule-term {
  color: #a3121f;
}

.noir-game .ng-clue.clue-ok::after {
  color: #2a9a5e;
}

.ng-hints {
  display: grid;
  gap: 3px;
  color: #6a3f72;
  font-size: 12px;
}

/* материалы дела — модальное окно */
.ng-brief {
  display: grid;
  gap: 12px;
  width: min(520px, 100%);
  max-height: 86dvh;
  overflow: auto;
}

.ng-brief .case-brief {
  display: block;
}

.ng-brief .ng-submit {
  flex: none;
  height: 44px;
}

/* ── телефон ── */
@media (max-width: 520px) {
  .noir-game {
    gap: 6px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .ng-suspects {
    margin: 0 -8px;
  }

  .ng-icon {
    width: 38px;
    height: 38px;
    align-self: center;
    font-size: 18px;
  }

  .ng-top {
    gap: 5px;
  }

  .ng-tool svg {
    width: 17px;
    height: 17px;
  }

  .ng-hint {
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    padding: 0 6px;
  }

  .ng-hint-bulb {
    font-size: 17px;
    line-height: 1;
  }

  .ng-hint-copy b {
    display: none;
  }

  .ng-hint-copy small {
    margin: 0;
    padding: 1px 4px;
    font-size: 7.5px;
  }

  .ng-tools {
    padding: 2px;
  }

  .ng-tool {
    padding: 3px 0;
    font-size: 9.5px;
    letter-spacing: -0.01em;
  }

  .ng-actions {
    height: 34px;
    gap: 5px;
  }


  .noir-game .suspect-card.ng-card {
    flex-basis: 80vw;
  }
}

/* ── широкий экран: поле слева, все показания под полароидами справа ── */
@media (min-width: 700px) and (min-aspect-ratio: 1/1) {
  .noir-game {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 42vw);
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "board top" "board actions" "board suspects";
    gap: 10px 22px;
    padding: 16px 18px;
  }

  .ng-suspects {
    --ng-portrait-size: clamp(42px, var(--ng-portrait-height, 8.2dvh), 100px);
    margin: 0;
    padding: 12px 0 8px;
    border-radius: 18px;
  }

  .ng-suspects > h2 { flex: none; }

  .ng-strip {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: repeat(var(--ng-suspect-columns, 3), minmax(0, 1fr));
    grid-auto-rows: max-content;
    align-content: start;
    align-items: stretch;
    gap: 18px 10px;
    padding: 6px 14px 14px;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: none;
    scrollbar-width: thin;
  }

  .ng-undo span { display: none; }
}

@media (min-width: 700px) and (min-aspect-ratio: 1/1) and (max-height: 650px) {
  .ng-suspects { --ng-portrait-size: clamp(36px, 6.5dvh, 48px); }
}

/* крестики жирнее и заметнее */
.campaign-noir .cell-cross::before,
.campaign-noir .cell-cross::after {
  height: max(4px, 5.5cqw);
  border-radius: 999px;
  background: #24151b;
  box-shadow: 0 0 0 2px rgba(255, 250, 240, 0.75);
}

.campaign-noir .cell-cross.auto::before,
.campaign-noir .cell-cross.auto::after {
  height: max(3px, 4cqw);
}

.campaign-noir .cell-cross.auto {
  opacity: 0.6;
}

/* фон пола на всю клетку, стена рисуется поверх */
.campaign-noir .cell {
  background-origin: border-box;
}

/* «Одиссея» на новом экране: PNG-портреты на цветной подложке полароида */
.ng-odyssey .ng-photo img {
  background: linear-gradient(180deg, #a9cbe8, #6f9fcf);
  object-fit: cover;
}

.ng-odyssey .ng-card:nth-child(3n + 2) .ng-photo img {
  background: linear-gradient(180deg, #e8c39a, #c98d5c);
}

.ng-odyssey .ng-card:nth-child(3n) .ng-photo img {
  background: linear-gradient(180deg, #b9d8b4, #7fae86);
}

.ng-odyssey .ng-clue-icon img {
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.2));
}

/* до 680 px мелкие кнопки строки действий — только иконки */
@media (max-width: 680px) {
  .ng-chip span:not(:first-child),
  .ng-undo span {
    display: none;
  }

  .ng-chip {
    padding: 0 10px;
  }
}

/* Phones have no hover: definitions are not offered there, so the terms must not look tappable. */
@media (hover: none) {
  .rule-term {
    text-decoration: none;
    cursor: inherit;
  }

  .rule-term::after {
    display: none !important;
  }
}
