@font-face { font-family: Oswald; font-weight: 700; font-display: swap; src: url(assets/fonts/oswald-cyrillic-700.woff2) format('woff2'); unicode-range: U+0400-04FF; }
@font-face { font-family: Oswald; font-weight: 700; font-display: swap; src: url(assets/fonts/oswald-latin-700.woff2) format('woff2'); }
@font-face { font-family: Onest; font-weight: 500; font-display: swap; src: url(assets/fonts/onest-cyrillic-500.woff2) format('woff2'); unicode-range: U+0400-04FF; }
@font-face { font-family: Onest; font-weight: 500; font-display: swap; src: url(assets/fonts/onest-latin-500.woff2) format('woff2'); }
@font-face { font-family: Onest; font-weight: 700; font-display: swap; src: url(assets/fonts/onest-cyrillic-700.woff2) format('woff2'); unicode-range: U+0400-04FF; }
@font-face { font-family: Onest; font-weight: 700; font-display: swap; src: url(assets/fonts/onest-latin-700.woff2) format('woff2'); }

/* та же гамма, что у стола нард: синий клуба, красный акцент */
:root {
  --navy: #0b2140; --navy-2: #163a6b; --red: #e8192c; --red-deep: #c90f22; --bg: #e8eef5; --card: #ffffff;
  --muted: #5b6b82; --line: #d4dde8; --good: #1f8a4c; --warn: #b07a00; --gold: #ffb300;
  --sq-light: #e3ebf4; --sq-dark: #5f86b3; --frame: #0b2140;
  color-scheme: only light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--navy); font: 500 15px/1.4 Onest, system-ui, sans-serif; overscroll-behavior: none; }
body { display: flex; flex-direction: column; height: 100dvh; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; }
a { color: inherit; }

/* шапка */
.top { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--card); border-bottom: 1px solid var(--line); min-height: 56px; }
.brand img { height: 28px; display: block; }
.title { font: 700 16px/1 Oswald, sans-serif; letter-spacing: .04em; text-transform: uppercase; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title small { display: block; font: 500 11px Onest, sans-serif; letter-spacing: 0; text-transform: none; color: var(--muted); margin-top: 3px; }
.spacer { flex: 1; }
.icon-btn { flex: none; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--navy); font: 700 14px Onest, sans-serif; cursor: pointer; display: grid; place-items: center; text-decoration: none; }
.icon-btn.ico { font-size: 20px; padding: 0; }
.icon-btn[hidden] { display: none; }

.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.screen[hidden] { display: none; }
.scroll { flex: 1; overflow: auto; padding: 14px 14px 24px; -webkit-overflow-scrolling: touch; }
.wrap { max-width: 640px; margin: 0 auto; }

/* главный экран */
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 22px 20px; color: #fff; background:
  repeating-conic-gradient(rgba(255,255,255,.05) 0 25%, transparent 0 50%) 0 0 / 44px 44px,
  linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); box-shadow: 0 12px 30px rgba(11,33,64,.25); }
