:root {
  --ink: #f7f0df;
  --ink-soft: #d6c9b4;
  --ink-muted: #a99a86;
  --wine: #6e2331;
  --wine-deep: #321119;
  --wine-bright: #9a4453;
  --gold: #d8b268;
  --gold-light: #efd59e;
  --bronze: #a8793e;
  --night: #100c0b;
  --panel: #1b1412;
  --panel-raised: #271b17;
  --line: rgba(216, 178, 104, .28);
  --line-strong: rgba(216, 178, 104, .58);
  --success: #96bd82;
  --danger: #e4988f;
  --focus: #fff3bd;
  --shadow: 0 24px 80px rgba(0, 0, 0, .42);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, Manrope, "Segoe UI", Arial, sans-serif;
  --content: 1180px;
  --text-scale: 1;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  font-size: calc(16px * var(--text-scale));
}

html[data-text-size="large"] {
  --text-scale: 1.125;
}

html[data-text-size="xlarge"] {
  --text-scale: 1.25;
}

html[data-high-contrast="true"] {
  --ink: #ffffff;
  --ink-soft: #ffffff;
  --ink-muted: #e8e8e8;
  --wine: #9d1836;
  --wine-deep: #260009;
  --wine-bright: #ff6f8f;
  --gold: #ffd95a;
  --gold-light: #fff2a8;
  --bronze: #ffd95a;
  --night: #000000;
  --panel: #080808;
  --panel-raised: #141414;
  --line: rgba(255, 255, 255, .62);
  --line-strong: #ffffff;
  --success: #baff9c;
  --danger: #ffaaa0;
  --focus: #00e5ff;
  color-scheme: dark;
}

html[data-high-contrast="true"] body {
  background: #000000;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(110, 35, 49, .24), transparent 34rem),
    radial-gradient(circle at 85% 28%, rgba(140, 102, 54, .12), transparent 30rem),
    var(--night);
  font-family: var(--sans);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
  content: "";
  pointer-events: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
a,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--gold-light);
  text-underline-offset: .18em;
}

button {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: #140d09;
  background: var(--focus);
  border-radius: 6px;
  font-weight: 800;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 22px max(24px, calc((100vw - var(--content)) / 2));
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: linear-gradient(180deg, rgba(10, 7, 6, .9), transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: .86rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark,
.game-home span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--gold-light);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: .8rem;
  letter-spacing: .08em;
}

.site-nav {
  display: flex;
  gap: 28px;
}

.site-nav a {
  color: var(--ink-soft);
  font-size: .84rem;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--gold-light);
}

.hero {
  position: relative;
  display: grid;
  min-height: min(940px, 100svh);
  align-items: end;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 8, 7, .92) 0%, rgba(11, 8, 7, .54) 48%, rgba(11, 8, 7, .2) 75%),
    linear-gradient(0deg, var(--night) 0%, transparent 52%),
    linear-gradient(180deg, rgba(8, 5, 4, .4), transparent 24%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(100%, var(--content));
  margin: 0 auto;
  padding: 160px 24px 76px;
}

.eyebrow,
.section-label {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .19em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 900px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.65rem, 6vw, 5.7rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: .98;
  text-wrap: balance;
}

.hero-lead {
  max-width: 680px;
  margin: 25px 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.3vw, 1.65rem);
  font-style: italic;
  line-height: 1.4;
}

.hero-intro {
  max-width: 760px;
  margin-top: 22px;
  color: var(--ink-muted);
  font-size: .94rem;
  line-height: 1.58;
}

.hero-intro p {
  margin: 0 0 8px;
}

.hero-intro h2 {
  max-width: 720px;
  margin: 0 0 12px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  font-weight: 500;
  line-height: 1.18;
}

.hero-intro .feature-list {
  margin-top: 14px;
  font-size: .84rem;
}

.city-section .city-figure {
  margin-top: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 780;
  letter-spacing: .015em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: #21120f;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 10px 28px rgba(216, 178, 104, .18);
}

.button-primary:hover {
  background: #f7dfad;
}

.button-secondary {
  color: var(--ink);
  background: rgba(25, 17, 14, .72);
  border-color: var(--line-strong);
  backdrop-filter: blur(10px);
}

.button-vk {
  color: #fff;
  background: #3568aa;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  max-width: 900px;
  margin: 54px 0 0;
  padding: 0;
  list-style: none;
}

