:root {
  --concrete: #232825;
  --wall: #2c332e;
  --panel: #353d37;
  --line: #4a544c;
  --text: #e8e4d4;
  --muted: #a3a998;
  --paper: #dbd0ac;
  --paper-edge: #bfb284;
  --ink: #26251f;
  --ink-soft: #5b5744;
  --lamp: #e3ad3f;
  --lamp-dark: #b9862a;
  --stamp: #b4412b;
  --moss: #77995f;

  --head: "Bahnschrift", "DIN Alternate", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Impact, sans-serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --type: "Courier Prime", "American Typewriter", "Courier New", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 50% -120px, rgba(227, 173, 63, .14), transparent 70%),
    var(--concrete);
  color: var(--text);
  font: 16px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: 3px solid var(--lamp); outline-offset: 2px; }

.muted { color: var(--muted); }

/* ---------- кнопки и поля ---------- */

.btn {
  appearance: none;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: .7rem 1.1rem;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .05s;
}
.btn:hover:not(:disabled) { border-color: var(--lamp); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--lamp); border-color: var(--lamp); color: var(--ink); }
.btn.primary:hover:not(:disabled) { background: #f0bb52; border-color: #f0bb52; }
.btn.danger { background: var(--stamp); border-color: var(--stamp); color: #fff6ee; }
.btn.danger:hover:not(:disabled) { background: #c64c34; border-color: #c64c34; }
.btn.ghost { background: transparent; }
.btn.small { padding: .35rem .75rem; font-size: .9rem; }
.btn.big { padding: .95rem 2rem; font-size: 1.1rem; }

input[type="text"] {
  width: 100%;
  padding: .75rem .9rem;
  border-radius: 4px;
  border: 2px solid var(--line);
  background: var(--concrete);
}
input[type="text"]::placeholder { color: #7d8479; }
input[type="text"]:focus-visible { outline: none; border-color: var(--lamp); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.1rem 1.2rem;
}

.wordmark {
  font-family: var(--head);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--lamp);
}

/* ---------- главная ---------- */

.home {
  max-width: 980px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 3rem 1.25rem;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.home-intro { display: grid; gap: 1.1rem; }
.wordmark.big { font-size: clamp(3.5rem, 11vw, 7rem); line-height: .9; letter-spacing: .06em; }
.lead { font-size: 1.35rem; line-height: 1.35; max-width: 28ch; }
.home-form { display: grid; gap: 1rem; padding: 1.5rem; }
.field { display: grid; gap: .4rem; }
.field label { font-weight: 600; }
.stack { display: grid; }
.or { color: var(--muted); font-size: .9rem; text-align: center; }
.join-row { display: grid; grid-template-columns: 7.5rem 1fr; gap: .6rem; }
.code-input {
  font-family: var(--type);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  text-align: center;
}
.notice {
  padding: .7rem .9rem;
  border-left: 4px solid var(--stamp);
  background: rgba(180, 65, 43, .15);
  font-size: .95rem;
}

.center-note { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }

/* ---------- игровой экран ---------- */

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .6rem 1rem;
  padding: .7rem 1.25rem;
  background: rgba(35, 40, 37, .94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.topbar .wordmark { font-size: 1.5rem; }
.topbar-info { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.chip {
  padding: .25rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--wall);
  font-size: .9rem;
}
.chip.phase { border-color: var(--lamp-dark); color: var(--lamp); }
.chip.timer { font-family: var(--type); font-variant-numeric: tabular-nums; min-width: 4.6rem; text-align: center; }
.chip.timer.warn { border-color: var(--stamp); color: #ff9c86; animation: timer-pulse 1s ease-in-out infinite; }
@keyframes timer-pulse { 50% { background: rgba(180, 65, 43, .28); } }
@media (prefers-reduced-motion: reduce) { .chip.timer.warn { animation: none; } }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--lamp); }
.chip strong { font-family: var(--type); letter-spacing: .12em; margin-left: .2rem; }

.layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 1.5rem;
  align-items: start;
}
.side { display: grid; gap: 1rem; }
.main-col { min-width: 0; }

.section-title {
  font-family: var(--head);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: .9rem;
}

.hint { border-left: 5px solid var(--lamp); }
.hint.done { border-left-color: var(--moss); }
.hint h2 { font-family: var(--head); font-size: 1.4rem; margin-bottom: .25rem; }
.hint p { color: var(--muted); }

.situation { display: grid; gap: .6rem; }
.situation h2 { font-family: var(--head); font-size: 1.35rem; color: var(--lamp); }
.situation h3 { font-family: var(--head); font-size: 1.05rem; margin-top: .4rem; }
.facts { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.facts li { margin: .15rem 0; }

.seats-row { display: grid; gap: .5rem; margin-top: .5rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.seats { display: flex; flex-wrap: wrap; gap: 5px; }
.seat { width: 20px; height: 24px; border-radius: 3px 3px 8px 8px; }
.seat.in { background: var(--lamp); }
.seat.out { background: transparent; border: 2px dashed #7d8479; }
.seats-text { font-size: .95rem; }

.log ul { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .5rem; }
.log h2 { font-family: var(--head); font-size: 1.1rem; }
.log-scroll {
  max-height: min(55vh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: .25rem;
}
.log-scroll:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; border-radius: 3px; }
.log-scroll ul { padding-bottom: .15rem; }
.log li { display: grid; grid-template-columns: 2.4rem 1fr; gap: .4rem; font-size: .92rem; }
.log li:first-child { color: var(--text); }
.log li:not(:first-child) { color: var(--muted); }
.log-round { font-family: var(--type); color: var(--lamp); }

/* ---------- досье (бумага) ---------- */

.paper {
  position: relative;
  background:
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(80, 70, 40, .06) 27px 28px),
    var(--paper);
  color: var(--ink);
  border-radius: 3px;
  padding: 1rem 1.1rem .8rem;
  box-shadow: 0 1px 0 var(--paper-edge), 0 8px 18px rgba(0, 0, 0, .35);
}
.paper::before { /* скрепка-язычок сверху */
  content: "";
  position: absolute; left: 1.1rem; top: -7px;
  width: 54px; height: 8px;
  background: var(--paper-edge);
  border-radius: 3px 3px 0 0;
}
.paper-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: .5rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--ink);
}
.paper-head h2, .paper-head h3 {
  font-family: var(--head);
  font-size: 1.3rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.hint-small { font-size: .8rem; color: var(--ink-soft); }
.tags { display: inline-flex; gap: .3rem; flex-shrink: 0; }
.tag {
  font-size: .75rem;
  padding: 0 .4rem;
  border: 1px solid var(--ink);
  border-radius: 2px;
}

.paper dl { margin: 0; }
.row {
  display: grid;
  grid-template-columns: 8.5rem 1fr auto;
  align-items: center;
  gap: .2rem .6rem;
  padding: .42rem 0;
  border-bottom: 1px dashed rgba(38, 37, 31, .35);
}
.dossier .row { grid-template-columns: 8.5rem 1fr; }
.row dt { font-size: .82rem; color: var(--ink-soft); }
.row dd { margin: 0; font-family: var(--type); font-weight: 700; font-size: .98rem; overflow-wrap: anywhere; }
.row dd.redacted { height: 1.2em; }
.row dd.redacted span { display: block; height: 100%; background: var(--ink); border-radius: 1px; }
.row-state { font-size: .78rem; font-weight: 700; color: #4c6a37; }
.row-state.quiet { color: var(--ink-soft); font-weight: 400; }
.mine .row { grid-template-columns: 1fr auto; row-gap: .1rem; }
.mine .row dt { grid-column: 1; grid-row: 1; }
.mine .row dd { grid-column: 1 / -1; grid-row: 2; }
.mine .row > :last-child { grid-column: 2; grid-row: 1; }
.mine .btn.reveal { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.mine .btn.reveal:hover:not(:disabled) { background: #3a392f; border-color: var(--lamp-dark); }

.paper-foot {
  min-height: 2.1rem;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding-top: .5rem;
}
.status { font-size: .85rem; color: var(--ink-soft); }

.dossiers {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.dossier.me { outline: 3px solid var(--lamp); outline-offset: 2px; }
.dossier.selected { outline: 3px solid var(--stamp); outline-offset: 2px; }
.dossier.dead { filter: saturate(.55) brightness(.88); }
.dossier.dead > :not(.stamp) { opacity: .55; }

.stamp {
  position: absolute;
  top: 46%; left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  padding: .2rem .9rem;
  border: 4px solid currentColor;
  border-radius: 6px;
  font-family: var(--head);
  font-weight: 800;
  font-size: 1.9rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
  pointer-events: none;
  mix-blend-mode: multiply;
}
.stamp.out { color: var(--stamp); }
.dossier.final { padding-bottom: 2.6rem; }
.dossier.final .stamp {
  top: auto; bottom: .55rem; left: auto; right: .9rem;
  transform: rotate(-6deg);
  font-size: 1.05rem; border-width: 3px; padding: .05rem .6rem;
}
.stamp.in { color: #3f6a2e; }

/* ---------- лобби ---------- */

.invite { display: grid; justify-items: start; gap: .5rem; margin-bottom: 1.5rem; max-width: 420px; }
.big-code {
  font-family: var(--type);
  font-weight: 700;
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  letter-spacing: .3em;
  color: var(--lamp);
  line-height: 1.1;
}
.slots {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: .5rem;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.slot {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  min-height: 3rem;
  padding: .55rem .9rem;
  border-radius: 4px;
  border: 2px dashed var(--line);
  color: #7d8479;
}
.slot.needed { border-color: var(--lamp-dark); color: var(--muted); }
.slot.filled {
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.slot .tag { border-color: var(--muted); color: var(--muted); }
.slot .tags { align-items: center; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.lobby-actions { margin-top: 1.5rem; display: grid; justify-items: start; gap: .5rem; }

/* ---------- панель подтверждения голоса ---------- */

.votebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem;
  padding: .9rem 1.25rem calc(.9rem + env(safe-area-inset-bottom, 0px));
  background: #1b1f1c;
  border-top: 3px solid var(--stamp);
}
.votebar p { max-width: 60ch; }
.votebar-actions { display: flex; gap: .6rem; }
.game:has(.votebar) .layout { padding-bottom: 7rem; }

/* ---------- чат ---------- */

.chat-toggle { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
.chat-toggle:hover, .chat-toggle[aria-expanded="true"] { border-color: var(--lamp); }
.badge {
  min-width: 1.35rem; padding: 0 .4rem;
  border-radius: 999px;
  background: var(--stamp); color: #fff6ee;
  font-size: .75rem; font-weight: 700; line-height: 1.35rem; text-align: center;
}
.badge[hidden] { display: none; }

.chat {
  position: fixed; z-index: 9;
  right: 1rem; bottom: calc(var(--chat-bottom, 0px) + 1rem);
  width: min(360px, calc(100vw - 2rem));
  height: min(480px, 68vh);
  display: flex; flex-direction: column;
  background: #1f2421;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .55);
}
.chat[hidden] { display: none; }
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .55rem .8rem;
  border-bottom: 1px solid var(--line);
}
.chat-head h2 { font-family: var(--head); font-size: 1.15rem; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: .7rem .8rem; }
.chat-empty { color: var(--muted); font-size: .9rem; }
.chat-empty[hidden] { display: none; }
.chat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.msg {
  max-width: 88%;
  justify-self: start;
  padding: .4rem .65rem;
  border-radius: 6px;
  background: var(--panel);
}
.msg.own { justify-self: end; background: #473f24; border: 1px solid var(--lamp-dark); }
.msg-meta { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; font-size: .78rem; color: var(--muted); }
.msg-meta strong { color: var(--lamp); overflow-wrap: anywhere; }
.msg p { overflow-wrap: anywhere; }
.chat-form { display: flex; gap: .5rem; padding: .6rem; border-top: 1px solid var(--line); }
.chat-form input { min-width: 0; }
.chat-form input:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- уведомления ---------- */

#toast {
  position: fixed; left: 50%; bottom: 1.25rem; z-index: 20;
  transform: translate(-50%, 24px);
  opacity: 0; visibility: hidden;
  max-width: min(92vw, 520px);
  padding: .75rem 1.1rem;
  border-radius: 4px;
  background: #111412;
  border: 2px solid var(--lamp);
  transition: transform .2s ease, opacity .2s ease, visibility .2s;
  pointer-events: none;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ---------- адаптив ---------- */

@media (max-width: 880px) {
  .home { grid-template-columns: 1fr; gap: 1.75rem; padding: 2rem 1.25rem; align-content: start; }
  .layout { grid-template-columns: 1fr; }
  /* на телефоне: подсказка, моё досье, игроки и голосование, затем справочные блоки */
  .side { display: contents; }
  .hint { order: 1; }
  .mine { order: 2; }
  .main-col { order: 3; }
  .situation { order: 4; }
  .log { order: 5; }
  .layout { gap: 1rem; }
  .dossier .row { grid-template-columns: 7.5rem 1fr; }
}

@media (max-width: 480px) {
  .topbar { padding: .6rem .9rem; }
  .layout { padding: 1rem .9rem; }
  .chat {
    left: 0; right: 0; width: auto; height: 62vh;
    bottom: var(--chat-bottom, 0px);
    border-radius: 12px 12px 0 0;
  }
  .votebar-actions { width: 100%; }
  .votebar-actions .btn { flex: 1; }
  .stamp { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- голосовой чат ---------- */

.voice { display: grid; gap: .7rem; }
.voice h2 { font-family: var(--head); font-size: 1.15rem; }
.voice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.voice-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .4rem .6rem;
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--wall);
  transition: border-color .15s, box-shadow .15s;
}
.voice-row.speaking { border-color: var(--moss); box-shadow: 0 0 0 2px rgba(119, 153, 95, .45); }
.voice-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; display: inline-flex; align-items: center; gap: .4rem; }
.voice-name .tag { border-color: var(--muted); color: var(--muted); }
.voice-status { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.voice-note { font-size: .9rem; }

/* значок микрофона рядом с именем игрока */
.voice-dot {
  display: inline-block; vertical-align: middle;
  width: .75rem; height: .75rem; margin-left: .45rem;
  border-radius: 50%;
  background: var(--moss);
  transition: box-shadow .15s, background-color .15s;
}
.voice-dot[hidden] { display: none; }
.voice-dot.muted { background: transparent; border: 2px solid var(--muted); }
.voice-dot.speaking { box-shadow: 0 0 0 3px rgba(119, 153, 95, .55); }
.paper .voice-dot.muted { border-color: var(--ink-soft); }

/* скрытые <audio> удалённых игроков (display:none в Safari может остановить воспроизведение) */
.voice-audio { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 880px) {
  /* на телефоне панель голоса идёт сразу после подсказки */
  .voice { order: 1; }
}

/* ---------- итог: выжили ли те, кто попал в кардум ---------- */

.outcome {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 6px solid var(--lamp);
  border-radius: 6px;
  padding: 1.2rem 1.3rem;
  margin-bottom: 1.5rem;
  display: grid;
  gap: .8rem;
}
.outcome.good { border-left-color: var(--moss); }
.outcome.mixed { border-left-color: var(--lamp); }
.outcome.bad { border-left-color: var(--stamp); }
.outcome-kicker { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.outcome h2 { font-family: var(--head); font-size: 1.7rem; line-height: 1.15; }
.outcome.good h2 { color: #a9cc92; }
.outcome.mixed h2 { color: var(--lamp); }
.outcome.bad h2 { color: #e0806a; }
.outcome-story { color: var(--text); }
.outcome-future { color: var(--muted); font-style: italic; }
.outcome h3 { font-family: var(--head); font-size: 1.05rem; margin-bottom: .4rem; }
.outcome-block ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }

.chance-bar {
  position: relative; height: 14px; border-radius: 7px;
  background: #1c211e; border: 1px solid var(--line);
}
.chance-fill { position: absolute; inset: 0 auto 0 0; border-radius: 7px 0 0 7px; background: var(--moss); opacity: .85; }
.chance-fill.all { background: #a9cc92; opacity: 1; border-radius: 7px 0 0 7px; }
.chance-text { margin-top: .4rem; font-size: .88rem; color: var(--muted); }

.fate { display: grid; grid-template-columns: 1.4rem auto 1fr; gap: .1rem .6rem; align-items: baseline; }
.fate-mark { font-weight: 800; }
.fate.alive .fate-mark { color: #a9cc92; }
.fate.lost .fate-mark { color: #e0806a; }
.fate-name { font-weight: 700; }
.fate-note { color: var(--muted); }

.need-head { display: flex; justify-content: space-between; gap: .75rem; font-size: .92rem; }
.need-level { color: var(--muted); white-space: nowrap; }
.meter { height: 8px; border-radius: 4px; background: #1c211e; border: 1px solid var(--line); margin: .25rem 0; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--lamp); }
.need-src { font-size: .8rem; color: var(--muted); }

.mods li { font-size: .92rem; }
.mods .plus strong { color: #a9cc92; }
.mods .minus strong { color: #e0806a; }

@media (max-width: 480px) {
  .outcome { padding: 1rem; }
  .outcome h2 { font-size: 1.4rem; }
  .fate { grid-template-columns: 1.4rem 1fr; }
  .fate-note { grid-column: 2; }
}

/* ---------- аватары ---------- */
.paper-head.with-avatar { align-items: center; justify-content: flex-start; gap: .8rem; }
.head-text { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; min-width: 0; }
.avatar {
  flex: 0 0 auto;
  width: 84px; height: 92px;
  margin-bottom: .1rem;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: linear-gradient(180deg, #c9c19a 0%, #b3aa80 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
  overflow: hidden;
}
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.avatar.unknown { background: #8e9486; }
.avatar.unknown img { opacity: .85; }
.avatar.big { width: 108px; height: 118px; }
.dossier.dead .avatar img { filter: grayscale(1); }
@media (max-width: 480px) {
  .avatar { width: 68px; height: 75px; }
  .avatar.big { width: 84px; height: 92px; }
}

/* ---- болезни и фобии со стадиями ---- */
.cond { display: grid; gap: .2rem; }
.cond-title { font-weight: 700; }
.pips { display: inline-flex; align-items: center; gap: .25rem; }
.pip { width: .8rem; height: .8rem; border-radius: 50%; border: 2px solid var(--line); background: transparent; display: inline-block; }
.pip.on { background: var(--moss); border-color: var(--moss); }
.pip.on.s2 { background: var(--lamp); border-color: var(--lamp); }
.pip.on.s3 { background: var(--stamp); border-color: var(--stamp); }
.stage-name { margin-left: .35rem; font-size: .85rem; color: var(--muted); }
.cond-hint { font-size: .8rem; color: var(--muted); font-style: italic; }

/* ---- хронология кардума ---- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; border-left: 2px solid var(--line); }
.tl { display: grid; grid-template-columns: 7.5rem 1fr; gap: .6rem; padding-left: .7rem; font-size: .92rem; }
.tl-when { color: var(--muted); white-space: nowrap; font-size: .82rem; padding-top: .1rem; }
.tl.good .tl-text { color: #a9cc92; }
.tl.warn .tl-text { color: var(--lamp); }
.tl.bad .tl-text, .tl.death .tl-text { color: #e0806a; }
.tl.death .tl-text { font-weight: 700; }
.fate-chance { color: var(--muted); font-size: .8rem; white-space: nowrap; }
@media (max-width: 560px) { .tl { grid-template-columns: 1fr; gap: 0; } }

/* ---- открытые игры ---- */
.check { display: flex; align-items: flex-start; gap: .6rem; cursor: pointer; }
.check input { margin-top: .25rem; width: 1.1rem; height: 1.1rem; accent-color: var(--lamp); }
.home-public { margin-top: 1rem; padding: 1.25rem 1.5rem; display: grid; gap: .6rem; }
.home-public .section-title { margin: 0; }
.public-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.public-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem .75rem; border: 1px solid var(--line); border-radius: 8px; }
.public-info { display: grid; gap: .1rem; }
.public-empty { padding: .25rem 0; }
.visibility { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .9rem; color: var(--muted); margin: 0; }


/* ---- подвал сайта ---- */
.site-footer {
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
}
.site-footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: .2em;
}
.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--lamp);
}

/* ---------- карты действий ---------- */
.action-card { display: grid; gap: .65rem; border-color: var(--lamp-dark); background: linear-gradient(145deg, #454638, var(--panel)); }
.action-card.used { opacity: .72; border-style: dashed; }
.action-card-label { color: var(--lamp); font: 700 .75rem var(--type); text-transform: uppercase; letter-spacing: .1em; }
.action-card h2 { color: var(--text); font-family: var(--head); font-size: 1.35rem; }
.action-card p { color: var(--muted); font-size: .9rem; }
.action-controls { display: grid; gap: .55rem; }
.action-select { width: 100%; padding: .65rem; color: var(--text); background: var(--concrete); border: 1px solid var(--line); border-radius: 4px; }
.shield-note { color: var(--lamp) !important; }


/* Встреча с существом: временная пауза поверх посеревших карточек игроков. */
.encounter-stage { position: relative; }
.dossiers.paused { filter: grayscale(1); opacity: .28; pointer-events: none; }
.encounter-panel {
  position: absolute; z-index: 5; top: 1.5rem; left: 50%; transform: translateX(-50%);
  width: min(620px, calc(100% - 2rem)); padding: 1.5rem;
  background: var(--paper); border: 3px solid var(--lamp-dark); border-radius: 4px;
  box-shadow: 0 16px 55px rgba(0,0,0,.45); text-align: center;
}
.encounter-kicker { font-size: .72rem; font-weight: 800; letter-spacing: .12em; color: var(--stamp); }
.encounter-panel h2 { margin: .5rem 0; font-family: var(--head); font-size: 1.7rem; }
.encounter-panel p { line-height: 1.5; }
.encounter-rationale { padding: .65rem; background: rgba(80,90,50,.09); border-left: 3px solid var(--lamp-dark); text-align: left; }
.encounter-vote { margin-top: 1rem; }
.encounter-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .75rem; }
.encounter-result { font-weight: 800; padding: .8rem; border: 1px solid var(--lamp-dark); }
@media (max-width: 600px) {
  .encounter-panel { top: .5rem; padding: 1rem; }
  .encounter-actions { flex-direction: column; }
}
