/* «Последний секрет Гэтсби» — Gatsby Private Club / Art Deco / Dark Luxury. Mobile-first. Без CDN. */

:root {
  --bg: #131313;
  --bg-deep: #0B0B0B;
  --bg-sunken: #0B0B0B;
  --surface: #24201D;
  --surface-elevated: #302823;
  --bg-raised: #24201D;
  --burgundy: #4D0509;
  --burgundy-hover: #70151D;
  --burgundy-dark: #3A0407;
  --gold: #DAAC6F;
  --gold-light: #E8CFA0;
  --gold-muted: #8F7047;
  --gold-soft: #8F7047;
  --ivory: #FFFBEF;
  --text: #FFFBEF;
  --muted: #A99C8B;
  --text-secondary: #A99C8B;
  --emerald: #263C30;
  --emerald-accent: #527C60;
  --error: #E8B4BC;
  --success: #8FB89A;
  --paper: #FFFBEF;
  --paper-edge: #D9C9A3;
  --ink: #1A1510;
  --ink-soft: #5A4A36;
  --focus: #E8CFA0;
  --radius: 6px;
  --radius-sm: 4px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", "DejaVu Serif", serif;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", "Noto Sans", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --nav-h: 4rem;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --space-xs: .35rem;
  --space-sm: .55rem;
  --space-md: .85rem;
  --space-lg: 1.25rem;
  --space-xl: 1.75rem;
  --page-pad-y: 1.25rem;
  --page-pad-bottom: 2rem;
  --page-title-size: clamp(1.875rem, 6vw, 2.25rem);
  --page-title-mb: .85rem;
  --section-gap: 1.5rem;
  --section-title-size: clamp(1.35rem, 4vw, 1.65rem);
  --lead-size: 1rem;
  --card-pad: .95rem 1.05rem;
  --card-border: 1px solid rgba(218, 172, 111, .35);
  --ease: 200ms ease;
  --shadow-soft: 0 12px 40px rgba(0, 0, 0, .45);
  --grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 120% 70% at 50% -10%, rgba(77, 5, 9, .28), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 100%, rgba(38, 60, 48, .12), transparent 45%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: normal;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  opacity: .035;
  background-image: var(--grain);
  background-size: 180px 180px;
  mix-blend-mode: soft-light;
}

[hidden] { display: none !important; }
body.has-nav { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 1rem); }

img, svg, video { max-width: 100%; height: auto; }
img { display: block; }

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

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 .75rem;
  letter-spacing: .02em;
}

p { margin: 0 0 .75rem; }

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

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 1.45rem; height: 1.45rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.skip-link {
  position: absolute;
  left: .5rem; top: -100px;
  z-index: 100;
  padding: .75rem 1rem;
  background: var(--burgundy);
  color: var(--ivory);
  border: 1px solid var(--gold);
  font-weight: 600;
  font-family: var(--sans);
}
.skip-link:focus { top: .5rem; color: var(--ivory); }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding-left: calc(1rem + var(--safe-l));
  padding-right: calc(1rem + var(--safe-r));
}

/* ---------- Шапка ---------- */

.site-header {
  border-bottom: 1px solid rgba(218, 172, 111, .35);
  background:
    linear-gradient(180deg, rgba(77, 5, 9, .35), transparent 70%),
    var(--bg-deep);
  padding-top: env(safe-area-inset-top, 0px);
  position: relative;
}
.site-header::after {
  content: "";
  position: absolute;
  left: 10%; right: 10%;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-muted), transparent);
  opacity: .7;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-top: .55rem;
  padding-bottom: .55rem;
}

.header-brand { min-width: 0; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  font-family: var(--serif);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .78rem;
  color: var(--gold);
  text-decoration: none;
  padding: .25rem 0;
}
.brand:hover { color: var(--gold-light); }
.brand__title {
  min-width: 0;
  width: max-content;
  max-width: 100%;
}
.brand__word {
  display: inline-grid;
  justify-items: start;
  vertical-align: baseline;
  cursor: inherit;
}
.brand__word-main,
.brand__word-alt {
  grid-area: 1 / 1;
  white-space: nowrap;
}
.brand__word-alt {
  visibility: hidden;
}
.brand__title:hover .brand__word-main,
.brand__title:focus-visible .brand__word-main {
  visibility: hidden;
}
.brand__title:hover .brand__word-alt,
.brand__title:focus-visible .brand__word-alt {
  visibility: visible;
}
.brand__mark {
  width: 2.75rem;
  height: auto;
  aspect-ratio: 3 / 2;
  flex: none;
  border-radius: 8px;
  object-fit: contain;
  background: #4D0509;
}

.logout-form { margin: 0; flex: none; }
.top-nav { display: none; }

/* ---------- Основная область ---------- */

.main {
  padding-top: var(--page-pad-y);
  padding-bottom: var(--page-pad-bottom);
  animation: page-in .28s ease both;
}
.main:focus { outline: none; }

@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.page-title {
  font-family: var(--serif);
  font-size: var(--page-title-size);
  font-weight: 500;
  text-transform: none;
  letter-spacing: .04em;
  color: var(--gold);
  text-align: center;
  margin: 0 0 var(--page-title-mb);
  display: flex;
  align-items: center;
  gap: .75rem;
  line-height: 1.15;
}
.page-title::before,
.page-title::after {
  content: "";
  flex: 1 1 1rem;
  min-width: 1rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-muted), transparent);
  border: 0;
}
.page-title--left,
.page-title--plain {
  text-align: left;
  display: block;
}
.page-title--plain { text-align: center; }
.page-title--left::before,
.page-title--left::after,
.page-title--plain::before,
.page-title--plain::after { display: none; }

.section { margin-top: var(--section-gap); }

.section-title {
  font-family: var(--serif);
  font-size: var(--section-title-size);
  font-weight: 500;
  text-transform: none;
  letter-spacing: .03em;
  color: var(--gold);
  margin: 0 0 var(--space-md);
  padding-bottom: .4rem;
  border-bottom: 1px solid rgba(143, 112, 71, .45);
  position: relative;
  line-height: 1.25;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 2.5rem;
  border-bottom: 2px solid var(--gold);
}

.section-subtitle {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: .03em;
  color: var(--gold);
  margin: var(--space-lg) 0 var(--space-sm);
}

.lead {
  font-size: var(--lead-size);
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 var(--space-md);
}
.lead.center { max-width: 40rem; margin-left: auto; margin-right: auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.meta { font-size: .8125rem; color: var(--muted); margin: 0 0 .5rem; }
.pre-wrap { white-space: pre-wrap; }
.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-family: var(--serif);
  color: var(--gold-light);
  letter-spacing: .02em;
}
.narrow { max-width: 34rem; margin-left: auto; margin-right: auto; }
.page-shell { max-width: 44rem; margin: 0 auto; }

.back { margin: 0 0 .75rem; }
.back a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-right: .5rem;
  font-size: .875rem;
  letter-spacing: .04em;
  text-decoration: none;
}

