/* ===========================================================
   ЛОКАЛЬНЫЕ ШРИФТЫ
   Каждый @font-face ссылается только на локальный файл рядом
   с этой страницей (папка fonts/). Если файла нет или он не
   загрузился, браузер просто не находит подходящее начертание —
   весь текст в этот момент рисуется невидимым (font-display:
   block даёт короткое окно ожидания вместо мгновенной подмены
   на системный шрифт, из-за которой обычно и заметен "скачок").
   Настоящий фолбэк на Google Fonts из интернета выполняет скрипт
   в конце страницы: он проверяет через document.fonts, какие
   начертания реально загрузились, и для тех, что не загрузились,
   сам подключает недостающий стиль с fonts.googleapis.com —
   ровно так же, как <img onerror> подменяет картинки.
   =========================================================== */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("fonts/Nunito-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url("fonts/Nunito-Bold.ttf") format("truetype");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: block;
  src: url("fonts/Nunito-ExtraBold.ttf") format("truetype");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 900;
  font-display: block;
  src: url("fonts/Nunito-Black.ttf") format("truetype");
}

@font-face {
  font-family: "Comic Neue";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("fonts/ComicNeue-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "Comic Neue";
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url("fonts/ComicNeue-Bold.ttf") format("truetype");
}

@font-face {
  font-family: "Press Start 2P";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("fonts/PressStart2P-Regular.ttf") format("truetype");
}

:root {
  --ink: #312835;
  --ink-soft: #655769;
  --rose: #f29ab6;
  --rose-light: #ffd7e4;
  --ash-rose: #d7acb8;
  --peach: #ffc49d;
  --peach-light: #ffe6d1;
  --cream: #fffaf6;
  --white: #ffffff;
  --mint: #9bd8c2;
  --lemon: #ffe28a;
  --sky: #8cc9ef;
  --danger: #ff6f91;
  --violet: #b8a7ff;
  --shadow: 0 24px 70px rgba(129, 68, 89, 0.2);
  --pixel-shadow: 4px 4px 0 #312835;
  --line: rgba(49, 40, 53, 0.16);
  --vn-dark: rgba(49, 40, 53, 0.86);
  --vn-light: rgba(255, 250, 246, 0.82);
  --container: min(1120px, calc(100% - 32px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.4) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.4) 1px, transparent 1px),
    radial-gradient(circle at 10% 8%, rgba(255, 215, 228, 0.9), transparent 28rem),
    radial-gradient(circle at 87% 18%, rgba(255, 196, 157, 0.72), transparent 25rem),
    radial-gradient(circle at 55% 95%, rgba(155, 216, 194, 0.28), transparent 34rem),
    linear-gradient(180deg, #fffaf6 0%, #fff0f5 44%, #fff8ee 100%);
  background-size:
    24px 24px,
    24px 24px,
    auto,
    auto,
    auto,
    auto;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(49, 40, 53, 0.035) 0 1px,
      transparent 1px 5px
    );
  content: "";
  mix-blend-mode: multiply;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 0 48%, rgba(49, 40, 53, 0.04) 48% 52%, transparent 52%),
    linear-gradient(45deg, transparent 0 48%, rgba(49, 40, 53, 0.035) 48% 52%, transparent 52%);
  background-size: 92px 92px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 58%);
  content: "";
}

a {
  color: inherit;
  text-decoration: none;
}

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

