:root {
  --paper: #efe6d2;
  --paper-2: #e6dabf;
  --paper-3: #f7f1e3;
  --ink: #2b2118;
  --ink-2: #5b4a3a;
  --muted: #8a7863;
  --line: #cdbb98;
  --ox: #7a2e22;
  --ox-2: #9b3d2d;
  --moss: #4f5e3e;
  --slate: #3f4d5c;
  --gold: #a8812f;
  --holmes: #3f4d5c;
  --watson: #6b4a2b;
  --shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 2px 10px rgba(60,40,20,.12);
  --serif: 'PT Serif', Georgia, 'Times New Roman', serif;
  --display: 'Cormorant Garamond', 'PT Serif', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--paper);
  background-image: radial-gradient(ellipse at 20% 0%, rgba(255,255,255,.55), transparent 60%), radial-gradient(ellipse at 100% 100%, rgba(120,90,50,.12), transparent 50%);
  color: var(--ink);
  font: 15px/1.5 var(--serif);
}
button {
  font: inherit; color: var(--ink); background: var(--paper-3); border: 1px solid var(--line);
  border-radius: 4px; padding: 6px 12px; cursor: pointer; transition: background .15s, border-color .15s;
}
button:hover:not(:disabled) { border-color: var(--ink-2); background: #fff9ec; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--ox); color: #fbf3e4; border-color: var(--ox); }
button.primary:hover:not(:disabled) { background: var(--ox-2); }
button.big { font-size: 17px; padding: 10px 22px; }
button.small { font-size: 13px; padding: 3px 9px; }
button.link { background: none; border: none; color: var(--ox); padding: 2px 4px; }
button.link:hover { text-decoration: underline; background: none; }
input, textarea {
  font: inherit; color: var(--ink); background: #fffaf0; border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; width: 100%;
}
input:focus, textarea:focus { outline: 2px solid rgba(122,46,34,.25); border-color: var(--ox); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; margin: 0 0 6px; }
h3 { font-size: 20px; } h4 { font-size: 17px; color: var(--ink-2); margin-top: 12px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { width: auto; }
.check.small { font-size: 13px; color: var(--ink-2); margin: 6px 0; }
.boot { padding: 40px; font-family: var(--display); font-size: 24px; }
.placeholder { display: grid; place-items: center; background: repeating-linear-gradient(45deg, var(--paper-2), var(--paper-2) 6px, var(--paper) 6px, var(--paper) 12px); color: var(--muted); font-family: var(--display); }
.placeholder span { font-size: 28px; opacity: .6; }

/* toast */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper-3); padding: 10px 18px; border-radius: 6px; z-index: 50; box-shadow: 0 6px 24px rgba(0,0,0,.25); max-width: 80vw; }
.toast.error { background: var(--ox); }
body.busy { cursor: progress; }
body.reconnecting::after { content: 'Переподключение…'; position: fixed; top: 8px; left: 50%; transform: translateX(-50%); background: var(--ox); color: #fff; padding: 4px 12px; border-radius: 4px; font-size: 13px; z-index: 60; }

/* лобби */
.lobby { max-width: 1100px; margin: 0 auto; padding: 32px 24px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; min-height: 100vh; }
.cover { position: relative; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--paper-2); aspect-ratio: 16/10; overflow: hidden; border-radius: 4px; }
.cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-text { position: absolute; inset: auto 0 0 0; padding: 24px 28px; background: linear-gradient(transparent, rgba(30,20,10,.82)); color: #f6ecd8; }
.cover-text h1 { font-size: 46px; line-height: 1.05; color: #fff6e6; }
.cover-text .sub { font-style: italic; margin: 4px 0; }
.kicker { text-transform: uppercase; letter-spacing: .18em; font-size: 12px; color: var(--gold); }
.lobby-forms { display: flex; flex-direction: column; gap: 16px; }
.case-list { display: flex; flex-direction: column; gap: 16px; }
.cover.small { aspect-ratio: 16/6; }
.cover.small .cover-text h2 { color: #fff6e6; font-size: 30px; margin: 0; }
.cover-text .meta { font-size: 13px; opacity: .85; margin: 2px 0 8px; }
.brand-big { font-family: var(--display); font-size: 44px; font-weight: 700; color: var(--ox); line-height: 1; }
.lobby-forms label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.join-row { display: flex; gap: 8px; }
.lobby-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: stretch; }
.lobby-actions.single { grid-template-columns: 1fr; }
.action-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper-2); }
.action-card.main { border-color: var(--ox); background: var(--paper-3); }
.action-card h3 { margin: 0; font-size: 18px; }
.action-card p { margin: 0; font-size: 13.5px; }
.action-card button { margin-top: auto; }
.action-card input { text-transform: uppercase; letter-spacing: .12em; }
.cover[data-case][role=button] { cursor: pointer; }
.cover.selected { outline: 3px solid var(--ox); outline-offset: 2px; }
.join-row input { text-transform: uppercase; letter-spacing: .12em; }