.hero h1 { margin: 0; font: 700 34px/1 Oswald, sans-serif; text-transform: uppercase; letter-spacing: .02em; }
.hero p { margin: 8px 0 0; max-width: 62%; color: #c9d6ea; font-size: 14px; }
.hero .knight { position: absolute; right: -6px; bottom: -10px; width: 46%; max-width: 190px; aspect-ratio: 1; background: center / contain no-repeat; filter: drop-shadow(0 10px 18px rgba(0,0,0,.35)); }
.hero .tag { display: inline-block; margin-bottom: 10px; padding: 4px 10px; border-radius: 999px; background: var(--red); font: 700 11px Onest, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stat { background: var(--card); border-radius: 14px; padding: 10px 12px; }
.stat b { display: block; font: 700 22px/1.1 Oswald, sans-serif; }
.stat span { color: var(--muted); font-size: 12px; }
.stat.fire b { color: var(--red); }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 128px; padding: 14px; border-radius: 18px; border: 0; background: var(--card); text-align: left; cursor: pointer; box-shadow: 0 2px 0 var(--line); transition: transform .1s; overflow: hidden; }
.mode:active { transform: scale(.98); }
.mode i { width: 46px; height: 46px; border-radius: 12px; background: var(--bg) center / 80% no-repeat; margin-bottom: 4px; }
.mode b { font: 700 17px/1.15 Oswald, sans-serif; text-transform: uppercase; }
.mode span { color: var(--muted); font-size: 13px; line-height: 1.3; }
.mode.accent { background: linear-gradient(180deg, #f2283a, var(--red) 55%, var(--red-deep)); color: #fff; box-shadow: 0 8px 18px rgba(232,25,44,.25); }
.mode.accent span { color: #ffe1e4; }
.mode.accent i { background-color: rgba(255,255,255,.18); }
.mode.wide { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; gap: 12px; }
.mode.wide i { flex: none; margin: 0; }
.mode.wide div { display: flex; flex-direction: column; gap: 2px; }
.mode.navy { background: linear-gradient(180deg, #16355f, var(--navy)); color: #fff; }
.mode.navy span { color: #c9d6ea; }
.mode.navy i { background-color: rgba(255,255,255,.14); }
.prof { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--card); margin-bottom: 4px; }
.prof i { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--bg) center / 78% no-repeat; }
.prof b { display: block; font: 700 17px Onest, sans-serif; }
.prof span { color: var(--muted); font-size: 13px; }
.card.flat { box-shadow: none; margin: 8px auto 0; }
.big.spin { animation: hop 1.2s ease-in-out infinite; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px) rotate(-6deg); } }
.game-row { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 6px; padding: 10px 12px; border-radius: 14px; border: 0; background: var(--card); text-align: left; cursor: pointer; font: inherit; color: inherit; }
.game-row .res { flex: none; width: 74px; padding: 3px 0; border-radius: 999px; text-align: center; font: 700 12px Onest, sans-serif; color: #fff; background: var(--muted); }
.game-row .res.win { background: var(--good); }
.game-row .res.loss { background: var(--red); }
.game-row div { flex: 1; min-width: 0; }
.game-row b { display: block; font: 700 14px Onest, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-row span { color: var(--muted); font-size: 12px; }
.game-row em { flex: none; font: 700 13px Onest, sans-serif; font-style: normal; color: var(--muted); }
.game-row em.up { color: var(--good); }
.game-row em.down { color: var(--red); }
.mode .badge { position: absolute; top: 10px; right: 10px; padding: 2px 8px; border-radius: 999px; background: var(--navy); color: #fff; font: 700 11px Onest, sans-serif; }
.resume { display: flex; align-items: center; gap: 12px; width: 100%; margin: 12px 0 0; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--navy); background: #fff; cursor: pointer; text-align: left; }
.resume[hidden], .btn[hidden], .sticky-go[hidden] { display: none; }
.resume i { width: 38px; height: 38px; background: center / contain no-repeat; }
.resume b { display: block; font: 700 15px Onest, sans-serif; }
.resume span { color: var(--muted); font-size: 13px; }
.club { margin-top: 14px; padding: 14px; border-radius: 16px; background: var(--card); font-size: 14px; }
.club b { display: block; font: 700 15px Oswald, sans-serif; text-transform: uppercase; margin-bottom: 4px; }
.club span { color: var(--muted); }
.club a { color: var(--red); font-weight: 700; text-decoration: none; }

/* настройка партии */
.h { margin: 18px 0 8px; font: 700 13px Onest, sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.h:first-child { margin-top: 4px; }
.pick { display: grid; gap: 8px; }
.pick.cols3 { grid-template-columns: repeat(3, 1fr); }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 2px solid transparent; background: var(--card); cursor: pointer; text-align: left; }
.opt.on { border-color: var(--navy); box-shadow: 0 6px 16px rgba(11,33,64,.12); }
.opt i { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--bg) center / 80% no-repeat; }
.opt b { display: block; font: 700 15px Onest, sans-serif; }
.opt span { display: block; color: var(--muted); font-size: 13px; line-height: 1.3; }
.cols3 .opt { flex-direction: column; justify-content: center; text-align: center; gap: 4px; padding: 10px 6px; }
.opt .dots { font-style: normal; color: var(--gold); letter-spacing: 1px; font-size: 13px; margin-left: 4px; }
.opt .dots s { color: var(--line); text-decoration: none; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--card); }
.switch b { display: block; font: 700 15px Onest, sans-serif; }
.switch span { display: block; color: var(--muted); font-size: 13px; }
.switch input { flex: none; width: 46px; height: 26px; appearance: none; border-radius: 13px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; }
.switch input::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked { background: var(--good); }
.switch input:checked::after { transform: translateX(20px); }
.sticky-go { flex: none; padding: 10px 14px 14px; background: linear-gradient(transparent, var(--bg) 30%); }
.sticky-go .btn { width: 100%; max-width: 640px; margin: 0 auto; display: grid; }

/* кнопки */
.btn { height: 48px; padding: 0 16px; white-space: nowrap; border-radius: 12px; border: 0; font: 700 15px Onest, sans-serif; cursor: pointer; transition: transform .08s, opacity .15s; text-decoration: none; display: inline-grid; place-items: center; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; cursor: default; transform: none; }
.btn-primary { background: linear-gradient(180deg, #f2283a, var(--red) 55%, var(--red-deep)); color: #fff; box-shadow: 0 6px 16px rgba(232,25,44,.25); }
.btn-ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn-navy { background: var(--navy); color: #fff; }

/* стол: игроки, доска, ходы, кнопки */
.table { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pl { display: flex; align-items: center; gap: 10px; padding: 6px 12px; min-height: 52px; }
.pl .ava { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--card) center / 80% no-repeat; border: 2px solid transparent; transition: border-color .2s; }
.pl.is-turn .ava { border-color: var(--red); }
.pl .who { min-width: 0; flex: 1; }
.pl .who b { font: 700 14px Onest, sans-serif; }
.pl .who .sub { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; min-height: 18px; }
.caps { display: flex; align-items: center; }
.caps i { width: 16px; height: 16px; margin-right: -5px; background: center / contain no-repeat; }
.caps em { font-style: normal; margin-left: 9px; font-weight: 700; color: var(--navy); }
.think { color: var(--red); font-weight: 700; }
.clk { flex: none; min-width: 74px; padding: 6px 10px; border-radius: 10px; background: var(--card); color: var(--navy); text-align: center; font: 700 18px/1.1 'Courier New', monospace; font-variant-numeric: tabular-nums; }
.clk[hidden] { display: none; }
.clk.run { background: var(--navy); color: #fff; }
.clk.low { background: var(--red); color: #fff; }
.stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 10px; container-type: size; }
.stage .cb { width: min(100cqw, 100cqh); }
.coach { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); z-index: 6; max-width: calc(100% - 28px); padding: 8px 14px; border-radius: 14px; border: 0; font: 500 13px/1.3 Onest, sans-serif; color: #fff; cursor: pointer; box-shadow: 0 6px 18px rgba(11,33,64,.3); animation: drop .2s ease-out; text-align: left; }
.coach[hidden] { display: none; }
.coach b { font-weight: 700; margin-right: 4px; }
.coach.best, .coach.good { background: var(--good); } .coach.inaccuracy { background: var(--warn); } .coach.mistake, .coach.blunder { background: var(--red-deep); }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -8px); } }
.moves { flex: none; padding: 4px 12px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow-x: auto; min-height: 26px; scrollbar-width: none; }
.moves::-webkit-scrollbar { display: none; }
.moves b { color: var(--navy); }
.moves .cur { background: var(--navy); color: #fff; border-radius: 6px; padding: 1px 4px; }
.controls { flex: none; display: flex; gap: 8px; padding: 6px 12px 12px; justify-content: center; }
.controls .btn { flex: 1; max-width: 160px; padding: 0 8px; font-size: 14px; }

/* доска */
.cb { position: relative; aspect-ratio: 1; border: 6px solid var(--frame); border-radius: 8px; box-shadow: 0 10px 30px rgba(11,33,64,.25); touch-action: none; container-type: inline-size; overflow: hidden; }
.cb-grid { position: absolute; inset: 0; display: grid; grid-template: repeat(8, 1fr) / repeat(8, 1fr); }
.cb-sq { position: relative; }
.cb-sq.l { background-color: var(--sq-light); } .cb-sq.d { background-color: var(--sq-dark); }
.cb-sq[data-rank]::before, .cb-sq[data-file]::after { position: absolute; font: 700 2.6cqw/1 Onest, sans-serif; opacity: .85; pointer-events: none; }
.cb-sq[data-rank]::before { content: attr(data-rank); left: 3%; top: 4%; }
.cb-sq[data-file]::after { content: attr(data-file); right: 5%; bottom: 3%; }
.cb-sq.l::before, .cb-sq.l::after { color: var(--sq-dark); } .cb-sq.d::before, .cb-sq.d::after { color: var(--sq-light); }
.cb-sq.last { background-image: linear-gradient(rgba(255,196,0,.38), rgba(255,196,0,.38)); }
.cb-sq.sel { background-image: linear-gradient(rgba(31,138,76,.45), rgba(31,138,76,.45)); }
.cb-sq.check { background-image: radial-gradient(circle, rgba(232,25,44,.95) 0, rgba(232,25,44,.6) 40%, transparent 72%); }
.cb-sq.dest { background-image: radial-gradient(circle, rgba(11,33,64,.38) 0 18%, transparent 19%); }
.cb-sq.capture { background-image: radial-gradient(circle, transparent 0 62%, rgba(11,33,64,.38) 63%); }
.cb-sq.hint { box-shadow: inset 0 0 0 4px var(--gold); animation: hint 1s ease-in-out infinite; }
.cb-sq.good { background-image: linear-gradient(rgba(31,138,76,.65), rgba(31,138,76,.65)); }
.cb-sq.bad { background-image: linear-gradient(rgba(232,25,44,.6), rgba(232,25,44,.6)); }
@keyframes hint { 50% { box-shadow: inset 0 0 0 7px var(--gold); } }
.cb-sq.star { display: grid; place-items: center; }
.cb-sq.star > i { font: 8cqw/1 sans-serif; color: var(--gold); text-shadow: 0 1px 2px rgba(0,0,0,.35); font-style: normal; animation: pop .25s ease-out; }
.cb-pieces { position: absolute; inset: 0; pointer-events: none; }
.cb-piece { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; background: center / 92% no-repeat; transition: transform .2s ease; will-change: transform; }
.cb-piece.dragging { transition: none; z-index: 3; filter: drop-shadow(0 6px 8px rgba(0,0,0,.35)); }
.cb-arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.cb-shade { position: absolute; inset: 0; background: rgba(11,33,64,.45); z-index: 4; }
.cb-promo { position: absolute; width: 12.5%; display: flex; flex-direction: column; z-index: 5; background: #fff; border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.cb-promo button { aspect-ratio: 1; border: 0; background: #fff center / 90% no-repeat; cursor: pointer; }
.cb-promo button:active { background-color: var(--sq-light); }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
.cb.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* уроки и задачи: списки */
.lesson-card { display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 8px; padding: 12px 14px; border-radius: 16px; border: 0; background: var(--card); cursor: pointer; text-align: left; }
.lesson-card i { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--bg) center / 78% no-repeat; }
.lesson-card .n { flex: none; width: 26px; color: var(--muted); font: 700 15px Oswald, sans-serif; text-align: center; }
.lesson-card div { flex: 1; min-width: 0; }
.lesson-card b { display: block; font: 700 15px Onest, sans-serif; }
.lesson-card span { color: var(--muted); font-size: 13px; }
.lesson-card .st { flex: none; color: var(--gold); font-size: 15px; letter-spacing: -1px; }
.lesson-card .st.no { color: var(--line); }
.lesson-card.done i { box-shadow: inset 0 0 0 2px var(--good); }
.lesson-card.next { box-shadow: 0 0 0 2px var(--red); }
.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 6px 0 14px; }
.bar i { display: block; height: 100%; background: var(--good); border-radius: 4px; transition: width .3s; }
.set { margin-bottom: 14px; padding: 14px; border-radius: 18px; background: var(--card); }
.set-head { display: flex; align-items: center; gap: 12px; }
.set-head i { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--bg) center / 78% no-repeat; }
.set-head b { display: block; font: 700 18px/1.15 Oswald, sans-serif; text-transform: uppercase; }
.set-head span { color: var(--muted); font-size: 13px; }
.set .bar { margin: 10px 0; }
.set-row { display: flex; gap: 8px; }
.set-row .btn { flex: 1; height: 42px; font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; margin-top: 10px; }
.tile { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; display: grid; place-items: center; font: 700 13px Onest, sans-serif; color: var(--navy); }
.tile.done { background: #e4f3ea; border-color: var(--good); color: var(--good); }
.tile.fail { background: #fde8ea; border-color: var(--red); color: var(--red-deep); }

/* шаг урока / задача */
.task-head { flex: none; padding: 10px 14px 4px; text-align: center; }
.task-head .steps { display: flex; justify-content: center; gap: 5px; margin-bottom: 8px; }
.task-head .steps i { width: 22px; height: 5px; border-radius: 3px; background: var(--line); }
.task-head .steps i.on { background: var(--good); }
.task-head .steps i.cur { background: var(--navy); }
.task-head b { display: block; font: 700 17px/1.2 Oswald, sans-serif; text-transform: uppercase; }
.task-head p { margin: 4px auto 0; max-width: 520px; color: var(--navy); font-size: 15px; line-height: 1.4; min-height: 42px; }
.status { flex: none; text-align: center; font: 700 15px Onest, sans-serif; min-height: 26px; padding: 4px 12px; }
.status.good { color: var(--good); } .status.bad { color: var(--red-deep); } .status.info { color: var(--muted); font-weight: 500; }

/* окна */
.modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(11,33,64,.4); z-index: 30; padding: 16px; animation: fade .2s; }
.modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.card { background: #fff; border-radius: 20px; padding: 22px 20px; width: min(380px, 100%); text-align: center; box-shadow: 0 20px 60px rgba(11,33,64,.3); max-height: 100%; overflow: auto; }
.card .big { width: 72px; height: 72px; margin: 0 auto 6px; background: center / contain no-repeat; }
.card h2 { margin: 0 0 6px; font: 700 26px/1.15 Oswald, sans-serif; text-transform: uppercase; }
.card p { margin: 0 0 14px; color: var(--muted); }
.card .stars { font-size: 34px; color: var(--gold); letter-spacing: 2px; margin: 4px 0 8px; }
.card .stars s { color: var(--line); text-decoration: none; }
.card .row { display: flex; gap: 8px; }
.card .row .btn { flex: 1; }
.card .col { display: grid; gap: 8px; }
.modal.win h2 { color: var(--red); }
.review { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 0 0 14px; }
.review div { padding: 8px 2px; border-radius: 10px; background: var(--bg); }
.review b { display: block; font: 700 20px Oswald, sans-serif; }
.review span { font-size: 10px; color: var(--muted); line-height: 1.1; display: block; }
.review .g-best b, .review .g-good b { color: var(--good); } .review .g-inaccuracy b { color: var(--warn); } .review .g-mistake b, .review .g-blunder b { color: var(--red-deep); }
.sheet { position: fixed; inset: 0; z-index: 25; background: rgba(11,33,64,.35); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-body { background: #fff; width: min(480px, 100%); max-height: 100%; overflow: auto; border-radius: 20px 20px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
.sheet-body .btn { width: 100%; margin-top: 8px; }
.coach u { text-decoration: underline; font-weight: 700; white-space: nowrap; }
/* окно «Почему?»: доска над ним остаётся видна */
.why-sheet { background: rgba(11,33,64,.12); }
.table.why-on > .side > * { display: none; }
.table.why-on > .stage { flex: 0 0 min(100vw, 58vh); margin-top: 6px; }
.sheet-body.why { max-height: 58vh; padding-top: 12px; box-shadow: 0 -8px 30px rgba(11,33,64,.25); }
.why-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.why-head b { font: 700 16px Onest, sans-serif; }
.pill { padding: 3px 10px; border-radius: 999px; color: #fff; font: 700 12px Onest, sans-serif; background: var(--warn); }
.pill.mistake, .pill.blunder { background: var(--red-deep); }
.why-sec { display: flex; gap: 10px; padding: 8px 12px; border-radius: 14px; margin-bottom: 6px; background: var(--card); }
.why-sec i { flex: none; width: 24px; font-style: normal; font-size: 17px; line-height: 1.3; text-align: center; }
.why-sec b { display: block; font: 700 13px Onest, sans-serif; text-transform: uppercase; letter-spacing: .02em; margin-bottom: 2px; }
.why-sec p { margin: 0; font-size: 14px; line-height: 1.38; }
.why-sec.good i, .why-sec.good b { color: var(--good); }
.why-sec.bad i, .why-sec.bad b { color: var(--red-deep); }
.why-sec.rule { background: #fff6dc; }
.why-sec.rule b { color: #8a5d00; }
.why-legend { margin: 4px 0 0; font-size: 12px; }
.sheet-body.why #why-close { position: sticky; bottom: 0; box-shadow: 0 -10px 14px #fff; }
.lg { display: inline-block; width: 18px; height: 5px; border-radius: 3px; vertical-align: middle; margin-left: 4px; }
.lg.good { background: #1f8a4c; } .lg.bad { background: #e8192c; } .lg.info { background: #1e5fbf; }
.note { font-size: 12px; color: var(--muted); margin-top: 12px; text-align: center; }
.link-box { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; font: 500 13px Onest, sans-serif; margin: 6px 0 4px; color: var(--navy); background: var(--bg); user-select: all; -webkit-user-select: all; word-break: break-all; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: drop .2s; max-width: calc(100% - 32px); }
.toast[hidden] { display: none; }

/* телефон вертикально: панель «растворяется», её части встают вокруг доски по order */
.table > .side { display: contents; }
.table > .stage { order: 2; flex: 0 1 100vw; }
/* игроки прижаты к доске, свободное место — над ними и над кнопками */
.table > .side > .o1 { margin-top: auto; }
.table > .side > .o5 { margin-top: auto; }
.o1 { order: 1; } .o3 { order: 3; } .o4 { order: 4; } .o5 { order: 5; }

/* горизонтальный телефон и широкий экран: доска слева, панель справа */
@media (orientation: landscape) and (max-height: 600px), (min-width: 900px) {
  .table { flex-direction: row; }
  .table > .stage { order: 1; width: 60%; height: 100%; flex: none; padding: 8px; }
  .table > .side > .o1, .table > .side > .o5 { margin-top: 0; }
  .table > .side { order: 2; flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: center; background: var(--card); border-left: 1px solid var(--line); }
  .side .pl .ava, .side .clk { background-color: var(--bg); }
  .side .controls { flex-wrap: wrap; }
  .side .controls .btn { max-width: none; flex: 1 1 40%; }
  .task-head p { min-height: 0; }
}