.empty {
  color: var(--muted);
  font-style: italic;
  padding: 1rem;
  border: 1px dashed rgba(143, 112, 71, .5);
  text-align: center;
  margin: .5rem 0;
  background: rgba(36, 32, 29, .5);
}

/* ---------- Карточки и рамки ---------- */

.card {
  background: var(--surface);
  border: var(--card-border);
  border-radius: var(--radius);
  padding: var(--card-pad);
  margin: 0 0 var(--space-md);
}
.card--compact { padding: var(--space-sm) var(--space-md); }
.card--flush { padding: var(--space-xs) 0; }
.card--accent {
  border-color: rgba(218, 172, 111, .55);
  background:
    linear-gradient(180deg, rgba(77, 5, 9, .22), transparent 65%),
    var(--surface-elevated);
}
.card--danger { border-color: rgba(112, 21, 29, .55); }
.card--danger > .section-title,
.card--danger > summary.section-title {
  color: #e8b4bc;
  border-bottom-color: rgba(112, 21, 29, .4);
}
.card > summary.section-title {
  cursor: pointer;
  list-style: none;
  margin-bottom: var(--space-sm);
}
.card > summary.section-title::-webkit-details-marker { display: none; }
.card > summary.section-title::after { display: none; }
.card > summary.section-title::before {
  content: "▾ ";
  color: var(--muted);
}
.card[open] > summary.section-title::before { content: "▴ "; }
.card__title {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--gold);
  margin: 0 0 var(--space-sm);
}
.card__subtitle {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--gold);
  margin: var(--space-lg) 0 var(--space-sm);
}
.card--secret {
  border-color: rgba(77, 5, 9, .8);
  box-shadow: inset 4px 0 0 var(--burgundy);
}

.secret { position: relative; }
.secret__body > :last-child { margin-bottom: 0; }
.secret__open {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(100% - 2rem, 18rem);
  box-shadow: var(--shadow-soft);
}
.secret.is-locked .secret__body {
  filter: blur(7px);
  user-select: none;
  pointer-events: none;
  transition: filter .25s ease;
}
.secret.is-locked .secret__body a { pointer-events: none; }
.secret:not(.is-locked) .secret__body {
  filter: none;
  transition: filter .25s ease;
}
@media (prefers-reduced-motion: reduce) {
  .secret.is-locked .secret__body,
  .secret:not(.is-locked) .secret__body { transition: none; }
}

.secret-dossier {
  background: var(--surface);
  border: var(--card-border);
  border-left: 4px solid var(--burgundy);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  margin: 0 0 var(--space-md);
}
.rules-page .secret-dossier__head { background: rgba(218, 172, 111, .06); }
.rules-page .secret-dossier__text h3:first-child { margin-top: 0; }
.secret-dossier__head {
  display: grid;
  gap: var(--space-md);
  padding: var(--card-pad);
  background: rgba(77, 5, 9, .28);
  border-bottom: 1px solid rgba(218, 172, 111, .22);
}
@media (min-width: 640px) {
  .secret-dossier__head {
    grid-template-columns: minmax(0, 1.6fr) minmax(10rem, .8fr);
    align-items: start;
    gap: var(--space-md) var(--space-lg);
  }
}
.secret-dossier__label {
  display: block;
  margin-bottom: .2rem;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  font-family: var(--sans);
}
.secret-dossier__value {
  display: block;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.4;
}
.secret-dossier__cash .secret-dossier__value {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--gold-light);
}
.secret-dossier__goal .secret-dossier__value { font-weight: 500; }
.secret-dossier__text { padding: var(--card-pad); }
.secret-dossier__text > :first-child { margin-top: 0; }
.secret-dossier__text > :last-child { margin-bottom: 0; }

.dossier-panel {
  padding: var(--card-pad);
  border-top: 1px solid rgba(218, 172, 111, .22);
}
.dossier-panel__title {
  margin: 0 0 .85rem;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: .03em;
}
.dossier-panel__cta { margin: 1rem 0 0; }
.dossier-panel--story { padding-bottom: calc(var(--card-pad) + .15rem); }

.dossier-block {
  padding: .9rem 0;
  border-top: 1px solid rgba(218, 172, 111, .16);
}
.dossier-block:first-child {
  padding-top: 0;
  border-top: 0;
}
.dossier-block__title {
  margin: 0 0 .55rem;
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--gold-light);
}
.dossier-block__list {
  margin: 0;
  padding-inline-start: 1.15rem;
  display: grid;
  gap: .4rem;
}
.dossier-block__text {
  margin: 0;
  line-height: 1.45;
  color: rgba(255, 251, 239, .9);
}
.dossier-block__action { margin: .7rem 0 0; }

.dossier-story {
  margin: 0;
}
.dossier-story > :first-child { margin-top: 0; }
.dossier-story > :last-child { margin-bottom: 0; }
.dossier-story h1 {
  margin: 1.35rem 0 .65rem;
  padding: .75rem 0 .15rem;
  border-top: 1px solid rgba(218, 172, 111, .28);
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--gold);
}
.dossier-story > h1:first-child {
  margin-top: .35rem;
  border-top: 0;
  padding-top: 0;
}
.dossier-story h2 {
  margin: 1rem 0 .45rem;
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--gold-light);
}
.dossier-story h3 {
  margin: .85rem 0 .4rem;
  font-size: .95rem;
  color: var(--ivory);
}
.dossier-story ul,
.dossier-story ol {
  margin: .35rem 0 .85rem;
  padding-inline-start: 1.2rem;
  display: grid;
  gap: .35rem;
}
.dossier-story p {
  margin: .45rem 0;
  line-height: 1.5;
}
.dossier-story hr {
  border: 0;
  border-top: 1px solid rgba(218, 172, 111, .22);
  margin: 1.1rem 0;
}

.secret-dossier__docs {
  padding: 0 var(--space-md) var(--space-md);
  border-top: 1px solid rgba(218, 172, 111, .22);
}
.secret-dossier__docs--solo {
  padding: var(--card-pad);
  border-top: 0;
}
.secret-dossier__heading {
  margin: 1rem 0 .75rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--gold);
  letter-spacing: .04em;
}
.secret-dossier__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .55rem;
}
.secret-doc {
  display: grid;
  grid-template-columns: 1fr;
  gap: .15rem;
  align-items: baseline;
  padding: .75rem .9rem;
  border: 1px solid rgba(218, 172, 111, .28);
  background: var(--bg-deep);
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: border-color var(--ease), background var(--ease);
}
.secret-doc:hover {
  border-color: var(--gold);
  color: var(--text);
  background: var(--surface-elevated);
}
.secret-doc__label {
  grid-row: 1 / span 2;
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--gold);
}
.secret-doc__title {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--text);
}
.secret-doc__meta {
  font-size: .8125rem;
  color: var(--muted);
}