.hero-facts li {
  display: grid;
  min-width: 170px;
  padding: 0 28px;
  border-left: 1px solid var(--line);
}

.hero-facts li:first-child {
  padding-left: 0;
  border-left: 0;
}

.hero-facts strong {
  color: var(--gold-light);
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
}

.hero-facts span {
  color: var(--ink-muted);
  font-size: .78rem;
}

.landing-section {
  width: min(calc(100% - 40px), var(--content));
  margin: 0 auto;
  padding: 110px 0;
}

.landing-section + .landing-section {
  border-top: 1px solid var(--line);
}

.landing-section h2 {
  max-width: 920px;
  margin: 0 0 40px;
  font-family: var(--serif);
  font-size: clamp(2rem, 4.8vw, 4rem);
  font-weight: 500;
  letter-spacing: -.025em;
  line-height: 1.08;
  text-wrap: balance;
}

.intro-grid,
.investigator-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .95fr);
  gap: clamp(32px, 6vw, 84px);
  align-items: center;
}

.prose-card {
  max-width: 700px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1.17rem;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.feature-list li::before {
  margin-right: 10px;
  color: var(--gold);
  content: "◆";
  font-size: .65em;
}

.city-figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px 38px 4px 4px;
  box-shadow: var(--shadow);
}

.city-figure img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.city-figure figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 30px 24px 18px;
  color: var(--ink-soft);
  background: linear-gradient(transparent, rgba(9, 6, 5, .92));
  font-family: var(--serif);
  font-style: italic;
}

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

.mechanic-card {
  position: relative;
  min-height: 280px;
  padding: 28px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(45, 30, 24, .88), rgba(22, 15, 13, .92));
  border: 1px solid var(--line);
  border-radius: 4px;
}

.mechanic-card::after {
  position: absolute;
  right: -30px;
  bottom: -55px;
  width: 130px;
  height: 130px;
  border: 1px solid rgba(216, 178, 104, .12);
  border-radius: 50%;
  content: "";
}

.mechanic-number {
  color: var(--gold);
  font-family: var(--serif);
  font-size: .95rem;
}

.mechanic-card h3 {
  margin: 56px 0 12px;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 500;
}

.mechanic-card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: .92rem;
}

.investigator-section {
  grid-template-columns: minmax(320px, .8fr) minmax(0, 1fr);
}

.investigator-media {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 44% 44% 3px 3px;
  box-shadow: var(--shadow);
}

.investigator-media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 22%;
}

.investigator-copy h2 {
  margin-bottom: 20px;
}

.investigator-copy blockquote {
  margin: 0 0 24px;
  color: var(--gold-light);
  font-family: var(--serif);
  font-size: clamp(1.3rem, 3vw, 2.2rem);
  font-style: italic;
}

.investigator-copy p,
.vk-section p {
  max-width: 700px;
  color: var(--ink-soft);
}

.vk-section {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding-top: 70px;
  padding-bottom: 70px;
}

.vk-section h2 {
  margin-bottom: 10px;
}

.game-view {
  min-height: 100svh;
  padding-bottom: 42px;
  background:
    radial-gradient(circle at 50% -10%, rgba(117, 45, 53, .26), transparent 52rem),
    #0d0908;
}

.game-hud {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(210px, 1fr) auto minmax(160px, 240px);
  gap: 20px;
  align-items: center;
  min-height: 78px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 10, 9, .94);
  box-shadow: 0 10px 35px rgba(0, 0, 0, .22);
  backdrop-filter: blur(18px);
}

.icon-button,
.game-home {
  display: grid;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  place-items: center;
  border: 0;
  background: none;
  cursor: pointer;
}

.chapter-meta {
  display: grid;
  line-height: 1.25;
}

.chapter-meta span,
.time-marker,
.progress-wrap {
  color: var(--ink-muted);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.chapter-meta strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-marker {
  padding: 8px 12px;
  color: var(--gold-light);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}

.progress-wrap {
  display: grid;
  gap: 6px;
}

.progress-track {
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, .1);
  border-radius: 99px;
}

#story-progress {
  display: block;
  width: 1%;
  height: 100%;
  background: var(--gold);
  transition: width .35s ease;
}

.game-shell {
  display: grid;
  grid-template-columns: 86px minmax(0, 960px) minmax(250px, 310px);
  gap: 22px;
  width: min(calc(100% - 32px), 1430px);
  margin: 28px auto 0;
  align-items: start;
}

