/* Decree — сайт игры.
   Правила заказчика: без теней, свечения, градиентов и рамок.
   Разделение — только тоном заливки. Начертания 400 и 500. Sentence case. */

@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,300;0,400;0,500;1,400&family=Onest:wght@400;500&display=swap');

:root {
  --bg: #12110f;
  --panel: #1a1917;
  --tile: #232220;
  --tile-2: #2c2b28;
  --text: #ece9e0;
  --text-2: #a09c90;
  --text-3: #6c6960;
  --calm: #b8cbb0;
  --calm-fill: #26362a;
  --alarm: #e5b8a4;
  --alarm-fill: #3d2318;
  --note: #b6c8dd;
  --note-fill: #21303f;
  --on-solid: #12110f;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f1eee6;
  --panel: #e7e3d9;
  --tile: #dedad0;
  --tile-2: #d4cfc3;
  --text: #191816;
  --text-2: #56534c;
  --text-3: #858177;
  --calm: #33513c;
  --calm-fill: #ccd9c9;
  --alarm: #7a3a20;
  --alarm-fill: #e8ccbe;
  --note: #29465f;
  --note-fill: #cbd9e4;
  --on-solid: #f1eee6;
  color-scheme: light;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Onest', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

button, input, textarea { font: inherit; color: inherit; background: none; border: none; }
button { cursor: pointer; }
button:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--text-2); outline-offset: 2px; }
svg { display: block; }
::selection { background: var(--calm-fill); }
* { scrollbar-width: thin; scrollbar-color: var(--tile-2) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--tile-2); border-radius: 999px; }
*::-webkit-scrollbar-track { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: var(--tile-2) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--tile-2); border-radius: 999px; }
*::-webkit-scrollbar-track { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: var(--tile-2) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--tile-2); border-radius: 999px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ── шапка сайта ───────────────────────────────────────────── */

.top {
  flex: 0 0 auto;
  z-index: 20;
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 16px 32px;
}

.logo { display: flex; align-items: baseline; gap: 10px; }
.logo b { font-family: 'Spectral', Georgia, serif; font-size: 21px; font-weight: 400; letter-spacing: 0.01em; }
.logo span { font-size: 11px; color: var(--text-3); letter-spacing: 0.09em; text-transform: uppercase; }

.top nav { display: flex; gap: 3px; margin-left: 14px; }
.top nav button { padding: 8px 15px; border-radius: 999px; color: var(--text-3); font-size: 13px; display: flex; align-items: center; gap: 7px; }
.top nav button:hover { color: var(--text-2); }
.top nav button.on { background: var(--tile); color: var(--text); font-weight: 500; }
.top nav .count { font-size: 11px; color: var(--alarm); }

.top .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.top .clock { font-size: 12px; color: var(--text-3); padding: 7px 13px; border-radius: 999px; background: var(--panel); }
.top .clock b { font-weight: 500; color: var(--text-2); }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--panel); color: var(--text-2); display: grid; place-items: center; }
.icon-btn:hover { color: var(--text); }

/* ── страница ──────────────────────────────────────────────── */

.page { flex: 1; min-height: 0; padding: 8px 32px 32px; overflow-y: auto; }
.page.narrow { max-width: 900px; margin: 0 auto; width: 100%; }
.page.tight { overflow: hidden; display: flex; flex-direction: column; padding-bottom: 20px; }

.world-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; flex: 1; min-height: 0; }
.world-column { display: flex; flex-direction: column; min-height: 0; }
.world-column .chronicle { flex: 1; min-height: 0; overflow-y: auto; padding-right: 14px; margin-bottom: 16px; }
.world-side { min-height: 0; overflow-y: auto; padding-right: 4px; }

.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 16px; flex: 0 0 auto; }
.title-row h1 { font-family: 'Spectral', Georgia, serif; font-size: 32px; font-weight: 400; letter-spacing: -0.01em; text-wrap: balance; }
.title-row .facts { font-size: 12px; color: var(--text-3); white-space: nowrap; }