.frame {
  position: relative;
  border: 1px solid rgba(218, 172, 111, .45);
  outline: 1px solid rgba(143, 112, 71, .35);
  outline-offset: -7px;
  padding: 1.25rem;
  border-radius: var(--radius-sm);
}
.frame::before,
.frame::after {
  content: "";
  position: absolute;
  width: 7px; height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
  top: -4px;
  pointer-events: none;
}
.frame::before { left: calc(50% - 3.5px); }
.frame::after { top: auto; bottom: -4px; left: calc(50% - 3.5px); }

.stack { list-style: none; margin: 0; padding: 0; }
.stack > li + li { margin-top: 0; }

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .75rem;
}
.cards > li { min-width: 0; }
.cards > .card { margin: 0; }

.status-card { margin-bottom: 1rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }

.dash-timer {
  margin: 0 0 var(--space-md);
  font-size: 1.35rem;
  letter-spacing: .04em;
  color: var(--gold);
  font-family: var(--serif);
}
.dash-timer__value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.dash-hint {
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.invite,
.venue {
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}
.invite .section-title,
.venue .section-title,
.arrived .section-title {
  text-align: center;
  border-bottom: 0;
  padding-bottom: 0;
}
.invite .section-title::after,
.venue .section-title::after,
.arrived .section-title::after {
  left: 50%;
  transform: translateX(-50%);
}
.invite-card,
.venue-card {
  margin-top: 1.25rem;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(77, 5, 9, .2), transparent 42%),
    var(--surface);
  text-align: center;
}
.invite-card { padding: 0; }
.venue-card { padding: 1.15rem 1rem 1.15rem; }
.invite-photo {
  margin: 0;
  background: var(--bg-deep);
  border-bottom: 1px solid rgba(218, 172, 111, .22);
}
.invite-photo__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 15%;
  background: var(--bg-deep);
}
.invite-photo__placeholder {
  display: grid;
  place-content: center;
  gap: .65rem;
  min-height: 16rem;
  aspect-ratio: 4 / 5;
  color: var(--gold);
  background:
    radial-gradient(ellipse at 50% 35%, rgba(218, 172, 111, .14), transparent 55%),
    var(--bg-deep);
}
.invite-photo__initials {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 12vw, 3.5rem);
  letter-spacing: .08em;
  line-height: 1;
}
.invite-photo__caption {
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.invite-card__body { padding: 1.15rem 1rem 1.25rem; }
.invite-card__kicker {
  margin: 0 0 .35rem;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.invite-card__title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 5.5vw, 2rem);
  letter-spacing: .03em;
  color: var(--gold);
}
.invite-card__role {
  margin: .35rem 0 0;
  font-size: .95rem;
  color: var(--muted);
  font-style: italic;
  font-family: var(--serif);
}
.invite-card__lead { margin: 1rem 0 0; font-size: 1.05rem; }
.invite-card__hosts { margin: .45rem 0 0; color: var(--muted); }
.invite-card__when {
  margin: .85rem 0 0;
  font-size: .9rem;
  color: var(--muted);
  letter-spacing: .04em;
}
.venue__name {
  margin: 0 0 .35rem;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 5vw, 1.75rem);
  letter-spacing: .03em;
  color: var(--gold);
}
.venue__address {
  margin: 0;
  font-size: .95rem;
  color: var(--muted);
}
.venue-map {
  margin: 1rem 0 0;
  border: 1px solid rgba(218, 172, 111, .25);
  background: var(--bg-deep);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.venue-map__link {
  display: block;
  line-height: 0;
  transition: opacity var(--ease);
}
.venue-map__link:hover { opacity: .92; }
.venue-map__img {
  display: block;
  width: 100%;
  height: auto;
}
.venue-card__action { margin: .9rem 0 0; }

.facts { margin: 0; display: flex; flex-wrap: wrap; gap: .75rem 2rem; }
.facts > div { min-width: 0; }
.facts dt {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}
.facts dd { margin: 0; font-size: 1.1rem; }
.facts--stack { display: block; }
.facts--stack > div {
  display: flex;
  flex-wrap: wrap;
  gap: .1rem .75rem;
  padding: .35rem 0;
  border-top: 1px solid rgba(218, 172, 111, .15);
}
.facts--stack > div:first-child { border-top: 0; }
.facts--stack dt { flex: 0 0 9rem; max-width: 100%; padding-top: .15rem; }
.facts--stack dd { flex: 1 1 10rem; min-width: 0; font-size: 1rem; }

.prose > :last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--gold);
  margin: 1.35rem 0 .55rem;
  line-height: 1.3;
}
.prose h1, .prose h2 {
  font-size: 1.15rem;
  letter-spacing: .04em;
  padding-bottom: .35rem;
  border-bottom: 1px solid rgba(218, 172, 111, .28);
}
.prose h3 {
  font-size: 1.05rem;
  letter-spacing: .03em;
  margin-top: 1.1rem;
}
.prose h4 {
  font-size: .95rem;
  color: var(--muted);
  margin-top: .9rem;
}
.prose p { margin: 0 0 .7rem; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 .85rem; }
.prose li + li { margin-top: .35rem; }
.prose blockquote {
  margin: .75rem 0 1rem;
  padding: .7rem 1rem;
  border-left: 3px solid var(--gold-muted);
  background: rgba(218, 172, 111, .06);
  font-style: italic;
  font-family: var(--serif);
  color: var(--text);
}
.prose hr { border: 0; border-top: 1px solid var(--gold-muted); margin: 1.15rem 0; }
.prose strong { color: var(--gold-light); }
.card--secret.prose h2,
.secret__body.prose h2,
.card--secret.prose h3,
.secret__body.prose h3 {
  color: var(--gold);
  border-bottom-color: rgba(218, 172, 111, .28);
}

.list { list-style: none; margin: 0; padding: 0; }
.list__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem 1rem;
  padding: .65rem 0;
  border-bottom: 1px solid rgba(218, 172, 111, .16);
}
.list__row .meta { margin: 0; }

.notice {
  border: 1px solid rgba(218, 172, 111, .35);
  border-left: 4px solid var(--gold);
  background: rgba(218, 172, 111, .06);
  padding: .8rem 1rem;
  margin: 0 0 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.notice > :last-child { margin-bottom: 0; }
.notice[hidden] { display: none; }
.list-plain {
  margin: .35rem 0 0;
  padding-left: 1.15rem;
}
.list-plain > li + li { margin-top: .35rem; }
.notice .list-plain { color: var(--text); }

.warning-box {
  background: var(--burgundy);
  color: var(--text);
  border: 1px solid rgba(218, 172, 111, .35);
  padding: .8rem 1rem;
  margin: 0 0 1rem;
  border-radius: var(--radius-sm);
}
.warning-box > :last-child { margin-bottom: 0; }
.warning-box__title {
  font-family: var(--serif);
  letter-spacing: .08em;
  font-size: 1rem;
  margin-bottom: .35rem;
  color: var(--gold-light);
}

.badge {
  display: inline-block;
  font-size: .72rem;
  padding: .2rem .55rem;
  border: 1px solid var(--gold-muted);
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
}

.ornament { color: var(--gold); font-size: 1.25rem; }

.doc-stamp {
  display: inline-block;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--burgundy);
  border: 1px solid rgba(77, 5, 9, .45);
  padding: .2rem .5rem;
  margin-bottom: .5rem;
  font-family: var(--sans);
  font-weight: 600;
}