p,
h1,
h2,
h3 {
  margin: 0;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.pixel-font {
  font-family: "Press Start 2P", "Comic Neue", cursive;
  letter-spacing: 0;
}

.site-header {
  position: fixed;
  inset: 14px 0 auto;
  z-index: 20;
  pointer-events: none;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: var(--container);
  min-height: 58px;
  margin: 0 auto;
  padding: 8px 10px 8px 14px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: rgba(255, 250, 246, 0.82);
  box-shadow: var(--pixel-shadow);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 0.72rem;
  line-height: 1.4;
}

.brand-icon {
  display: grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 2px solid var(--ink);
  background:
    linear-gradient(90deg, var(--ink) 6px, transparent 6px 10px, var(--ink) 10px 16px, transparent 16px),
    linear-gradient(180deg, transparent 0 6px, var(--rose-light) 6px);
  box-shadow: 2px 2px 0 var(--ink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.58rem;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 2px solid transparent;
  transition: background 160ms steps(2), transform 160ms steps(2), border-color 160ms steps(2);
}

.nav-links a:hover {
  border-color: var(--ink);
  background: var(--lemon);
  transform: translate(-2px, -2px);
}

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: 128px 0 76px;
  overflow: hidden;
}

.hero::before,
.hero::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.hero::before {
  inset: auto auto 8% -42px;
  width: 170px;
  height: 170px;
  background:
    linear-gradient(90deg, var(--rose) 14px, transparent 14px) 0 0 / 28px 28px,
    linear-gradient(var(--rose) 14px, transparent 14px) 0 0 / 28px 28px;
  opacity: 0.22;
  transform: rotate(8deg);
}

.hero::after {
  top: 120px;
  right: max(20px, calc((100vw - 1120px) / 2));
  width: 126px;
  height: 96px;
  border: 3px solid rgba(49, 40, 53, 0.16);
  background:
    linear-gradient(90deg, transparent 34px, rgba(49, 40, 53, 0.12) 34px 40px, transparent 40px),
    linear-gradient(180deg, var(--mint) 0 45%, var(--lemon) 45% 58%, var(--rose-light) 58%);
  clip-path: polygon(0 16px, 16px 16px, 16px 0, calc(100% - 16px) 0, calc(100% - 16px) 16px, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 16px calc(100% - 16px), 0 calc(100% - 16px));
  opacity: 0.55;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.78fr);
  gap: 44px;
  align-items: center;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.save-slot {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin-bottom: 22px;
  padding: 0 12px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--mint);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 0.58rem;
  line-height: 1.5;
}

.save-slot::before {
  width: 10px;
  height: 10px;
  background: var(--danger);
  box-shadow:
    14px 0 0 var(--lemon),
    28px 0 0 var(--sky);
  content: "";
}

h1 {
  max-width: 760px;
  color: #342636;
  font-size: clamp(2.65rem, 9vw, 6.8rem);
  font-weight: 900;
  line-height: 0.96;
  text-wrap: balance;
  text-shadow:
    4px 4px 0 #ffffff,
    8px 8px 0 rgba(242, 154, 182, 0.45);
}

.typing-line {
  width: fit-content;
  max-width: 100%;
  min-height: 2.4em;
  margin-top: 28px;
  padding: 18px 20px;
  border: 3px solid var(--ink);
  color: var(--white);
  background: var(--vn-dark);
  box-shadow: var(--pixel-shadow);
  font-size: clamp(1rem, 2vw, 1.24rem);
  font-weight: 800;
}

.typing-text {
  display: inline;
}

.typing-text::after {
  display: inline-block;
  width: 0.65em;
  color: var(--lemon);
  content: "▌";
  animation: caret 800ms steps(2) infinite;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

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

.pixel-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 3px solid var(--ink);
  color: var(--ink);
  background: var(--white);
  box-shadow: var(--pixel-shadow);
  font-size: 0.68rem;
  line-height: 1.35;
  text-align: center;
  transition:
    transform 150ms steps(2),
    box-shadow 150ms steps(2),
    background 150ms steps(2);
}

.pixel-btn.primary {
  background: var(--rose-light);
}

.pixel-btn.secondary {
  background: var(--peach-light);
}

.pixel-btn::before {
  margin-right: 10px;
  content: "▶";
  font-size: 0.72em;
}

.pixel-btn:hover,
.pixel-btn:focus-visible {
  background: var(--lemon);
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(2px, 2px);
}

.hero-visual {
  position: relative;
  min-height: 560px;
}

.portrait-shell {
  position: absolute;
  inset: 14px 0 0;
  border: 4px solid var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 215, 228, 0.74)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 16px, transparent 16px 32px);
  box-shadow:
    10px 10px 0 var(--ink),
    28px 28px 0 rgba(242, 154, 182, 0.36);
  overflow: hidden;
  isolation: isolate;
}