.section-label { font-size: 11px; color: var(--text-3); letter-spacing: 0.09em; text-transform: uppercase; margin-bottom: 12px; }

.card { background: var(--panel); border-radius: 16px; padding: 17px 19px; }
.card + .card { margin-top: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ── карта ─────────────────────────────────────────────────── */

.map-box { background: var(--panel); border-radius: 18px; padding: 12px; }
.map-box svg { width: 100%; height: auto; }
.map-note { font-size: 11px; color: var(--text-3); padding: 8px 6px 2px; }
.region-shape { cursor: pointer; }
.region-shape:hover path { opacity: 0.82; }
.region-label { text-anchor: middle; font-family: 'Onest', sans-serif; font-weight: 500; }
.region-sub { text-anchor: middle; font-family: 'Onest', sans-serif; }
.link-line { stroke: var(--tile-2); stroke-width: 0.45; }

/* ── голос бога ────────────────────────────────────────────── */

.voice { background: var(--tile); border-radius: 18px; padding: 12px 12px 12px 20px; display: flex; align-items: flex-end; gap: 12px; }
.voice textarea {
  flex: 1; resize: none; font-family: 'Spectral', Georgia, serif; font-size: 17px;
  line-height: 1.5; max-height: 132px; padding: 8px 0; outline: none;
}
.voice textarea::placeholder { color: var(--text-3); }
.voice .send { width: 38px; height: 38px; min-width: 38px; border-radius: 50%; background: var(--text); color: var(--on-solid); display: grid; place-items: center; }
.voice .send[disabled] { opacity: 0.4; cursor: default; }
.voice-hint { font-size: 11px; color: var(--text-3); padding: 8px 4px 0; }

/* ── хроника ───────────────────────────────────────────────── */
/* Класс ленты и класс записи не должны совпадать: раньше запись с kind
   «chronicle» попадала под селектор контейнера и схлопывалась в ноль. */

.chronicle { display: flex; flex-direction: column; gap: 20px; }
.entry { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 16px; }
.entry .when { font-size: 11px; color: var(--text-3); padding-top: 3px; display: flex; flex-direction: column; gap: 2px; font-variant-numeric: tabular-nums; }
.entry .when .date { color: var(--text-2); }
.entry .kind { font-size: 11px; color: var(--text-3); letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 5px; }
.entry .body { font-family: 'Spectral', Georgia, serif; font-size: 16px; line-height: 1.7; text-wrap: pretty; }
.entry.kind-media .body { font-size: 14.5px; font-style: italic; color: var(--text-2); }
.entry.kind-prayer .body { color: var(--calm); }
.entry.mine .kind { color: var(--calm); }

/* Слово игрока — не летопись, а приказ: оно и выглядит иначе. */
.entry.kind-decree .kind { color: var(--calm); }
.entry.kind-decree .body {
  font-family: 'Onest', sans-serif; font-size: 14px; font-weight: 500;
  background: var(--tile); border-radius: 14px; padding: 11px 15px; display: inline-block;
}
.entry.waiting { color: var(--text-3); font-size: 13px; }
.entry.waiting .spin { display: inline-block; margin-right: 8px; }

/* ── числа ─────────────────────────────────────────────────── */

.numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.numbers .n { font-family: 'Spectral', Georgia, serif; font-size: 25px; font-variant-numeric: tabular-nums; }
.numbers .l { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.numbers .d { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.numbers .d.up { color: var(--calm); }
.numbers .d.down { color: var(--alarm); }

.lands { display: flex; flex-direction: column; gap: 10px; }
.land { display: flex; align-items: center; gap: 10px; font-size: 13px; width: 100%; text-align: left; }
.land .dot { width: 8px; height: 8px; min-width: 8px; border-radius: 50%; background: var(--calm-fill); }
.land.hot .dot { background: var(--alarm-fill); }
.land .name { flex: 1; }
.land .num { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.land.hot .num { color: var(--alarm); }
.land:hover .name { color: var(--calm); }

.whisper { display: flex; flex-direction: column; gap: 7px; }
.whisper div { font-size: 11.5px; color: var(--text-3); }

.forces { display: flex; flex-direction: column; gap: 10px; }
.force { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--text-2); }

.pill { border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.pill.calm { background: var(--calm-fill); color: var(--calm); }
.pill.alarm { background: var(--alarm-fill); color: var(--alarm); }
.pill.note { background: var(--note-fill); color: var(--note); }
.pill.mute { background: var(--tile); color: var(--text-3); }

/* ── события ───────────────────────────────────────────────── */

.tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.tabs button { padding: 7px 15px; border-radius: 999px; font-size: 13px; color: var(--text-3); background: var(--panel); }
.tabs button.on { background: var(--tile); color: var(--text); font-weight: 500; }

/* ── молитвы ───────────────────────────────────────────────── */

.prayers { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.prayer-card { background: var(--panel); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.prayer-card .who { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-3); }
.prayer-card .text { font-family: 'Spectral', Georgia, serif; font-size: 16px; line-height: 1.65; color: var(--calm); text-wrap: pretty; }
.prayer-card.done .text { color: var(--text-2); }
.prayer-card .act { align-self: flex-start; background: var(--tile); border-radius: 999px; padding: 7px 14px; font-size: 12px; color: var(--text-2); }
.prayer-card .act:hover { color: var(--text); }

/* ── люди и аудиенция ──────────────────────────────────────── */

.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.person-card { background: var(--panel); border-radius: 16px; padding: 18px 20px; text-align: left; }
.person-card .name { font-family: 'Spectral', Georgia, serif; font-size: 19px; margin-bottom: 4px; }
.person-card .what { font-size: 12px; color: var(--text-3); }
.person-card .tags { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }

.audience { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 26px; flex: 1; min-height: 0; }
.audience .who-card { align-self: start; }
.talk-column { display: flex; flex-direction: column; min-height: 0; }
.audience .who-card { background: var(--panel); border-radius: 16px; padding: 20px; }
.audience .who-card .name { font-family: 'Spectral', Georgia, serif; font-size: 24px; margin-bottom: 6px; }
.audience .who-card .what { font-size: 12px; color: var(--text-3); margin-bottom: 16px; }
.audience .who-card .story { font-family: 'Spectral', Georgia, serif; font-size: 15px; line-height: 1.65; color: var(--text-2); }
.audience .who-card .row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); margin-top: 14px; }

.talk { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; flex: 1; min-height: 0; overflow-y: auto; padding-right: 10px; }
.turn { max-width: 74%; border-radius: 16px; padding: 13px 17px; line-height: 1.6; }
.turn.god { align-self: flex-end; background: var(--tile); font-size: 14px; }
.turn.person { align-self: flex-start; background: var(--panel); font-family: 'Spectral', Georgia, serif; font-size: 16px; }
.turn .mood { font-family: 'Onest', sans-serif; font-size: 11px; color: var(--text-3); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; }
/* Что человек делает телом — отдельной строкой, как ремарка в пьесе. */
.turn .action { font-family: 'Onest', sans-serif; font-size: 12.5px; color: var(--calm); margin-top: 8px; }
.turn.waiting { color: var(--text-3); font-family: 'Onest', sans-serif; font-size: 13px; display: flex; gap: 9px; align-items: center; }

/* ── миры ──────────────────────────────────────────────────── */

.genesis { background: var(--panel); border-radius: 18px; padding: 22px 24px; margin-bottom: 22px; }
.presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 18px; }
.preset { background: var(--tile); border-radius: 14px; padding: 16px 17px; text-align: left; }
.preset.on { background: var(--calm-fill); }
.preset .t { font-size: 14px; font-weight: 500; margin-bottom: 5px; }
.preset .h { font-size: 12px; color: var(--text-3); line-height: 1.45; }
.preset.on .h { color: var(--calm); }

.field { background: var(--tile); border-radius: 999px; padding: 13px 20px; width: 100%; outline: none; font-size: 14px; }
.field::placeholder { color: var(--text-3); }
.row { display: flex; gap: 12px; align-items: center; }
.btn { background: var(--text); color: var(--on-solid); border-radius: 999px; padding: 12px 22px; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.btn.quiet { background: var(--tile); color: var(--text); }
.btn[disabled] { opacity: 0.45; cursor: default; }
.toggle { font-size: 12px; color: var(--text-3); padding: 9px 16px; border-radius: 999px; background: var(--tile); white-space: nowrap; }
.toggle.on { background: var(--calm-fill); color: var(--calm); }

.worlds { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.world-card { background: var(--panel); border-radius: 16px; padding: 20px; text-align: left; }
.world-card.here { background: var(--tile); }
.world-card .name { font-family: 'Spectral', Georgia, serif; font-size: 21px; margin-bottom: 8px; }
.world-card .facts { font-size: 12px; color: var(--text-3); display: flex; flex-direction: column; gap: 3px; margin-top: 12px; }

/* ── мелочи ────────────────────────────────────────────────── */

.empty { color: var(--text-3); font-size: 13px; padding: 40px 6px; text-align: center; }
.spin { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.1s infinite ease-in-out; }
@keyframes pulse { 0%, 100% { opacity: 0.25 } 50% { opacity: 0.95 } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none } html { scroll-behavior: auto } }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 26px; background: var(--tile-2); color: var(--text); border-radius: 999px; padding: 11px 20px; font-size: 13px; z-index: 40; }

.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: grid; place-items: center; z-index: 30; padding: 20px; }
.sheet .panel { background: var(--panel); border-radius: 18px; padding: 22px; width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto; }
.settings { display: flex; flex-direction: column; gap: 22px; }
.setting-head { margin-bottom: 11px; }
.setting-title { font-size: 14px; font-weight: 500; }
.setting-hint { font-size: 12px; color: var(--text-3); margin-top: 3px; line-height: 1.45; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { background: var(--tile); border-radius: 13px; padding: 12px 14px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.choice.on { background: var(--calm-fill); }
.choice.off { opacity: 0.45; cursor: default; }
.choice .c-name { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.choice.on .c-name { color: var(--calm); }
.choice .c-note { font-size: 12px; color: var(--text-3); }
.choice .c-price { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.sheet h2 { font-family: 'Spectral', Georgia, serif; font-size: 21px; font-weight: 400; margin-bottom: 16px; }

/* На телефоне высота окна прыгает от адресной строки — там обычная прокрутка. */
@media (max-width: 1080px) {
  body { height: auto; overflow: visible; }
  .top { position: sticky; top: 0; }
  .page, .page.tight { overflow: visible; padding-bottom: 40px; }
  .world-grid, .audience { grid-template-columns: 1fr; min-height: auto; }
  .world-column .chronicle, .world-side, .talk { overflow: visible; min-height: auto; padding-right: 0; }
}

@media (max-width: 1080px) {
  body { height: auto; overflow: visible; }
  .top { position: sticky; top: 0; }
  .page, .page.tight { overflow: visible; padding-bottom: 40px; }
  .world-column .chronicle, .world-side { overflow: visible; min-height: auto; padding-right: 0; }
  .world-grid { min-height: auto; }
}

@media (max-width: 720px) {
  .top { padding: 12px 14px; gap: 12px; flex-wrap: wrap; }
  .top nav { margin-left: 0; order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .top nav button { padding: 8px 13px; }
  .top .right { margin-left: auto; }
  .page { padding: 6px 14px 44px; }
  .title-row h1 { font-size: 25px; }
  .title-row { flex-direction: column; gap: 6px; }
  .entry { grid-template-columns: 1fr; gap: 4px; }
  .entry .when { padding-top: 0; }
  .turn { max-width: 88%; }
}