.case-nav {
  position: sticky;
  top: 106px;
  display: grid;
  gap: 6px;
  padding: 9px;
  background: rgba(29, 20, 17, .82);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(12px);
}

.case-nav button {
  position: relative;
  display: grid;
  min-width: 66px;
  min-height: 58px;
  gap: 2px;
  place-items: center;
  padding: 6px 4px;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: .67rem;
}

.case-nav button > span:first-child {
  color: var(--gold);
  font-size: 1.1rem;
}

.case-nav button:hover,
.case-nav button[aria-pressed="true"] {
  color: var(--ink);
  background: rgba(216, 178, 104, .08);
  border-color: var(--line);
}

.case-nav b {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  color: #1c100e;
  background: var(--gold);
  border-radius: 99px;
  font-size: .6rem;
}

.scene-card {
  min-width: 0;
  overflow: hidden;
  background: rgba(25, 17, 15, .96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.scene-card[aria-busy="true"] {
  opacity: .72;
}

.scene-media {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background: #211715;
  aspect-ratio: 16 / 9;
}

.scene-media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .22s ease, transform 1.2s ease;
}

.scene-card:not([aria-busy="true"]) .scene-media > img {
  transform: scale(1.006);
}

.scene-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(12, 8, 7, .96), transparent 58%);
  pointer-events: none;
}

.scene-caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 40px 34px 25px;
}

.scene-caption > span {
  color: var(--gold);
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .18em;
}

.scene-caption h1 {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  font-weight: 500;
  line-height: 1.05;
  text-wrap: balance;
}

.scene-image-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 26px;
  color: var(--ink-muted);
  background: radial-gradient(circle, #2c1e19, #130e0c);
  text-align: center;
}

.scene-image-fallback span {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 4rem;
}

.scene-content {
  padding: clamp(24px, 4.3vw, 44px);
}

.scene-narrative {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.72;
}

.scene-narrative p {
  margin: 0 0 1em;
}

.scene-dialogue {
  display: grid;
  gap: 12px;
  margin: 26px 0;
  padding: 20px 22px;
  background: rgba(6, 4, 4, .36);
  border-left: 2px solid var(--bronze);
}

.dialogue-beat {
  display: grid;
  gap: 12px;
  padding: 4px 0;
}

.dialogue-beat + .dialogue-beat {
  margin-top: 6px;
  padding-top: 18px;
  border-top: 1px solid rgba(216, 178, 104, .16);
}

.dialogue-line,
.dialog-line {
  display: grid;
  grid-template-columns: minmax(84px, 130px) minmax(0, 1fr);
  gap: 14px;
}

.dialogue-line strong,
.dialog-line strong,
.speaker {
  color: var(--gold-light);
  font-family: var(--serif);
  font-weight: 600;
}

.dialogue-line p,
.dialog-line p {
  margin: 0;
  color: var(--ink);
}

.scene-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 30px;
}

.scene-actions:has(> :only-child) {
  grid-template-columns: minmax(0, 420px);
}

.scene-actions button,
.action-button,
.puzzle-option {
  min-height: 54px;
  padding: 12px 16px;
  color: var(--ink);
  background: rgba(216, 178, 104, .07);
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.scene-actions button:hover,
.action-button:hover,
.puzzle-option:hover {
  background: rgba(216, 178, 104, .14);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.scene-actions .primary,
.scene-actions [data-primary="true"] {
  color: #21120f;
  background: var(--gold);
  border-color: var(--gold);
}

.scene-feedback {
  margin: 18px 0 0;
  padding: 12px 15px;
  color: var(--ink-soft);
  background: rgba(216, 178, 104, .07);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.scene-feedback[data-tone="success"] {
  color: #dbeed3;
  border-color: rgba(150, 189, 130, .48);
}

.scene-feedback[data-tone="error"] {
  color: #f2c5bf;
  border-color: rgba(228, 152, 143, .48);
}

.puzzle-panel {
  margin: 25px 0;
  padding: clamp(18px, 3vw, 28px);
  background: linear-gradient(145deg, rgba(87, 31, 42, .18), rgba(8, 5, 5, .32));
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.puzzle-panel h2,
.puzzle-panel h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 500;
}

.puzzle-instruction {
  color: var(--ink-soft);
}

.puzzle-options,
.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 18px;
}

.puzzle-option[aria-pressed="true"],
.puzzle-option.is-selected {
  background: rgba(216, 178, 104, .22);
  border-color: var(--gold);
}

.case-brief {
  position: sticky;
  top: 106px;
  padding: 20px;
  background: rgba(28, 19, 16, .86);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(12px);
}

.brief-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--gold);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.brief-heading b {
  color: var(--success);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .06em;
}

.case-brief h2 {
  margin: 22px 0 8px;
  font-family: var(--serif);
  font-size: 1.48rem;
  font-weight: 500;
  line-height: 1.15;
}

.case-brief p {
  margin: 0;
  color: var(--ink-muted);
  font-size: .86rem;
}

.brief-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 24px;
}