.portrait-shell::before {
  position: absolute;
  inset: 16px;
  z-index: -1;
  border: 2px dashed rgba(49, 40, 53, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 196, 157, 0.28), transparent 52%),
    linear-gradient(45deg, rgba(155, 216, 194, 0.3), transparent 48%);
  content: "";
}

.portrait-shell img {
  position: absolute;
  inset: 26px;
  width: calc(100% - 52px);
  height: calc(100% - 52px);
  object-fit: cover;
  object-position: center 18%;
  filter: saturate(1.04) contrast(1.02);
  transition: transform 500ms ease;
}

.portrait-shell:hover img {
  transform: scale(1.025);
}

.hero-badge {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  width: 74px;
  height: 42px;
  border: 2px solid var(--ink);
  background:
    linear-gradient(90deg, rgba(49, 40, 53, 0.16) 2px, transparent 2px) 0 0 / 10px 10px,
    var(--white);
  box-shadow: 3px 3px 0 var(--ink);
  animation: floaty 4.5s ease-in-out infinite;
}

.hero-badge::before,
.hero-badge::after {
  position: absolute;
  border: 2px solid var(--ink);
  background: var(--white);
  content: "";
}

.hero-badge::before {
  left: 12px;
  top: 12px;
  width: 12px;
  height: 12px;
}

.hero-badge::after {
  right: 12px;
  top: 12px;
  width: 22px;
  height: 10px;
  box-shadow: 0 14px 0 -2px var(--white), 0 14px 0 0 var(--ink);
}

.hero-badge.one {
  top: 52px;
  left: -10px;
  background: var(--lemon);
}

.hero-badge.two {
  right: -4px;
  bottom: 112px;
  background: var(--mint);
  animation-delay: -1.4s;
}

.hero-badge.three {
  left: 24px;
  bottom: 42px;
  background: var(--peach-light);
  animation-delay: -2.8s;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.section {
  position: relative;
  padding: 88px 0;
}

.section-title {
  display: grid;
  gap: 14px;
  max-width: 880px;
  margin-bottom: 34px;
}

.section-title .label {
  display: inline-flex;
  width: fit-content;
  min-width: 78px;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 2px solid var(--ink);
  background:
    linear-gradient(90deg, var(--danger) 0 14px, transparent 14px 22px, var(--lemon) 22px 36px, transparent 36px 44px, var(--mint) 44px 58px, transparent 58px),
    var(--rose-light);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 0.58rem;
  line-height: 1.45;
}

h2 {
  font-size: clamp(1.7rem, 4vw, 3.35rem);
  font-weight: 900;
  line-height: 1.05;
  text-wrap: balance;
}

h3 {
  font-size: 1.16rem;
  font-weight: 900;
  line-height: 1.15;
}

.vn-window {
  position: relative;
  border: 3px solid var(--ink);
  background: var(--vn-light);
  box-shadow: var(--pixel-shadow);
  backdrop-filter: blur(12px);
  cursor: pointer;
  user-select: none;
  transition: box-shadow 150ms steps(2), transform 150ms steps(2);
}

.vn-window.dark {
  color: var(--white);
  background: var(--vn-dark);
}

/* Лёгкий отклик при наведении/фокусе, чтобы окно читалось как интерактивное */
.vn-window:hover,
.vn-window:focus-visible {
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(2px, 2px);
  outline: none;
}

.vn-window:active {
  box-shadow: 0 0 0 var(--ink);
  transform: translate(4px, 4px);
}

.vn-window::before {
  display: block;
  height: 28px;
  border-bottom: 3px solid var(--ink);
  background:
    linear-gradient(90deg, var(--danger) 0 12px, transparent 12px 20px, var(--lemon) 20px 32px, transparent 32px 40px, var(--mint) 40px 52px, transparent 52px),
    rgba(255, 255, 255, 0.48);
  content: "";
}

.vn-window::after {
  position: absolute;
  right: 18px;
  bottom: 14px;
  color: var(--lemon);
  font-family: "Press Start 2P", cursive;
  font-size: 0.76rem;
  content: "▼";
  animation: nextBlink 900ms steps(2) infinite;
}

@keyframes nextBlink {
  50% {
    opacity: 0.25;
    transform: translateY(2px);
  }
}

.vn-speaker {
  position: absolute;
  top: -14px;
  left: 22px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--rose);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 0.62rem;
  line-height: 1.4;
}