/* ---------- Сообщения ---------- */

.messages:empty { display: none; }
.messages [role]:empty { display: none; }

.alert {
  padding: .8rem 1rem;
  margin: 0 0 1rem;
  border: 1px solid rgba(218, 172, 111, .35);
  border-left-width: 4px;
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.alert > :last-child { margin-bottom: 0; }
.alert--success { border-color: var(--emerald-accent); background: rgba(38, 60, 48, .35); }
.alert--error { border-color: var(--error); color: var(--text); background: rgba(77, 5, 9, .45); }
.alert--warning { border-color: var(--gold); }
.alert__list { margin: 0 0 .5rem; padding-left: 1.25rem; }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  padding: .65rem 1.2rem;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background: transparent;
  color: var(--gold);
  font-family: var(--sans);
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  max-width: 100%;
  transition: background var(--ease), color var(--ease), border-color var(--ease), transform var(--ease);
}
.btn:hover { background: rgba(218, 172, 111, .1); color: var(--gold-light); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--burgundy);
  border-color: var(--gold);
  color: var(--ivory);
}
.btn--primary:hover {
  background: var(--burgundy-hover);
  color: var(--ivory);
}
.btn--secondary {
  background: transparent;
  border-color: var(--gold);
  color: var(--gold);
}
.btn--secondary:hover {
  background: rgba(218, 172, 111, .1);
  color: var(--gold-light);
}
.btn--danger {
  background: var(--burgundy);
  border-color: rgba(218, 172, 111, .55);
  color: var(--ivory);
}
.btn--danger:hover {
  background: var(--burgundy-hover);
  color: var(--ivory);
}
.btn--ghost {
  border-color: rgba(143, 112, 71, .55);
  color: var(--muted);
}
.btn--ghost:hover { color: var(--text); border-color: var(--gold); }
.btn--small { font-size: .78rem; padding: .45rem .85rem; min-height: 40px; }
.btn--block { width: 100%; }
.btn--paper {
  border-color: var(--ink);
  color: var(--ink);
  background: transparent;
}
.btn--paper:hover { background: rgba(26, 21, 16, .08); color: var(--ink); }
.btn:disabled, .btn.is-busy {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Формы ---------- */

.form { margin: 0 0 1rem; }
.form__actions { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.form__actions--split > .btn { flex: 1 1 12rem; }
.form--inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin: .75rem 0; }
.form--inline .field { flex: 1 1 10rem; margin: 0; }

.field { margin: 0 0 1.1rem; min-width: 0; }
.field__label {
  display: block;
  font-weight: 500;
  margin-bottom: .4rem;
  color: var(--text);
  font-size: .875rem;
  letter-spacing: .04em;
}
.field__help { font-size: .85rem; color: var(--muted); margin: 0 0 .4rem; }
.field__errors {
  list-style: none;
  margin: .4rem 0 0;
  padding: 0;
  color: var(--error);
  font-weight: 500;
  font-size: .875rem;
}
.field__errors li::before { content: "! "; }

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  padding: .7rem .85rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-deep);
  border: 1px solid rgba(143, 112, 71, .55);
  border-radius: var(--radius);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}
select {
  padding-right: 2.5rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 50%, calc(100% - .8rem) 50%;
  background-size: .35rem .35rem;
  background-repeat: no-repeat;
}
textarea { min-height: 8rem; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(218, 172, 111, .25);
}
[aria-invalid="true"] {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 1px rgba(232, 180, 188, .35);
}

.fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1.1rem;
  min-width: 0;
}
.fieldset > legend { padding: 0; }
.choices { display: grid; gap: .5rem; }

.check-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  min-height: 48px;
  padding: .75rem .9rem;
  border: 1px solid rgba(218, 172, 111, .35);
  background: var(--surface);
  cursor: pointer;
  border-radius: var(--radius);
  transition: border-color var(--ease), background var(--ease);
}
.check-row input[type="checkbox"],
.check-row input[type="radio"] {
  flex: none;
  width: 1.35rem; height: 1.35rem;
  margin: .1rem 0 0;
  accent-color: var(--gold);
}
.check-row__text { min-width: 0; }
.check-row:has(input:checked) {
  border-color: var(--gold);
  background: rgba(218, 172, 111, .1);
}
.check-row:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.field--error .check-row { border-color: var(--error); }
.counter { margin: .35rem 0 0; text-align: right; }

/* ---------- Быстрые ссылки ---------- */

.quick-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  margin: 0 0 1rem;
}
.quick-link {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 56px;
  padding: .65rem .8rem;
  border: 1px solid rgba(218, 172, 111, .35);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: .875rem;
  line-height: 1.25;
  border-radius: var(--radius);
  transition: border-color var(--ease), background var(--ease);
}
.quick-link .icon { color: var(--gold); }
.quick-link:hover {
  border-color: var(--gold);
  color: var(--text);
  background: var(--surface-elevated);
}

/* ---------- Списки дел ---------- */

.crime-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: crime;
}
.crime-list li {
  counter-increment: crime;
  display: flex;
  gap: .75rem;
  padding: .7rem 0;
  border-bottom: 1px solid rgba(218, 172, 111, .16);
}
.crime-list li::before {
  content: counter(crime, upper-roman);
  flex: 0 0 2.25rem;
  font-family: var(--serif);
  color: var(--gold);
  font-size: 1.05rem;
}

.case-card {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  height: 100%;
  min-height: 44px;
  padding: 1rem;
  border: 1px solid rgba(218, 172, 111, .4);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
  transition: border-color var(--ease);
}
a.case-card:hover { border-color: var(--gold); color: var(--text); }
.case-card__title { font-family: var(--serif); font-size: 1.15rem; color: var(--gold); }
.case-card__status { font-size: .875rem; color: var(--muted); }
.case-card__status.is-empty { color: rgba(169, 156, 139, .55); font-style: italic; }
.case-card__status.is-draft { color: var(--text); }
.case-card__status.is-submitted { color: var(--gold); font-weight: 600; }
.case-card__status.is-submitted::before { content: "◆ "; font-size: .7em; vertical-align: .15em; }
.case-card__meta { font-size: .875rem; color: var(--muted); }
.case-card__action { margin-top: auto; padding-top: .25rem; font-size: .875rem; color: var(--gold); }
.case-card.is-disabled { opacity: .75; border-style: dashed; }

.folder-card {
  display: flex;
  gap: .75rem;
  align-items: baseline;
  margin: 0;
  text-decoration: none;
  color: var(--text);
}
.folder-card__label {
  font-family: var(--serif);
  color: var(--gold);
  font-size: 1.25rem;
  flex: none;
}
.folder-card__title { color: var(--text); }

