/* The "Игры" section: the list of games, the sudoku board and the ratings. Colours come from the variables of the app (style.css). */

.game-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; border: 0; color: inherit; text-align: left; cursor: pointer; transition: transform 140ms ease, background-color 140ms ease; }
.game-card:active { transform: scale(.985); }
.game-art { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.game-icon { width: 28px; height: 28px; }
.game-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.game-body strong { font-size: 18px; }
.game-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.game-facts .chip { margin: 0; }
.game-go { flex: none; font-size: 26px; color: var(--hint); }
.game-main { padding: 20px 16px; }
.game-main .game-body strong { font-size: 24px; }
.game-earn-title { margin: 28px 0 8px; font-size: 20px; color: var(--text); text-transform: none; letter-spacing: normal; }
.game-rewards { margin: 12px 0; font-size: 14px; color: var(--text); }
.game-rewards summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-weight: 650; }
.game-rewards p { margin: 8px 0; }
.game-rewards ul { padding-left: 20px; }
.game-rewards li { margin: 8px 0; }
.game-reward-history { list-style: none; padding: 0 !important; }
.game-reward-history li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; }
.game-reward-history strong { font-variant-numeric: tabular-nums; }
.game-card:focus-visible, .game-rewards summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.seg { display: flex; gap: 4px; margin: 12px 0; padding: 4px; border-radius: 14px; background: var(--card); }
.seg-item { flex: 1; min-height: 38px; border: 0; border-radius: 10px; background: none; color: var(--hint); font-size: 15px; font-weight: 600; cursor: pointer; transition: background-color 160ms ease, color 160ms ease; }
.seg-item.on { background: var(--bg); color: var(--text); box-shadow: 0 1px 4px color-mix(in srgb, var(--text) 14%, transparent); }