.dialogue-body {
  display: grid;
  gap: 18px;
  min-height: 7.5em;
  padding: 30px 26px 42px;
  font-size: clamp(1rem, 1.6vw, 1.12rem);
}

/* Текст фразы: короткая fade+slide анимация при каждой смене реплики */
.dialogue-body p {
  animation: vnFadeIn 260ms ease both;
  white-space: pre-line;
}

@keyframes vnFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.vn-progress {
  position: absolute;
  left: 22px;
  bottom: 14px;
  color: var(--rose-light);
  font-size: 0.56rem;
  line-height: 1.4;
  opacity: 0.85;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.side-console {
  position: sticky;
  top: 96px;
  overflow: hidden;
  border: 3px solid var(--ink);
  background: #fff;
  box-shadow: var(--pixel-shadow);
}

.side-console header {
  min-height: 48px;
  padding: 12px 14px;
  border-bottom: 3px solid var(--ink);
  background:
    linear-gradient(90deg, var(--danger) 0 16px, transparent 16px 28px, var(--lemon) 28px 44px, transparent 44px 56px, var(--mint) 56px 72px, transparent 72px),
    var(--mint);
  font-size: 0.58rem;
  line-height: 1.45;
}

.console-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 16px;
  list-style: none;
}

.console-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 36px;
  padding: 8px 10px;
  border: 2px solid var(--ink);
  background: var(--cream);
  font-weight: 800;
  font-size: 0.9rem;
}

.console-list li::before,
.console-list li::after {
  display: block;
  height: 12px;
  border: 2px solid var(--ink);
  background: var(--line-color);
  content: "";
}

.console-list li::before {
  width: 38px;
}

.console-list li::after {
  flex: 1;
  max-width: var(--line-width);
}

.stats-grid {
  display: grid;
  gap: 18px;
}

.status-panel {
  position: relative;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 120px;
  padding: 18px;
  border: 3px solid var(--ink);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--pixel-shadow);
  overflow: hidden;
}

.status-panel::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.56), transparent 35%),
    repeating-linear-gradient(90deg, transparent 0 16px, rgba(49, 40, 53, 0.04) 16px 18px);
  content: "";
}

.status-name {
  display: grid;
  gap: 7px;
}

.status-name strong {
  font-size: 1.02rem;
  line-height: 1.2;
}

.bar-shell {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.bar-track {
  position: relative;
  height: 28px;
  border: 3px solid var(--ink);
  background:
    linear-gradient(90deg, rgba(49, 40, 53, 0.12) 1px, transparent 1px) 0 0 / 18px 100%,
    #ffffff;
  box-shadow: inset 3px 3px 0 rgba(49, 40, 53, 0.1);
  overflow: hidden;
}

.bar-fill {
  width: calc(var(--value) * 1%);
  height: 100%;
  border-right: 3px solid var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.42), transparent),
    var(--bar-color);
  transform-origin: left center;
  animation: charge 900ms steps(8) both;
}

@keyframes charge {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

.bar-caption {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ===== Ежедневные квесты ===== */
.quest-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quest-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 78px;
  padding: 16px 20px;
  border: 3px solid var(--ink);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--pixel-shadow);
  overflow: hidden;
  transition: background 150ms steps(2);
}

.quest-item:hover {
  background: #fff;
}

/* Кастомный пиксельный чекбокс-кнопка */
.quest-check {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 3px solid var(--ink);
  background: var(--cream);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  transition: transform 150ms steps(2), box-shadow 150ms steps(2), background 150ms steps(2);
}

