/* ==========================================================================
   Режими запитань («як відповідати») і командна гра — /test-beta
   Окремий файл після beta.css: ті самі токени (--go, --ink, --s-* сцени), нові лише сутності.
   Режим ≠ гра: гра — сцена прогресу (Говерла…), режим — вигляд відповіді (слово, кросворд…).
   ========================================================================== */

/* ---------- підписи у формах ---------- */
.tb-panel-title .tb-panel-sub { margin-left: 6px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.tb-lobby-hint { margin-left: 6px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-3); }

/* ---------- вибір режиму (той самий компонент, що й вибір гри) ---------- */
.tb-mode-picker { margin-bottom: 10px; }
.tb-mode-picker .tb-game-opt b .lucide { color: var(--g); }
.tb-mode-picker .tb-game-opt.is-off { cursor: not-allowed; background: var(--paper); box-shadow: none; border-style: dashed; }
.tb-mode-picker .tb-game-opt.is-off .tb-mode-thumb { filter: grayscale(1); opacity: .45; }
.tb-mode-picker .tb-game-opt.is-off b { color: var(--ink-3); }
.tb-mode-note { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; line-height: 1.3; color: var(--ink-2); }
.tb-mode-note .lucide { width: 13px; height: 13px; flex: none; }
.tb-game-opt.is-off .tb-mode-note { color: var(--ink-3); }
.tb-mode-more { align-items: center; justify-content: center; text-align: center; border-style: dashed; background: transparent; box-shadow: none; min-height: 120px; }
.tb-mode-more .lucide { width: 26px; height: 26px; color: var(--ink-3); }
.tb-mode-about { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 22px; padding: 12px 14px; border-radius: var(--r); background: var(--paper-2); border: 2px solid rgba(255, 171, 0, .35); color: #5d4300; font-weight: 600; font-size: 14px; line-height: 1.45; }
.tb-mode-about .lucide { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--go-d); }
.tb-after-games { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 12px 64px; border-bottom: 1px solid var(--line); }
@media (max-width: 640px) { .tb-after-games { padding-left: 0; } }