/* выбор ролей */
.roles-screen { max-width: 980px; margin: 0 auto; padding: 32px 24px; text-align: center; }
.roles-screen h2 { font-size: 38px; }
.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 24px 0; }
.role-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px; text-align: center; background: var(--paper-3); box-shadow: var(--shadow); }
.role-card.mine { border: 2px solid var(--ox); background: #fff8ea; }
.role-card.taken { opacity: .55; }
.role-portrait { width: 180px; height: 240px; object-fit: cover; border: 1px solid var(--line); border-radius: 3px; }
.role-name { font-family: var(--display); font-size: 26px; font-weight: 700; }
.role-title { color: var(--ox); font-style: italic; }
.role-desc { font-size: 14px; color: var(--ink-2); margin: 4px 0 0; }
.role-taken { font-size: 13px; color: var(--moss); font-weight: 700; }
.invite { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 18px 0; flex-wrap: wrap; }
.invite code { background: var(--paper-3); border: 1px dashed var(--line); padding: 4px 10px; border-radius: 4px; }
.start-row { margin-top: 18px; }
.roles-screen .check { justify-content: center; }

/* игровой экран */
.game { display: grid; grid-template-columns: 290px minmax(0, 1fr) 370px; grid-template-rows: 50px minmax(0, 1fr); height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--paper-2); font-size: 14px; white-space: nowrap; overflow: hidden; }
.brand { font-family: var(--display); font-size: 21px; font-weight: 700; }
.clock { font-weight: 700; color: var(--ox); }
.deadline { color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }
.partner .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.partner.on .dot { background: #4c8a3a; }
.llm { font-size: 12px; color: var(--muted); }
.role-switch button { padding: 2px 8px; font-size: 13px; }
.role-switch button.on { background: var(--ink); color: var(--paper-3); }
.hint-btn { background: #f6e7b8; border-color: var(--gold); }

.left, .right { overflow-y: auto; padding: 12px; background: rgba(255,255,255,.18); }
.left { border-right: 1px solid var(--line); }
.right { border-left: 1px solid var(--line); display: flex; flex-direction: column; padding-top: 0; }
.mapwrap { background-color: var(--paper-3); background-size: 100% 100%; background-position: center; border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); }
.mapsvg { width: 100%; display: block; }
.mapsvg .route { stroke: var(--ox); stroke-width: 1.2; stroke-dasharray: 3 3; opacity: .55; }
.mapsvg .node circle { fill: var(--paper-3); stroke: var(--ink-2); stroke-width: 1.4; }
.mapsvg .node text { font: 600 10.5px var(--serif); fill: var(--ink); paint-order: stroke; stroke: var(--paper-3); stroke-width: 3px; }
.mapsvg .node text.cost { font-size: 9px; fill: var(--ox); font-weight: 400; }
.mapsvg .node.go { cursor: pointer; }
.mapsvg .node.go:hover circle { fill: #f6e7b8; stroke: var(--ox); }
.mapsvg .node.here circle { fill: var(--ox); stroke: var(--ox); }
.mapsvg .node .partner-ring { fill: none; stroke: var(--slate); stroke-width: 2; stroke-dasharray: 2 2; }
.mapsvg .node.closed { opacity: .35; }
.lsec { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 8px; }
.lsec-head { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: none; padding: 6px 2px; font: 600 19px var(--serif); color: var(--ink); text-align: left; cursor: pointer; box-shadow: none; }
.lsec-head:hover { color: var(--ox); background: none; }
.lsec-head .chev { font-size: 12px; color: var(--muted); transition: transform .2s; width: 12px; }
.lsec.closed .chev { transform: rotate(-90deg); }
.lsec-count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 0 7px; }
.lsec.closed .lsec-body { display: none; }
.lsec-body { padding-top: 4px; }
.mapwrap { position: relative; cursor: zoom-in; }
.map-expand { position: absolute; right: 6px; bottom: 6px; width: 28px; height: 28px; padding: 0; border-radius: 4px; font-size: 16px; line-height: 26px; background: rgba(251,243,226,.92); }
.left .people { flex-direction: column; flex-wrap: nowrap; gap: 6px; }
.left .person { width: 100%; border-radius: 6px; padding: 4px 8px 4px 4px; text-align: left; }
.left .person .pinfo { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.left .person .pname { font-weight: 700; }
.left .person .mood { font-size: 12.5px; }
.left .objects { grid-template-columns: 1fr; gap: 6px; }
.left .object { flex-direction: row; align-items: center; gap: 8px; padding: 5px; }
.left .object .thumb { width: 64px; height: 48px; object-fit: cover; flex: none; border-radius: 3px; }
.left .object .obody { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.left .object .oname { font-weight: 700; font-size: 14px; line-height: 1.2; }
.left .object .oactions { display: flex; flex-wrap: wrap; gap: 4px; }
.loc-actions { margin-top: 4px; }
/* карта на весь экран */
.mapfs { position: fixed; inset: 0; z-index: 60; background: radial-gradient(ellipse at center, rgba(43,33,24,.82), rgba(25,18,10,.94)); display: flex; }
.mapfs-stage { position: absolute; inset: 18px; overflow: hidden; border: 1px solid #8a7353; border-radius: 6px; box-shadow: 0 0 0 4px rgba(239,230,210,.12), 0 10px 40px rgba(0,0,0,.5); background: var(--paper-2); touch-action: none; cursor: grab; }
.mapfs-stage:active { cursor: grabbing; }
.mapfs-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.mapfs-paper { background-size: 100% 100%; background-color: var(--paper-3); box-shadow: inset 0 0 120px rgba(107,74,43,.35); }
.mapfs-paper .mapsvg { width: 100%; height: 100%; }
.mapfs-ui { position: absolute; right: 34px; top: 34px; display: flex; flex-direction: column; gap: 6px; z-index: 1; }
.mapfs-ui button { width: 40px; height: 40px; padding: 0; font-size: 20px; border-radius: 6px; background: var(--paper-3); box-shadow: var(--shadow); }
.mapfs-ui button.close { margin-top: 10px; background: var(--ox); color: var(--paper-3); border-color: var(--ox); }
.mapfs-hint { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); background: rgba(251,243,226,.92); border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px; font-size: 13px; color: var(--ink-2); pointer-events: none; max-width: calc(100% - 60px); text-align: center; }
.travel-list { list-style: none; padding: 0; margin: 8px 0 12px; font-size: 14px; }
.travel-list li { margin: 2px 0; }
.action { display: block; width: 100%; text-align: left; margin: 4px 0; font-size: 14px; }
.time-actions { display: flex; gap: 6px; margin-top: 14px; }

.center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.scene { position: relative; height: 30vh; min-height: 170px; max-height: 340px; flex: none; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--paper-2); cursor: pointer; transition: height .28s ease, min-height .28s ease; }
.scene-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: object-position .28s ease; }
.scene-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 18px 10px; background: linear-gradient(transparent, rgba(25,18,10,.72)); display: flex; align-items: flex-end; gap: 10px; pointer-events: none; }
.scene-title h2 { color: #fff4e0; font-size: 28px; margin: 0; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.scene-chev { color: #fff4e0; opacity: 0; font-size: 14px; margin-left: auto; transition: opacity .2s, transform .28s; transform: rotate(180deg); }
.scene:hover .scene-chev, .scene:focus-visible .scene-chev { opacity: .85; }
.scene:focus-visible { outline: 2px solid var(--ox); outline-offset: -2px; }
/* свёрнута: узкая полоса вровень со строкой вкладок справа */
.scene.collapsed { height: var(--tabs-h, 44px); min-height: 0; }
.scene.collapsed .scene-img { object-position: center 38%; }
.scene.collapsed .scene-title { top: 0; padding: 0 14px; align-items: center; background: linear-gradient(90deg, rgba(25,18,10,.78), rgba(25,18,10,.35) 60%, rgba(25,18,10,.15)); }
.scene.collapsed .scene-title h2 { font-size: 17px; }
.scene.collapsed .scene-chev { opacity: .85; transform: none; }
@media (prefers-reduced-motion: reduce) { .scene, .scene-img, .scene-chev { transition: none; } }
.log { flex: 1; overflow-y: auto; padding: 14px 22px; min-height: 120px; }
.entry { margin: 0 0 12px; max-width: 760px; }
.entry-head { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; color: var(--muted); }
.entry-head .speaker { font-weight: 700; color: var(--ox); font-size: 14px; }
.entry-head .kind { text-transform: uppercase; letter-spacing: .1em; font-size: 11px; color: var(--gold); }
.entry-head .title { font-weight: 700; color: var(--ink-2); }
.entry-head .time { margin-left: auto; }
.from-badge { background: #e3dccb; color: var(--ink-2); padding: 0 6px; border-radius: 3px; font-size: 10.5px; letter-spacing: .05em; }
.private-badge { background: var(--slate); color: #fff; padding: 0 6px; border-radius: 3px; font-size: 10.5px; letter-spacing: .05em; }
.entry.k-scene .entry-text { font-style: italic; color: var(--ink-2); }
.entry.k-player { margin-left: 40px; }
.entry.k-player .entry-text { background: #fffaf0; border: 1px solid var(--line); border-radius: 8px 8px 2px 8px; padding: 6px 10px; display: inline-block; }
.entry.k-player .speaker { color: var(--slate); }
.entry.k-dialogue .entry-text { border-left: 3px solid var(--ox); padding-left: 10px; }
.log-new { position: sticky; bottom: 8px; display: block; margin: 0 auto; z-index: 2; background: var(--ox); color: var(--paper-3); border: none; border-radius: 16px; padding: 4px 14px; font-size: 13px; box-shadow: 0 2px 6px rgba(0,0,0,.2); cursor: pointer; }
.log-new[hidden] { display: none; }
.entry.k-expression { margin-left: 14px; }
.entry.k-expression.compact { font-size: 12.5px; font-style: italic; color: var(--muted); }
.expr-pair { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.expr-pair figure { margin: 0; width: 132px; text-align: center; }
.expr-pair img { width: 132px; height: 198px; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); display: block; background: var(--paper-2); }
.expr-pair figcaption { font-size: 12px; color: var(--muted); margin-top: 3px; font-style: italic; }
.expr-arrow { font-size: 22px; color: var(--ox); }
.face-card { position: fixed; z-index: 70; width: 260px; background: var(--paper-3); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 10px 30px rgba(43,33,24,.35); padding: 6px; pointer-events: none; }
.face-card[hidden] { display: none; }
.face-card img { width: 100%; height: 390px; object-fit: cover; border-radius: 4px; display: block; }
.face-cap { padding: 6px 4px 2px; font-size: 14px; }
.face-cap span { color: var(--muted); font-style: italic; }
.entry.k-tell { margin-left: 14px; }
.entry.k-tell .entry-text { font-style: italic; color: var(--ink-2); font-size: 14.5px; }
.entry.k-tell .kind { color: var(--slate); }
.entry.k-tell_hint { margin: 0 0 10px 14px; font-size: 12.5px; font-style: italic; color: var(--muted); }
img.face { transition: opacity .12s ease-in-out; }
img.face.swap { opacity: .25; }
@media (prefers-reduced-motion: reduce) { img.face { transition: none; } }
.entry.k-filler .entry-text { border-left: 3px dotted var(--ox); padding-left: 10px; font-style: italic; color: var(--ink-2); }
.pending .typing { margin: 0 0 12px; font-size: 13px; color: var(--muted); font-style: italic; animation: typing-pulse 1.4s ease-in-out infinite; }
@keyframes typing-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pending .typing { animation: none; } }
.entry.k-clue, .entry.k-observation { background: #fbf4e2; border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px; }
.entry.k-clue { border-left: 4px solid var(--gold); }
.entry.k-observation.private, .entry.k-clue.private { border-left-color: var(--slate); }
.entry.k-deduction { background: #f3ead2; border: 1px solid var(--gold); padding: 10px 14px; border-radius: 4px; }
.entry.k-deduction .kind { color: var(--ox); }
.entry.k-hint { background: #fbf0c9; border-left: 4px solid var(--gold); padding: 8px 12px; border-radius: 3px; }
.entry.k-tutorial { background: #e9eef0; border-left: 4px solid var(--slate); padding: 8px 12px; border-radius: 3px; font-size: 14px; }
.entry.k-safety { background: #fde9e4; border: 1px solid var(--ox); padding: 8px 12px; border-radius: 4px; }
.entry.k-challenge { background: #f6e2dc; border-left: 4px solid var(--ox); padding: 8px 12px; }
.entry.k-system { color: var(--muted); font-size: 13.5px; }
.entry.k-system .entry-head { display: none; }
.entry.k-interpretation { color: var(--muted); font-size: 12px; margin: -6px 0 10px; font-style: italic; }
.entry.k-epilogue { background: #f3ead2; border: 2px double var(--gold); padding: 12px 16px; }
.entry.k-board { color: var(--ink-2); font-size: 14px; }

.interact { flex: none; display: grid; grid-template-columns: 1fr 1.6fr; gap: 14px; padding: 8px 18px 10px; border-top: 1px solid var(--line); background: rgba(255,255,255,.25); max-height: 34vh; overflow-y: auto; }
.interact h4 { margin: 2px 0 6px; font-size: 15px; }
.people { display: flex; flex-wrap: wrap; gap: 8px; }
.person { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 30px; }
.person.active { border-color: var(--ox); background: #fff4e2; }
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); flex: none; }
.avatar.small { width: 28px; height: 28px; }
.pname { font-weight: 700; font-size: 14px; }
.mood { font-size: 12px; color: var(--muted); font-style: italic; }
.objects { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.object { background: var(--paper-3); border: 1px solid var(--line); border-radius: 4px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.object.seen { opacity: .85; }
.thumb { width: 100%; height: 64px; object-fit: cover; border-radius: 3px; }
.oname { font-size: 13.5px; font-weight: 700; line-height: 1.25; }
.oactions { display: flex; flex-wrap: wrap; gap: 4px; }
.act-trace { border-color: var(--holmes); }
.act-examine { border-color: var(--watson); }

.talkbox { display: none; flex: none; border-top: 2px solid var(--ox); padding: 8px 18px 12px; background: #fbf3e2; }
.talkbox.open { display: block; }
.talk-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.talk-head .link { margin-left: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; align-items: center; }
.chips:empty { display: none; }
.chips-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
.chip { font-size: 12.5px; padding: 2px 9px; border-radius: 12px; }
.chip.clue { border-style: dashed; }
.chip.clue.on { background: var(--gold); color: #fff; border-style: solid; }
.talk-form { display: flex; gap: 8px; }

.tabs { position: sticky; top: 0; display: flex; gap: 2px; background: var(--paper-2); padding: 8px 0 0; margin: 0 -12px 8px; padding-left: 8px; border-bottom: 1px solid var(--line); z-index: 2; }
.tabs button { border-radius: 4px 4px 0 0; border-bottom: none; font-size: 13.5px; background: transparent; }
.tabs button.on { background: var(--paper); border-color: var(--line); font-weight: 700; }
.combine-bar { position: sticky; top: 42px; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; background: var(--paper); z-index: 1; font-size: 13px; }
.card { background: var(--paper-3); border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; margin: 6px 0; font-size: 14px; }
.card.private { border-left: 3px solid var(--slate); }
.card.selected { outline: 2px solid var(--gold); }
.card.deduction { background: #f6edd3; border-color: var(--gold); }
.card p { margin: 4px 0; }
.card-head { display: flex; gap: 6px; align-items: baseline; cursor: pointer; }
.card-head input { width: auto; }
.card-title { font-weight: 700; flex: 1; }
.card .time { font-size: 11px; color: var(--muted); }
.lens-holmes b { color: var(--holmes); }
.lens-watson b { color: var(--watson); }
.note { font-size: 13px; }
.board-form { position: sticky; bottom: 0; background: var(--paper); padding: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.atoms { list-style: none; padding: 0; margin: 6px 0 0; font-size: 13.5px; }
.atoms li { margin: 3px 0; }
.badge { font-size: 11px; padding: 0 6px; border-radius: 3px; background: #ddd; white-space: nowrap; }
.st-supported .badge { background: #c9dcb9; color: #2f4a1f; }
.st-unproven .badge { background: #eadfbf; color: #6b5420; }
.st-contradicted .badge { background: #efc4b9; color: var(--ox); }
.st-untestable .badge { background: #ddd8ce; color: #666; }
.unexplained { background: #f6e2dc; border-radius: 4px; padding: 6px 10px; font-size: 13.5px; }
.finale-form fieldset { border: 1px solid var(--line); border-radius: 4px; margin: 0 0 10px; padding: 8px 10px; background: var(--paper-3); }
.finale-form legend { font-family: var(--display); font-weight: 700; font-size: 17px; padding: 0 4px; }
.opt { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 4px 0; cursor: pointer; }
.opt input { width: auto; margin-top: 4px; }

.modal { position: fixed; inset: 0; background: rgba(30,20,10,.55); display: grid; place-items: center; z-index: 40; padding: 20px; }
.modal-card { background: var(--paper); max-width: 680px; max-height: 88vh; overflow-y: auto; padding: 28px 32px; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.4); border: 1px solid var(--gold); }
.modal-card h2 { font-size: 36px; }
.epilogue p { margin: 6px 0; }

@media (max-width: 1100px) {
  .game { grid-template-columns: 240px minmax(0, 1fr) 320px; }
}
@media (max-width: 860px) {
  .game { grid-template-columns: 1fr; grid-template-rows: auto auto auto auto; height: auto; }
  .left, .right { border: none; max-height: none; }
  .lobby { grid-template-columns: 1fr; }
  .lobby-actions { grid-template-columns: 1fr; }
  .role-cards { grid-template-columns: 1fr; }
  .interact { grid-template-columns: 1fr; }
}

/* Полосы прокрутки в стиле бумаги и чернил */
* { scrollbar-width: thin; scrollbar-color: #b49c76 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background-color: #c4ad86; border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #9c7f56; }
::-webkit-scrollbar-thumb:active { background-color: var(--ox); }
::-webkit-scrollbar-corner { background: transparent; }