.quest-check:hover,
.quest-check:focus-visible {
  background: var(--lemon);
  outline: none;
}

.quest-check:active {
  box-shadow: 0 0 0 var(--ink);
  transform: translate(3px, 3px);
}

.quest-check-box {
  position: relative;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
}

/* Галочка — угловатый pixel-style SVG-путь, "дорисовывается" через stroke-dashoffset */
.quest-check-box svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.quest-check-box polyline {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  transition: stroke-dashoffset 220ms steps(4);
}

.quest-item.is-checked .quest-check-box polyline {
  stroke-dashoffset: 0;
}

.quest-item.is-checked .quest-check {
  background: var(--mint);
}

.quest-body {
  min-width: 0;
}

.quest-text {
  font-weight: 800;
  font-size: 1rem;
}

.quest-status {
  display: none;
  color: var(--ink-soft);
  font-weight: 700;
}

/* Статус показывается только после того, как игрок отметил задание —
   текст сначала зачёркивается, и лишь затем "вскрывается" результат */
.quest-item.is-checked .quest-status {
  display: inline;
  animation: statusReveal 260ms ease 120ms both;
}

@keyframes statusReveal {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Зачёркивание относится только к названию задания — статус в скобках
   выезжает отдельно и не перечёркивается. Линия рисуется через
   background-image (а не через один общий ::after), потому что
   background у inline-элемента оборачивается по каждой строке текста
   отдельно — благодаря этому при переносе названия на несколько строк
   зачёркнутой оказывается каждая строка, а не пустое место посередине
   всего блока. background-size анимируется по горизонтали (0% -> 100%),
   что и даёт эффект "прочерчивания" линии, как раньше давал width. */
.quest-title {
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat;
  background-position: 0 50%;
  background-size: 0% 3px;
  transition: opacity 200ms ease, background-size 320ms ease;
}

.quest-item.is-checked .quest-title {
  background-size: 100% 3px;
  opacity: 0.55;
}

/* Печать/стикер результата — выезжает и проворачивается при отметке квеста */
.quest-stamp {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 2px solid currentColor;
  font-size: 0.54rem;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transform: scale(1.5) rotate(-14deg);
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.quest-item.is-checked .quest-stamp {
  opacity: 1;
  transform: scale(1) rotate(-10deg);
}

.quest-stamp.success {
  color: #1f7a55;
  background: rgba(155, 216, 194, 0.35);
}

.quest-stamp.fail {
  color: #b3264b;
  background: rgba(255, 111, 145, 0.18);
}

.quest-stamp.progress {
  color: #8a6d00;
  background: rgba(255, 226, 138, 0.35);
}

.quest-stamp.impossible {
  color: #5b4aa8;
  background: rgba(184, 167, 255, 0.32);
}

.inventory-grid,
.npc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.item-card,
.npc-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
  min-height: 280px;
  padding: 18px;
  border: 3px solid var(--ink);
  background: rgba(255, 250, 246, 0.86);
  box-shadow: var(--pixel-shadow);
  transition:
    transform 150ms steps(2),
    box-shadow 150ms steps(2),
    background 150ms steps(2);
}

.item-card:hover,
.npc-card:hover {
  background: #fff;
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(2px, 2px);
}

.slot-icon {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 3px solid var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.58), transparent 50%),
    var(--slot-bg);
  box-shadow: inset -6px -6px 0 rgba(49, 40, 53, 0.08);
  font-size: 2rem;
}

.slot-icon svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.6;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.item-card h3,
.npc-card h3 {
  min-height: 2.3em;
}

.item-card p,
.npc-card p {
  color: var(--ink-soft);
}

/* Карточки с секретной мыслью персонажа: слегка приподнятая рамка-подсказка */
.item-card.has-secret {
  cursor: help;
}

.item-card.has-secret::before {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink);
  background: var(--violet);
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--ink);
  font-family: "Press Start 2P", cursive;
  font-size: 0.62rem;
  line-height: 18px;
  text-align: center;
  content: "?";
  z-index: 2;
}