.sudoku-level { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 16px; border: 0; color: inherit; text-align: left; cursor: pointer; transition: transform 140ms ease; }
.sudoku-level:active:not(:disabled) { transform: scale(.985); }
.sudoku-level:disabled { cursor: default; }
.sudoku-level.solved { opacity: .8; }
.level-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.level-body strong { font-size: 17px; }
.sudoku-level .chip { margin: 0; flex: none; }
.chip.accent { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.practice { padding: 14px 16px; border-radius: var(--radius); border: 1.5px dashed var(--line); }
.practice p { margin: 4px 0 10px; }
.practice .actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Dimkashooter: the address of the game, large enough to be read from the phone and typed on a computer */
.shooter-open { margin: 12px 0; }
.shooter-address { margin: 2px 0 6px !important; font-size: 20px; font-weight: 700; word-break: break-all; user-select: all; -webkit-user-select: all; }

.rank-block { margin: 14px 0; }
.rank-block h3 { margin: 0 0 6px; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--hint); }
.rank-list { border-radius: var(--radius); background: var(--card); overflow: hidden; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.rank-row + .rank-row { border-top: 1px solid var(--line); }
.rank-row.me { background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 600; }
.rank-place { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--hint); }
.rank-place.p1 { background: #f2c14e; color: #3b2a00; }
.rank-place.p2 { background: #c3cad3; color: #26303b; }
.rank-place.p3 { background: #d79a68; color: #3d2208; }
.rank-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-score { flex: none; font-size: 14px; color: var(--hint); font-variant-numeric: tabular-nums; }
.rank-row.me .rank-score { color: inherit; }
.rank-gap { padding: 2px 14px; color: var(--hint); letter-spacing: .3em; }

.sudoku-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 6px; }
.sudoku-top .back { margin: 0 auto 0 0; }
.sudoku-top .chip { margin: 0; }
.sudoku-level-name { font-weight: 600; }
.sudoku-time { min-width: 52px; text-align: right; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

.sudoku-wrap { width: min(100%, 460px); margin: 8px auto 12px; }
.sudoku-board { display: grid; grid-template-columns: repeat(9, 1fr); grid-template-rows: repeat(9, 1fr); aspect-ratio: 1; border: 2px solid var(--text); border-radius: 12px; overflow: hidden; background: var(--bg); user-select: none; -webkit-user-select: none; }
.cell { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 0; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; background: none; color: var(--accent); font-size: clamp(18px, 6.2vw, 29px); font-weight: 500; font-variant-numeric: tabular-nums; cursor: pointer; transition: background-color 90ms ease; }
.cell.bx { border-right: 2px solid var(--text); }
.cell.by { border-bottom: 2px solid var(--text); }
.cell:nth-child(9n) { border-right: 0; }
.cell:nth-child(n+73) { border-bottom: 0; }
.cell.given { color: var(--text); font-weight: 700; }
.cell.peer { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.cell.same { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.cell.sel { background: color-mix(in srgb, var(--accent) 38%, transparent); }
.cell.bad, .cell.wrong { color: var(--danger); background: color-mix(in srgb, var(--danger) 18%, transparent); }
.cell.wrong { animation: cell-shake 320ms ease; }
.cell.dead { box-shadow: inset 0 0 0 2px var(--danger); }
.sudoku-dead { width: min(100%, 460px); margin: 10px auto 0; text-align: center; }
.sudoku-dead[hidden] { display: none; }
.cell:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; }
.notes { position: absolute; inset: 1px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); place-items: center; font-size: clamp(7px, 2.3vw, 11px); font-weight: 600; line-height: 1; color: var(--hint); }
.notes i { font-style: normal; }
@keyframes cell-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

.sudoku-pad { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; width: min(100%, 460px); margin: 0 auto 10px; }
.pad-digit { position: relative; display: grid; place-items: center; aspect-ratio: 3 / 4; padding: 0; border: 0; border-radius: 12px; background: var(--card); color: var(--text); font-size: clamp(20px, 6.4vw, 28px); font-weight: 600; cursor: pointer; transition: transform 100ms ease, opacity 140ms ease; }
.pad-digit:active:not(:disabled) { transform: scale(.92); }
.pad-digit:disabled { opacity: .3; cursor: default; }
.pad-digit small { position: absolute; right: 5px; bottom: 3px; font-size: 10px; font-weight: 500; color: var(--hint); }
.sudoku-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: min(100%, 460px); margin: 0 auto; }
.tool { position: relative; min-height: 40px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 99px; background: none; color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; }
.tool:disabled { opacity: .4; cursor: default; }
.tool.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.tool small { margin-left: 6px; padding: 1px 6px; border-radius: 99px; background: color-mix(in srgb, var(--hint) 22%, transparent); font-size: 11px; }
.tool small:empty { display: none; }
.sudoku-note { text-align: center; margin: 10px 0 0; }

.sudoku-result { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 18px 20px; text-align: center; animation: result-in 320ms cubic-bezier(.2, .8, .25, 1) both; }
.result-check { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 34px; font-weight: 700; animation: result-pop 460ms cubic-bezier(.3, 1.4, .5, 1) both; }
.result-title { font-size: 24px; }
.result-score { margin: 0; font-size: 34px; font-weight: 800; color: var(--accent); }
.sudoku-result .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
@keyframes result-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes result-pop { from { transform: scale(.3); } to { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .cell, .game-card, .sudoku-level, .pad-digit, .seg-item { transition: none; }
  .cell.wrong, .sudoku-result, .result-check { animation: none; }
}

/* БИКбласт (Block Blast): a dark blue stage with glossy colourful blocks; the same look in the light and the dark theme of the app */
/* the button of Dimka would sit on top of the pieces: it is hidden while a board is on the screen (games.js sets the class on <html>). Do not make this
   selector a list with :has(): a browser that does not know :has() drops the whole rule, and then the class does nothing either. */
html.game-on .ai-launcher { display: none; }
/* BIKblast does not scroll (games.js sets the class on <html> while its board is on the screen) */
html.game-lock, html.game-lock body { overflow: hidden; overscroll-behavior: none; }
html.game-lock body { height: 100dvh; box-sizing: border-box; }

.bb { --bb-cell: 40px; --bb-gap: 3px; }
.bb-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.bb-bar-gap { flex: 1; }
.bb-bar .back { margin: 0; }
.bb-bar .btn.small { padding: 6px 10px; white-space: nowrap; }
.bb-dot { display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: #ff5a3c; vertical-align: middle; }
/* duels */
.bb-call { display: flex; gap: 8px; margin: 8px 0; }
.bb-who { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; }
.bb-duel { margin: 10px 0; }
.bb-duel .actions { margin-top: 10px; }
.bb-duel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bb-duel-state { font-size: 14px; font-weight: 700; color: var(--hint); }
.bb-duel.won .bb-duel-state { color: var(--ok); }
.bb-duel.lost .bb-duel-state { color: var(--danger); }
.bb-duel.invite .bb-duel-state, .bb-duel.play .bb-duel-state { color: var(--accent); }
.bb-duel-score { margin: 4px 0 0; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bb-stage { touch-action: none; padding: 10px 12px 12px; border-radius: 24px; color: #eef2ff; background: radial-gradient(120% 70% at 50% -10%, #3a4fb5 0%, rgba(58, 79, 181, 0) 60%), linear-gradient(170deg, #23357f 0%, #17235a 52%, #0f173f 100%); box-shadow: 0 10px 30px rgb(10 20 70 / .35), inset 0 0 0 1px rgb(150 175 255 / .16); }
.bb-top { position: relative; display: flex; align-items: center; justify-content: center; min-height: 50px; margin: 0 0 8px; }
.bb-best { position: absolute; left: 2px; top: 4px; display: flex; align-items: center; gap: 6px; padding: 5px 11px 5px 8px; border-radius: 99px; background: rgb(255 255 255 / .1); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bb-crown { width: 17px; height: 17px; fill: #ffd04d; filter: drop-shadow(0 1px 0 #b57c00); }
.bb-score { font-size: 46px; font-weight: 900; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-shadow: 0 3px 0 rgb(8 14 50 / .55), 0 0 22px rgb(130 160 255 / .45); }
.bb-score[data-digits="5"] { font-size: 40px; }
.bb-score[data-digits="6"] { font-size: 34px; }
.bb-score[data-digits="7"] { font-size: 29px; }
.bb-score[data-digits="8"] { font-size: 25px; }
.bb-best-number[data-digits="6"], .bb-best-number[data-digits="7"], .bb-best-number[data-digits="8"] { font-size: 13px; }
.bb-score.bump { animation: bb-bump 280ms ease; }
.bb-combo { position: absolute; right: 2px; top: 6px; padding: 5px 11px; border-radius: 99px; background: linear-gradient(135deg, #ff9a3c, #ff5a3c); color: #fff; font-size: 14px; font-weight: 800; box-shadow: 0 2px 10px rgb(255 110 60 / .5); animation: bb-pulse 900ms ease infinite; }
.bb-combo[hidden] { display: none; }
.bb-combo { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; text-align: center; }
.bb-combo-left { font-size: 11px; font-weight: 700; opacity: .92; white-space: nowrap; }
.bb-combo.last { background: linear-gradient(135deg, #ff5a3c, #d62f4a); }
.bb-combo.last .bb-combo-left { opacity: 1; }
.bb-wrap { position: relative; width: 100%; margin: 0 auto; }
.bb-board { display: grid; grid-template-columns: repeat(8, 1fr); grid-auto-rows: 1fr; gap: var(--bb-gap); aspect-ratio: 1; padding: 5px; border-radius: 16px; background: #0a1030; box-shadow: inset 0 0 0 2px rgb(120 150 255 / .2), 0 8px 22px rgb(0 0 20 / .4); touch-action: none; user-select: none; -webkit-user-select: none; }
.bb-wrap.ended .bb-board { filter: brightness(.5) saturate(.7); }
.bb-board.shake { animation: bb-shake 420ms ease; }
.bb-cell { position: relative; border-radius: 0; background: rgb(120 150 255 / .1); box-shadow: inset 0 0 0 1px rgb(150 175 255 / .07); }
.bb-cell.on, .bb-piece i.on { background: linear-gradient(150deg, hsl(var(--h, 210) 95% 70%) 0%, hsl(var(--h, 210) 88% 54%) 52%, hsl(var(--h, 210) 85% 44%) 100%); box-shadow: inset 0 2px 0 hsl(var(--h, 210) 100% 86% / .8), inset 2px 0 0 hsl(var(--h, 210) 100% 80% / .35), inset 0 -3px 0 hsl(var(--h, 210) 85% 30% / .75), 0 0 8px hsl(var(--h, 210) 95% 60% / .22); }
.bb-cell.on::after, .bb-piece i.on::after { content: ""; position: absolute; left: 14%; top: 12%; width: 38%; height: 26%; border-radius: 40%; background: rgb(255 255 255 / .38); transform: rotate(-18deg); }
.t0 { --h: 8; } .t1 { --h: 48; } .t2 { --h: 100; } .t3 { --h: 148; } .t4 { --h: 192; } .t5 { --h: 226; } .t6 { --h: 276; } .t7 { --h: 324; }
.bb-cell.ghost { background: hsl(var(--ghost-h, 210) 85% 62% / .5); box-shadow: inset 0 0 0 2px hsl(var(--ghost-h, 210) 100% 82% / .65); }
.bb-cell.on.ghost { background: linear-gradient(150deg, hsl(var(--h, 210) 95% 70%), hsl(var(--h, 210) 85% 44%)); }
.bb-cell.will-clear:not(.on) { background: hsl(var(--ghost-h, 210) 85% 60% / .38); box-shadow: inset 0 0 0 2px hsl(var(--ghost-h, 210) 100% 80% / .7); }
.bb-cell.on.will-clear { filter: brightness(1.35) saturate(1.15); animation: bb-glow 480ms ease infinite alternate; }
.bb-cell.pop { animation: bb-place 180ms ease-out; }
.bb-cell.clearing { z-index: 2; animation: bb-clear 360ms ease-in forwards; }
.bb-fx { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.bb-spark { position: absolute; width: var(--s, 7px); height: var(--s, 7px); margin: calc(var(--s, 7px) / -2) 0 0 calc(var(--s, 7px) / -2); border-radius: 30%; background: hsl(var(--h, 40) 100% 72%); box-shadow: 0 0 6px hsl(var(--h, 40) 100% 65%); animation: bb-spark var(--d, 600ms) ease-out forwards; }
.bb-tray { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 8px; margin: 10px 0 0; }
.bb-slot { display: grid; place-items: center; height: calc(var(--bb-cell) * 3.2 + 26px); /* the height of the tallest piece (five in a column): the tray does not change its height from round to round, so the board keeps its size */ padding: 6px; border-radius: 16px; background: rgb(255 255 255 / .05); touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; transition: transform 120ms ease, opacity 120ms ease; }
.bb-slot:active { transform: scale(1.06); }
.bb-slot.empty { background: none; cursor: default; }
.bb-slot.lifted { opacity: .25; }
.bb-slot { min-width: 0; container-type: inline-size; }
.bb-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.bb-top .bb-best { position: static; grid-row: 1; grid-column: 1; justify-self: start; min-width: 0; max-width: 100%; }
.bb-top .bb-combo { position: static; grid-row: 1; grid-column: 2; justify-self: end; max-width: 100%; }
.bb-top .bb-score { grid-row: 2; grid-column: 1 / -1; justify-self: center; max-width: 100%; font-size: clamp(18px, calc(360px / var(--bb-digits, 1)), 46px); }
.bb-bar { flex-wrap: wrap; }
.bb-best-number { min-width: 0; overflow-wrap: anywhere; font-size: clamp(10px, calc(120px / var(--bb-digits, 1)), 15px); }
.result-score, .bb-duel-score { overflow-wrap: anywhere; }
.bb-piece { display: grid; gap: var(--bb-gap); }
.bb-piece i { position: relative; border-radius: 0; background: transparent; }
.bb-piece.bb-float { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; will-change: transform; filter: drop-shadow(0 10px 12px rgb(0 0 20 / .5)); }
.bb-pop { position: absolute; left: 50%; top: 34%; z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 94%; transform: translateX(-50%); pointer-events: none; text-align: center; animation: bb-pop 2200ms ease-out forwards; }
.bb-pop strong { font-size: clamp(30px, 9vw, 38px); font-weight: 900; line-height: 1.05; color: #fff; text-shadow: 0 3px 0 #c24a12, 0 0 20px rgb(255 190 70 / .9); white-space: nowrap; }
.bb-pop small { font-size: 18px; font-weight: 800; color: #ffe08a; text-shadow: 0 2px 0 rgb(80 40 0 / .6); }
.bb-pop .bb-pop-combo { font-size: 14px; color: #ffb27a; }
.bb-pop.big strong { font-size: clamp(32px, 10vw, 44px); }
.bb-pop.perfect strong { color: #fff3b0; text-shadow: 0 3px 0 #a5750a, 0 0 26px rgb(255 220 90 / 1); }
.bb-result { position: absolute; inset: 14% 8% auto; z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 16px 16px; text-align: center; box-shadow: 0 14px 36px rgb(0 0 0 / .45); animation: result-in 320ms cubic-bezier(.2, .8, .25, 1) both; }
.bb-record { margin: 0; font-weight: 700; color: var(--ok); }
.bb-retry { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 10px; }
.bb-retry p { margin: 0; font-size: 13px; opacity: .85; }
@keyframes bb-clear { 0% { transform: scale(1); filter: brightness(1.4); } 30% { transform: scale(1.12); filter: brightness(3) saturate(.3); } 100% { transform: scale(.1); opacity: 0; filter: brightness(2); } }
@keyframes bb-spark { 0% { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; } 100% { transform: translate(var(--dx, 0), var(--dy, 0)) rotate(220deg) scale(.1); opacity: 0; } }
@keyframes bb-pop { 0% { transform: translate(-50%, 14px) scale(.6); opacity: 0; } 10% { transform: translate(-50%, 0) scale(1.04); opacity: 1; } 20%, 72% { transform: translate(-50%, 0) scale(1); opacity: 1; } 100% { transform: translate(-50%, -24px) scale(.98); opacity: 0; } }
@keyframes bb-place { 0% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes bb-glow { to { filter: brightness(1.7) saturate(1.2); } }
@keyframes bb-bump { 40% { transform: scale(1.16); } }
@keyframes bb-shake { 0%, 100% { transform: none; } 15% { transform: translate(-5px, 2px); } 35% { transform: translate(5px, -3px); } 55% { transform: translate(-3px, 2px); } 75% { transform: translate(3px, -1px); } }
@keyframes bb-pulse { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .bb-cell.clearing, .bb-pop, .bb-combo, .bb-result, .bb-cell.pop, .bb-board.shake, .bb-score.bump, .bb-cell.on.will-clear { animation: none; } .bb-cell.clearing { opacity: 0; } .bb-spark { display: none; } .bb-slot { transition: none; } }

/* Full-board clear unlocks the next skin; piece and board use the same tile. */
.bb-cell.skin-1.on, .bb-piece.skin-1 i.on {
  background: radial-gradient(ellipse at 30% 29%, #422524 0 4%, transparent 5%), radial-gradient(ellipse at 69% 38%, #422524 0 4%, transparent 5%), radial-gradient(ellipse at 48% 62%, #422524 0 4%, transparent 5%), linear-gradient(#ff6878, #ee4057 76%, #e5edaf 77% 84%, #328654 85%);
  box-shadow: inset 0 1px 0 #ffb4b9, inset 0 -2px 0 #205c3c;
}
.bb-cell.skin-2.on, .bb-piece.skin-2 i.on {
  background: repeating-conic-gradient(from 15deg, transparent 0 42deg, #ffeabb 43deg 45deg), radial-gradient(circle, #ffb844 0 55%, #ffeabb 57% 65%, #ec8324 67%);
  box-shadow: inset 0 1px 0 #ffdb90, inset 0 -2px 0 #c36a1b;
}
.bb-cell.skin-1.on::after, .bb-piece.skin-1 i.on::after,
.bb-cell.skin-2.on::after, .bb-piece.skin-2 i.on::after { display: none; }

/* ---- "Угадай модуляцию" ---- */
.mod-bar { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 10px; font-size: 15px; color: var(--hint); }
.mod-bar b { color: var(--text); font-variant-numeric: tabular-nums; }
.mod-stage { width: min(100%, 360px, 46vh); margin: 0 auto; }
.mod-plot { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 16px; overflow: hidden; }
.mod-bg { fill: #0e1a2b; }
.mod-grid { stroke: #ffffff; stroke-opacity: .07; stroke-width: .008; }
.mod-axis { stroke: #ffffff; stroke-opacity: .35; stroke-width: .012; }
.mod-axis-label { fill: #ffffff; fill-opacity: .55; font-size: .12px; font-family: inherit; }
.mod-dot { fill: #5fd0ff; fill-opacity: .6; }
.mod-ideal { fill: none; stroke: #f2c14e; stroke-width: .02; }
.mod-ask { margin: 14px 0 8px; font-size: 17px; text-align: center; }
.mod-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.mod-option { min-height: 48px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); font-size: 17px; font-weight: 700; cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease; }
.mod-option:not(:disabled):active { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.mod-option:disabled { cursor: default; opacity: .75; }
.mod-option.right { opacity: 1; border-color: #2fb36b; background: color-mix(in srgb, #2fb36b 22%, transparent); }
.mod-option.wrong { opacity: 1; border-color: #e5484d; background: color-mix(in srgb, #e5484d 20%, transparent); }
.mod-hint { text-align: center; margin: 12px 0; }
.mod-feedback { display: grid; gap: 6px; margin: 12px 0 4px; }
.mod-feedback p { margin: 0; }
.mod-feedback .btn { margin-top: 6px; }
.mod-verdict { font-size: 18px; }
.mod-verdict.ok { color: #2fb36b; }
.mod-verdict.bad { color: #e5484d; }
.mod-result { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 18px 14px; }
.mod-total { font-size: 34px; font-variant-numeric: tabular-nums; }
.mod-answers { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.chip.mod-miss { background: color-mix(in srgb, #e5484d 18%, transparent); color: var(--text); }
@media (prefers-reduced-motion: reduce) { .mod-option { transition: none; } }

/* a request is on its way: the pressed button dims and a thin bar runs along the top */
button.pending { opacity: .6; pointer-events: none; animation: game-pending 900ms ease-in-out infinite; }
@keyframes game-pending { 50% { opacity: .35; } }
.games-load { position: fixed; z-index: 30; top: 0; left: 0; width: 100%; height: 3px; overflow: hidden; pointer-events: none; display: none; }
.games-load.on { display: block; }
.games-load::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 38%; border-radius: 0 3px 3px 0; background: var(--accent); animation: loadbar 1.15s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { button.pending { animation: none; } .games-load::before { animation: none; width: 100%; } }

.mod-option.picked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.mod-option.waiting { opacity: .55; pointer-events: none; }

/* A sweep follows the cleared row or column; the ring marks a full-board clear. */
.bb-clear-trail { position: absolute; background: linear-gradient(90deg, transparent, #fff5bc, #fff, transparent); animation: bb-trail 650ms ease-out forwards; transform-origin: center; }
.bb-clear-trail.vertical { background: linear-gradient(0deg, transparent, #fff5bc, #fff, transparent); }
.bb-clear-ring { position: absolute; border: 3px solid #ffe08a; animation: bb-clear-ring 950ms ease-out forwards; }
@keyframes bb-trail { 0% { opacity: .8; transform: scaleX(.1) scaleY(.25); } 45% { opacity: .65; transform: scaleX(1) scaleY(.14); } 100% { opacity: 0; transform: scaleX(1.05) scaleY(.05); } }
.bb-clear-trail.vertical { animation-name: bb-trail-vertical; }
@keyframes bb-trail-vertical { 0% { opacity: .8; transform: scaleY(.1) scaleX(.25); } 45% { opacity: .65; transform: scaleY(1) scaleX(.14); } 100% { opacity: 0; transform: scaleY(1.05) scaleX(.05); } }
@keyframes bb-clear-ring { from { opacity: .8; transform: scale(.92); } to { opacity: 0; transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .bb-clear-trail, .bb-clear-ring { display: none; } }

/* ---- "Бит в бит" (the answers are the same buttons as in the modulation game) ---- */
.bits-card { display: grid; gap: 10px; justify-items: start; margin: 8px 0 14px; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.bits-question { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.35; font-variant-numeric: tabular-nums; word-break: break-word; }
.bits-options { grid-template-columns: 1fr 1fr; }
.bits-options .mod-option { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 18px; letter-spacing: .02em; }