/* ---------- Документы / архив ---------- */

.doc-card {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  height: 100%;
  min-height: 44px;
  padding: .95rem 1.05rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--paper-edge);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .4);
  text-decoration: none;
  border-radius: var(--radius-sm);
  position: relative;
  transition: box-shadow var(--ease), transform var(--ease);
}
.doc-card::before {
  content: "Конфиденциально";
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--burgundy);
  font-weight: 600;
  margin-bottom: .15rem;
}
.doc-card:hover {
  color: var(--ink);
  box-shadow: 4px 4px 0 rgba(143, 112, 71, .55);
  transform: translateY(-1px);
}
.doc-card:focus-visible { outline-color: var(--gold); }
.doc-card__label {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--burgundy);
  font-weight: 700;
  letter-spacing: .05em;
}
.doc-card__title {
  font-family: var(--serif);
  font-size: 1.1rem;
}
.doc-card__meta { font-size: .8rem; color: var(--ink-soft); }
.doc-card__new { margin-left: .35rem; color: var(--burgundy); border-color: var(--burgundy); font-family: var(--sans); }
.cash-task { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--gold-muted); }
.evidence-search-empty .empty { margin-bottom: .5rem; }

.paper {
  background:
    linear-gradient(transparent 0 calc(100% - 1px), rgba(26, 21, 16, .04) 0) 0 0 / 100% 1.65em,
    var(--paper);
  color: var(--ink);
  border: 1px solid var(--paper-edge);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .4);
  padding: 1.35rem 1.1rem;
  margin: 0 0 1rem;
  outline: 1px solid rgba(26, 21, 16, .2);
  outline-offset: -8px;
  border-radius: var(--radius-sm);
  position: relative;
}
.paper::before {
  content: "";
  position: absolute;
  top: .75rem;
  right: .85rem;
  width: 2.5rem;
  height: 2.5rem;
  background: url("../img/decorations/seal.0693cd7af279.svg") center / contain no-repeat;
  opacity: .85;
  pointer-events: none;
}
.paper a { color: var(--burgundy); }
.paper :focus-visible { outline-color: var(--ink); }
.paper__head {
  border-bottom: 2px solid var(--ink);
  padding-bottom: .55rem;
  margin-bottom: 1rem;
  padding-right: 2.75rem;
}
.paper__label {
  font-family: var(--sans);
  font-size: .72rem;
  color: var(--burgundy);
  font-weight: 600;
  margin: 0 0 .3rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.paper__title {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 5vw, 1.85rem);
  color: var(--ink);
  margin: 0 0 .25rem;
  font-weight: 500;
}
.paper__meta { font-size: .85rem; color: var(--ink-soft); margin: 0; }
.paper__body {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.65;
}
.paper__body h1, .paper__body h2, .paper__body h3 { color: var(--ink); }
.paper__body blockquote { border-left-color: var(--ink-soft); }
.paper__attachment {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--ink-soft);
}

.zoomable { display: block; color: var(--ink); text-decoration: none; }
.zoomable img { margin: 0 auto; border: 1px solid var(--paper-edge); }
.zoomable__hint {
  display: block;
  text-align: center;
  font-size: .85rem;
  color: var(--ink-soft);
  margin-top: .4rem;
}

/* ---------- Гости ---------- */

