:root {
  --ink: #0a0e0c;
  --ink-2: #101614;
  --parchment: #d8cfb8;
  --parchment-dim: #a99f88;
  --acid: #8fa86b;
  --brass: #b08d57;
  --brass-bright: #d9b87a;
  --blood: #7a2f2a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--ink);
  color: var(--parchment);
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

/* --- фон с туманом --- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, #1c2b26 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 90%, #241a1a 0%, transparent 70%),
    linear-gradient(180deg, #0a0e0c 0%, #070a09 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  opacity: 0.35;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- шапка --- */
.site-header {
  position: relative;
  padding: 64px 0 40px;
  text-align: center;
}

.logo {
  width: min(560px, 82vw);
  height: min(560px, 82vw);
  display: block;
  margin: 0 auto 16px;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.75)) contrast(1.08) saturate(1.05);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 62%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 50%, #000 62%, transparent 72%);
}

.logo.logo-ready {
  -webkit-mask-image: none;
  mask-image: none;
}

.site-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 0;
  color: var(--parchment);
  text-shadow: 0 0 30px rgba(143, 168, 107, 0.25), 0 2px 2px #000;
}

.site-title span {
  display: block;
  font-size: 0.32em;
  letter-spacing: 0.5em;
  color: var(--parchment-dim);
  margin-top: 10px;
}

.rule {
  width: 220px;
  height: 1px;
  margin: 28px auto;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
  position: relative;
}

.rule::after {
  content: "✦";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--brass-bright);
  background: var(--ink);
  padding: 0 12px;
  font-size: 12px;
}

/* --- навигация --- */
nav.mainnav {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

nav.mainnav a {
  color: var(--parchment-dim);
  text-decoration: none;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: all 0.25s ease;
}

nav.mainnav a:hover,
nav.mainnav a:focus-visible {
  color: var(--brass-bright);
  border-color: rgba(176, 141, 87, 0.4);
  background: rgba(176, 141, 87, 0.06);
}

/* --- секции --- */
section {
  padding: 72px 0;
}

section + section {
  border-top: 1px solid rgba(176, 141, 87, 0.12);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 8px;
  color: var(--parchment);
}

.section-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 14px;
}

.lede {
  color: var(--parchment-dim);
  max-width: 62ch;
  font-size: 1.05rem;
}

/* --- карта --- */
.map-shell {
  position: relative;
  margin-top: 32px;
  border-radius: 4px;
  overflow: hidden;
  background: #060a09;
  border: 1px solid rgba(176, 141, 87, 0.25);
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.7),
    inset 0 0 0 1px rgba(0, 0, 0, 0.6);
}

.map-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background:
    radial-gradient(ellipse at 50% 40%, #16211d 0%, #060a09 75%);
}

.map-stage.dragging {
  cursor: grabbing;
}

.map-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.map-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 45%, rgba(0, 0, 0, 0.65) 100%);
  mix-blend-mode: multiply;
}

.map-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-hud > * {
  pointer-events: auto;
}

.map-controls {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-controls button {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(176, 141, 87, 0.45);
  background: rgba(8, 12, 10, 0.82);
  color: var(--parchment);
  font-size: 18px;
  cursor: pointer;
  border-radius: 2px;
  line-height: 1;
  font-family: inherit;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.map-controls button:hover {
  border-color: var(--brass-bright);
  color: var(--brass-bright);
  background: rgba(20, 26, 22, 0.95);
}

.map-hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(169, 159, 136, 0.6);
  white-space: nowrap;
  pointer-events: none;
}

.map-legend {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  margin-top: 20px;
  font-size: 0.82rem;
  color: var(--parchment-dim);
}

.map-legend div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.map-legend svg {
  width: 26px;
  height: 32px;
  flex: none;
}

/* --- карточка события --- */
.event-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  width: min(320px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  overflow-y: auto;
  background: rgba(10, 14, 12, 0.94);
  border: 1px solid rgba(176, 141, 87, 0.5);
  border-radius: 3px;
  padding: 20px 22px;
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
  transform: translateX(calc(100% + 32px));
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
  pointer-events: none;
}

.event-panel.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.event-panel .ev-type {
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 10px;
}

.event-panel .ev-type::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, var(--brass));
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 8px var(--accent, var(--brass));
}

.event-panel h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  color: var(--parchment);
  font-weight: normal;
}

.event-panel .ev-date {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(169, 159, 136, 0.7);
  margin-bottom: 14px;
}

.event-panel p {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: #c4bba4;
  line-height: 1.65;
}

.ev-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--parchment-dim);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  font-family: inherit;
}

.ev-close:hover {
  color: var(--brass-bright);
}

/* --- подсказка-тултип на карте --- */
.map-tooltip {
  position: absolute;
  padding: 6px 12px;
  background: rgba(10, 14, 12, 0.95);
  border: 1px solid rgba(176, 141, 87, 0.5);
  border-radius: 2px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--parchment);
  pointer-events: none;
  transform: translate(-50%, -140%);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 5;
}

.map-tooltip.visible {
  opacity: 1;
}

/* --- хроника --- */
.log-list {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.log-item {
  display: grid;
  grid-template-columns: 96px auto 1fr;
  gap: 20px;
  align-items: baseline;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.015);
  border-left: 2px solid rgba(176, 141, 87, 0.2);
  transition: all 0.2s ease;
  cursor: pointer;
}

.log-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-left-color: var(--accent, var(--brass));
}

.log-item .log-date {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
  white-space: nowrap;
}

.log-item .log-marker {
  width: 18px;
  height: 22px;
  justify-self: start;
}

.log-item .log-body strong {
  display: block;
  font-weight: normal;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.log-item .log-body span {
  font-size: 0.85rem;
  color: var(--parchment-dim);
}

/* --- команда --- */
.crew {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.creed {
  display: grid;
  gap: 18px;
  max-width: 72ch;
}

.creed .lede {
  margin: 0;
}

.crew-card {
  border: 1px solid rgba(176, 141, 87, 0.2);
  padding: 24px;
  background: rgba(255, 255, 255, 0.015);
  position: relative;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.crew-card:hover {
  border-color: rgba(176, 141, 87, 0.4);
  background: rgba(255, 255, 255, 0.03);
}

.crew-card.dead {
  opacity: 0.55;
  filter: grayscale(0.8);
}

.crew-card h3 {
  margin: 0 0 2px;
  padding-right: 88px;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
  font-weight: normal;
  letter-spacing: 0.08em;
}

.crew-card .crew-role {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 12px;
}

.crew-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--parchment-dim);
}

.crew-card .crew-status {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--acid);
}

.crew-card.dead .crew-status {
  color: var(--blood);
}

/* --- подвал --- */
footer {
  padding: 56px 0;
  text-align: center;
  border-top: 1px solid rgba(176, 141, 87, 0.12);
  color: rgba(169, 159, 136, 0.5);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* --- появление --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (max-width: 900px) {
  .event-panel {
    top: auto;
    bottom: 16px;
    right: 16px;
    max-height: 55%;
  }

  .event-panel.open {
    transform: none;
  }
}

@media (max-width: 720px) {
  .log-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .map-legend {
    gap: 14px;
    font-size: 0.75rem;
  }

  .map-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
