:root {
  --paper: #f3ece0;
  --ink: #221c17;
  --faded: #6a5d50;
  --line: #d6c7b2;
  --accent: #7b2c1f;
  --accent-ink: #f7efe4;
  --shadow: 0 10px 30px rgba(34, 28, 23, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #1b1713;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

#app {
  max-width: 760px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--paper);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

#bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  color: var(--faded);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 5;
}

#chapter { letter-spacing: 0.04em; text-transform: uppercase; }
#tools { display: flex; gap: 8px; }

button {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  background: transparent;
  color: var(--faded);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}

button:hover { border-color: var(--faded); color: var(--ink); }

#screen {
  padding: 28px 34px 40px;
  flex: 1;
  font-size: 19px;
  line-height: 1.62;
}

p { margin: 0 0 18px; }

.card-title {
  text-align: center;
  padding: 18px 0 26px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.card-title .kicker {
  font-size: 15px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.card-title .card-body {
  margin: 0;
  font-size: 21px;
  line-height: 1.45;
  font-style: italic;
}

figure { margin: 0 0 20px; }
figure img { width: 100%; border-radius: 4px; display: block; }

.choices { display: flex; flex-direction: column; gap: 10px; margin: 24px 0 8px; }

.choice {
  text-align: left;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink);
  background: #faf5ec;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  padding: 12px 16px;
}

.choice:hover { background: #fff; border-color: var(--accent); }
.choice:disabled { color: #a99c8c; border-left-color: var(--line); cursor: default; }

.continue { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }

.continue button:disabled { opacity: 0.45; cursor: default; }

.continue button.ghost {
  background: transparent;
  color: var(--faded);
  border: 1px solid var(--line);
}

button:disabled { opacity: 0.45; cursor: default; }

.continue button {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 10px 22px;
  font-size: 15px;
}

.continue button:hover { background: #63231a; color: #fff; }

.input-row { display: flex; gap: 10px; margin-top: 20px; }

.input-row input {
  flex: 1;
  font-family: Georgia, serif;
  font-size: 17px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

#stats {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 13, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: "Segoe UI", Arial, sans-serif;
}

#stats[hidden] { display: none; }

.stats-card {
  background: var(--paper);
  border-radius: 8px;
  padding: 24px 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.stats-card h2 {
  margin: 0 0 16px;
  font-size: 18px;
  font-family: Georgia, serif;
  font-weight: normal;
  letter-spacing: 0.03em;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 15px;
}

.stat-row span:last-child { color: var(--accent); font-variant-numeric: tabular-nums; }

.wall { border-top: 2px solid var(--accent); padding-top: 20px; margin-top: 24px; }

.wall h2 {
  font-family: Georgia, serif;
  font-weight: normal;
  font-size: 24px;
  margin: 0 0 10px;
  color: var(--accent);
}

.wall p { font-size: 17px; }
.wall .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }

.wall .counter {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  color: var(--faded);
  margin-top: 14px;
}

.note { font-size: 15px; color: var(--faded); font-style: italic; }

/* Экран знакомства. */
.intro {
  position: fixed;
  inset: 0;
  background: #17130f;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  z-index: 20;
}

.intro[hidden] { display: none; }

.intro-card {
  background: var(--paper);
  border-radius: 10px;
  padding: 28px 30px 26px;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow);
}

.intro-kicker {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.intro-card h1 {
  font-size: 30px;
  font-weight: normal;
  margin: 0 0 12px;
  line-height: 1.15;
}

.intro-lead {
  font-size: 18px;
  line-height: 1.55;
  margin: 0 0 18px;
}

.intro-card h2 {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faded);
  margin: 22px 0 8px;
  font-weight: 600;
}

.intro-list {
  margin: 0;
  padding-left: 20px;
  font-size: 17px;
  line-height: 1.5;
}

.intro-list li { margin-bottom: 6px; }

.intro-card p { font-size: 17px; line-height: 1.5; margin: 0 0 10px; }

.intro-credits { color: var(--faded); font-size: 15px; }

.intro-start {
  margin-top: 22px;
  width: 100%;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 6px;
  padding: 14px 18px;
  font-size: 17px;
  cursor: pointer;
}

.intro-start:hover { background: #63231a; color: #fff; }

/* Тёмная тема площадки. */
@media (prefers-color-scheme: dark) {
  :root[data-platform="tg"],
  :root[data-platform="vk"] {
    --paper: #17130f;
    --ink: #e8ddcd;
    --faded: #a2947f;
    --line: #3a3229;
    --accent: #c0634a;
    --accent-ink: #17130f;
  }
  :root[data-platform="tg"] .choice,
  :root[data-platform="vk"] .choice {
    background: #211b16;
  }
}

@media (max-width: 560px) {
  #screen { padding: 20px 18px 30px; font-size: 17px; }
  #bar { padding: 10px 14px; }
  #chapter { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #tools button { padding: 5px 8px; font-size: 12px; }
}