.guest-grid {
  --guest-gap: .5rem;
  --guest-row-gap: .65rem;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: start;
  gap: var(--guest-row-gap) var(--guest-gap);
}
.guest-grid > li {
  flex: 0 1 calc((100% - (var(--guest-cols, 4) - 1) * var(--guest-gap)) / var(--guest-cols, 4));
  max-width: calc((100% - (var(--guest-cols, 4) - 1) * var(--guest-gap)) / var(--guest-cols, 4));
  min-width: 0;
}
.guest-tile {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
  transition: transform var(--ease);
}
.guest-tile:hover { color: var(--text); }
.guest-tile:hover .guest-tile__photo {
  border-color: var(--gold);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.guest-tile__photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 15%;
  border: 1px solid rgba(218, 172, 111, .4);
  background: var(--bg-deep);
  border-radius: var(--radius-sm);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.guest-tile__photo--placeholder {
  display: grid;
  place-content: center;
  color: var(--gold);
  font-family: var(--serif);
  font-size: clamp(.95rem, 3.2vw, 1.35rem);
  letter-spacing: .06em;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(218, 172, 111, .14), transparent 55%),
    var(--bg-deep);
}
.guest-tile__body {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 0;
  padding: .45rem .15rem 0;
  text-align: center;
}
.guest-tile__name {
  font-family: var(--serif);
  font-size: clamp(.9rem, 2.5vw, 1.05rem);
  font-weight: 500;
  color: var(--gold);
  letter-spacing: .02em;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.guest-tile__meta {
  font-family: var(--serif);
  font-size: clamp(.72rem, 1.9vw, .84rem);
  font-style: italic;
  line-height: 1.3;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.guest-tile__player {
  font-size: clamp(.68rem, 1.7vw, .76rem);
  letter-spacing: .02em;
  line-height: 1.25;
  color: rgba(169, 156, 139, .85);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.guests-board {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  min-height: calc(100dvh - var(--nav-h) - 5.5rem);
}
.guests-board__hosts,
.guests-board__guests {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.guests-board .section-title--board { text-align: center; }
.guests-board__guests { flex: 1 1 auto; }
.guest-grid--hosts { flex: 0 0 auto; }
.guest-grid--hosts .guest-tile__photo {
  aspect-ratio: auto;
  height: clamp(3.5rem, calc((100dvh - var(--nav-h) - 11rem) / 4 - 2.4rem), 9.5rem);
}
.guest-grid--fit { flex: 1 1 auto; }
.guest-grid--fit .guest-tile__photo {
  aspect-ratio: auto;
  height: clamp(3.75rem, calc((100dvh - var(--nav-h) - 11rem) / 4 - 2.4rem), 10.5rem);
}
.guest-grid--dash .guest-tile__photo {
  aspect-ratio: 3 / 4;
  height: auto;
}
.section--board { margin-top: var(--space-md); }
.section-title--board {
  margin-bottom: var(--space-sm);
  padding-bottom: 0;
  border-bottom: 0;
}
.section-title--board::after { display: none; }
.arrived .guest-grid { margin-top: var(--space-xs); }

body:has(.dash-intro) .main,
body:has(.guests-board) .main,
body:has(.profile--own) .main,
body:has(.gate) .main {
  padding-top: var(--space-md);
  padding-bottom: var(--space-md);
}

.dash-intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-height: 0;
}
.dash-intro__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  text-align: center;
}
.dash-intro__head .page-title { margin-bottom: 0; }
.dash-timer--under {
  margin: 0 0 var(--space-xs);
  font-size: var(--lead-size);
  letter-spacing: .04em;
  color: var(--gold);
}
.dash-intro__ann {
  max-width: 40rem;
  margin: 0 auto;
  width: 100%;
}
.dash-intro__ann .announcements > li + li { margin-top: .45rem; }
.dash-intro__ann .announcement {
  position: relative;
  margin: 0;
  padding: var(--card-pad);
  border: var(--card-border);
  border-color: rgba(218, 172, 111, .55);
  background:
    linear-gradient(180deg, rgba(77, 5, 9, .25), transparent 55%),
    var(--surface);
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(218, 172, 111, .15);
  border-radius: var(--radius);
}
.dash-intro__ann .announcement::before,
.dash-intro__ann .announcement::after {
  content: "◆";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: .45rem;
  line-height: 1;
  color: var(--gold);
  opacity: .85;
}
.dash-intro__ann .announcement::before { top: .25rem; }
.dash-intro__ann .announcement::after { bottom: .25rem; }
.dash-intro__ann .card__title {
  margin: .15rem 0 .45rem;
  font-size: clamp(1.1rem, 3.8vw, 1.3rem);
  letter-spacing: .06em;
}
.dash-intro__ann .meta { display: none; }
.dash-intro__ann .prose {
  font-size: .84rem;
  line-height: 1.4;
  color: var(--text);
}
.dash-intro__ann .prose p { margin: 0 0 .4rem; }
.dash-intro__ann .prose p:last-child { margin-bottom: 0; }
.dash-intro__ann .prose blockquote {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-style: italic;
}
.dash-intro__board {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.dash-intro__board .section-title--board { margin-bottom: var(--space-sm); }
.dash-intro__board .guest-grid {
  --guest-row-gap: .4rem;
  flex: 1 1 auto;
}
.dash-intro .guest-grid--dash .guest-tile__photo {
  aspect-ratio: 3 / 4;
  height: auto;
}
.dash-intro__empty { margin: .5rem 0 0; }

@media (max-width: 430px) {
  .guests-board .guest-grid {
    --guest-cols: 2 !important;
  }
  .guests-board .guest-grid--hosts .guest-tile__photo,
  .guests-board .guest-grid--fit .guest-tile__photo {
    aspect-ratio: 4 / 5;
    height: auto;
  }
  .guest-tile__name { -webkit-line-clamp: 3; }
}

@media (min-width: 720px) {
  .guest-grid { --guest-gap: .55rem; --guest-row-gap: .7rem; }
  .dash-intro .guest-grid { --guest-row-gap: .5rem; }
  .dash-intro__ann .prose { font-size: .9rem; line-height: 1.45; }
}

.avatar {
  flex: none;
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
}
.avatar--initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--burgundy);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: .05em;
}
.avatar--large { width: 120px; height: 120px; font-size: 2.5rem; }

.profile__head { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.profile__head > div { flex: 1 1 12rem; min-width: 0; }
.portrait {
  width: 100%;
  max-width: 240px;
  border: 1px solid var(--gold);
  outline: 1px solid var(--gold-muted);
  outline-offset: 4px;
}

/* ---------- Кинематографичный портрет персонажа ---------- */

.character-hero {
  display: grid;
  gap: 0;
  margin: 0 0 var(--space-lg);
  align-items: start;
  position: relative;
}
.character-hero__stage {
  position: relative;
  margin: 0 calc(-1rem - var(--safe-l)) 0 calc(-1rem - var(--safe-r));
  overflow: hidden;
  background: var(--bg-deep);
}
.character-hero__photo {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  aspect-ratio: 3 / 4;
  max-height: min(72vh, 36rem);
  object-fit: cover;
  object-position: center 18%;
  border: 0;
  outline: 0;
  background: var(--bg-deep);
  animation: portrait-in .45s ease both;
}
@keyframes portrait-in {
  from { opacity: 0; transform: scale(1.03); }
  to { opacity: 1; transform: none; }
}
.character-hero__photo--placeholder {
  display: grid;
  place-content: center;
  color: var(--gold);
  font-family: var(--serif);
  font-size: clamp(2.5rem, 12vw, 4.5rem);
  letter-spacing: .08em;
  min-height: 18rem;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(218, 172, 111, .14), transparent 55%),
    linear-gradient(160deg, #1a1210, #0b0b0b);
}
.character-hero__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 0%, transparent 55%, rgba(11, 11, 11, .45) 78%, rgba(11, 11, 11, .92) 100%);
}
.character-hero__identity {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.25rem 1.15rem 1.35rem;
  text-align: center;
  z-index: 1;
}
.character-hero__kicker {
  margin: 0 0 .35rem;
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-light);
  opacity: .85;
}
.character-hero__name {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 7vw, 2.75rem);
  font-weight: 500;
  color: var(--gold);
  letter-spacing: .03em;
  line-height: 1.1;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .65);
}
.character-hero__role {
  margin: .45rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1rem, 3.2vw, 1.15rem);
  font-style: italic;
  color: var(--ivory);
  opacity: .92;
}
.character-hero__player {
  margin: .35rem 0 0;
  font-size: .8rem;
  color: var(--muted);
}
.character-hero__public {
  min-width: 0;
  padding-top: var(--space-lg);
}
.character-hero__public .section-title { margin-top: 0; }
.character-hero__frame {
  position: absolute;
  inset: .65rem;
  border: 1px solid rgba(218, 172, 111, .35);
  outline: 1px solid rgba(143, 112, 71, .25);
  outline-offset: -5px;
  pointer-events: none;
  z-index: 1;
}
.character-hero__frame::before,
.character-hero__frame::after {
  content: "";
  position: absolute;
  width: 8px; height: 8px;
  background: var(--gold);
  transform: rotate(45deg);
}
.character-hero__frame::before { top: -4px; left: calc(50% - 4px); }
.character-hero__frame::after { bottom: -4px; left: calc(50% - 4px); }

@media (min-width: 720px) {
  .character-hero {
    grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr);
    gap: 1.5rem 1.85rem;
    align-items: stretch;
  }
  .character-hero__stage {
    margin: 0;
    border-radius: var(--radius-sm);
  }
  .character-hero__photo {
    max-height: none;
    aspect-ratio: 4 / 5;
  }
  .character-hero__public {
    padding-top: 0;
    /* Высота колонки = высота фото; лишнее — внутрь прокрутки */
    height: 0;
    min-height: 100%;
    overflow: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: .65rem;
  }
  .character-hero__public .prose {
    font-size: .95rem;
    line-height: 1.45;
  }
  .character-hero__public .prose p { margin: 0 0 .65rem; }
  .character-hero__public .prose p:last-child { margin-bottom: 0; }
  .character-hero__public .prose p:has(> em:only-child) {
    font-family: var(--serif);
    font-size: 1.05rem;
    color: var(--gold-light);
  }
  .character-hero__identity { text-align: left; padding: 1.5rem; }
  .character-hero__name { font-size: clamp(2.1rem, 3vw, 2.6rem); }
}

/* ---------- Решения / финансы ---------- */

.decision { margin: 0 0 1rem; }
.decision__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: .5rem;
}
.decision__title {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--gold);
}
.decision__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: .75rem;
}
.decision__actions form { flex: 1 1 9rem; margin: 0; }
.decision__actions .btn { width: 100%; }
.decision form { margin-top: .5rem; }