.item-secret {
  position: absolute;
  inset: auto 14px 18px;
  z-index: 3;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  background: var(--vn-dark);
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.item-card.has-secret:hover .item-secret,
.item-card.has-secret:focus-within .item-secret {
  opacity: 1;
  transform: translateY(0);
}

.rarity,
.npc-role {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  min-width: 42px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 8px 0 12px;
  border: 2px solid var(--ink);
  background: var(--lemon);
  color: var(--ink);
  font-size: 0.52rem;
  line-height: 1.45;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

/* Акцентная полоска слева вместо декоративных штрихов поверх текста */
.rarity::before,
.npc-role::before {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--ink);
  content: "";
}

.npc-card {
  min-height: 250px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 240, 245, 0.78)),
    var(--cream);
}

.npc-avatar {
  position: relative;
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border: 3px solid var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.62), transparent 50%),
    var(--avatar-bg);
  box-shadow: inset -6px -6px 0 rgba(49, 40, 53, 0.08);
  color: var(--ink);
  font-size: 1.45rem;
  overflow: hidden;
}

/* Квадратные портреты NPC заполняют слот целиком, тень остаётся поверх картинки */
.npc-avatar img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(1.04) contrast(1.02);
}

.footer {
  padding: 36px 0 42px;
  border-top: 3px solid var(--ink);
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 18px 18px,
    var(--ink);
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer p {
  max-width: 900px;
  font-weight: 800;
}

.footer-tag {
  flex: 0 0 auto;
  width: 64px;
  min-height: 32px;
  padding: 7px 10px 0 26px;
  border: 2px solid var(--white);
  color: var(--ink);
  background:
    linear-gradient(90deg, var(--ink) 0 8px, transparent 8px 14px, var(--ink) 14px 22px, transparent 22px),
    var(--rose-light);
  box-shadow: 3px 3px 0 var(--white);
  font-size: 0.52rem;
  line-height: 1.45;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 560ms ease,
    transform 560ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .site-header {
    position: absolute;
  }

  .hero-grid,
  .about-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-visual {
    min-height: 500px;
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
  }

  .side-console {
    position: static;
  }

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

@media (max-width: 760px) {
  :root {
    --container: min(100% - 24px, 1120px);
    --pixel-shadow: 3px 3px 0 #312835;
  }

  .nav {
    align-items: flex-start;
  }

  .brand {
    font-size: 0.6rem;
  }

  .nav-links {
    display: none;
  }

  .hero {
    padding: 104px 0 52px;
  }

  h1 {
    font-size: clamp(2.35rem, 15vw, 4.1rem);
  }

  .typing-line {
    min-height: 4.4em;
    padding: 15px 15px;
  }

  .hero-actions {
    display: grid;
  }

  .pixel-btn {
    width: 100%;
  }

  .hero-visual {
    min-height: 420px;
  }

  .portrait-shell {
    inset: 8px 6px 0 0;
    box-shadow:
      7px 7px 0 var(--ink),
      16px 16px 0 rgba(242, 154, 182, 0.36);
  }

  .portrait-shell img {
    inset: 20px;
    width: calc(100% - 40px);
    height: calc(100% - 40px);
  }

  .hero-badge.one {
    left: 6px;
  }

  .hero-badge.two {
    right: 8px;
    bottom: 86px;
  }

  .hero-badge.three {
    left: 14px;
    bottom: 26px;
  }

  .section {
    padding: 64px 0;
  }

  .dialogue-body {
    padding: 20px 18px 40px;
  }

  .status-panel {
    grid-template-columns: 1fr;
  }

  .inventory-grid,
  .npc-grid {
    grid-template-columns: 1fr;
  }

  .item-card,
  .npc-card {
    min-height: auto;
  }

  .quest-item {
    grid-template-columns: auto minmax(0, 1fr);
    row-gap: 12px;
  }

  .quest-stamp {
    grid-column: 1 / -1;
    justify-self: start;
    transform: scale(1.3) rotate(-14deg);
  }

  .quest-item.is-checked .quest-stamp {
    transform: scale(1) rotate(-6deg);
  }

  .footer .container {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

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