/* ===== IGRY V CHATE: doski, lobby, menyu. Tema cherez sushchestvuyushchie peremennye base.css ===== */
/* Ispolzuem realnye peremennye: --accent, --text, --text-secondary, --border, --bubble-other. Fallbacki dlya nadezhnosti. */

.aya-game-host { display: block; margin: 2px 0; }
.aya-game {
    box-sizing: border-box;
    max-width: min(320px, 82vw);
    background: var(--bubble-other, #fff);
    border: 1px solid var(--border, rgba(0,56,65,.1));
    border-radius: 18px;
    padding: 14px 14px 15px;
    color: var(--text, #1A1D21);
    box-shadow: 0 1px 2px rgba(0,56,65,.05), 0 8px 24px rgba(0,56,65,.08);
    -webkit-user-select: none; user-select: none;
}
.aya-game { position: relative; }
.aya-game-loading { color: var(--text-secondary, #65676B); font-size: 14px; text-align: center; padding: 18px 8px; }
.aya-game-title { font-weight: 700; font-size: 15px; letter-spacing: -.01em; margin-bottom: 11px; padding-right: 32px; }
/* knopka «na ves ekran» */
.aya-game-expand { position: absolute; top: 10px; right: 10px; z-index: 2; width: 30px; height: 30px; padding: 0; border: none; border-radius: 10px; background: var(--soft, rgba(0,56,65,.06)); color: var(--text-secondary, #65676B); font-size: 15px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s ease, transform .12s ease; }
.aya-game-expand:active { background: var(--soft-hover, rgba(0,0,0,.1)); transform: scale(.92); }
.aya-game-status { margin-top: 10px; font-size: 13px; color: var(--text-secondary, #65676B); text-align: center; min-height: 18px; }
.aya-game-controls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }

/* --- knopki: myagkie pilyuli, brand-petrol dlya glavnogo dejstviya --- */
.aya-game-btn {
    appearance: none; border: none;
    background: var(--soft, #f1f1ef); color: var(--text, #1A1D21);
    border-radius: 12px; padding: 9px 14px; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: background .15s, opacity .15s, transform .12s ease; line-height: 1;
    box-shadow: inset 0 0 0 1px var(--border, rgba(0,56,65,.08));
}
.aya-game-btn:active { transform: scale(.96); }
.aya-game-btn.primary {
    background: linear-gradient(135deg, var(--brand, #005f6d), var(--brand-dark, #0a7c88));
    color: #fff; box-shadow: 0 3px 10px rgba(0,95,109,.28);
}
.aya-game-btn:disabled { opacity: .45; cursor: default; }

/* --- knopka «Играть» v kompozere --- */
.game-btn-mobile {
    flex: 0 0 auto; width: 38px; height: 38px; border: none; background: transparent;
    font-size: 21px; line-height: 1; cursor: pointer; padding: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: var(--text, #1A1D21);
}
.game-btn-mobile:active { background: var(--border, rgba(0,0,0,.06)); }

/* ===== KRESTIKI-NOLIKI ===== */
.ttt-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: min(240px, 66vw); margin: 0 auto; }
.ttt-cell {
    aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
    font-size: 34px; font-weight: 700; border-radius: 12px; border: none;
    background: var(--border, rgba(0,56,65,.08)); color: var(--text, #1A1D21); cursor: default;
}
.ttt-board.can-tap .ttt-cell:not(:disabled) { cursor: pointer; box-shadow: inset 0 0 0 2px var(--accent, #ff8c42); background: transparent; }
.ttt-cell.v1 { color: var(--aya-petrol, #005f6d); }
.ttt-cell.v2 { color: var(--accent, #ff8c42); }
.ttt-cell.ttt-win { background: var(--aya-pill-active-bg, #cfe8db); }

/* ===== SHASHKI ===== */
.ch-board { display: grid; grid-template-columns: repeat(8, 1fr); width: min(288px, 78vw); margin: 0 auto; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-strong, rgba(0,0,0,.15)); }
.ch-sq { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; position: relative; }
.ch-light { background: #efdcbf; }
.ch-dark { background: #9a6b3f; }
.ch-board.can-tap .ch-dark { cursor: pointer; }
.ch-sel { box-shadow: inset 0 0 0 3px var(--accent, #ff8c42); }
.ch-pc { width: 72%; height: 72%; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.ch-pc-1, .ch-pc-3 { background: radial-gradient(circle at 35% 30%, #ff6b5e, #c0392b); color: #ffe; }
.ch-pc-2, .ch-pc-4 { background: radial-gradient(circle at 35% 30%, #4a4a4a, #111); color: #ffd54a; }
.ch-king { box-shadow: 0 0 0 2px #ffd54a, 0 1px 2px rgba(0,0,0,.4); }

/* ===== SHAHMATY ===== */
.cs-board { display: grid; grid-template-columns: repeat(8, 1fr); width: min(304px, 82vw); margin: 0 auto; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-strong, rgba(0,0,0,.15)); }
.cs-sq { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; position: relative; }
.cs-light { background: #efdcbf; }
.cs-dark { background: #9a6b3f; }
.cs-board.can-tap .cs-sq { cursor: pointer; }
.cs-pc { font-size: 26px; line-height: 1; text-shadow: 0 1px 1px rgba(0,0,0,.35); }
.cs-lastmv { box-shadow: inset 0 0 0 3px rgba(255,213,74,.75); }
.cs-sel { box-shadow: inset 0 0 0 3px var(--accent, #ff8c42); }
.cs-hint::after { content: ''; position: absolute; width: 30%; height: 30%; border-radius: 50%; background: rgba(0,0,0,.28); }
.cs-cap { box-shadow: inset 0 0 0 3px rgba(232,80,46,.85); }
.cs-promo { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px; }
.cs-promo-b { font-size: 28px; padding: 10px 14px; }

/* ===== REVERSI ===== */
.rv-score { text-align: center; font-size: 15px; font-weight: 700; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; justify-content: center; }
.rv-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; border-radius: 50%; font-size: 13px; padding: 0 6px; }
.rv-b1 { background: #222; color: #fff; }
.rv-b2 { background: #f4f4f4; color: #222; border: 1px solid rgba(0,0,0,.2); }
.rv-board { display: grid; grid-template-columns: repeat(8, 1fr); width: min(288px, 78vw); margin: 0 auto; background: #1f6f43; border: 2px solid #17532f; border-radius: 6px; overflow: hidden; }
.rv-sq { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; position: relative; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.rv-board.can-tap .rv-sq { cursor: pointer; }
.rv-disc { width: 74%; height: 74%; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.rv-disc-1 { background: radial-gradient(circle at 35% 30%, #555, #000); }
.rv-disc-2 { background: radial-gradient(circle at 35% 30%, #fff, #cfcfcf); }
.rv-hint::after { content: ''; position: absolute; width: 28%; height: 28%; border-radius: 50%; background: rgba(255,255,255,.45); }

/* ===== CHETYRE V RYAD ===== */
.c4-board { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; width: min(266px, 74vw); margin: 0 auto; background: #2a68c4; padding: 6px; border-radius: 10px; }
.c4-cell { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; }
.c4-board.can-tap .c4-cell { cursor: pointer; }
.c4-disc { width: 82%; height: 82%; border-radius: 50%; }
.c4-disc-0 { background: var(--bubble-other, #fff); box-shadow: inset 0 2px 4px rgba(0,0,0,.35); }
.c4-disc-1 { background: radial-gradient(circle at 35% 30%, #ff6b5e, #c0392b); box-shadow: 0 1px 2px rgba(0,0,0,.35); }
.c4-disc-2 { background: radial-gradient(circle at 35% 30%, #ffe14d, #e0a800); box-shadow: 0 1px 2px rgba(0,0,0,.35); }
.c4-win .c4-disc { box-shadow: 0 0 0 3px #fff, 0 1px 2px rgba(0,0,0,.4); }
.c4-lastmv .c4-disc { outline: 2px solid rgba(255,255,255,.7); outline-offset: -2px; }

/* ===== NARDY / BACKGAMMON ===== */
/* Nardy: vpisyvaem v ekran po SHIRINE i VYSOTE (v landscape ranshe vylezala po vysote). */
/* Kartochku s nardami delaem SHIRE ostalnyh igr — pochti vsya shirina ekrana (nardy — shirokaya doska).
   NE ispolzuem :has() — on ne rabotaet v etom WKWebView; cepляemsya za klass tipa igry (buildHtml: aya-game-<type>). */
.aya-game-backgammon, .aya-game-longnard { max-width: min(96vw, 460px); }
/* Rama: tyoplyj oreh s myagkim voloknom (repeating-gradient), vnutrennyaya ten, skruglenie.
   Ramka/otstupy v px (cq-edinicy na samom kontejnere ne rezolvyatsya ot nego samogo). */
.bg-wrap {
    width: 100%; max-width: min(460px, 74vh); margin: 0 auto;
    background:
        repeating-linear-gradient(92deg, rgba(255,214,160,.05) 0 3px, rgba(0,0,0,0) 3px 8px, rgba(30,12,2,.07) 8px 11px, rgba(0,0,0,0) 11px 17px),
        linear-gradient(160deg, #6d4423, #56351a 55%, #472b13);
    border: 3px solid #38220f; border-radius: 14px; padding: 6px;
    box-shadow: inset 0 1px 0 rgba(255,206,150,.16), inset 0 0 10px rgba(0,0,0,.35), 0 4px 14px rgba(40,20,5,.22);
    container-type: inline-size; box-sizing: border-box;
}
/* Polnoekranka: doska = 100% shiriny kartochki (uzhe uchityvaet ee padding -> NE vylezaet vbok),
   ogranichena po VYSOTE (82vh) i absolyutom. Bez vmin/vw — oni ignorirovali padding i doska vyezzhala vpravo. */
.aya-game-fs-host .bg-wrap { width: 100%; max-width: min(560px, 82vh); }
/* Vysota polovin/razmery fishek/bara/kubikov — v cqw (% shiriny doski) -> vsyo masshtabiruetsya
   vmeste s .bg-wrap i vpisyvaetsya v ekran (i v landscape). Px pered cqw — folbэk dlya staryh iOS. */
/* Igrovoe pole: dve polovinki dereva potemnee ramy, vinetka po krayam, shchel-«petlya» mezhdu nimi. */
.bg-half {
    display: flex; align-items: stretch; height: 92px; height: 29cqw;
    position: relative; overflow: hidden;
    background: linear-gradient(180deg, #7d4e24, #6f421d);
    box-shadow: inset 0 0 12px rgba(42,20,5,.45);
}
.bg-half.bg-top { border-radius: 8px 8px 2px 2px; }
.bg-half.bg-bottom { margin-top: 3px; border-radius: 2px 2px 8px 8px; }
.bg-quad { display: flex; flex: 1; }
.bg-point { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; padding: 2px 0; min-width: 0; }
.bg-top .bg-point { justify-content: flex-start; }
.bg-bottom .bg-point { justify-content: flex-end; }
/* Treugolniki: chyotkij clip-path, gradient ot osnovaniya k vershine (obyom), tonkaya kromka drop-shadow. */
.bg-point::before {
    content: ''; position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 0;
    filter: drop-shadow(0 0 1px rgba(42,20,5,.5));
}
.bg-top .bg-point::before { clip-path: polygon(0 0, 100% 0, 50% 92%); background: linear-gradient(180deg, var(--pt1), var(--pt2) 88%); }
.bg-bottom .bg-point::before { clip-path: polygon(50% 8%, 0 100%, 100% 100%); background: linear-gradient(0deg, var(--pt1), var(--pt2) 88%); }
.bg-pt-a { --pt1: #f0e0bc; --pt2: #d3b483; }
.bg-pt-b { --pt1: #b5652f; --pt2: #8d451e; }
/* Shashki: obyomnye shajby — blik sverhu, pritenenie snizu, tokarnaya kanavka po krugu. */
.bg-disc { width: 15px; height: 15px; width: 5.1cqw; height: 5.1cqw; border-radius: 50%; margin: 1px 0; margin: .2cqw 0; z-index: 1; flex: 0 0 auto; }
.bg-disc-1 {
    background:
        radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 52%, rgba(120,90,40,.22) 56% 62%, rgba(0,0,0,0) 66%),
        radial-gradient(circle at 32% 28%, #ffffff, #efe8d6 45%, #d6caae 78%, #bfb192);
    box-shadow: inset 0 1px 1px rgba(255,255,255,.9), inset 0 -2px 3px rgba(120,96,54,.38), 0 0 0 1px rgba(101,67,33,.35), 0 1px 2px rgba(20,10,2,.45);
}
.bg-disc-2 {
    background:
        radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 52%, rgba(255,255,255,.10) 56% 62%, rgba(0,0,0,0) 66%),
        radial-gradient(circle at 32% 28%, #7c7168, #3d342c 45%, #231c15 78%, #150f0a);
    box-shadow: inset 0 1px 1px rgba(255,255,255,.22), inset 0 -2px 3px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.12), 0 1px 2px rgba(20,10,2,.5);
}
/* Schyotchik stopki: kruglyj bejdzh POVERH krajnej shashki (otricatelnyj otstup), a ne pod nej. */
.bg-count {
    z-index: 2; font-size: 10px; font-size: 3.1cqw; font-weight: 800; line-height: 1;
    padding: 2px 4px; border-radius: 999px; margin-top: -10px; margin-top: -3.4cqw;
    box-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.bg-count-1 { background: #fffdf4; color: #2b1d0e; }
.bg-count-2 { background: #241d17; color: #f5efe2; border: 1px solid rgba(255,255,255,.18); }
/* Bar po centru: tochenyj derevyannyj stolbik s prodolnym bleskom. */
.bg-bar {
    width: 20px; flex: 0 0 20px; width: 7cqw; flex-basis: 7cqw; position: relative;
    background: linear-gradient(90deg, #331d0c, #593719 28%, #6b4624 50%, #593719 72%, #2e1a0a);
    box-shadow: inset 0 0 6px rgba(0,0,0,.4);
    display: flex; flex-direction: column; align-items: center;
}
.bg-bar-top { justify-content: flex-start; padding-top: 2px; }
.bg-bar-bottom { justify-content: flex-end; padding-bottom: 2px; }
/* Podsvetki hodov: zalivka po forme SAMOGO treugolnika (clip-path), spokojnye tyoplye tona. */
.bg-movable { cursor: pointer; }
.bg-movable::after, .bg-sel::after, .bg-hint::after { content: ''; position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 2; pointer-events: none; }
.bg-top .bg-point::after { clip-path: polygon(0 0, 100% 0, 50% 92%); }
.bg-bottom .bg-point::after { clip-path: polygon(50% 8%, 0 100%, 100% 100%); }
.bg-point.bg-movable::after { background: rgba(255,166,64,.28); }
.bg-point.bg-sel::after { background: rgba(255,204,88,.45); }
.bg-point.bg-hint::after { background: rgba(124,196,108,.42); }
.bg-point.bg-movable::before { filter: drop-shadow(0 0 1px rgba(42,20,5,.5)) drop-shadow(0 0 4px rgba(255,152,52,.65)); }
.bg-point.bg-sel::before { filter: drop-shadow(0 0 1px rgba(42,20,5,.5)) drop-shadow(0 0 4px rgba(255,198,74,.75)); }
/* Bar — pryamougolnaya ramka-podsvetka (clip-path tut ne nuzhen). */
.bg-bar.bg-movable, .bg-bar.bg-sel { cursor: pointer; position: relative; }
.bg-bar.bg-movable::after { left: 1px; right: 1px; top: 1px; bottom: 1px; border-radius: 4px; background: rgba(255,166,64,.2); box-shadow: inset 0 0 0 2px rgba(255,166,64,.9); }
.bg-bar.bg-sel::after { left: 1px; right: 1px; top: 1px; bottom: 1px; border-radius: 4px; background: rgba(255,204,88,.22); box-shadow: inset 0 0 0 2px rgba(255,204,88,.95); }
/* Snyatye shashki: gromozdkie lotki «Соперник снял / Вы сняли» UBRANY (po prosbe vladelca).
   Vmesto nih — kompaktnyj bejdzh v stroke statusa (⚪ 3/15 · ⚫ 1/15), a sbros (bearing off) —
   knopka «Снять шашку» v .aya-game-controls (poyavlyaetsya tolko kogda vybrana shashka,
   kotoroj legalno snyatsya — ta zhe proverka hintTo['off'], hod tot zhe: from=sel, to='off'). */
.bg-off-note { white-space: nowrap; font-weight: 600; opacity: .9; }
/* Kubiki: kost slonovoj kosti s tochkami-pipsami (risuyutsya radial-gradientami po klassu bg-die-vN). */
.bg-dice { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 10px; }
.bg-die {
    display: inline-flex; align-items: center; justify-content: center;
    position: relative;
    width: 28px; height: 28px; width: 8.6cqw; height: 8.6cqw; border-radius: 22%;
    --pip: #33230f; --face: linear-gradient(145deg, #fffef7, #ece2cc);
    background: var(--face);
    color: #222; font-weight: 800; font-size: 16px; font-size: 4.6cqw;
    box-shadow: inset 0 1px 1px rgba(255,255,255,.85), inset 0 -2px 3px rgba(96,70,40,.28), 0 2px 5px rgba(30,15,4,.35);
    animation: bg-die-roll .6s cubic-bezier(.3,1.1,.4,1) backwards;
}
/* Glyanec na grani: myagkij blik sverhu, ne perekryvaet pipsy (poluprozrachnyj). */
.bg-die::after {
    content: ''; position: absolute; left: 10%; top: 6%; width: 66%; height: 36%;
    border-radius: 50%; pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0));
}
/* Brosok: kubik «padaet» s kuvyrkom i korotkim otskokom; vtoroj — chut pozzhe (nth-child).
   Opacity zadan tolko na 0% — plavno prihodit k sobstvennomu znacheniyu elementa
   (vazhno dlya .bg-die-dim s opacity .4). */
@keyframes bg-die-roll {
    0%   { transform: translateY(-30px) rotate(-200deg) scale(.5); opacity: 0; }
    45%  { transform: translateY(3px) rotate(22deg) scale(1.08); }
    65%  { transform: translateY(-4px) rotate(-7deg) scale(.97); }
    82%  { transform: translateY(1px) rotate(3deg) scale(1.02); }
    100% { transform: translateY(0) rotate(0deg) scale(1); }
}
.bg-dice .bg-die:nth-child(2) { animation-delay: .14s; }
/* Est klass znacheniya -> pryachem cifru i risuem pipsy; bez klassa ostayotsya krupnaya cifra (folbэk). */
.bg-die[class*="bg-die-v"] { color: transparent; }
.bg-die-v1 { background: radial-gradient(9% 9% at 50% 50%, var(--pip) 98%, rgba(0,0,0,0)) , var(--face); }
.bg-die-v2 { background: radial-gradient(9% 9% at 28% 28%, var(--pip) 98%, rgba(0,0,0,0)), radial-gradient(9% 9% at 72% 72%, var(--pip) 98%, rgba(0,0,0,0)), var(--face); }
.bg-die-v3 { background: radial-gradient(9% 9% at 25% 25%, var(--pip) 98%, rgba(0,0,0,0)), radial-gradient(9% 9% at 50% 50%, var(--pip) 98%, rgba(0,0,0,0)), radial-gradient(9% 9% at 75% 75%, var(--pip) 98%, rgba(0,0,0,0)), var(--face); }
.bg-die-v4 { background: radial-gradient(9% 9% at 28% 28%, var(--pip) 98%, rgba(0,0,0,0)), radial-gradient(9% 9% at 72% 28%, var(--pip) 98%, rgba(0,0,0,0)), radial-gradient(9% 9% at 28% 72%, var(--pip) 98%, rgba(0,0,0,0)), radial-gradient(9% 9% at 72% 72%, var(--pip) 98%, rgba(0,0,0,0)), var(--face); }
.bg-die-v5 { background: radial-gradient(9% 9% at 26% 26%, var(--pip) 98%, rgba(0,0,0,0)), radial-gradient(9% 9% at 74% 26%, var(--pip) 98%, rgba(0,0,0,0)), radial-gradient(9% 9% at 50% 50%, var(--pip) 98%, rgba(0,0,0,0)), radial-gradient(9% 9% at 26% 74%, var(--pip) 98%, rgba(0,0,0,0)), radial-gradient(9% 9% at 74% 74%, var(--pip) 98%, rgba(0,0,0,0)), var(--face); }
.bg-die-v6 { background: radial-gradient(9% 9% at 30% 26%, var(--pip) 98%, rgba(0,0,0,0)), radial-gradient(9% 9% at 30% 50%, var(--pip) 98%, rgba(0,0,0,0)), radial-gradient(9% 9% at 30% 74%, var(--pip) 98%, rgba(0,0,0,0)), radial-gradient(9% 9% at 70% 26%, var(--pip) 98%, rgba(0,0,0,0)), radial-gradient(9% 9% at 70% 50%, var(--pip) 98%, rgba(0,0,0,0)), radial-gradient(9% 9% at 70% 74%, var(--pip) 98%, rgba(0,0,0,0)), var(--face); }
.bg-die-dim { opacity: .4; filter: saturate(.4); }
.bg-die-dbl { font-size: 12px; font-weight: 700; color: var(--accent, #ff8c42); background: rgba(255,140,66,.12); border-radius: 999px; padding: 3px 9px; }

/* ===== MORSKOJ BOJ ===== */
.sb-wrap { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.sb-col { display: flex; flex-direction: column; align-items: center; }
.sb-label { font-size: 12px; color: var(--text-secondary, #65676B); margin-bottom: 4px; }
.sb-grid { display: grid; grid-template-columns: repeat(10, 1fr); width: min(200px, 60vw); border: 1px solid var(--border-strong, rgba(0,0,0,.2)); background: var(--border-strong, rgba(0,0,0,.2)); gap: 1px; }
.sbc {
    aspect-ratio: 1 / 1; background: var(--bubble-other, #fff); display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: var(--text-secondary, #65676B); line-height: 1;
}
.sb-grid.can-tap .sbc { cursor: pointer; }
.sb-grid.can-tap .sbc:hover { background: var(--accent-light, #fff0eb); }
.sb-ship { background: #7fa8c9; }
.sb-ship-hit { background: #e8502e; color: #fff; }
/* Markery vystrelov krupnee i kontrastnee (bylo melko, ploho vidno) */
.sb-miss { color: #4a5a68; font-size: 20px; font-weight: 900; line-height: 1; }
.sb-hit { background: #e8502e; color: #fff; }
.sb-sunk { background: #7a1f12; color: #fff; }
.sb-hit, .sb-sunk, .sb-ship-hit { font-size: 18px; font-weight: 900; line-height: 1; }
body.dark-theme .sb-miss { color: #a7bccd; }

/* ===== GRUPPOVOE LOBBY ===== */
.aya-game-lobby { text-align: center; }
.lobby-q { font-size: 14px; margin-bottom: 8px; color: var(--text-secondary, #65676B); }
.lobby-players { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 10px; }
.lobby-player { background: var(--border, rgba(0,56,65,.08)); border-radius: 12px; padding: 4px 10px; font-size: 13px; }
.lobby-in, .lobby-wait { font-size: 13px; color: var(--text-secondary, #65676B); align-self: center; }

/* ===== TABLICA OCHKOV ===== */
.aya-score { margin-top: 10px; border-top: 1px solid var(--border, rgba(0,0,0,.08)); padding-top: 8px; }
.aya-score-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 4px; border-radius: 6px; }
.aya-score-row.win { background: var(--aya-pill-active-bg, #cfe8db); font-weight: 700; }
.aya-score-row b { color: var(--brand, #005f6d); }

/* ===== VIKTORINA ===== */
.quiz-head { font-size: 12px; color: var(--text-secondary, #65676B); text-align: center; }
.quiz-q { font-size: 15px; font-weight: 600; margin: 8px 0 10px; text-align: center; }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt { text-align: left; white-space: normal; }
.quiz-opt.chosen { border-color: var(--accent, #ff8c42); }
.quiz-opt.correct { background: #d6f0dc; border-color: #2e9e50; color: #16341f; }
.quiz-opt.wrong { background: #f7d9d2; border-color: #e8502e; color: #5a1c11; }
.quiz-timer { font-weight: 700; color: var(--brand, #005f6d); }

/* ===== VISELICA ===== */
.hm-head { font-size: 12px; color: var(--text-secondary, #65676B); text-align: center; }
.hm-stage { font-size: 40px; text-align: center; margin: 4px 0; }
.hm-mask { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin: 6px 0; }
.hm-ch { min-width: 18px; text-align: center; font-size: 22px; font-weight: 700; border-bottom: 2px solid var(--text, #1A1D21); }
.hm-wrong { text-align: center; font-size: 13px; color: #e8502e; margin: 4px 0; }
.hm-last { text-align: center; font-size: 12px; color: var(--text-secondary, #65676B); }
.hm-keys { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px; margin: 8px 0; }
.hm-key { padding: 6px 0; font-size: 13px; min-width: 0; }

/* ===== GORODA ===== */
.cities-last { font-size: 14px; text-align: center; }
.cities-need { text-align: center; font-size: 13px; color: var(--brand, #005f6d); font-weight: 600; margin: 4px 0; }
.cities-used { font-size: 12px; color: var(--text-secondary, #65676B); margin: 6px 0; word-break: break-word; }
.cities-input { display: flex; gap: 6px; margin-top: 8px; }
.cities-field { flex: 1; min-width: 0; border: 1px solid var(--border-strong, rgba(0,0,0,.16)); border-radius: 10px; padding: 8px 10px; font-size: 14px; background: var(--bg, #fff); color: var(--text, #1A1D21); }

/* ===== POLE CHUDES (baraban / koleso) ===== */
.pc-head { font-size: 12px; color: var(--text-secondary, #65676B); text-align: center; }
.pc-question { text-align: center; font-size: 14px; font-weight: 600; color: var(--brand, #005f6d); margin: 5px 4px 8px; word-break: break-word; }
.pc-mask { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin: 6px 0 10px; }
.pc-ch { min-width: 22px; height: 28px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; border-radius: 6px; }
.pc-ch-empty { border-bottom: 3px solid var(--text, #1A1D21); border-radius: 0; }
.pc-ch-open { background: var(--brand, #005f6d); color: #fff; }
/* Koleso */
.pc-wheel-wrap { position: relative; width: 220px; height: 220px; margin: 6px auto 4px; }
.pc-wheel-ptr { position: absolute; top: -4px; left: 50%; transform: translateX(-50%); font-size: 22px; color: #d32f2f; z-index: 3; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); }
.pc-wheel { position: absolute; inset: 0; border-radius: 50%; border: 4px solid rgba(0,0,0,.25); box-shadow: 0 4px 16px rgba(0,0,0,.28), inset 0 0 0 2px rgba(255,255,255,.35);
  transition: transform 3.4s cubic-bezier(.15,.62,.24,1); will-change: transform; }
.pc-wsl { position: absolute; top: 0; left: 50%; width: 0; height: 50%; transform-origin: bottom center; }
.pc-wsl-t { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.65); white-space: nowrap; }
.pc-wheel-hub { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 62px; height: 62px; border-radius: 50%;
  background: var(--bg, #fff); color: var(--text, #1A1D21); display: flex; align-items: center; justify-content: center; z-index: 2;
  font-size: 15px; font-weight: 800; box-shadow: 0 2px 8px rgba(0,0,0,.3), inset 0 0 0 2px rgba(0,0,0,.15); text-align: center; padding: 4px; }
.pc-sector-note { text-align: center; font-size: 12px; color: var(--text-secondary, #65676B); margin: 2px 0 4px; min-height: 15px; }
.pc-spin-btn { font-size: 15px; }
.pc-keys { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px; margin: 8px 0; }
.pc-key { padding: 6px 0; font-size: 13px; min-width: 0; border: 1px solid var(--border-strong, rgba(0,0,0,.16)); border-radius: 6px; background: var(--bg, #fff); color: var(--text, #1A1D21); }
.pc-keys.can-tap .pc-key:not([disabled]):active { background: var(--brand, #005f6d); color: #fff; }
.pc-key-used { opacity: .4; }
.pc-word-input { display: flex; gap: 6px; margin-top: 6px; }
.pc-word-field { flex: 1; min-width: 0; border: 1px solid var(--border-strong, rgba(0,0,0,.16)); border-radius: 10px; padding: 8px 10px; font-size: 14px; background: var(--bg, #fff); color: var(--text, #1A1D21); }
.pc-round-scores { font-size: 12px; color: var(--text-secondary, #65676B); text-align: center; margin-top: 6px; }
.pc-last { font-size: 12px; color: var(--text-secondary, #65676B); text-align: center; margin-top: 4px; }
body.dark-theme .pc-key { background: #222b35; }
body.dark-theme .pc-wheel-hub { background: #222b35; }
body.dark-theme .pc-word-field { background: #222b35; }

/* ===== OBSCHEE: stroka vvoda v igrah (story/duoq/yesno) ===== */
.aya-game-inputrow { display: flex; gap: 6px; margin-top: 8px; }
.aya-gfield { flex: 1; min-width: 0; border: 1px solid var(--border-strong, rgba(0,0,0,.16)); border-radius: 10px; padding: 8px 10px; font-size: 14px; background: var(--bg, #fff); color: var(--text, #1A1D21); }
.aya-gfield:focus { outline: none; border-color: var(--brand, #005f6d); box-shadow: 0 0 0 2px rgba(0,95,109,.15); }

/* ===== TOCHKI (dots and boxes) ===== */
.dots-score { display: flex; gap: 8px; align-items: center; justify-content: center; margin-bottom: 10px; font-size: 13px; }
.dots-sep { color: var(--text-secondary, #65676B); font-weight: 700; }
.dots-tag { padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.dots-tag b { font-size: 14px; }
.dots-tag-p1 { background: rgba(0,95,109,.12); color: var(--brand, #005f6d); }
.dots-tag-p2 { background: rgba(255,140,66,.16); color: #c05f1d; }
.dots-board {
    display: grid; width: min(280px, 76vw); aspect-ratio: 1 / 1; margin: 0 auto;
    background: var(--soft, rgba(0,56,65,.04)); border-radius: 14px; padding: 8px; box-sizing: content-box;
}
.dots-dot { display: flex; align-items: center; justify-content: center; }
.dots-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-secondary, #65676B); opacity: .85; }
/* Rebro: shirokaya tap-zona, vnutri tonkaya «linija»-plank */
.dots-e { display: flex; align-items: center; justify-content: center; position: relative; }
.dots-e i { display: block; border-radius: 99px; background: var(--border, rgba(0,56,65,.1)); transition: background .15s ease, box-shadow .15s ease; }
.dots-eh i { width: 100%; height: 4px; }
.dots-ev i { width: 4px; height: 100%; }
.dots-board.can-tap .dots-e:not(.dots-on) { cursor: pointer; }
.dots-board.can-tap .dots-e:not(.dots-on) i { background: var(--border-strong, rgba(0,56,65,.16)); }
.dots-board.can-tap .dots-e:not(.dots-on):hover i { background: var(--accent, #ff8c42); opacity: .55; }
.dots-e.dots-on i { height: 5px; }
.dots-ev.dots-on i { width: 5px; height: 100%; }
.dots-e.dots-p1 i { background: var(--brand, #005f6d); }
.dots-e.dots-p2 i { background: var(--accent, #ff8c42); }
.dots-e.dots-last i { box-shadow: 0 0 0 2px rgba(255,213,74,.65); }
/* Kvadrat: zalivka cvetom vladeltsa + bukva (В = vy, С = sopernik) */
.dots-box { display: flex; align-items: center; justify-content: center; border-radius: 8px; margin: 2px; font-size: 15px; font-weight: 800; transition: background .2s ease; }
.dots-box.dots-bp1 { background: rgba(0,95,109,.18); color: var(--brand, #005f6d); animation: dotsClaim .25s ease; }
.dots-box.dots-bp2 { background: rgba(255,140,66,.22); color: #c05f1d; animation: dotsClaim .25s ease; }
@keyframes dotsClaim { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ===== VOPROS NA DVOIH (duoq) ===== */
.duoq-head { font-size: 12px; color: var(--text-secondary, #65676B); text-align: center; }
.duoq-q {
    margin: 8px 0 10px; padding: 12px 14px; border-radius: 14px; text-align: center;
    font-size: 15px; font-weight: 600; line-height: 1.35;
    background: linear-gradient(135deg, rgba(0,95,109,.08), rgba(255,140,66,.1));
    border: 1px solid var(--border, rgba(0,56,65,.1));
}
.duoq-final { font-size: 16px; }
.duoq-final-sub { font-size: 13px; font-weight: 400; color: var(--text-secondary, #65676B); }
.duoq-wait { text-align: center; font-size: 13px; color: var(--text-secondary, #65676B); margin: 8px 0; }
.duoq-nudge { color: var(--accent, #ff8c42); font-weight: 600; }
/* Otvety — krupnye, YAVNO razdelyonnye BLOKI s raznymi tonami (svoj petrol / sobesednik oranzh), ramka+ten */
.duoq-answers { display: flex; flex-direction: column; gap: 14px; margin: 12px 0 6px; }
.duoq-ans { border-radius: 16px; padding: 14px 16px; font-size: 18px; line-height: 1.42; color: var(--text, #1A1D21); word-break: break-word; box-shadow: 0 2px 6px rgba(0,56,65,.1); }
.duoq-mine { background: rgba(0,95,109,.1); border: 1.5px solid rgba(0,95,109,.28); }
.duoq-theirs { background: rgba(255,140,66,.12); border: 1.5px solid rgba(255,140,66,.32); }
.duoq-who { display: block; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }
.duoq-mine .duoq-who { color: #005f6d; }
.duoq-theirs .duoq-who { color: #c85a17; }
body.dark-theme .duoq-mine { background: rgba(56,182,201,.16); border-color: rgba(56,182,201,.34); }
body.dark-theme .duoq-theirs { background: rgba(255,140,66,.17); border-color: rgba(255,140,66,.34); }
body.dark-theme .duoq-mine .duoq-who { color: #57c9dd; }
body.dark-theme .duoq-theirs .duoq-who { color: #ff9d52; }

/* ===== SVIDANIE-RULETKA (dateroulette) ===== */
.dr-wheel { font-size: 52px; text-align: center; line-height: 1; margin: 4px 0 8px; }
.dr-wheel.dr-spun { animation: drSpin .8s cubic-bezier(.22,1,.36,1); }
.dr-wheel.dr-spinning { animation: drSpinLoop .7s linear infinite; }
@keyframes drSpin { from { transform: rotate(-360deg) scale(.7); } to { transform: rotate(0) scale(1); } }
@keyframes drSpinLoop { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.dr-intro { text-align: center; font-size: 13px; color: var(--text-secondary, #65676B); margin: 4px 6px 6px; line-height: 1.4; }
.dr-card {
    margin: 4px 0 8px; padding: 14px 15px; border-radius: 16px; text-align: center;
    font-size: 15px; font-weight: 600; line-height: 1.4;
    background: linear-gradient(135deg, rgba(255,140,66,.14), rgba(233,74,111,.12));
    border: 1px solid rgba(255,140,66,.35);
    box-shadow: 0 3px 12px rgba(233,74,111,.1);
    animation: dotsClaim .3s ease;
}
.dr-by { text-align: center; font-size: 12px; color: var(--text-secondary, #65676B); }

/* ===== ISTORIYA PO OCHEREDI (story) ===== */
.story-head { font-size: 12px; color: var(--text-secondary, #65676B); text-align: center; margin-bottom: 6px; }
.story-list { max-height: 190px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 2px; }
.story-empty { text-align: center; font-size: 13px; color: var(--text-secondary, #65676B); padding: 10px 0; }
.story-item { background: var(--soft, rgba(0,56,65,.05)); border-radius: 10px; padding: 7px 10px; font-size: 14px; line-height: 1.35; word-break: break-word; }
.story-author { display: block; font-size: 11px; font-weight: 700; color: var(--brand, #005f6d); margin-bottom: 1px; }
.story-final { background: linear-gradient(160deg, rgba(0,95,109,.07), rgba(255,140,66,.08)); border: 1px solid var(--border, rgba(0,56,65,.1)); border-radius: 14px; padding: 12px 14px; }
.story-final-title { font-weight: 800; font-size: 15px; margin-bottom: 8px; text-align: center; }
.story-final-text { font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.story-authors { text-align: center; font-size: 12px; color: var(--text-secondary, #65676B); margin-top: 8px; }

/* ===== KTO SKOREE? (whomore) ===== */
.wm-head { font-size: 12px; color: var(--text-secondary, #65676B); text-align: center; }
.wm-q { font-size: 15px; font-weight: 700; text-align: center; margin: 8px 4px 10px; line-height: 1.35; }
.wm-vote { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.wm-cand { min-width: 40%; }
.wm-results { display: flex; flex-direction: column; gap: 6px; margin: 4px 0; }
.wm-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 6px; border-radius: 8px; }
.wm-row.wm-top { background: var(--aya-pill-active-bg, #cfe8db); font-weight: 700; }
.wm-name { flex: 0 0 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-bar { flex: 1; height: 10px; border-radius: 99px; background: var(--soft, rgba(0,56,65,.07)); overflow: hidden; }
.wm-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand, #005f6d), var(--accent, #ff8c42)); transition: width .4s ease; }
.wm-row b { min-width: 16px; text-align: right; }
.wm-line { text-align: center; font-size: 13px; font-weight: 600; margin: 8px 0 2px; color: var(--brand, #005f6d); }

/* ===== DANETKI (yesno) ===== */
.yn-scenario {
    font-size: 14px; font-weight: 600; line-height: 1.45; padding: 11px 13px; border-radius: 13px;
    background: linear-gradient(150deg, rgba(84,60,150,.1), rgba(0,95,109,.08));
    border: 1px solid var(--border, rgba(0,56,65,.1)); margin-bottom: 8px;
}
.yn-log { max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; padding: 2px; }
.yn-empty { text-align: center; font-size: 13px; color: var(--text-secondary, #65676B); padding: 8px 0; }
.yn-qa { font-size: 13px; line-height: 1.4; background: var(--soft, rgba(0,56,65,.05)); border-radius: 9px; padding: 6px 9px; word-break: break-word; }
.yn-qa.yn-guess { border: 1px dashed var(--border-strong, rgba(0,56,65,.2)); }
.yn-qa-who { font-weight: 700; color: var(--brand, #005f6d); }
.yn-ans { display: inline-block; font-weight: 800; border-radius: 999px; padding: 1px 8px; font-size: 12px; margin-left: 4px; background: var(--border, rgba(0,56,65,.09)); }
.yn-ans.yn-a-yes { background: #d6f0dc; color: #16341f; }
.yn-ans.yn-a-no { background: #f7d9d2; color: #5a1c11; }
.yn-ans.yn-a-guess { background: rgba(255,213,74,.35); color: #6b4d00; }
.yn-solved { text-align: center; font-size: 14px; font-weight: 700; margin: 8px 0; }
.yn-solution { background: rgba(46,158,80,.1); border: 1px solid rgba(46,158,80,.35); border-radius: 13px; padding: 11px 13px; font-size: 14px; line-height: 1.45; }
.yn-sol-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #2e9e50; margin-bottom: 4px; }
.yn-giveup { font-size: 12px; }

/* ===== MENYU VYBORA IGRY ===== */
.aya-game-modal-ov { position: fixed; inset: 0; z-index: 4000; background: rgba(6,18,30,.45); display: flex; align-items: flex-end; justify-content: center; padding: 0; animation: aya-game-fade .15s ease; }
@keyframes aya-game-fade { from { opacity: 0; } to { opacity: 1; } }
.aya-game-modal { width: 100%; max-width: 480px; background: var(--bg, #fff); color: var(--text, #1A1D21); border-radius: 22px 22px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -12px 40px rgba(0,16,34,.25); animation: aya-game-up .22s cubic-bezier(.22,1,.36,1); }
@keyframes aya-game-up { from { transform: translateY(24px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
/* ruchka-grabber sverhu shtorki */
.aya-game-modal::before { content: ''; display: block; width: 36px; height: 4px; border-radius: 999px; background: var(--text-tertiary, #6E7177); opacity: .35; margin: 2px auto 12px; }
.aya-game-modal-title { font-weight: 700; font-size: 17px; letter-spacing: -.01em; text-align: center; margin-bottom: 14px; }
.aya-game-modal-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 14px; }
.aya-game-pick { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 15px 8px; border: 1px solid var(--border, rgba(0,56,65,.1)); border-radius: 16px; background: var(--bubble-other, #fff); color: var(--text, #1A1D21); font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 1px 2px rgba(0,56,65,.05); transition: transform .12s ease, box-shadow .15s ease; }
.aya-game-pick:active { transform: scale(.96); }
.pick-ic { font-size: 28px; }
.aya-game-modal-close { width: 100%; }
.quiz-theme-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px; }
.quiz-count-row { display: flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: 14px; font-size: 14px; }
/* Vybor varianta nard (Короткие/Длинные) */
.nardy-variants { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.nardy-var { flex-direction: row; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; }
.nardy-vtxt { display: flex; flex-direction: column; gap: 2px; }
.nardy-vtxt b { font-size: 15px; }
.nardy-desc { font-size: 12px; font-weight: 400; color: var(--text-secondary, #65676B); }
.nardy-colors { flex-direction: row; }
.nardy-colors .nardy-var { flex: 1; justify-content: center; text-align: center; }
/* Dlinnye nardy: bara net — delitel po centru kak uzkij pazh-zheobok v dereve */
.bg-wrap-long .bg-bar { width: 12px; flex-basis: 12px; width: 3.4cqw; flex-basis: 3.4cqw; background: linear-gradient(90deg, rgba(0,0,0,.32), rgba(0,0,0,.1) 50%, rgba(0,0,0,.32)); box-shadow: inset 0 0 5px rgba(0,0,0,.4); }
body.dark-theme .bg-wrap-long .bg-bar { background: linear-gradient(90deg, rgba(0,0,0,.45), rgba(0,0,0,.18) 50%, rgba(0,0,0,.45)); }

/* ===== POLNOEKRANNYJ REZHIM DOSKI ===== */
body.aya-game-fs-open { overflow: hidden; }                              /* chat pod overlayem ne skrollit */
.aya-game-fs-ov {
    position: fixed; inset: 0; z-index: 5000; display: flex; align-items: flex-start; justify-content: center;
    background: var(--bg, #fff); overflow: auto; -webkit-overflow-scrolling: touch;
    /* align-items:flex-start — chtoby JS mog izmerit realnuyu poziciyu polej i podnyat kartochku
       (transform) nad klaviaturoj «danetki» pri fokuse polya vvoda. */
    padding: calc(56px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom));
    animation: aya-game-fade .15s ease;
}
/* Plavnyj podyom kartochki nad klaviaturoj (JS stavit transform na .aya-game-fs-host). */
.aya-game-fs-host { transition: transform .2s ease; }
.aya-game-fs-close {
    position: fixed; top: calc(10px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); z-index: 5001;
    width: 42px; height: 42px; border: none; border-radius: 50%; cursor: pointer;
    background: var(--soft, rgba(0,0,0,.08)); color: var(--text, #1A1D21); font-size: 20px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 10px rgba(0,40,48,.14);
}
.aya-game-fs-close:active { transform: scale(.95); }
.aya-game-fs-host { width: 100%; display: flex; justify-content: center; }
.aya-game-fs-host .aya-game { max-width: min(560px, 96vw); width: 100%; box-shadow: none; }
.aya-game-fs-host .aya-game-expand { display: none; }                    /* v polnoekranke pryachem — est knopka zakrytiya */
.aya-game-fs-host .aya-game-title { font-size: 18px; }
/* Uvelichivaem doski (perekryvaem vw/px-kapy) */
.aya-game-fs-host .ttt-board { width: min(400px, 80vmin); }
.aya-game-fs-host .dots-board { width: min(440px, 84vmin); }
.aya-game-fs-host .story-list { max-height: 46vh; }
.aya-game-fs-host .yn-log { max-height: 40vh; }
.aya-game-fs-host .ch-board,
.aya-game-fs-host .rv-board { width: min(460px, 88vmin); }
.aya-game-fs-host .cs-board { width: min(480px, 90vmin); }
.aya-game-fs-host .c4-board { width: min(440px, 86vmin); }
/* px — folbэk dlya brauzerov bez container queries; cqw povtoryaem, chtoby fs-pravilo ne lomalo proporcii */
.aya-game-fs-host .bg-half { height: 150px; height: 29cqw; }
.aya-game-fs-host .bg-disc { width: 26px; height: 26px; width: 5.1cqw; height: 5.1cqw; }
.aya-game-fs-host .sb-wrap { gap: 14px; }

/* LANDSCAPE (povyornutyj ekran) v POLNOM ekrane, tolko nardy: DVE KOLONKI.
   Sleva — doska .bg-wrap maksimalno po VYSOTE, sprava — panel .bg-side (kubiki, status, knopki).
   Shirina doski schitaetsya OT VYSOTY ekrana: vysota doski = 0.58*(w-18px)+21px (dve poloviny po
   29cqw + rama), poetomu w = calc(166vh - 160px) daet ~96% dostupnoj vysoty (overlay est 56px
   sverhu + 16px snizu + padding kartochki). Kapy 66vw/920px — chtoby panel sprava vsegda vlezala.
   cqw-masshtabirovanie vnutri .bg-wrap ne trogaem — ono ot shiriny samoj doski. */
@media (orientation: landscape) {
    .aya-game-fs-host .aya-game-backgammon,
    .aya-game-fs-host .aya-game-longnard {
        max-width: none;
        display: flex; flex-direction: row; align-items: center; justify-content: center;
        gap: 18px; padding: 10px 14px;
    }
    /* zagolovok ne dolzhen syest kolonku — absolyutom v svobodnuyu polosu NAD kartochkoj
       (overlay imeet 56px sverhu pod knopku zakrytiya, tuda i vstaet, ne perekryvaya dosku) */
    .aya-game-fs-host .aya-game-backgammon .aya-game-title,
    .aya-game-fs-host .aya-game-longnard .aya-game-title {
        position: absolute; top: -32px; left: 4px; margin: 0; padding: 0;
        font-size: 15px; opacity: .8;
    }
    /* LEVAYA kolonka: doska, razmer ot vysoty ekrana (obe nardy: .bg-wrap i .bg-wrap-long) */
    .aya-game-fs-host .aya-game-backgammon .bg-wrap,
    .aya-game-fs-host .aya-game-longnard .bg-wrap {
        flex: 0 0 auto; margin: 0;
        width: min(calc(166vh - 160px), 72vw, 920px); max-width: none;
    }
    /* PRAVAYA kolonka: kubiki + status + upravlenie vertikalno, po centru ostavshejsya shiriny */
    .aya-game-fs-host .bg-side {
        flex: 1 1 auto; min-width: 140px; max-width: 300px; align-self: stretch;
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    }
    /* kubiki vne .bg-wrap (cqw tut = vyuport) — fiksiruem priyatnyj krupnyj razmer v px */
    .aya-game-fs-host .bg-side .bg-die { width: 46px; height: 46px; font-size: 24px; }
    .aya-game-fs-host .bg-side .aya-game-status { font-size: 14px; }
    .aya-game-fs-host .bg-side .aya-game-controls { flex-direction: column; align-items: stretch; width: 100%; max-width: 190px; }
}
/* Polnoekrannyj morskoj boj: polya krupnee i centrirovany (sb-wrap uzhe justify-center).
   V portrete dva polya stopkoj po ~88vw; v landscape ryadom (2 polya vpisyvayutsya po vysote). */
.aya-game-fs-host .sb-grid { width: min(400px, 88vw, 46vh); }
.aya-game-fs-host .sb-wrap { gap: 18px; align-items: center; align-content: center; }
@media (orientation: landscape) {
    .aya-game-fs-host .sb-grid { width: min(440px, 44vw, 82vh); }
}
/* Na ves' ekran kletki bol'she — markery vystrelov tozhe krupnee */
.aya-game-fs-host .sb-miss { font-size: 30px; }
.aya-game-fs-host .sb-hit, .aya-game-fs-host .sb-sunk, .aya-game-fs-host .sb-ship-hit { font-size: 28px; }

/* ===== TYOMNAYA TEMA ===== */
body.dark-theme .aya-game { background: var(--bubble-other, #2D333B); box-shadow: 0 2px 10px rgba(0,0,0,.3); }
body.dark-theme .ttt-cell { background: rgba(255,255,255,.06); }
body.dark-theme .sbc { background: #1f262d; }
body.dark-theme .sb-ship { background: #3d6f9a; }
body.dark-theme .ch-light { background: #c9a97a; }
body.dark-theme .ch-dark { background: #6d4a29; }
body.dark-theme .cs-light { background: #c9a97a; }
body.dark-theme .cs-dark { background: #6d4a29; }
body.dark-theme .rv-board { background: #1a5c37; border-color: #0f3d24; }
body.dark-theme .rv-b2 { background: #d8d8d8; }
body.dark-theme .c4-disc-0 { background: #161d27; }
body.dark-theme .c4-board { background: #24528f; }
body.dark-theme .bg-wrap {
    background:
        repeating-linear-gradient(92deg, rgba(255,214,160,.04) 0 3px, rgba(0,0,0,0) 3px 8px, rgba(0,0,0,.1) 8px 11px, rgba(0,0,0,0) 11px 17px),
        linear-gradient(160deg, #452a12, #35200c 55%, #2a1808);
    border-color: #1e1105;
    box-shadow: inset 0 1px 0 rgba(255,206,150,.08), inset 0 0 10px rgba(0,0,0,.5), 0 4px 14px rgba(0,0,0,.4);
}
body.dark-theme .bg-half { background: linear-gradient(180deg, #543018, #472613); box-shadow: inset 0 0 12px rgba(0,0,0,.55); }
body.dark-theme .bg-pt-a { --pt1: #cfa872; --pt2: #a67c46; }
body.dark-theme .bg-pt-b { --pt1: #8a4a20; --pt2: #613111; }
body.dark-theme .bg-bar { background: linear-gradient(90deg, #1e1105, #3a2110 28%, #472a14 50%, #3a2110 72%, #1a0e04); }
body.dark-theme .bg-die { --pip: #211505; --face: linear-gradient(145deg, #efe8d6, #d5c9ae); box-shadow: inset 0 1px 1px rgba(255,255,255,.6), inset 0 -2px 3px rgba(60,42,20,.4), 0 2px 5px rgba(0,0,0,.5); }
body.dark-theme .bg-count-1 { background: #efe8d6; }
body.dark-theme .cities-field { background: #1f262d; }
body.dark-theme .aya-gfield { background: #1f262d; }
/* dots */
body.dark-theme .dots-board { background: rgba(255,255,255,.05); }
body.dark-theme .dots-dot i { background: #8b949e; }
body.dark-theme .dots-e i { background: rgba(255,255,255,.1); }
body.dark-theme .dots-board.can-tap .dots-e:not(.dots-on) i { background: rgba(255,255,255,.18); }
body.dark-theme .dots-e.dots-p1 i { background: #38b6c9; }
body.dark-theme .dots-e.dots-p2 i { background: var(--accent, #ff8c42); }
body.dark-theme .dots-tag-p1 { background: rgba(56,182,201,.16); color: #6fd3e2; }
body.dark-theme .dots-tag-p2 { background: rgba(255,140,66,.2); color: #ffb07e; }
body.dark-theme .dots-box.dots-bp1 { background: rgba(56,182,201,.22); color: #6fd3e2; }
body.dark-theme .dots-box.dots-bp2 { background: rgba(255,140,66,.26); color: #ffb07e; }
/* duoq / dateroulette / story / whomore / yesno */
body.dark-theme .duoq-q { background: linear-gradient(135deg, rgba(56,182,201,.12), rgba(255,140,66,.12)); }
/* duoq-otvety naследуют var(--text-secondary) — otdelnyh dark-pravil ne nuzhno */
body.dark-theme .dr-card { background: linear-gradient(135deg, rgba(255,140,66,.16), rgba(233,74,111,.16)); border-color: rgba(255,140,66,.4); }
body.dark-theme .story-item { background: rgba(255,255,255,.06); }
body.dark-theme .story-author { color: #6fd3e2; }
body.dark-theme .story-final { background: linear-gradient(160deg, rgba(56,182,201,.1), rgba(255,140,66,.1)); }
body.dark-theme .wm-bar { background: rgba(255,255,255,.08); }
body.dark-theme .wm-bar i { background: linear-gradient(90deg, #38b6c9, var(--accent, #ff8c42)); }
body.dark-theme .wm-line { color: #6fd3e2; }
body.dark-theme .yn-scenario { background: linear-gradient(150deg, rgba(122,92,200,.16), rgba(56,182,201,.1)); }
body.dark-theme .yn-qa { background: rgba(255,255,255,.06); }
body.dark-theme .yn-qa-who { color: #6fd3e2; }
body.dark-theme .yn-ans { background: rgba(255,255,255,.1); }
body.dark-theme .yn-ans.yn-a-yes { background: #204a2a; color: #d6f0dc; }
body.dark-theme .yn-ans.yn-a-no { background: #4a201a; color: #f7d9d2; }
body.dark-theme .yn-ans.yn-a-guess { background: rgba(255,213,74,.2); color: #ffd54a; }
body.dark-theme .yn-solution { background: rgba(46,158,80,.16); }
body.dark-theme .quiz-opt.correct { background: #204a2a; color: #d6f0dc; }
body.dark-theme .quiz-opt.wrong { background: #4a201a; color: #f7d9d2; }
body.dark-theme .aya-game-modal { background: #161D27; }
body.dark-theme .aya-game-pick { background: #222b35; }
body.dark-theme .aya-game-fs-ov { background: var(--bg, #0f141a); }
body.dark-theme .aya-game-fs-close { background: rgba(255,255,255,.12); color: #fff; }

/* Plavnoe poyavlenie doski posle asinhronnoj podgruzki (bez rezkogo swap-miganiya). */
.aya-game-loading{ display:flex; align-items:center; justify-content:center; font-size:34px; opacity:.5; }
@keyframes ayaGameFade{ from{ opacity:0 } to{ opacity:1 } }
.aya-game-fadein{ animation: ayaGameFade .22s ease both; }

/* ===== Единая страница игр (турнирные + аркады + учёба) ===== */
.aya-game-modal-all{ max-height:86vh; display:flex; flex-direction:column; }
.aya-game-modal-all .aya-game-modal-title{ position:relative; }
.aya-game-lb{ position:absolute; right:4px; top:50%; transform:translateY(-50%); border:none; background:transparent; font-size:22px; line-height:1; cursor:pointer; }
.aya-game-modal-scroll{ overflow-y:auto; -webkit-overflow-scrolling:touch; }
/* Zametnaya knopka «Рейтинг друзей» vverhu menyu igr */
.aya-game-lb-banner{ display:flex; align-items:center; justify-content:space-between; width:100%; margin:2px 0 6px;
  padding:14px 16px; border:none; border-radius:16px; cursor:pointer; -webkit-tap-highlight-color:transparent;
  background:linear-gradient(135deg,#ff8c42,#ff6f3c); color:#fff; font-size:16px; font-weight:800;
  box-shadow:0 4px 14px rgba(255,111,60,.34); }
.aya-game-lb-banner:active{ transform:scale(.98); }
.aya-game-lb-banner .lb-arrow{ font-size:22px; opacity:.9; }
.aya-game-sect{ font-size:12.5px; font-weight:800; color:var(--text-secondary,#8894a0); text-transform:uppercase; letter-spacing:.03em; margin:14px 2px 8px; }
.aya-game-sect:first-child{ margin-top:2px; }
.ap-2p{ font-size:11px; font-weight:700; color:#fff; background:#0e7e89; border-radius:10px; padding:2px 7px; margin-left:6px; }