.brief-stats div {
  display: grid;
  padding: 9px 5px;
  background: rgba(255, 255, 255, .025);
  border: 1px solid rgba(255, 255, 255, .06);
  text-align: center;
}

.brief-stats span {
  color: var(--ink-muted);
  font-size: .57rem;
  text-transform: uppercase;
}

.brief-stats strong {
  color: var(--gold-light);
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
}

.panel-dialog {
  width: min(920px, calc(100% - 32px));
  max-height: min(840px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: #19110f;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  box-shadow: 0 32px 120px rgba(0, 0, 0, .7);
}

.panel-dialog::backdrop {
  background: rgba(4, 2, 2, .78);
  backdrop-filter: blur(4px);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.dialog-header .section-label {
  margin-bottom: 4px;
}

.dialog-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
}

.dialog-close {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.7rem;
}

.panel-body {
  max-height: calc(100dvh - 150px);
  padding: 24px;
  overflow: auto;
}

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

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.record-id {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--bronze-light);
  font: 700 .62rem/1 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.record-details {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}

.record-details div {
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.record-details dt {
  margin-bottom: 3px;
  color: var(--bronze-light);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.record-details dd {
  margin: 0;
  color: var(--ink-muted);
  font-size: .86rem;
  line-height: 1.45;
}

.suspect-portrait {
  width: calc(100% + 36px);
  height: 168px;
  margin: -18px -18px 16px;
  object-fit: cover;
  object-position: center 28%;
  border-bottom: 1px solid var(--line);
  border-radius: 5px 5px 0 0;
  filter: saturate(.72) contrast(1.03);
}

.suspect-role {
  color: var(--bronze-light) !important;
}

.record-card,
.clue-card,
.suspect-card,
.hint-card,
.setting-card,
.ending-stat {
  padding: 18px;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.record-card h3,
.clue-card h3,
.suspect-card h3,
.hint-card h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
}

.record-card p,
.clue-card p,
.suspect-card p,
.hint-card p {
  margin: 5px 0;
  color: var(--ink-muted);
  font-size: .88rem;
}

.card-status,
.clue-status,
.suspect-status {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 8px;
  color: var(--gold-light);
  background: rgba(216, 178, 104, .08);
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: .66rem;
}

.board-grid,
.connections-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.board-node {
  min-height: 92px;
  padding: 12px;
  color: var(--ink-soft);
  background: rgba(41, 28, 23, .85);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
}

.board-node > span {
  display: block;
  margin-bottom: 7px;
  color: var(--bronze-light);
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.board-node.is-active,
.board-node[aria-pressed="true"] {
  background: rgba(216, 178, 104, .13);
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(216, 178, 104, .18);
}

.board-node[data-category="person"] { border-top-color: #c78b8b; }
.board-node[data-category="place"] { border-top-color: #96ad86; }
.board-node[data-category="document"] { border-top-color: #b8a27a; }
.board-node[data-category="item"],
.board-node[data-category="object"] { border-top-color: #8ca4bd; }
.board-node[data-category="event"] { border-top-color: #aa8bc0; }
.board-node[data-category="question"] { border-top-color: #d7bd63; }

.board-node-detail {
  margin: 16px 0;
  padding: 18px;
  background: linear-gradient(135deg, rgba(216, 178, 104, .08), rgba(255, 255, 255, .02));
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}

.board-node-detail h3 {
  margin: 0 0 7px;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 500;
}

.board-node-detail p,
.board-empty-links {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.5;
}

.board-links {
  display: grid;
  gap: 8px;
}

.board-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.board-link b {
  color: var(--gold);
}

.board-link small {
  grid-column: 1 / -1;
  color: var(--bronze-light);
  text-align: center;
}

.connection-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
  padding: 18px;
  background: radial-gradient(circle at 50% 0, rgba(216, 178, 104, .09), transparent 65%);
  border: 1px dashed rgba(216, 178, 104, .34);
  border-radius: 6px;
}

.connection-board .puzzle-option,
.connection-card {
  position: relative;
  z-index: 1;
  min-height: 84px;
  background: rgba(29, 19, 16, .96);
  border-color: rgba(216, 178, 104, .3);
  text-align: center;
}

.connection-board .puzzle-option.is-selected {
  box-shadow: 0 0 0 2px rgba(216, 178, 104, .38), 0 12px 28px rgba(0, 0, 0, .2);
}

.connection-board.is-fixed {
  border-style: solid;
}

.connection-board.is-fixed::before {
  position: absolute;
  top: 50%;
  right: 12%;
  left: 12%;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.connection-card {
  display: grid;
  min-height: 72px;
  padding: 12px;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--gold);
  border-radius: 5px;
}

.settings-grid,
.ending-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.setting-row button,
.panel-body button {
  min-height: 44px;
}

.danger-button {
  color: #f1c0ba;
  background: rgba(166, 61, 52, .08);
  border: 1px solid rgba(228, 152, 143, .4);
}

.ending-screen {
  display: grid;
  gap: 22px;
}

.ending-screen h2 {
  margin: 0;
  color: var(--gold-light);
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.7rem);
  font-weight: 500;
}

.game-error {
  position: fixed;
  z-index: 1000;
  right: 20px;
  bottom: 20px;
  width: min(440px, calc(100% - 40px));
  padding: 22px;
  color: var(--ink);
  background: #241613;
  border: 1px solid rgba(228, 152, 143, .55);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.game-error p {
  color: var(--ink-soft);
}

.toast {
  position: fixed;
  z-index: 9999;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100% - 48px));
  padding: 13px 17px;
  color: var(--ink);
  background: #2a1d18;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  box-shadow: var(--shadow);
}

.flora-footer {
  padding: 34px 20px;
  color: var(--ink-muted);
  background: #090706;
  border-top: 1px solid var(--line);
}

.footer-inner {
  width: min(100%, var(--content));
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  display: grid;
  margin-bottom: 18px;
}

.footer-brand strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
}

.footer-brand span,
.footer-legal,
.footer-note {
  font-size: .77rem;
}

.footer-note {
  max-width: 980px;
  margin: 12px auto 0;
  line-height: 1.5;
}

.flora-footer a,
.flora-footer button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding-inline: 5px;
}

.site-cookie-settings {
  color: inherit;
  background: none;
  border: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.site-cookie-banner {
  position: fixed;
  z-index: 2147483646;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: flex;
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
  padding: 16px 18px;
  align-items: center;
  gap: 22px;
  color: #f7f2e8;
  background: rgba(9, 13, 20, .98);
  border: 1px solid rgba(216, 178, 104, .72);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.site-cookie-banner[hidden] {
  display: none !important;
}

.site-cookie-copy {
  min-width: 0;
  flex: 1;
}

.site-cookie-title {
  display: block;
  margin-bottom: 3px;
  color: #fff;
  font-size: 1rem;
}

.site-cookie-text {
  margin: 0;
  color: #d7d2c8;
}

.site-cookie-link,
.site-cookie-decline {
  color: #f0c978;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-cookie-actions {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin-left: 4px;
  white-space: nowrap;
}

.site-cookie-decline {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: #f0c978;
  cursor: pointer;
  min-height: auto;
}

.site-cookie-accept {
  min-width: 128px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 6px;
  color: #161109;
  background: #efca7a;
  border: 1px solid #efca7a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.noscript {
  position: fixed;
  z-index: 99999;
  right: 12px;
  bottom: 12px;
  left: 12px;
  padding: 16px;
  color: #1c100e;
  background: var(--gold-light);
  border-radius: 5px;
  text-align: center;
}

@media (max-width: 1180px) {
  .game-shell {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .case-brief {
    position: static;
    grid-column: 2;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(200px, 1.5fr) auto;
    gap: 18px;
    align-items: center;
  }

  .case-brief h2 {
    margin: 0;
  }

  .brief-stats {
    margin-top: 0;
  }
}

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

  .hero {
    min-height: 880px;
  }

  .hero-vignette {
    background:
      linear-gradient(0deg, var(--night) 1%, rgba(11, 8, 7, .66) 63%, rgba(11, 8, 7, .22)),
      linear-gradient(180deg, rgba(8, 5, 4, .45), transparent 30%);
  }

  .hero-content {
    padding-bottom: 55px;
  }

  .intro-grid,
  .investigator-section {
    grid-template-columns: 1fr;
  }

  .investigator-media {
    max-width: 580px;
  }

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

  .game-hud {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .time-marker {
    display: none;
  }

  .progress-wrap {
    min-width: 110px;
  }
}

@media (max-width: 700px) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .site-header {
    padding: 14px 16px;
  }

  .brand span:last-child {
    display: none;
  }

  .hero {
    min-height: 760px;
  }

  .hero-image {
    object-position: 58% 30%;
  }

  .hero-content {
    padding: 120px 18px 38px;
  }

  .hero-actions,
  .hero-actions .button {
    width: 100%;
  }

  .hero-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 36px;
  }

  .hero-facts li,
  .hero-facts li:first-child {
    min-width: 0;
    padding: 0 0 0 12px;
    border-left: 1px solid var(--line);
  }

  .landing-section {
    width: min(calc(100% - 32px), var(--content));
    padding: 72px 0;
  }

  .feature-list,
  .mechanic-grid {
    grid-template-columns: 1fr;
  }

  .mechanic-card {
    min-height: 220px;
  }

  .mechanic-card h3 {
    margin-top: 30px;
  }

  .vk-section {
    display: grid;
  }

  .game-view {
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .game-hud {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 68px;
    padding: 9px 12px;
  }

  .progress-wrap {
    display: none;
  }

  .game-home span,
  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .game-shell {
    display: block;
    width: 100%;
    margin-top: 0;
  }

  .scene-card {
    width: 100%;
    max-width: 100%;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .scene-media {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    height: auto;
  }

  .site-cookie-banner {
    right: 8px;
    bottom: 8px;
    left: 8px;
    flex-direction: column;
    width: calc(100% - 16px);
    align-items: stretch;
    gap: 13px;
    padding: 15px;
  }

  .site-cookie-actions {
    margin-left: 0;
    white-space: normal;
    flex-wrap: wrap;
  }

  .site-cookie-accept {
    width: 100%;
  }

  .scene-caption {
    padding: 38px 18px 18px;
  }

  .scene-content {
    padding: 24px 18px 30px;
  }

  .scene-actions,
  .puzzle-options,
  .puzzle-grid {
    grid-template-columns: 1fr;
  }

  .scene-actions button,
  .action-button,
  .puzzle-option {
    min-height: 56px;
  }

  .dialogue-line,
  .dialog-line {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .case-brief {
    margin: 14px;
    display: block;
  }

  .case-brief h2 {
    margin: 16px 0 6px;
  }

  .brief-stats {
    margin-top: 18px;
  }

  .case-nav {
    position: fixed;
    z-index: 100;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    padding: 5px max(4px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
    background: rgba(15, 10, 9, .98);
    border: 0;
    border-top: 1px solid var(--line-strong);
    border-radius: 0;
  }

  .case-nav button {
    min-width: 0;
    min-height: 58px;
    padding: 4px 1px;
    font-size: .58rem;
  }

  .case-nav button > span:first-child {
    font-size: 1rem;
  }

  .panel-dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 12px);
    margin: auto 0 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 14px 14px 0 0;
  }

  .panel-body {
    max-height: calc(100dvh - 110px);
    padding: 18px;
  }

  .card-grid,
  .clue-grid,
  .suspect-grid,
  .settings-grid,
  .ending-stats,
  .board-grid,
  .connections-board {
    grid-template-columns: 1fr;
  }

  .flora-footer {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }

  .landing-view + .game-view[hidden] ~ .flora-footer {
    padding-bottom: 34px;
  }

  .toast {
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 12px;
    max-width: none;
  }
}

@media (max-width: 390px) {
  .hero h1 {
    font-size: 2.35rem;
  }

  .hero-facts strong {
    font-size: 1rem;
  }

  .case-nav button span:last-of-type {
    font-size: .52rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

html[data-reduced-motion="reduce"] {
  scroll-behavior: auto;
}

html[data-reduced-motion="reduce"] *,
html[data-reduced-motion="reduce"] *::before,
html[data-reduced-motion="reduce"] *::after {
  scroll-behavior: auto !important;
  transition-duration: .01ms !important;
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
}

@media print {
  .site-header,
  .hero-actions,
  .game-view,
  .vk-section,
  .site-cookie-banner,
  .site-cookie-settings {
    display: none !important;
  }

  body {
    color: #111;
    background: #fff;
  }

  .landing-section {
    color: #111;
  }
}
