:root {
  --bg: #111215;
  --surface: #191b20;
  --surface-elevated: #20232a;
  --border: #2c303a;
  --text: #f0f2f5;
  --text-soft: #e6e2d8;
  --muted: #8f96a6;
  --accent: #e5b84b;
  --accent-dark: #14120c;
  --danger: #e26252;
  --danger-bg: rgba(226, 98, 82, 0.14);
  --success: #46bd87;
  --success-bg: rgba(70, 189, 135, 0.14);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.app-shell {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 14px 16px 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.09em;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
}

.brand__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--accent);
}

.progress-wrap { margin-bottom: 14px; }

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.progress-bar {
  height: 4px;
  background: var(--surface-elevated);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.25s ease;
}

.main-stage { flex: 1; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.card__tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 6px;
}

.card__title {
  font-size: 23px;
  font-weight: 700;
  line-height: 1.24;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.media-grid { display: grid; gap: 10px; margin-bottom: 16px; }
.media-grid--diptych { grid-template-columns: 1fr 1fr; }

.frame {
  background: #0b0c0e;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.frame__img-wrap {
  aspect-ratio: 4 / 3;
  background: #14171d;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.frame__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.03);
}

.frame__caption {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.card__context {
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  margin-bottom: 14px;
}

.inner-voice {
  margin: 0 0 18px;
  padding: 12px 15px;
  background: rgba(229, 184, 75, 0.07);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  color: #f3efe6;
  font-size: 15.5px;
  line-height: 1.52;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.option-btn {
  width: 100%;
  text-align: left;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: #ece8df;
  padding: 15px 16px;
  border-radius: 13px;
  font-size: 15.5px;
  line-height: 1.48;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.08s ease;
}

.option-btn:hover { border-color: var(--accent); }
.option-btn:active { transform: scale(0.99); }

.option-btn--trap {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.option-btn--step {
  border-color: var(--success);
  background: var(--success-bg);
}

.feedback {
  margin-top: 18px;
  padding: 16px;
  border-radius: 13px;
  font-size: 15.5px;
  line-height: 1.58;
}

.feedback--trap {
  background: var(--danger-bg);
  border: 1px solid rgba(226, 98, 82, 0.45);
}

.feedback--step {
  background: var(--success-bg);
  border: 1px solid rgba(70, 189, 135, 0.45);
}

.feedback__head {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.feedback--trap .feedback__head { color: var(--danger); }
.feedback--step .feedback__head { color: var(--success); }

.step-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 10px;
  font-size: 14.5px;
  line-height: 1.55;
}

.step-box strong { color: var(--accent); }

.btn-primary {
  width: 100%;
  margin-top: 16px;
  padding: 15px 18px;
  border: none;
  border-radius: 13px;
  background: var(--accent);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.paywall {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px 18px;
}

.paywall__badge { display: inline-block; font-size: 11px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.paywall__title { font-size: 22px; line-height: 1.25; margin-bottom: 10px; }
.paywall__desc { font-size: 15.5px; line-height: 1.55; color: var(--text-soft); margin-bottom: 14px; }
.paywall__list { list-style: none; display: grid; gap: 8px; font-size: 14.5px; color: var(--muted); margin-bottom: 18px; }
.paywall__list li::before { content: "→ "; color: var(--accent); font-weight: 700; }
.unlock-box { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.unlock-box__label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.unlock-row { display: flex; gap: 8px; }
.unlock-input { flex: 1; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 11px 12px; font-size: 15px; text-transform: uppercase; }
.btn-secondary { background: var(--surface-elevated); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 11px 14px; font-weight: 600; font-size: 14px; cursor: pointer; }
.paywall__note { margin-top: 12px; font-size: 12px; color: var(--muted); }

.bottom-nav { display: flex; justify-content: space-between; padding-top: 6px; }
.btn-ghost { background: transparent; border: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 8px 4px; }
.btn-ghost:disabled { opacity: 0.35; cursor: default; }

/* ===== СВЕТЛАЯ «БУМАЖНАЯ» ТЕМА (АЙВОРИ) ===== */
[data-theme="light"] {
  --bg: #f4f1ea;
  --surface: #fcfaf5;
  --surface-elevated: #efeae0;
  --border: #dcd5c7;
  --text: #22201d;
  --text-soft: #383530;
  --muted: #6e695f;
  --accent: #b88418;
  --accent-dark: #ffffff;
  --danger: #c63d2f;
  --danger-bg: rgba(198, 61, 47, 0.09);
  --success: #1e7e50;
  --success-bg: rgba(30, 126, 80, 0.10);
}

[data-theme="light"] .card {
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .frame {
  background: var(--surface-elevated);
}

[data-theme="light"] .frame__img-wrap {
  background: #e6e0d4;
}

[data-theme="light"] .card__context {
  color: var(--text-soft);
}

[data-theme="light"] .inner-voice {
  color: #2b2823;
  background: rgba(184, 132, 24, 0.09);
}

[data-theme="light"] .option-btn {
  color: var(--text);
}

[data-theme="light"] .step-box {
  border-top-color: rgba(0, 0, 0, 0.10);
}

[data-theme="light"] .step-box strong {
  color: #8a5a00;
}

[data-theme="light"] .film-grain {
  opacity: 0.015;
}

.deck-cover { margin: -22px -20px 16px; height: 155px; overflow: hidden; border-radius: 15px 15px 0 0; border-bottom: 1px solid var(--border); background: #14171d; }
.deck-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.deck-card__sub { font-size: 13px !important; color: var(--muted) !important; margin: -4px 0 14px !important; }
.deck-card--draft .btn-primary { display: none; }

#accessStatus:empty { display: none; }
.brand:focus, .brand:focus-visible { outline: none; }

.back-link { display: block; margin-bottom: 12px; }
.intro-blocks { display: flex; flex-direction: column; gap: 18px; margin: 20px 0 24px; }
.intro-block__label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent, #b88418); margin-bottom: 6px; }
.intro-block p { margin: 0; line-height: 1.55; }

/* Защита от случайного выделения текста и копирования */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