.finance-panel {
  background:
    linear-gradient(160deg, rgba(218, 172, 111, .08), transparent 45%),
    var(--surface);
  border: 1px solid rgba(218, 172, 111, .4);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  position: relative;
}
.finance-panel::before {
  content: "";
  position: absolute;
  left: 1rem; right: 1rem; top: .45rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-muted), transparent);
}
.finance-panel__label {
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: .35rem 0 .25rem;
}
.finance-panel__value {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 5vw, 2rem);
  color: var(--gold-light);
  letter-spacing: .03em;
  margin: 0;
}

.salon {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(82, 124, 96, .18), transparent 55%),
    linear-gradient(180deg, rgba(38, 60, 48, .35), transparent 40%),
    var(--surface);
  border: 1px solid rgba(82, 124, 96, .4);
  border-radius: var(--radius);
  padding: 1.1rem;
}
.salon__title {
  font-family: var(--serif);
  color: var(--gold);
  margin: 0 0 .5rem;
  letter-spacing: .04em;
}

/* ---------- Финал ---------- */

.placeholder { padding: 2rem 1.25rem; }
.epilogue { font-family: var(--serif); font-size: 1.08rem; line-height: 1.65; }
.verdict { margin: 0; }
.verdict__status { color: var(--muted); }
.verdict.is-proven { border-color: var(--gold); }
.verdict.is-proven .verdict__status { color: var(--gold); font-weight: 600; }
.reasons { margin: 1rem 0 0; padding-left: 1.25rem; color: var(--muted); }

/* ---------- Вход / приглашение ---------- */

body.page-gate {
  background:
    radial-gradient(ellipse 90% 60% at 50% 20%, rgba(77, 5, 9, .45), transparent 60%),
    var(--bg-deep);
}
body.page-gate .site-header { display: none; }
body.page-gate .main {
  padding-top: 0;
  padding-bottom: 0;
  max-width: none;
  animation: none;
}
body.page-gate::after,
body.page-gate::before {
  content: none;
  display: none;
}

.gate {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem calc(2rem + env(safe-area-inset-bottom, 0px));
  z-index: 3;
}
.gate__panel {
  width: min(100%, 26rem);
  text-align: center;
  padding: 2rem 1.35rem 1.75rem;
  background:
    linear-gradient(180deg, rgba(77, 5, 9, .22), transparent 40%),
    var(--surface);
  border: 1px solid rgba(218, 172, 111, .45);
  outline: 1px solid rgba(143, 112, 71, .3);
  outline-offset: -8px;
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius-sm);
  animation: gate-in .5s ease both;
}
@keyframes gate-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.gate__logo {
  width: min(14rem, 72vw);
  height: auto;
  aspect-ratio: 3 / 2;
  margin: .35rem auto 1rem;
  border-radius: 18px;
  object-fit: contain;
  background: #4D0509;
  display: block;
}
.gate__title {
  margin: .55rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.65rem, 6vw, 2.05rem);
  font-weight: 500;
  color: var(--ivory);
  letter-spacing: .02em;
  line-height: 1.2;
}
.gate__date {
  margin: .7rem 0 0;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.gate__divider {
  display: block;
  width: min(100%, 14rem);
  height: 1.25rem;
  margin: 1rem auto;
  background: url("../img/decorations/divider.db6e5899e864.svg") center / contain no-repeat;
}
.gate__quote {
  margin: 0 auto;
  max-width: 22rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--muted);
  line-height: 1.45;
}
.gate__form { margin-top: 1.35rem; text-align: left; }
.gate__form .form__actions { margin-top: 1rem; }
.gate__lead {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
}


/* ---------- Нижняя навигация ---------- */

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: rgba(11, 11, 11, .96);
  border-top: 1px solid rgba(218, 172, 111, .4);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, .45);
  padding-bottom: var(--safe-b);
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
  backdrop-filter: blur(8px);
}
.bottom-nav__list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: flex;
  max-width: 40rem;
}
.bottom-nav__item { flex: 1 1 0; min-width: 0; position: relative; }
.bottom-nav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .18rem;
  min-height: var(--nav-h);
  padding: .35rem .15rem;
  color: var(--muted);
  text-decoration: none;
  font-size: clamp(.66rem, 3.3vw, .76rem);
  font-weight: 500;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
  border-top: 2px solid transparent;
  transition: color var(--ease), border-color var(--ease);
}
.bottom-nav__link::-webkit-details-marker { display: none; }
.bottom-nav__link::marker { content: ""; }
.bottom-nav__link:hover { color: var(--text); }
.bottom-nav__link.is-active {
  color: var(--gold);
  border-top-color: var(--gold);
}
.bottom-nav__link.is-active .icon { color: var(--gold); }
.bottom-nav__label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.more { position: static; }
.more[open] > .bottom-nav__link { color: var(--text); }
.more__panel {
  list-style: none;
  margin: 0;
  padding: .5rem;
  position: absolute;
  right: .25rem;
  bottom: calc(100% + .5rem);
  width: min(17rem, calc(100vw - 1rem));
  background: var(--bg-deep);
  border: 1px solid rgba(218, 172, 111, .45);
  outline: 1px solid rgba(143, 112, 71, .3);
  outline-offset: -5px;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .65);
  border-radius: var(--radius-sm);
}
.more__link {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 48px;
  padding: .5rem .75rem;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.more__link .icon { color: var(--gold); }
.more__link.is-active {
  color: var(--gold);
  background: rgba(218, 172, 111, .1);
}
.more__link:hover {
  background: rgba(218, 172, 111, .1);
  color: var(--text);
}

.kb-open .bottom-nav { display: none; }

/* ---------- Confirm dialog ---------- */

.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: calc(1rem + var(--safe-t, 0px)) calc(1rem + var(--safe-r)) calc(1rem + var(--safe-b)) calc(1rem + var(--safe-l));
}
.confirm-dialog[hidden] { display: none !important; }
.confirm-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 6, 6, .7);
}
.confirm-dialog__panel {
  position: relative;
  z-index: 1;
  width: min(32rem, 100%);
  padding: 1.75rem 1.6rem 1.5rem;
  border-radius: 20px;
  border: 1px solid rgba(218, 172, 111, .3);
  background: var(--surface-elevated, #1c1816);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  color: var(--ivory);
}
.confirm-dialog__kicker {
  margin: 0 0 .75rem;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.confirm-dialog__text {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.5;
  color: rgba(255, 251, 239, .9);
}
.confirm-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: 1.5rem;
}
.confirm-dialog__actions .btn {
  min-width: 6.5rem;
  min-height: 2.85rem;
  font-size: 1rem;
}
body.confirm-open { overflow: hidden; }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(11, 11, 11, .97);
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 0px) var(--safe-r) var(--safe-b) var(--safe-l);
}
.lightbox__bar { display: flex; justify-content: flex-end; padding: .5rem; flex: none; }
.lightbox__stage {
  flex: 1 1 auto;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-x pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
}
.lightbox__stage img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.lightbox__stage.is-zoomed { display: block; }
.lightbox__stage.is-zoomed img { max-width: none; max-height: none; width: auto; cursor: zoom-out; }
body.lightbox-open { overflow: hidden; }