/* ---------- мініатюри режимів ---------- */
.tb-mode-thumb { display: grid; place-items: center; width: 100%; aspect-ratio: 1000 / 560; border-radius: 10px; overflow: hidden; background: color-mix(in srgb, var(--g, var(--ink-3)) 14%, #fff); pointer-events: none; }
.tb-mode-thumb i { font-style: normal; }
.tb-mt-plain { display: grid; gap: 6px; width: 46%; }
.tb-mt-plain i { height: 10px; border-radius: 99px; background: rgba(38, 50, 56, .18); }
.tb-mt-plain i:first-child { width: 70%; background: var(--ink-3); }
.tb-mt-word, .tb-mt-tiles { display: flex; gap: 5px; }
.tb-mt-word i { display: grid; place-items: center; width: 24px; height: 30px; border-radius: 6px; background: #fff; border: 2px solid rgba(38, 50, 56, .2); font: 800 15px var(--f-display); color: var(--ink); }
.tb-mt-word i.is-e { background: transparent; border-style: dashed; }
.tb-mt-tiles i { display: grid; place-items: center; width: 22px; height: 26px; border-radius: 7px; background: #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .12); font: 800 13px var(--f-display); color: var(--ink); }
.tb-mt-cw { display: grid; grid-template-columns: repeat(6, 13px); grid-auto-rows: 13px; gap: 2px; }
.tb-mt-cw i.is-c, .tb-mt-cw i.is-f { background: #fff; border: 1.5px solid rgba(38, 50, 56, .35); border-radius: 3px; }
.tb-mt-cw i.is-f { background: var(--go); border-color: var(--go-d); }
.tb-mt-ws { position: relative; display: grid; grid-template-columns: repeat(7, 13px); gap: 2px; font: 800 9.5px/13px var(--f-display); text-align: center; color: var(--ink-2); }
.tb-mt-ws b { position: absolute; left: -3px; top: -2px; width: 62px; height: 17px; border-radius: 99px; background: color-mix(in srgb, var(--mint) 40%, transparent); }
.tb-mt-ws i { position: relative; }
.tb-mt-mu { display: grid; grid-template-columns: 50px 50px; gap: 5px 20px; }
.tb-mt-mu i { display: grid; place-items: center; height: 19px; border-radius: 6px; background: #fff; border: 2px solid rgba(38, 50, 56, .18); font: 800 10px var(--f-display); color: var(--ink); }
.tb-mt-mu i.is-ok { background: var(--mint); border-color: var(--mint-d); color: #fff; }
.tb-mt-show { display: grid; gap: 7px; width: 70%; }
.tb-mt-show > b { height: 7px; border-radius: 99px; background: rgba(38, 50, 56, .15); overflow: hidden; }
.tb-mt-show > b i { display: block; width: 62%; height: 100%; background: #e0565b; }
.tb-mt-show > span { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.tb-mt-show > span i { height: 16px; border-radius: 5px; background: #fff; font: 800 9px/16px var(--f-display); padding-left: 5px; color: var(--ink-2); }
.tb-mt-show > span i.is-x { opacity: .3; }
.tb-mt-whack { display: grid; grid-template-columns: repeat(3, 26px); gap: 6px 10px; }
.tb-mt-whack i { height: 12px; margin-top: 10px; border-radius: 50%; background: rgba(38, 50, 56, .25); }
.tb-mt-whack i.is-up { height: 22px; margin-top: 0; border-radius: 8px 8px 50% 50%; background: var(--mint); box-shadow: 0 3px 0 var(--mint-d); }
.tb-mt-cards { position: relative; width: 96px; height: 58px; }
.tb-mt-cards i { position: absolute; inset: 0; border-radius: 9px; }
.tb-mt-cards i:first-child { background: color-mix(in srgb, var(--grape) 35%, #fff); transform: rotate(-6deg) translate(-4px, 4px); }
.tb-mt-cards i:last-child { display: grid; place-items: center; background: #fff; border: 2px solid var(--grape); font: 800 12px var(--f-display); color: var(--grape-d); }

/* ---------- сторінка тесту: «Нове» і плитки режимів ---------- */
.tb-mode { position: relative; }
.tb-mode-new { position: absolute; top: -9px; right: 16px; padding: 4px 8px; border-radius: 99px; background: var(--ink); color: var(--go); font: 800 10px/1 var(--f-display); letter-spacing: .1em; text-transform: uppercase; }
.tb-hub-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tb-hub-tile { display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 12px; border-radius: var(--r); background: var(--card); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); color: var(--ink); text-decoration: none; transition: transform .12s, border-color .12s, box-shadow .12s; }
.tb-hub-tile:hover:not(.is-disabled) { transform: translateY(-2px); border-color: var(--ink); box-shadow: 0 5px 0 var(--ink); color: var(--ink); }
.tb-hub-tile:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.tb-hub-tile.is-disabled { opacity: .6; cursor: not-allowed; }
.tb-hub-tile-name { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.tb-hub-tile-name b { font: 800 15px/1.2 var(--f-display); }
.tb-hub-tile-name small { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.tb-hub-tile-name small .lucide { width: 13px; height: 13px; }
.tb-hub-hint { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; font-size: 13px; font-weight: 600; line-height: 1.45; color: var(--ink-3); }
.tb-hub-hint .lucide { flex: none; width: 16px; height: 16px; margin-top: 1px; }
@media (max-width: 980px) { .tb-modes-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .tb-hub-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }

/* ---------- слово клітинками (вгадай слово, анаграма) ---------- */
/* розмір клітинки — від кількості символів (--n), щоб слово до 14 літер стало в один рядок */
.tb-word { --gap: 5px; --slot: clamp(20px, calc((min(100vw, 760px) - 28px - (var(--n, 6) - 1) * var(--gap)) / var(--n, 6)), 58px); display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; gap: var(--gap); width: 100%; }
.tb-word-slot { display: grid; place-items: center; flex: none; width: var(--slot); height: calc(var(--slot) * 1.15); padding: 0; border-radius: calc(var(--slot) * .24); background: var(--s-surface); border: max(2px, calc(var(--slot) * .06)) solid var(--line-2); box-shadow: 0 4px 0 var(--line-2); font: 800 calc(var(--slot) * .55) var(--f-display); color: var(--ink); text-transform: uppercase; animation: tb-pop .3s cubic-bezier(.34, 1.56, .64, 1) both; }
button.tb-word-slot { cursor: pointer; }
button.tb-word-slot:disabled { cursor: default; }
.tb-word-slot.is-empty { background: transparent; border-style: dashed; box-shadow: none; animation: none; }
.tb-word-slot.is-ok { background: var(--mint); border-color: var(--mint-d); box-shadow: 0 4px 0 var(--mint-d); color: #fff; }
.tb-word-slot.is-bad { background: var(--bad-bg); border-color: var(--coral); box-shadow: 0 4px 0 #f3c0b3; }
.tb-word-sym { flex: none; font: 800 calc(var(--slot) * .6) var(--f-display); color: var(--ink-2); }
.tb-mode-hang, .tb-mode-anagram { display: flex; flex-direction: column; gap: 16px; align-items: center; max-width: 760px; width: 100%; margin: 0 auto; }
.tb-mode-note { margin: 0; text-align: center; font-weight: 700; color: var(--ink-2); }
.tb-mode-note b { color: var(--mint-d); letter-spacing: .04em; }
.tb-mode-tools { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.tb-mode-guess { max-width: 480px; }
.tb-lives { display: flex; gap: 6px; justify-content: center; }
.tb-life.lucide { width: 22px; height: 22px; color: var(--coral); fill: var(--coral); }
.tb-life.is-lost.lucide { color: var(--line-2); fill: none; }

/* екранна клавіатура абетки */
.tb-kb { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 640px; margin: 0 auto; user-select: none; }
.tb-kb-row { display: flex; justify-content: center; gap: 5px; }
.tb-kb-key { flex: 1 1 0; max-width: 46px; min-width: 0; height: clamp(42px, 6vh, 52px); padding: 0; border: 0; border-radius: 9px; background: var(--s-surface); color: var(--ink); box-shadow: 0 3px 0 var(--line-2); font: 800 clamp(15px, 2.2vw, 19px) var(--f-display); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tb-kb-key:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--line-2); }
.tb-kb-key:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.tb-kb-key.is-hit { background: var(--mint); color: #fff; box-shadow: 0 3px 0 var(--mint-d); }
.tb-kb-key.is-miss { background: rgba(38, 50, 56, .06); color: var(--ink-3); box-shadow: none; text-decoration: line-through; }
.tb-kb-key.is-wide { flex-grow: 1.6; max-width: 70px; display: grid; place-items: center; }
.tb-kb-key.is-wide .lucide { width: 20px; height: 20px; }
.tb-kb-key:disabled { cursor: default; }

/* анаграма: літери-плитки */
.tb-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tb-tile { display: grid; place-items: center; width: clamp(42px, 10vw, 56px); height: clamp(46px, 11vw, 60px); padding: 0; border: 3px solid transparent; border-radius: 14px; background: var(--p, #fff); box-shadow: 0 5px 0 var(--p-d, var(--line-2)); font: 800 clamp(20px, 4.4vw, 28px) var(--f-display); color: var(--ink); cursor: pointer; transition: transform .1s, opacity .2s; animation: tb-rise .4s cubic-bezier(.2, .9, .3, 1.2) both; }
.tb-tile:hover:not(:disabled) { transform: translateY(-2px); }
.tb-tile:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--p-d, var(--line-2)); }
.tb-tile.is-used { opacity: .18; box-shadow: none; transform: scale(.9); }

/* ---------- таймер запитання, «50 на 50» ---------- */
.tb-mode-show, .tb-mode-whack { display: flex; flex-direction: column; gap: clamp(10px, 1.6vw, 14px); }
.tb-show-bar { display: flex; align-items: center; gap: 10px; }
.tb-qtimer { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; height: 44px; padding: 0 14px; border-radius: 14px; background: var(--s-surface); border: 2px solid var(--s-surface-line); box-shadow: var(--s-shadow); }
.tb-qtimer .lucide { flex: none; color: var(--go); }
.tb-qtimer-track { flex: 1; height: 10px; border-radius: 99px; background: rgba(38, 50, 56, .1); overflow: hidden; }
.tb-qtimer-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--go), var(--orange)); transition: width 1s linear; }
.tb-qtimer b { min-width: 24px; text-align: right; font: 800 18px var(--f-display); }
.tb-qtimer.is-low .tb-qtimer-track i { background: var(--coral); }
.tb-qtimer.is-low b, .tb-qtimer.is-low .lucide { color: var(--coral-d); animation: tb-pulse 1s ease-in-out infinite; }
.tb-lifeline { display: inline-flex; flex: none; white-space: nowrap; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border: 0; border-radius: 14px; background: var(--grape); color: #fff; box-shadow: 0 4px 0 var(--grape-d); font: 900 16px var(--f-display); letter-spacing: .02em; cursor: pointer; }
.tb-lifeline small { display: grid; place-items: center; min-width: 22px; height: 22px; border-radius: 99px; background: rgba(255, 255, 255, .25); font-size: 12px; }
.tb-lifeline:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--grape-d); }
.tb-lifeline:disabled { opacity: .45; cursor: default; box-shadow: none; }

/* ---------- «Лови правильну» ---------- */
.tb-holes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 1.6vw, 14px); max-width: 720px; width: 100%; margin: 0 auto; }
.tb-hole { position: relative; height: clamp(78px, 12vh, 108px); border-radius: 18px; background: var(--s-surface); border: 2px solid var(--s-surface-line); box-shadow: var(--s-shadow); overflow: hidden; }
.tb-hole::after { content: ''; position: absolute; left: 14%; right: 14%; bottom: 8px; height: 14px; border-radius: 50%; background: rgba(38, 50, 56, .22); }
.tb-mole { position: absolute; z-index: 1; left: 7%; right: 7%; bottom: 13px; top: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px 6px; border: 3px solid transparent; border-radius: 16px 16px 12px 12px; background: var(--p, #fff); box-shadow: 0 4px 0 var(--p-d, var(--line-2)); color: var(--ink); font: 700 clamp(13px, 1.8vw, 17px)/1.15 var(--f-body); text-align: center; cursor: pointer; animation: tb-mole-up .28s cubic-bezier(.34, 1.56, .64, 1) both; animation-delay: var(--d, 0ms); overflow: hidden; overflow-wrap: anywhere; }
.tb-mole .tb-answer-key { width: 22px; height: 22px; font-size: 11px; border-radius: 7px; box-shadow: none; }
.tb-mole.is-picked { border-color: var(--c); box-shadow: 0 2px 0 var(--p-d), 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }
@keyframes tb-mole-up { from { transform: translateY(120%); } }
.tb-whack-result { display: flex; flex-direction: column; gap: 10px; max-width: 720px; width: 100%; margin: 0 auto; }

/* ---------- дошки: кросворд, пошук слів, пари ---------- */
.tb-board-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tb-board-head b { font: 800 clamp(18px, 2.4vw, 22px)/1.2 var(--f-display); }
.tb-board-head > span:last-child { font-weight: 600; color: var(--s-muted); }
.tb-board-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .18); }
.tb-board-ico .lucide { width: 20px; height: 20px; }
.tb-board { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 860px; margin: 0 auto; }
.tb-board-card { position: relative; display: flex; justify-content: center; padding: clamp(20px, 3vw, 28px) clamp(10px, 2vw, 20px) clamp(14px, 2vw, 20px); border-radius: var(--r-xl); background: var(--s-surface); border: 2px solid var(--s-surface-line); box-shadow: 0 6px 0 rgba(38, 50, 56, .07), 0 18px 40px rgba(38, 50, 56, .06); overflow: hidden; }
.tb-board-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px; background: linear-gradient(90deg, var(--go), var(--orange)); }
.tb-board-hint { margin: 0 auto; padding: 4px 12px; border-radius: 99px; background: color-mix(in srgb, var(--s-surface) 80%, transparent); text-align: center; font-size: 13.5px; font-weight: 700; color: var(--ink-2); width: fit-content; max-width: 100%; }
.tb-board-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 4px; font-weight: 700; color: var(--s-muted); }

/* кросворд */
.tb-cw { --cell: min(40px, calc((100vw - 64px) / var(--cols))); display: grid; grid-template-columns: repeat(var(--cols), var(--cell)); grid-auto-rows: var(--cell); gap: 3px; touch-action: manipulation; }
.tb-cw-cell { position: relative; display: grid; place-items: center; padding: 0; border: 2px solid rgba(38, 50, 56, .32); border-radius: 7px; background: #fff; font: 800 calc(var(--cell) * .5) var(--f-display); color: var(--ink); cursor: pointer; text-transform: uppercase; }
.tb-cw-cell.is-void { border: 0; background: transparent; cursor: default; }
.tb-cw-cell sup { position: absolute; left: 2px; top: 0; font: 800 max(8px, calc(var(--cell) * .24)) var(--f-display); color: var(--ink-3); }
.tb-cw-cell.is-active { background: var(--paper-2); border-color: var(--go); }
.tb-cw-cell.is-cursor { background: var(--go); border-color: var(--go-d); color: #fff; }
.tb-cw-cell.is-cursor sup { color: rgba(255, 255, 255, .8); }
.tb-cw-cell.is-ok { background: var(--ok-bg); border-color: var(--mint); color: var(--mint-d); }
.tb-cw-cell.is-bad { background: var(--bad-bg); border-color: var(--coral); color: var(--coral-d); }
.tb-cw-cell.is-half { border-color: var(--sun); }
.tb-cw-cell.is-done { background: rgba(38, 50, 56, .05); }
.tb-cw-cell:focus-visible { outline: 3px solid var(--sky); outline-offset: 1px; z-index: 1; }
.tb-cw-clue { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 16px; background: var(--ink); color: #fff; }
.tb-cw-clue.is-done { opacity: .7; }
.tb-cw-clue-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tb-cw-clue-text small { font: 800 11px var(--f-display); letter-spacing: .06em; text-transform: uppercase; color: var(--go); }
.tb-cw-clue-text b { font: 600 15.5px/1.35 var(--f-body); }
.tb-cw-img-ico.lucide { width: 15px; height: 15px; margin-right: 4px; vertical-align: -2px; color: var(--go); }
.tb-cw-img { max-height: 120px; max-width: 100%; border-radius: 10px; margin-top: 6px; align-self: flex-start; background: #fff; }
.tb-cw-nav { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; }
.tb-cw-nav:hover { background: rgba(255, 255, 255, .2); }
.tb-clues { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.tb-clues-col h3 { margin: 0 0 8px; font: 800 13px var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--s-faint); }
.tb-clues-col ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tb-clue { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px 10px; border: 2px solid var(--s-surface-line); border-radius: 12px; background: var(--s-surface); color: var(--ink); text-align: left; font: 600 14px/1.35 var(--f-body); cursor: pointer; }
.tb-clue b { flex: none; min-width: 20px; font-weight: 800; color: var(--ink-3); }
.tb-clue span { flex: 1; min-width: 0; }
.tb-clue small { color: var(--ink-3); }
.tb-clue .lucide { flex: none; width: 18px; height: 18px; }
.tb-clue.is-on { border-color: var(--go); background: var(--paper-2); }
.tb-clue.is-ok { color: var(--ink-2); }
.tb-clue.is-ok .lucide { color: var(--mint-d); }
.tb-clue.is-bad .lucide { color: var(--coral-d); }

/* пошук слів */
.tb-ws { --cell: min(42px, calc((100vw - 56px) / var(--cols))); display: grid; grid-template-columns: repeat(var(--cols), var(--cell)); grid-auto-rows: var(--cell); gap: 2px; touch-action: none; user-select: none; -webkit-user-select: none; }
.tb-ws.is-miss { animation: tb-shake .4s ease both; }
.tb-ws-cell { display: grid; place-items: center; border-radius: 9px; font: 800 calc(var(--cell) * .5) var(--f-display); color: var(--ink-2); cursor: pointer; transition: background .12s; }
.tb-ws-cell.is-f0 { background: #e2ffd2; color: var(--mint-d); }
.tb-ws-cell.is-f1 { background: #d9f3fc; color: var(--sky-d); }
.tb-ws-cell.is-f2 { background: #fce1ec; color: var(--pink-d); }
.tb-ws-cell.is-f3 { background: #e4e4f2; color: var(--grape-d); }
.tb-ws-cell.is-f4 { background: #ffecb3; color: var(--orange-d); }
.tb-ws-cell.is-f5 { background: #d6f3f6; color: var(--teal-d); }
.tb-ws-cell.is-sel { background: var(--go); color: #fff; box-shadow: 0 2px 0 var(--go-d); }
.tb-ws-clues { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px; }
.tb-ws-clue { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 2px solid var(--s-surface-line); border-radius: 12px; background: var(--s-surface); font: 600 14px/1.3 var(--f-body); }
.tb-ws-num { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 8px; background: rgba(38, 50, 56, .08); font: 800 12px var(--f-display); color: var(--ink-3); }
.tb-ws-num .lucide { width: 15px; height: 15px; }
.tb-ws-text { flex: 1; min-width: 0; }
.tb-ws-text small { color: var(--ink-3); }
.tb-ws-clue b { font: 800 13px var(--f-display); letter-spacing: .04em; }
.tb-ws-clue.is-ok .tb-ws-num { background: var(--mint); color: #fff; }
.tb-ws-clue.is-ok b { color: var(--mint-d); }

/* знайди пару */
.tb-mu-pool { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 12px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--s-surface) 88%, transparent); backdrop-filter: blur(8px); border: 2px solid var(--s-surface-line); box-shadow: 0 6px 20px rgba(38, 50, 56, .08); }
.tb-mu-chip { padding: 10px 14px; border: 3px solid transparent; border-radius: 14px; background: var(--p, #fff); box-shadow: 0 4px 0 var(--p-d, var(--line-2)); color: var(--ink); font: 700 15px/1.25 var(--f-body); cursor: pointer; animation: tb-pop .3s cubic-bezier(.34, 1.56, .64, 1) both; }
.tb-mu-chip.is-picked { border-color: var(--c); transform: translateY(-3px); box-shadow: 0 7px 0 var(--p-d), 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }
.tb-mu-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tb-mu-row { display: grid; grid-template-columns: auto minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 2px solid var(--s-surface-line); border-radius: 16px; background: var(--s-surface); box-shadow: var(--s-shadow); color: var(--ink); text-align: left; cursor: pointer; }
.tb-mu-row.is-target { border-color: var(--go); border-style: dashed; }
.tb-mu-row:disabled { cursor: default; }
.tb-mu-num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--ink); color: #fff; font: 800 13px var(--f-display); }
.tb-mu-q { font: 600 15px/1.35 var(--f-body); }
.tb-mu-q img { display: block; max-height: 80px; max-width: 100%; border-radius: 8px; margin-bottom: 4px; }
.tb-mu-slot { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 44px; padding: 8px 12px; border: 2px dashed var(--line-2); border-radius: 12px; color: var(--ink-3); font: 700 14.5px/1.25 var(--f-body); }
.tb-mu-slot.is-filled { border-style: solid; border-color: var(--go); background: var(--paper-2); color: var(--ink); }
.tb-mu-slot .lucide { flex: none; width: 20px; height: 20px; }
.tb-mu-row.is-ok .tb-mu-slot { border-color: var(--mint); background: var(--ok-bg); color: var(--mint-d); }
.tb-mu-row.is-bad .tb-mu-slot { border-color: var(--coral); background: var(--bad-bg); color: var(--coral-d); }
.tb-mu-row.is-saved .tb-mu-slot { border-style: solid; color: var(--ink-3); }
.tb-mu-fix { margin: 4px 0 0 52px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.tb-mu-fix b { color: var(--mint-d); }
@media (max-width: 640px) {
    .tb-mu-row { grid-template-columns: auto minmax(0, 1fr); }
    .tb-mu-slot { grid-column: 1 / -1; }
    .tb-mu-fix { margin-left: 0; }
    .tb-clues, .tb-ws-clues { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- командна гра (екран учителя, темна сцена) ---------- */
.tb-team .tb-live-tag { background: var(--grape); box-shadow: 0 4px 0 var(--grape-d); }
.tb-team-dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; }
.tb-team-setup { align-self: center; display: flex; flex-direction: column; gap: 14px; width: min(640px, calc(100% - 32px)); margin: clamp(8px, 3vh, 32px) auto 40px; padding: clamp(20px, 3vw, 32px); border-radius: var(--r-xl); background: #fff; color: var(--ink); box-shadow: 0 10px 0 var(--shadow-soft), 0 40px 80px rgba(0, 0, 0, .35); }
.tb-team-setup h1 { margin: 0; font: 900 clamp(26px, 4vw, 36px)/1.1 var(--f-display); }
.tb-team-setup .tb-label { margin: 6px 0 0; color: var(--ink-2); }
.tb-team-how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.tb-team-how li { padding: 10px 12px; border-radius: 14px; background: var(--paper); font-size: 13.5px; font-weight: 600; line-height: 1.35; color: var(--ink-2); }
.tb-team-how b { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 6px; border-radius: 7px; background: var(--ink); color: #fff; font: 800 12px var(--f-display); }
.tb-team-names { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tb-team-name { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 10px; border: 2px solid var(--line-2); border-radius: 14px; }
.tb-team-name i { width: 24px; height: 24px; flex: none; border-radius: 8px; box-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.tb-team-name input { flex: 1; min-width: 0; border: 0; background: transparent; font: 800 16px var(--f-body); color: var(--ink); padding: 8px 2px; outline: none; }
.tb-team-name:focus-within { border-color: var(--sky); box-shadow: var(--ring); }
.tb-team-toggles { margin: 4px 0 6px; }
.tb-team-setup > .tb-btn-xl { align-self: stretch; }
.tb-team-body { flex: 1; min-height: 0; display: flex; gap: clamp(12px, 2vw, 24px); padding: 8px clamp(12px, 3vw, 28px) clamp(12px, 3vw, 28px); }
.tb-team-tiles { flex: 1; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: minmax(70px, 1fr); gap: clamp(8px, 1.2vw, 14px); }
.tb-team-tile { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px; border: 3px solid transparent; border-radius: 20px; background: var(--p, #fff); box-shadow: 0 6px 0 var(--p-d, var(--line-2)); color: var(--ink); cursor: pointer; transition: transform .12s; }
.tb-team-tile b { font: 900 clamp(28px, 4vw, 52px)/1 var(--f-display); }
.tb-team-tile:hover { transform: translateY(-3px); }
.tb-team-tile:focus-visible { outline: 3px solid var(--go); outline-offset: 3px; }
.tb-team-tile.is-done { background: rgba(255, 255, 255, .05); border: 3px dashed rgba(255, 255, 255, .12); box-shadow: none; cursor: default; color: rgba(255, 255, 255, .72); font: 800 clamp(12px, 1.4vw, 16px)/1.2 var(--f-display); text-align: center; }
.tb-team-tile.is-done:hover { transform: none; }
.tb-team-side { width: clamp(220px, 24vw, 320px); flex: none; display: flex; flex-direction: column; gap: 10px; }
.tb-team-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; background: rgba(255, 255, 255, .07); border: 3px solid rgba(255, 255, 255, .1); color: #fff; }
.tb-team-card.is-on { border-color: var(--go); background: rgba(255, 171, 0, .12); }
.tb-team-sw { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 13px; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); color: #fff; font: 900 18px var(--f-display); }
.tb-team-sw .lucide { width: 22px; height: 22px; }
.tb-team-tn { flex: 1; min-width: 0; font: 800 clamp(16px, 1.7vw, 20px)/1.2 var(--f-display); overflow-wrap: anywhere; }
.tb-team-tn small { display: block; font: 800 11px var(--f-display); letter-spacing: .1em; color: var(--go); }
.tb-team-sc { font: 900 clamp(26px, 3vw, 38px)/1 var(--f-display); }
.tb-team-left { margin: auto 0 0; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .06); font-weight: 700; color: rgba(255, 255, 255, .75); }
.tb-team-ov { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(17, 24, 28, .76); overflow-y: auto; }
.tb-team-q { position: relative; display: flex; flex-direction: column; gap: 18px; width: min(980px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: clamp(22px, 3vw, 34px); border-radius: var(--r-xl); background: #fff; color: var(--ink); box-shadow: 0 8px 0 rgba(0, 0, 0, .25), 0 30px 80px rgba(0, 0, 0, .4); }
.tb-team-q::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 8px; background: linear-gradient(90deg, var(--go), var(--orange)); }
.tb-team-qhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tb-team-qhead .tb-hud-chip { background: var(--paper); border-color: transparent; box-shadow: none; color: var(--ink); }
.tb-team-qhead .tb-hud-chip:last-child:not(:nth-child(2)) { margin-left: auto; }
.tb-team-qhead .tb-hud-chip.is-low { background: var(--coral); color: #fff; }
.tb-team-text { font: 600 clamp(22px, 3vw, 34px)/1.3 var(--f-body); text-align: center; overflow-wrap: break-word; }
.tb-team-text p { margin: 0 0 .3em; }
.tb-team-img { max-height: 30vh; max-width: 100%; align-self: center; border-radius: 16px; border: 2px solid var(--line); }
.tb-team-q .tb-answers .tb-answer { cursor: default; }
.tb-team-answer { margin: 0; padding: 16px; border-radius: 18px; background: var(--ink); color: #fff; text-align: center; font: 700 clamp(18px, 2.4vw, 26px)/1.35 var(--f-body); }
.tb-team-answer small { display: block; margin-bottom: 6px; font: 800 12px var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--go); }
.tb-team-foot { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.tb-team-foot .tb-btn-xl { width: auto; min-width: 240px; }
.tb-team-surprise { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0; text-align: center; }
.tb-team-surprise h2 { margin: 0; font: 900 clamp(30px, 4vw, 44px)/1.1 var(--f-display); }
.tb-team-surprise p { margin: 0; font: 600 clamp(17px, 2vw, 22px)/1.4 var(--f-body); color: var(--ink-2); }
.tb-team-gift { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 28px; background: var(--grape); color: #fff; box-shadow: 0 6px 0 var(--grape-d); animation: tb-bump .6s cubic-bezier(.34, 1.56, .64, 1); }
.tb-team-gift .lucide { width: 52px; height: 52px; }
.tb-team-final { display: flex; flex-direction: column; gap: 10px; width: min(560px, 100%); }
@media (max-width: 900px) {
    .tb-team-body { flex-direction: column; }
    .tb-team-side { width: 100%; flex-direction: row; flex-wrap: wrap; }
    .tb-team-side .tb-team-card { flex: 1 1 160px; }
    .tb-team-left { margin: 0; flex-basis: 100%; }
}
@media (max-width: 640px) {
    .tb-team-how, .tb-team-names { grid-template-columns: minmax(0, 1fr); }
    .tb-team-foot .tb-btn-xl { min-width: 0; width: 100%; }
}
.tb-game-opt.tb-mode-more .lucide { padding: 0; background: none; border-radius: 0; color: var(--ink-3); }
/* «Правильно» у командній грі — суцільна зелена (tb-btn-mint у системі — вторинна, контурна) */
.tb-team-foot .tb-btn.tb-team-ok { --c: var(--mint); --c-d: var(--mint-d); --t: #fff; border: 0; color: #fff !important; text-shadow: 0 1px 0 rgba(0, 0, 0, .18); }

/* світлі модальні вікна поверх темної сцени (екран учителя): тексти — як на звичайних сторінках */
.tb-stage .tb-modal { color: var(--ink); }
.tb-stage .tb-modal .tb-label { color: var(--ink-2); }
.tb-stage .tb-modal .tb-help { color: var(--ink-3); }
.tb-stage .tb-modal .tb-help b { color: var(--ink); }
.tb-stage .tb-modal .tb-btn-ghost { --t: var(--ink); color: var(--ink) !important; }
.tb-stage .tb-modal .tb-btn-ghost:hover { background: rgba(38, 50, 56, .06); }
.tb-hw-modes { margin-top: 8px; }
@media (max-width: 640px) {
    .tb-mt-tiles { gap: 3px; }
    .tb-mt-tiles i { width: 17px; height: 21px; font-size: 11px; border-radius: 5px; }
    .tb-mt-word i { width: 20px; height: 25px; font-size: 13px; }
}

/* ==========================================================================
   Роздруківки (/test-beta/print/<id>): аркуш A4, ключ — окремою сторінкою
   ========================================================================== */
.tb-pr { max-width: 860px; margin: 0 auto; padding: 16px 16px 60px; }
.tb-pr-bar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 0; background: rgba(238, 241, 243, .94); backdrop-filter: blur(8px); }
.tb-pr-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(38, 50, 56, .06); }
.tb-pr-tab { padding: 7px 12px; border-radius: 9px; font: 800 14px var(--f-body); color: var(--ink-2); text-decoration: none; }
.tb-pr-tab:hover { color: var(--ink); }
.tb-pr-tab.is-on { background: #fff; color: var(--ink); box-shadow: 0 2px 0 var(--line-2); }
.tb-pr-tools { display: inline-flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.tb-pr-tools .tb-btn.is-on { background: var(--paper-2); border-color: var(--go); }
.tb-pr-note { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.tb-pr-sheet { margin-top: 16px; padding: 18mm 16mm; background: #fff; color: #111; border-radius: 6px; box-shadow: 0 4px 0 var(--line), 0 18px 40px rgba(38, 50, 56, .1); font: 400 14px/1.45 var(--f-body); }
.tb-pr-empty { margin: 0; text-align: center; color: var(--ink-3); font-weight: 600; }
.tb-pr-head { margin-bottom: 14px; }
.tb-pr-who { display: flex; gap: 24px; margin-bottom: 12px; font-size: 13px; color: #333; }
.tb-pr-who span { flex: 1; display: flex; align-items: flex-end; gap: 8px; }
.tb-pr-who span:last-child { flex: 0 0 140px; }
.tb-pr-who i { flex: 1; border-bottom: 1px solid #555; height: 16px; }
.tb-pr-head h1 { margin: 0; font: 800 24px/1.2 var(--f-display); }
.tb-pr-sub { margin: 2px 0 0; font-weight: 600; color: #555; }
.tb-pr-task { margin: 8px 0 0; font-style: italic; color: #333; }
.tb-pr-cw { --cell: 30px; display: grid; grid-template-columns: repeat(var(--cols), var(--cell)); grid-auto-rows: var(--cell); justify-content: center; margin: 10px auto 18px; }
.tb-pr-cell { position: relative; display: grid; place-items: center; margin: 0 -1px -1px 0; border: 1px solid #222; font: 700 15px var(--f-display); text-transform: uppercase; }
.tb-pr-cell sup { position: absolute; left: 2px; top: 1px; font: 700 8px/1 var(--f-display); }
.tb-pr-cell.is-void { border-color: transparent; }
.tb-pr-clues { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tb-pr-col h2 { margin: 0 0 6px; font: 800 13px var(--f-body); letter-spacing: .08em; text-transform: uppercase; }
.tb-pr-col ol, .tb-pr-list, .tb-pr-keyline, .tb-pr-mu-left, .tb-pr-mu-right { margin: 0; padding: 0; list-style: none; }
.tb-pr-col li { margin-bottom: 5px; }
.tb-pr-col small, .tb-pr-list small { color: #666; }
.tb-pr-ws { --cell: 34px; display: grid; grid-template-columns: repeat(var(--cols), var(--cell)); grid-auto-rows: var(--cell); justify-content: center; margin: 10px auto 18px; border: 1.5px solid #222; width: fit-content; }
.tb-pr-wl { display: grid; place-items: center; font: 700 17px var(--f-display); }
.tb-pr-wl.is-f0 { background: #c8f0b8; } .tb-pr-wl.is-f1 { background: #c3e7fb; } .tb-pr-wl.is-f2 { background: #f9cfe0; }
.tb-pr-wl.is-f3 { background: #d6d6f0; } .tb-pr-wl.is-f4 { background: #ffe39a; } .tb-pr-wl.is-f5 { background: #c1ecf1; }
.tb-pr-list { columns: 2; column-gap: 22px; }
.tb-pr-list li { display: flex; gap: 8px; break-inside: avoid; margin-bottom: 6px; }
.tb-pr-box { flex: none; width: 13px; height: 13px; margin-top: 3px; border: 1.5px solid #333; border-radius: 3px; }
.tb-pr-mu { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.tb-pr-mu-left li { display: flex; gap: 6px; align-items: baseline; margin-bottom: 9px; }
.tb-pr-blank { flex: none; width: 34px; height: 18px; margin-left: auto; border-bottom: 1.5px solid #333; }
.tb-pr-mu-right li { margin-bottom: 9px; padding: 4px 8px; border: 1px solid #bbb; border-radius: 6px; }
.tb-pr-mu-right b { display: inline-block; min-width: 18px; }
.tb-pr-keyline { columns: 2; column-gap: 22px; }
.tb-pr-keyline li { margin-bottom: 6px; break-inside: avoid; }
.tb-pr-cards { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px dashed #777; border-left: 1px dashed #777; }
.tb-pr-card { display: grid; grid-template-rows: 1fr 1fr; min-height: 46mm; border-right: 1px dashed #777; border-bottom: 1px dashed #777; break-inside: avoid; }
.tb-pr-card > div { position: relative; display: flex; align-items: center; justify-content: center; padding: 8px 12px; text-align: center; font-size: 13px; line-height: 1.35; }
.tb-pr-card small { position: absolute; left: 6px; top: 4px; font-size: 9px; color: #888; }
.tb-pr-card-front { font-weight: 600; border-bottom: 1px dotted #aaa; }
.tb-pr-card-back { font-weight: 800; transform: rotate(180deg); }
@media (max-width: 640px) {
    .tb-pr-cw { --cell: min(24px, calc((100vw - 56px) / var(--cols))); }
    .tb-pr-ws { --cell: min(30px, calc((100vw - 56px) / var(--cols))); }
    .tb-pr-sheet { padding: 16px 12px; }
    .tb-pr-clues, .tb-pr-mu { grid-template-columns: 1fr; }
    .tb-pr-list, .tb-pr-keyline { columns: 1; }
    .tb-pr-tools { margin-left: 0; }
}
@media print {
    @page { size: A4; margin: 12mm; }
    body.tb { background: #fff !important; }
    .tb-pr { max-width: none; padding: 0; }
    .tb-pr-bar, .tb-pr-note { display: none !important; }
    .tb-pr-sheet { margin: 0; padding: 0; box-shadow: none; border-radius: 0; }
    .tb-pr-key { break-before: page; }
    .tb-pr-wl[class*="is-f"] { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- аркади: «Літачок», «Лабіринт» ---------- */
.tb-arcade { display: flex; flex-direction: column; gap: 12px; max-width: 760px; width: 100%; margin: 0 auto; }
.tb-arcade-top { display: flex; align-items: center; gap: 10px; }
.tb-arcade-top .tb-qtimer { flex: 1; }
.tb-sky { position: relative; display: grid; grid-template-rows: repeat(var(--lanes), minmax(0, 1fr)); height: clamp(240px, 38vh, 340px); border-radius: var(--r-xl); background: linear-gradient(180deg, #bfe3f5, #eaf6fb); border: 2px solid var(--s-surface-line); box-shadow: 0 6px 0 rgba(38, 50, 56, .07); overflow: hidden; touch-action: manipulation; }
.tb-lane { border: 0; border-bottom: 2px dashed rgba(255, 255, 255, .7); background: transparent; cursor: pointer; }
.tb-lane:last-of-type { border-bottom: 0; }
.tb-plane { position: absolute; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--go); color: #fff; box-shadow: 0 4px 0 var(--go-d); transition: top .18s cubic-bezier(.34, 1.56, .64, 1); transform: translateX(-50%); pointer-events: none; }
.tb-plane .lucide { width: 26px; height: 26px; transform: rotate(45deg); }
.tb-plane.is-ok { background: var(--mint); box-shadow: 0 4px 0 var(--mint-d); }
.tb-plane.is-bad { background: var(--coral); box-shadow: 0 4px 0 var(--coral-d); }
.tb-cloud { position: absolute; z-index: 1; display: inline-flex; align-items: center; gap: 6px; width: max-content; max-width: min(46%, 320px); min-height: 52px; padding: 6px 14px 6px 8px; border-radius: 26px; background: var(--p, #fff); box-shadow: 0 4px 0 var(--p-d, var(--line-2)), 0 10px 18px rgba(38, 50, 56, .08); color: var(--ink); font: 700 clamp(13px, 1.8vw, 16px)/1.2 var(--f-body); pointer-events: none; white-space: normal; overflow-wrap: anywhere; }
.tb-cloud b { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 9px; background: var(--c, var(--sky)); color: #fff; font: 800 13px var(--f-display); }
.tb-arcade-pad { display: flex; justify-content: center; gap: 12px; }
.tb-arcade-pad .tb-btn { min-width: 110px; }
.tb-arcade-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.tb-arcade-opt { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 3px solid transparent; border-radius: 14px; background: var(--p, #fff); box-shadow: 0 3px 0 var(--p-d, var(--line-2)); font: 600 14px/1.25 var(--f-body); color: var(--ink); }
.tb-arcade-opt b { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 8px; background: var(--c, var(--sky)); color: #fff; font: 800 12px var(--f-display); }
.tb-arcade-opt.is-right { --p: var(--mint); --p-d: var(--mint-d); color: #fff; }
.tb-arcade-opt.is-right b, .tb-arcade-opt.is-wrong b { background: rgba(255, 255, 255, .25); }
.tb-arcade-opt.is-wrong { --p: var(--coral); --p-d: var(--coral-d); color: #fff; }
.tb-arcade-opt.is-dim { opacity: .45; }
.tb-maze { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); grid-template-rows: repeat(11, minmax(0, 1fr)); width: min(100%, 440px); aspect-ratio: 1; margin: 0 auto; padding: 6px; border-radius: var(--r-lg); background: var(--ink); box-shadow: 0 6px 0 var(--ink-shadow); touch-action: none; user-select: none; }
.tb-maze.is-caught { animation: tb-shake .45s ease both; }
.tb-maze-cell { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; background: #f4f6f7; }
.tb-maze-cell.is-wall { background: transparent; }
.tb-maze-cell.is-zone { background: var(--p); box-shadow: inset 0 0 0 2px var(--c); border-radius: 6px; }
.tb-maze-cell.is-zone b { font: 900 clamp(13px, 3vw, 18px) var(--f-display); color: var(--c-d, var(--ink)); }
.tb-maze-me, .tb-maze-ghost { position: absolute; inset: 8%; display: grid; place-items: center; border-radius: 50%; }
.tb-maze-me { background: var(--go); color: #fff; box-shadow: 0 2px 0 var(--go-d); z-index: 2; }
.tb-maze-me.is-ok { background: var(--mint); }
.tb-maze-ghost { background: var(--coral); color: #fff; border-radius: 50% 50% 30% 30%; }
.tb-maze-me .lucide, .tb-maze-ghost .lucide { width: 72%; height: 72%; }
.tb-dpad { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 52px); gap: 6px; justify-content: center; }
.tb-dpad .tb-btn { min-height: 0; padding: 0; }
.tb-dpad .tb-btn:nth-child(1) { grid-column: 2; grid-row: 1; }
.tb-dpad .tb-btn:nth-child(2) { grid-column: 1; grid-row: 2; }
.tb-dpad .tb-btn:nth-child(3) { grid-column: 3; grid-row: 2; }
.tb-dpad .tb-btn:nth-child(4) { grid-column: 2; grid-row: 2; }

/* ---------- «Знайди відповідь» ---------- */
.tb-fm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tb-fm-tile { min-height: 64px; padding: 10px 12px; border: 3px solid transparent; border-radius: 16px; background: var(--p, #fff); box-shadow: 0 5px 0 var(--p-d, var(--line-2)); color: var(--ink); font: 700 15px/1.25 var(--f-body); cursor: pointer; transition: transform .1s, opacity .3s; animation: tb-pop .3s cubic-bezier(.34, 1.56, .64, 1) both; }
.tb-fm-tile:hover:not(:disabled) { transform: translateY(-2px); }
.tb-fm-tile:disabled { cursor: default; }
.tb-fm-tile.is-right { --p: var(--mint); --p-d: var(--mint-d); color: #fff; animation: tb-bump .5s cubic-bezier(.34, 1.56, .64, 1); }
.tb-fm-tile.is-wrong { --p: var(--coral); --p-d: var(--coral-d); color: #fff; animation: tb-shake .45s ease both; }
.tb-fm-tile.is-gone { min-height: 64px; border-radius: 16px; border: 2px dashed var(--line-2); background: transparent; box-shadow: none; animation: none; }
@media (max-width: 640px) { .tb-fm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* мініатюри нових режимів */
.tb-mt-plane { position: relative; width: 86%; height: 72%; border-radius: 8px; background: linear-gradient(180deg, #bfe3f5, #eaf6fb); }
.tb-mt-plane b { position: absolute; left: 10%; top: 40%; width: 18px; height: 14px; border-radius: 4px; background: var(--go); }
.tb-mt-plane i { position: absolute; right: 8%; width: 34px; height: 13px; border-radius: 99px; background: #fff; font: 800 8px/13px var(--f-display); text-align: center; color: var(--ink-2); }
.tb-mt-plane i:nth-of-type(1) { top: 12%; } .tb-mt-plane i:nth-of-type(2) { top: 42%; right: 30%; } .tb-mt-plane i:nth-of-type(3) { top: 72%; }
.tb-mt-plane i.is-ok { background: var(--mint); color: #fff; }
.tb-mt-maze { display: grid; grid-template-columns: repeat(9, 9px); grid-auto-rows: 9px; padding: 4px; border-radius: 6px; background: var(--ink); }
.tb-mt-maze i { background: #f4f6f7; }
.tb-mt-maze i.is-w { background: transparent; }
.tb-mt-maze i.is-z { background: var(--sky); }
.tb-mt-maze i.is-p { background: var(--go); border-radius: 50%; }
.tb-mt-fm { display: grid; gap: 5px; width: 84%; }
.tb-mt-fm b { padding: 3px 6px; border-radius: 6px; background: #fff; font: 800 9px var(--f-display); color: var(--ink); text-align: center; }
.tb-mt-fm span { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.tb-mt-fm i { padding: 3px 0; border-radius: 6px; background: #fff; font: 800 9px var(--f-display); color: var(--ink-2); text-align: center; box-shadow: 0 2px 0 rgba(0, 0, 0, .1); }
.tb-mt-fm i.is-ok { background: var(--mint); color: #fff; }
.tb-hub-print { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.tb-hub-print > span { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; color: var(--ink-2); }
.tb-hub-print .lucide { width: 16px; height: 16px; }

/* ---------- командна гра: вибір поля, колесо, «Чотири в ряд», «Хрестики-нулики», скриньки ---------- */
.tb-team-boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tb-team-board-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; border: 2px solid var(--line-2); border-radius: 14px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; font-family: var(--f-body); }
.tb-team-board-opt .lucide { width: 22px; height: 22px; color: var(--grape); }
.tb-team-board-opt b { font: 800 15px/1.2 var(--f-display); }
.tb-team-board-opt span { font-size: 12.5px; line-height: 1.3; color: var(--ink-2); }
.tb-team-board-opt.is-on { border-color: var(--ink); box-shadow: 0 0 0 3px var(--ink); background: var(--paper); }
.tb-pill:disabled { opacity: .35; cursor: not-allowed; }
.tb-team-tiles.is-boxes .tb-team-tile { flex-direction: column; gap: 2px; border-radius: 14px 14px 20px 20px; }
.tb-team-box.lucide { width: clamp(26px, 3.4vw, 44px); height: clamp(26px, 3.4vw, 44px); color: var(--c, var(--ink-2)); }
.tb-team-tiles.is-boxes .tb-team-tile b { font-size: clamp(20px, 2.6vw, 32px); }
.tb-team-wheel, .tb-team-grid-wrap { flex: 1; display: flex; align-items: center; justify-content: center; gap: clamp(16px, 3vw, 40px); flex-wrap: wrap; min-width: 0; }
.tb-wheel-wrap { position: relative; display: flex; flex-direction: column; align-items: center; gap: 16px; max-width: 100%; overflow-x: clip; overflow-y: visible; }
.tb-wheel-disc { width: min(62vh, 520px, 86vw); aspect-ratio: 1; transform-origin: 50% 50%; border-radius: 50%; box-shadow: 0 0 0 8px rgba(255, 255, 255, .08), 0 0 40px rgba(0, 0, 0, .35); }
.tb-wheel-svg { display: block; width: 100%; height: 100%; }
.tb-wheel-label { font: 800 18px var(--f-display); fill: #263238; }
.tb-wheel-label.is-small { font-size: 12px; }
.tb-wheel-pointer { position: absolute; top: -18px; left: 50%; z-index: 2; transform: translateX(-50%); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--go); color: #fff; box-shadow: 0 4px 0 var(--go-d); }
.tb-wheel-pointer .lucide { width: 26px; height: 26px; }
.tb-wheel-spin { min-width: 240px; }
.tb-four { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; width: min(100%, 640px, calc((100vh - 190px) * 1.12)); padding: 12px; border-radius: 24px; background: #2979ff; box-shadow: 0 8px 0 #1c54c4; }
.tb-four-col { display: flex; flex-direction: column; gap: 6px; padding: 4px; border: 0; border-radius: 14px; background: transparent; cursor: default; }
.tb-four.is-placing .tb-four-col:not(:disabled) { cursor: pointer; }
.tb-four.is-placing .tb-four-col:not(:disabled):hover { background: rgba(255, 255, 255, .18); box-shadow: inset 0 0 0 3px var(--turn); }
.tb-four-hole { position: relative; aspect-ratio: 1; border-radius: 50%; background: #1e2a30; box-shadow: inset 0 3px 0 rgba(0, 0, 0, .35); }
.tb-four-hole i { position: absolute; inset: 6%; border-radius: 50%; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2); animation: tb-drop .35s cubic-bezier(.5, 0, .75, 0) both; }
.tb-four-hole.is-win i { box-shadow: 0 0 0 4px #fff, inset 0 -4px 0 rgba(0, 0, 0, .2); animation: tb-bump .6s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes tb-drop { from { transform: translateY(-420%); } }
.tb-ttt { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: min(100%, 520px, calc(100vh - 200px)); }
.tb-ttt-cell { display: grid; place-items: center; aspect-ratio: 1; border: 0; border-radius: 24px; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .12); cursor: default; }
.tb-ttt.is-placing .tb-ttt-cell:not(:disabled) { cursor: pointer; background: rgba(255, 255, 255, .14); }
.tb-ttt.is-placing .tb-ttt-cell:not(:disabled):hover { box-shadow: inset 0 0 0 4px var(--go); }
.tb-ttt-cell .lucide { width: 70%; height: 70%; stroke-width: 3; animation: tb-pop .3s cubic-bezier(.34, 1.56, .64, 1) both; }
.tb-ttt-cell.is-win { background: rgba(255, 171, 0, .22); }
.tb-team-grid-side { display: flex; flex-direction: column; align-items: center; gap: 14px; flex: 0 1 260px; max-width: 280px; text-align: center; }
.tb-team-state { margin: 0; font: 800 clamp(20px, 2.6vw, 30px)/1.25 var(--f-display); }
.tb-team-state .lucide { width: 1em; height: 1em; vertical-align: -.12em; }
.tb-team-state.is-win { color: var(--go); }
.tb-team-state.is-place { color: #b9f6ca; }
.tb-names { flex: 1; display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: clamp(16px, 3vw, 40px); align-items: start; padding: 12px clamp(12px, 3vw, 28px) 28px; }
.tb-names-list { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--r-xl); background: #fff; color: var(--ink); box-shadow: 0 8px 0 var(--shadow-soft); }
.tb-names-list .tb-textarea { min-height: 220px; font: 600 15px/1.5 var(--f-body); }
.tb-names-list .tb-label { color: var(--ink-2); }
.tb-names-stage { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.tb-names-picked { padding: 12px 28px; border-radius: 20px; background: var(--go); color: #fff; box-shadow: 0 6px 0 var(--go-d); font: 900 clamp(28px, 4.6vw, 54px)/1.1 var(--f-display); text-align: center; }
@media (max-width: 900px) { .tb-names { grid-template-columns: minmax(0, 1fr); } }
.tb-names-picked { margin-bottom: 14px; }
/* аркади: компактна картка запитання, щоб поле вміщалося на телефоні без прокрутки */
.tb-stagebox:has(.tb-arcade) .tb-question { min-height: 0; padding: 18px 16px 14px; gap: 8px; }
.tb-stagebox:has(.tb-arcade) .tb-question-text { font-size: clamp(17px, 2.4vw, 24px); }
.tb-stagebox:has(.tb-arcade) { gap: 10px; }
.tb-maze { width: min(100%, 440px, 46vh); }
@media (max-width: 640px) {
    .tb-dpad { grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 44px); }
    .tb-arcade-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .tb-arcade-opt { padding: 6px 8px; font-size: 13px; }
    .tb-sky { height: clamp(220px, 34vh, 300px); }
}
/* старт аркади: поверх поля, поки учень читає запитання */
.tb-arcade-gate { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(255, 255, 255, .55); backdrop-filter: blur(2px); border-radius: inherit; text-align: center; }
.tb-arcade-gate .tb-btn-xl { width: auto; min-width: 200px; }
.tb-arcade-gate span { padding: 4px 12px; border-radius: 99px; background: rgba(255, 255, 255, .85); font: 700 13.5px var(--f-body); color: var(--ink-2); }
.tb-maze { position: relative; }
/* хмарка: не вище за доріжку — до двох рядків, повний текст у легенді під полем */
.tb-cloud { max-height: calc(100% / var(--lanes, 4) - 8px); }
.tb-cloud .tb-rich { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 640px) { .tb-cloud { max-width: 64%; font-size: 13px; } }
.tb-cloud { transform: translateY(-50%); }
/* кросворд: підказка, клавіатура й «Перевірити» — завжди внизу екрана, сітка прокручується над ними */
.tb-cw-dock { position: sticky; bottom: 0; z-index: 6; display: flex; flex-direction: column; gap: 8px; margin: 0 -4px; padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); }
.tb-cw-dock .tb-submit-row .tb-btn-xl { min-height: 50px; }
.tb-cw-clue-text b { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tb-cw-clue-text small { font-size: 12px; }
.tb-cw-img { max-height: 72px; }
/* кнопки браузер не успадковує шрифт — задаємо явно для всіх нових кнопок-контейнерів */
.tb-mu-row, .tb-cw-nav, .tb-lane, .tb-four-col, .tb-ttt-cell, .tb-mole, .tb-fm-tile, .tb-mu-chip, .tb-tile, .tb-kb-key, .tb-word-slot, .tb-lifeline, .tb-team-tile { font-family: var(--f-body); }
/* широкі екрани (ПК, проєктор): запитання ліворуч, поле гри праворуч — усе на одному екрані */
@media (min-width: 960px) {
    .tb-stagebox:has(.tb-arcade), .tb-stagebox:has(.tb-mode-hang), .tb-stagebox:has(.tb-mode-anagram) {
        display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; column-gap: clamp(16px, 2.4vw, 28px); padding-bottom: 40px;
    }
    .tb-stagebox:has(.tb-arcade) > .tb-question, .tb-stagebox:has(.tb-mode-hang) > .tb-question, .tb-stagebox:has(.tb-mode-anagram) > .tb-question { position: sticky; top: 12px; min-height: 0; }
    .tb-stagebox:has(.tb-arcade) .tb-maze { width: min(100%, 440px, calc(100vh - 360px)); }
    .tb-stagebox:has(.tb-arcade) .tb-sky { height: clamp(240px, calc(100vh - 380px), 360px); }
    .tb-stagebox:has(.tb-mode-hang) .tb-word { --slot: clamp(20px, calc((min(55vw, 640px) - 28px - (var(--n, 6) - 1) * var(--gap)) / var(--n, 6)), 54px); }
    .tb-stagebox:has(.tb-mode-anagram) .tb-word { --slot: clamp(20px, calc((min(55vw, 640px) - 28px - (var(--n, 6) - 1) * var(--gap)) / var(--n, 6)), 54px); }
}
/* кросворд на широкому екрані: сітка ліворуч, підказка/клавіатура/список праворуч — без перекриття */
@media (min-width: 1100px) {
    .tb-board.tb-cw-board { max-width: 1080px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, 1fr); grid-template-areas: "card dock" "card clues" "foot foot"; align-items: start; column-gap: 20px; }
    .tb-cw-board > .tb-board-card { grid-area: card; }
    .tb-cw-board > .tb-cw-dock { grid-area: dock; position: static; margin: 0; padding: 0; background: none; backdrop-filter: none; }
    .tb-cw-board > .tb-clues { grid-area: clues; grid-template-columns: minmax(0, 1fr); }
    .tb-cw-board > .tb-board-foot { grid-area: foot; }
    .tb-cw-board .tb-cw { --cell: min(40px, calc((55vw - 80px) / var(--cols))); }
}
/* вибір режиму / гри — кнопки: підписи шрифтом системи, а не стандартним шрифтом кнопки */
.tb-game-opt, .tb-team-board-opt, .tb-pill, .tb-lifeline { font-family: var(--f-body); }
.tb-mode-new { font-size: 11px; }
.tb-lobby-hint { font-size: 12px; }
/* старт: згорнутий вибір режиму */
.tb-lobby-modes-box { margin-top: 8px; }
.tb-lobby-modes-box > summary { list-style: none; border-color: var(--g); box-shadow: 0 0 0 3px color-mix(in srgb, var(--g) 30%, transparent); background: #fffdf7; padding-right: 36px; }
.tb-lobby-modes-box > summary::-webkit-details-marker { display: none; }
.tb-lobby-modes-box > summary::after { content: ''; position: absolute; right: 14px; top: 50%; width: 9px; height: 9px; border-right: 2.5px solid var(--ink-2); border-bottom: 2.5px solid var(--ink-2); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
.tb-lobby-modes-box[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.tb-lobby-modes-box > summary small { color: var(--ink-2); font-weight: 500; }
.tb-lobby-modes-box .tb-lobby-modes { margin-top: 8px; }
/* верхня панель командної гри на вужчих екранах: назва тесту ховається, кнопки переносяться */
@media (max-width: 900px) {
    .tb-team .tb-live-bar { flex-wrap: wrap; row-gap: 6px; }
    .tb-team .tb-live-title { display: none; }
}
@media (max-width: 520px) {
    .tb-team .tb-live-bar .tb-btn-sm { padding: 6px 8px; }
    .tb-team .tb-live-tag { display: none; }
}
.tb-team-tn small { font-size: 12px; }
/* екран гри на телефоні: «Продовжити вдома» і «Завершити гру» — один ряд, однакова ширина */
@media (max-width: 640px) {
    .tb-live-board-head .tb-btn { flex: 1 1 calc(50% - 8px); min-width: 0; padding-left: 10px; padding-right: 10px; font-size: 14px; }
    .tb-live-board-head h2 { flex: 1 1 auto; }
    .tb-live-board-head > span { flex-basis: 100%; }
}

/* гра в реальному часі: код, QR і посилання — і до, і під час гри */
.tb-live-code-chip { cursor: pointer; color: inherit; font-family: var(--f-display); letter-spacing: .04em; }
.tb-live-code-chip:hover { background: var(--s-chip-hover, rgba(255, 255, 255, .18)); }
.tb-live-code-chip:focus-visible { outline: 3px solid var(--go); outline-offset: 2px; }
.tb-live-share { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 24px; }
.tb-live-share-main { flex: 1 1 280px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; min-width: 0; }
.tb-live-share-main p { margin: 0; font-weight: 600; font-size: 16px; color: var(--ink-2); }
.tb-live-share .tb-live-code { font-size: clamp(44px, 8vw, 84px); }
.tb-live-share .tb-live-qr { width: min(240px, 70vw); }
.tb-live-share-link { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.tb-live-share-link .tb-input { flex: 1 1 220px; min-width: 0; font-size: 14px; }
.tb-live-join > .tb-btn { margin-top: 2px; }
/* верхня панель екрана гри на телефоні: переноситься, назва — окремим рядком */
@media (max-width: 640px) {
    .tb-live-bar { flex-wrap: wrap; row-gap: 6px; }
    .tb-live-bar .tb-live-title { order: 10; flex-basis: 100%; }
}

/* Старт тесту (start.php): прев’ю режимів і ігор замість кольорових крапок; малюнки — app/lobby.js */
.tb-lobby-game.has-thumb { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; align-content: start; align-items: start; row-gap: 2px; padding: 7px 7px 10px; }
.tb-lobby-game.has-thumb > b, .tb-lobby-game.has-thumb > small { padding: 0 4px; }
.tb-lobby-thumb { display: block; width: 100%; aspect-ratio: 1000 / 560; margin-bottom: 6px; border-radius: 9px; overflow: hidden; background: color-mix(in srgb, var(--g, var(--ink-3)) 14%, #fff); pointer-events: none; }
.tb-lobby-thumb > [data-thumb-mode] { display: block; width: 100%; height: 100%; }
.tb-lobby-thumb .tb-mode-thumb { height: 100%; border-radius: 0; }
.tb-lobby-thumb.tb-game-thumb.is-plain .lucide { background: var(--g); }
.tb-lobby-games:has(.has-thumb) { gap: 10px; }
@media (max-width: 420px) { .tb-lobby-games:has(.has-thumb) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
@media (max-width: 330px) { .tb-lobby-games:has(.has-thumb) { grid-template-columns: 1fr; } }
/* згорнутий вибір режиму — рядок: маленький малюнок ліворуч */
.tb-lobby-game.has-thumb.is-row { grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; row-gap: 1px; align-items: center; padding: 7px 40px 7px 7px; }
.tb-lobby-game.has-thumb.is-row .tb-lobby-thumb { grid-row: span 2; margin: 0; border-radius: 8px; }
.tb-lobby-game.has-thumb.is-row > b { align-self: end; padding: 0; }
.tb-lobby-game.has-thumb.is-row > small { align-self: start; padding: 0; }
.tb-lobby-game.is-row .tb-mode-thumb > * { transform: scale(.55); }
/* у випадному списку режимів (старт тесту) — рядки, не картки */
.tb-lobby-modes:has(.is-row) { grid-template-columns: 1fr; gap: 6px; }
.tb-lobby-modes .tb-lobby-game.has-thumb.is-row { padding-right: 12px; }

/* Нове ДЗ / гра: режими — плитками, гейміфікація — випадним списком з малюнками (HomeworkNewPage → PickSelect) */
.tb-pick-lead { margin-top: -4px; margin-bottom: 12px; }
.tb-mode-picker { margin-bottom: 8px; }
.tb-mode-picker .tb-game-opt > span:not(.tb-mode-thumb) { font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
.tb-mode-picker .tb-game-opt > small.tb-mode-note { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.tb-mode-picker .tb-game-opt > small.tb-mode-note .lucide { width: 13px; height: 13px; padding: 0; background: none; color: inherit; }
.tb-pick-select { margin-bottom: 14px; }
.tb-pick-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); column-gap: 14px; align-items: center; width: 100%; padding: 8px; border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); font-family: var(--f-body); text-align: left; cursor: pointer; }
.tb-pick-row .tb-game-thumb { border-radius: 9px; }
.tb-pick-row .tb-game-thumb.is-plain .lucide { width: 34px; height: 34px; padding: 7px; border-radius: 9px; color: #fff; }
.tb-pick-row-text { display: grid; gap: 2px; min-width: 0; }
.tb-pick-row-text b { display: flex; align-items: center; gap: 6px; font: 800 15px/1.2 var(--f-display); color: var(--ink); }
.tb-pick-row-text b .lucide { flex: none; width: 18px; height: 18px; color: var(--g); }
.tb-pick-row-text > span { font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.tb-pick-row:focus-visible { outline: 3px solid var(--go); outline-offset: 2px; }
.tb-pick-select-btn { grid-template-columns: 120px minmax(0, 1fr) 24px; border-color: var(--g, var(--ink-3)); box-shadow: 0 3px 0 var(--g, var(--ink-3)); background: var(--paper); }
.tb-pick-select-chev { width: 22px; height: 22px; color: var(--ink-2); transition: transform .2s; }
.tb-pick-select.is-open .tb-pick-select-chev { transform: rotate(180deg); }
.tb-pick-list { display: grid; gap: 6px; margin-top: 8px; padding: 6px; border: 2px solid var(--line); border-radius: 16px; background: var(--paper); }
.tb-pick-list .tb-pick-row:hover { border-color: var(--g, var(--ink-3)); }
.tb-pick-list .tb-pick-row.is-on { border-color: var(--g, var(--ink-3)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--g, var(--ink-3)) 30%, transparent); }
@media (max-width: 480px) {
    .tb-pick-row { grid-template-columns: 92px minmax(0, 1fr); column-gap: 10px; }
    .tb-pick-select-btn { grid-template-columns: 92px minmax(0, 1fr) 22px; }
}
/* старт тесту: малюнок гри у вкладеному span (його копіює згорнутий рядок) */
.tb-lobby-thumb-art { display: grid; place-items: center; width: 100%; height: 100%; }
/* сторінка тесту (single.php): прев’ю в плитках режимів — з app/lobby.js */
.tb-hub-tile .tb-lobby-thumb { margin-bottom: 0; }
.tb-single-work > :last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Вибір гри: підзаголовки груп (Україна, Пори року, Для розваги, Для малечі) */
.tb-pick-group { display: block; margin: 8px 4px 0; font: 800 12px/1.3 var(--f-display); letter-spacing: .02em; color: var(--ink-3); }
.tb-pick-group:first-child { margin-top: 2px; }

/* Тематичні ігри (game-themes.tsx): легкі анімації малюнків і сцен */
/* листя падає, як справжнє: гойдається з боку в бік і перевертається */
.tb-leaf-fall { animation: tb-leaf-fall 5.5s ease-in-out infinite; }
.tb-leaf-fall.is-near { animation-name: tb-leaf-fall-near; animation-duration: 6.5s; }
.tb-leaf-fall.is-far { animation-name: tb-leaf-fall-far; animation-duration: 12s; animation-timing-function: linear; }
@keyframes tb-leaf-fall { 0% { transform: translate(0, 0) rotate(0); opacity: 0; } 10% { opacity: 1; } 30% { transform: translate(11px, 28px) rotate(70deg); } 55% { transform: translate(-7px, 54px) rotate(-25deg); } 80% { transform: translate(12px, 78px) rotate(95deg); opacity: 1; } 100% { transform: translate(3px, 96px) rotate(30deg); opacity: 0; } }
@keyframes tb-leaf-fall-near { 0% { transform: translate(0, 0) rotate(0); opacity: 0; } 10% { opacity: 1; } 35% { transform: translate(24px, 40px) rotate(80deg); } 65% { transform: translate(-6px, 76px) rotate(-30deg); } 90% { opacity: 1; } 100% { transform: translate(20px, 112px) rotate(110deg); opacity: 0; } }
@keyframes tb-leaf-fall-far { 0% { transform: translate(0, -40px) rotate(0); opacity: 0; } 6% { opacity: 1; } 25% { transform: translate(45px, 80px) rotate(120deg); } 50% { transform: translate(-15px, 200px) rotate(-40deg); } 75% { transform: translate(50px, 330px) rotate(160deg); } 92% { opacity: 1; } 100% { transform: translate(20px, 460px) rotate(60deg); opacity: 0; } }
/* сніг: повільно, з легким знесенням вітром */
.tb-snow-fall { animation: tb-snow-fall 4.5s linear infinite; }
.tb-snow-fall.is-far { animation-name: tb-snow-fall-far; animation-duration: 13s; }
@keyframes tb-snow-fall { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 1; } 50% { transform: translate(7px, 60px); } 100% { transform: translate(-2px, 122px); opacity: 0; } }
@keyframes tb-snow-fall-far { 0% { transform: translate(0, -40px); opacity: 0; } 8% { opacity: 1; } 33% { transform: translate(22px, 120px); } 66% { transform: translate(-8px, 300px); } 100% { transform: translate(18px, 480px); opacity: 0; } }
/* кульки, що відлетіли: піднімаються, нитка гойдається */
.tb-th-rise { animation: tb-th-rise 16s linear infinite; }
.tb-th-rise.is-far { animation-name: tb-th-rise-far; animation-duration: 26s; }
@keyframes tb-th-rise { to { transform: translate(40px, -760px); } }
@keyframes tb-th-rise-far { to { transform: translate(70px, -1000px); } }
.tb-th-sway { transform-box: fill-box; transform-origin: 50% 0; animation: tb-th-sway 2.8s ease-in-out infinite alternate; }
@keyframes tb-th-sway { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
/* кулька в лапці ведмедика: гойдається навколо лапки разом із ниткою; нова — «надувається» з лапки */
.tb-th-pivot { transform-box: view-box; transform-origin: 0 0; animation: tb-th-pivot 2.4s ease-in-out infinite alternate; }
@keyframes tb-th-pivot { from { transform: rotate(-3.5deg); } to { transform: rotate(3.5deg); } }
.tb-th-pivot.tb-th-inflate { animation: tb-th-inflate .9s cubic-bezier(.3, 1.5, .5, 1) both, tb-th-pivot 2.4s ease-in-out .9s infinite alternate; }
@keyframes tb-th-inflate { from { transform: scale(.12); opacity: .2; } 60% { opacity: 1; } }
.tb-bob { animation: tb-bob 1.8s ease-in-out infinite alternate; }
@keyframes tb-bob { to { transform: translate(1px, -4px) rotate(3deg); } }
.tb-lift { animation: tb-lift 2.4s ease-in-out infinite alternate; }
@keyframes tb-lift { from { transform: translateY(-4px); } to { transform: translateY(-14px); } }
.tb-float { animation: tb-lift 2s ease-in-out infinite alternate; }
.tb-tail { transform-box: fill-box; transform-origin: 0% 100%; animation: tb-tail 1.6s ease-in-out infinite alternate; }
@keyframes tb-tail { to { transform: rotate(-7deg); } }
.tb-scarf { transform-box: fill-box; transform-origin: 50% 0; animation: tb-scarf 1.4s ease-in-out infinite alternate; }
@keyframes tb-scarf { to { transform: rotate(9deg); } }
.tb-cape { transform-box: fill-box; transform-origin: 50% 0; animation: tb-scarf 1.2s ease-in-out infinite alternate; }
.tb-clatter { transform-box: fill-box; transform-origin: 50% 100%; animation: tb-clatter 2.6s ease-in-out infinite; }
@keyframes tb-clatter { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(14deg); } 86% { transform: rotate(4deg); } 92% { transform: rotate(14deg); } }
.tb-glide { animation: tb-glide 3s ease-in-out infinite alternate; }
@keyframes tb-glide { to { transform: translate(-8px, -5px); } }
.tb-crab { animation: tb-crab 2.2s ease-in-out infinite alternate; }
@keyframes tb-crab { to { transform: translateX(-10px); } }
.tb-coin { transform-box: fill-box; transform-origin: center; animation: tb-coin 1.2s ease-in-out infinite; }
@keyframes tb-coin { 50% { transform: scaleX(.15); } }
.tb-pixel-idle { animation: tb-pixel-idle .9s steps(2) infinite; }
@keyframes tb-pixel-idle { to { transform: translateY(-3px); } }
.tb-smoke { animation: tb-smoke 3.6s linear infinite; }
@keyframes tb-smoke { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 15% { opacity: .9; } 100% { transform: translate(10px, -34px) scale(1.4); opacity: 0; } }
.tb-swing { transform-box: fill-box; transform-origin: 50% 100%; animation: tb-swing .7s ease-in-out infinite alternate; }
@keyframes tb-swing { from { transform: rotate(-25deg); } to { transform: rotate(20deg); } }
.tb-wave-hand { transform-box: fill-box; transform-origin: 50% 100%; animation: tb-swing .5s ease-in-out infinite alternate; }
.tb-glow { transform-box: fill-box; transform-origin: center; animation: tb-glow 1.6s ease-in-out infinite alternate; }
@keyframes tb-glow { to { transform: scale(1.12); opacity: .34; } }
.tb-flicker { animation: tb-flicker 1.1s steps(3) infinite alternate; }
@keyframes tb-flicker { to { opacity: .72; } }
.tb-bat { animation: tb-bat 4s ease-in-out infinite alternate; }
@keyframes tb-bat { 30% { transform: translate(-14px, 6px); } 65% { transform: translate(10px, -8px); } to { transform: translate(-4px, 2px); } }
@media (prefers-reduced-motion: reduce) {
    .tb-leaf-fall, .tb-snow-fall, .tb-th-rise, .tb-th-sway, .tb-th-pivot, .tb-th-inflate, .tb-bob, .tb-lift, .tb-float, .tb-tail, .tb-scarf, .tb-cape, .tb-clatter, .tb-glide, .tb-crab, .tb-coin, .tb-pixel-idle, .tb-smoke, .tb-swing, .tb-wave-hand, .tb-glow, .tb-flicker, .tb-bat { animation: none; }
    .tb-leaf-fall, .tb-snow-fall, .tb-th-rise, .tb-smoke { opacity: 0; }
}
/* старт тесту: обраний варіант уже в рядку-підсумку — у відкритому списку не повторюємо (і заголовок групи, якщо в ній більше нічого) */
details[data-pick] .tb-lobby-modes > label:has(> input:checked) { display: none; }
details[data-pick] .tb-lobby-modes > .tb-pick-group:has(+ label > input:checked):is(:has(+ label + .tb-pick-group), :has(+ label:last-child)) { display: none; }
/* тематичні ігри: іскри навколо малюнка на новому етапі */
.tb-th-burst { opacity: 0; animation: tb-th-burst .9s cubic-bezier(.2, .7, .3, 1) .15s both; }
@keyframes tb-th-burst { 0% { opacity: 0; transform: translate(0, 0) scale(.3); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1) rotate(90deg); } }
@media (prefers-reduced-motion: reduce) { .tb-th-burst { display: none; } }
/* непарна кількість варіантів у два стовпці: останній — по центру, тієї ж ширини, а не сиротою ліворуч */
@media (min-width: 641px) {
    .tb-answers:not(.is-4):not(.is-long):not([style*="--cols"]) > .tb-answer:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc((100% - clamp(10px, 1.6vw, 14px)) / 2); }
}
@media (max-width: 640px) { .tb-answers.is-tiny > .tb-answer:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc((100% - 8px) / 2); } }