/* ---------- Планшет / десктоп ---------- */

@media (min-width: 600px) {
  body { font-size: 16px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
  .quick-links { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .paper { padding: 2rem 2.25rem; }
  .brand { font-size: .85rem; }
}

@media (min-width: 900px) {
  body.has-nav { padding-bottom: 0; }
  .bottom-nav { display: none; }

  .top-nav {
    display: block;
    border-top: 1px solid rgba(218, 172, 111, .2);
  }
  .top-nav__list {
    list-style: none;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 .25rem;
  }
  .top-nav__link {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 .9rem;
    color: var(--muted);
    text-decoration: none;
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: .1em;
    font-size: .72rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color var(--ease), border-color var(--ease);
  }
  .top-nav__link:hover { color: var(--text); }
  .top-nav__link.is-active {
    color: var(--gold);
    border-bottom-color: var(--gold);
  }

  .brand { font-size: .9rem; }
  .main { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }
  .form:not(.form--inline) { max-width: 44rem; }
}

/* ---------- Доступность ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .main, .gate__panel, .character-hero__photo { animation: none !important; }
}

@media (forced-colors: active) {
  .frame::before, .frame::after,
  .character-hero__frame::before, .character-hero__frame::after { display: none; }
  .btn { border: 1px solid ButtonText; }
  body::before { display: none; }
}

@media print {
  .site-header, .bottom-nav, .skip-link, form, .quick-links,
  body::before, .character-hero__veil, .character-hero__frame { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  .card, .paper { box-shadow: none; }
}

/* ---------- Ведущий ---------- */

.dash-next { max-width: 34rem; margin: 1.25rem auto 0; }
.dash-next .notice { margin-bottom: .75rem; }
.dash-facts { margin-bottom: 1rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dash-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.dash-table th, .dash-table td {
  padding: .45rem .5rem;
  border-bottom: 1px solid rgba(218, 172, 111, .16);
  text-align: left;
  vertical-align: top;
}
.dash-table thead th {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.dash-table td { white-space: nowrap; }
.mono { font-family: var(--mono); }
details.card > summary { cursor: pointer; color: var(--gold); }
.btn-row--center { justify-content: center; }
.kicker {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .72rem;
  margin: 0 0 .25rem;
  font-family: var(--sans);
}
.dash-table tbody th { min-width: 8.5rem; font-weight: 600; }
.dash-who { display: block; font-weight: 400; }
.dash-arrival { margin: 0; }
.dash-arrival__btn {
  appearance: none;
  border: 1px solid rgba(218, 172, 111, .3);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .85rem;
  padding: .25rem .55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-width: 2.75rem;
  min-height: 36px;
}
.dash-arrival__btn.is-on {
  border-color: var(--gold);
  color: var(--text);
  background: rgba(218, 172, 111, .12);
}
.dash-arrival__btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
@media (max-width: 480px) {
  .dash-table { font-size: .85rem; }
  .dash-table th, .dash-table td { padding: .4rem .3rem; }
  .dash-table thead th { letter-spacing: .02em; font-size: .68rem; }
}

.host-panel__head { margin-bottom: 0; text-align: center; }
.host-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm) var(--space-md);
  margin: 0;
}
.host-metrics > div {
  min-width: 4.5rem;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid rgba(218, 172, 111, .25);
  background: rgba(218, 172, 111, .05);
  text-align: center;
  border-radius: var(--radius-sm);
}
.host-metrics dt {
  margin: 0;
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.host-metrics dd {
  margin: .1rem 0 0;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.host-metrics__warn { color: #e8b4bc; }
.host-note {
  margin: 0 0 var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: .9rem;
  line-height: 1.35;
}
.host-note--warn {
  border-left: 3px solid rgba(112, 21, 29, .8);
  background: rgba(77, 5, 9, .28);
}
.host-list {
  margin: 0 0 var(--space-sm);
  padding-left: 1.15rem;
  font-size: .9rem;
}
.host-list li + li { margin-top: var(--space-xs); }
.host-table tbody th {
  min-width: 0;
  font-weight: 600;
  white-space: normal;
}
.host-table__actions { text-align: right; }
.host-inline-form {
  display: inline-block;
  margin-left: var(--space-xs);
  vertical-align: middle;
}

/* Private role cockpit: the same shared actions, arranged for the player's role. */
.player-dashboard__focus { display: grid; gap: .85rem; }
.player-dashboard__goal { font-size: 1.12rem; font-weight: 600; margin: 0; }
.player-dashboard__actions, .player-dashboard__attention, .player-guide, .player-book {
  display: grid; gap: .6rem; min-width: 0;
}
.player-dashboard__focus > .player-guide {
  gap: 0;
  margin-top: .25rem;
  padding-top: .35rem;
  border-top: 1px solid rgba(218, 172, 111, .22);
}
.player-dashboard__actions .btn, .player-dashboard__attention .btn { white-space: normal; text-align: center; }
.player-statuses { display: grid; gap: .5rem; list-style: none; padding: 0; margin: .55rem 0; }
.player-status { border: 1px solid currentColor; border-radius: .65rem; padding: .65rem .8rem; display: grid; gap: .2rem; }
.player-status--neutral { border-color: rgba(170, 142, 91, .35); }
.player-status--done { color: #b7dfb0; border-color: rgba(150, 211, 140, .45); }
.player-status--waiting { color: #e8cf93; border-color: rgba(232, 207, 147, .45); }
.player-status__label { font-size: .79rem; opacity: .85; margin: 0; }
.guide-spoiler { border-top: 1px solid rgba(170, 142, 91, .35); padding: .45rem 0; }
.guide-spoiler summary { cursor: pointer; font-weight: 600; padding: .4rem 0; }
.guide-spoiler > p, .guide-spoiler > ul { margin: .65rem 0; }
.guide-spoiler ul { padding-inline-start: 1.2rem; }
.guide-spoiler li + li { margin-top: .35rem; }
.guide-rule-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.evidence-option { display: grid; gap: .15rem; min-width: 0; }
.evidence-option .check-row { margin: 0; }
.evidence-option__read { margin-inline-start: 2rem; width: fit-content; padding: .2rem 0; font-size: .84rem; }
.evidence-option[hidden] { display: none; }
.player-dashboard__phase { text-align: center; margin: 0; font-size: .88rem; }
.home-board .player-dashboard { margin-top: 0; }
.player-dashboard { margin-top: .6rem; }
.player-dashboard__name { margin-bottom: .15rem; }
.player-dashboard__private { margin: 0 0 .7rem; }
.player-dashboard__focus .player-statuses { margin: 0; }
.player-dashboard__focus > .small { margin: 0; }
