/* Emergency gameplay presentation repair — r220
   Purpose: prevent critical game/settings text clipping and restore readable controls
   across host/player surfaces without changing gameplay state or logic. */

body[data-game-brand] :is(
  .question-text,.question-prompt,.q-question-text,.qadha-answer-explanation,.qadha-answer-variants,
  .answer-box,.revealed-content,.round-mode-banner,.surprise-banner,.late-join-notice,
  .modal-sub,.inline-note,.field small,.field label,.settings-design-hint,
  .participant-edit-row small,.player-live-status,.waiting-stage p,.submission-card p,
  .game-hud-meta,.phase-scene p,.phase-scene h1,.phase-scene h2,
  .k-card p,.k-card small,.k-hero p,.lobby-heading p,
  .t10-card p,.setup-card p,.section-title,.option-description
){
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  -webkit-line-clamp:unset!important;
  -webkit-box-orient:initial!important;
  max-height:none!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  hyphens:none!important;
}

body[data-game-brand] :is(
  button,.btn,.segment,.sound-option,.category-choice,.q-toolbar-action,
  .q-question-actions button,.q-timer-buttons button,.winner-buttons button,
  .mode-toggle,.option-switch,.t10-btn
){
  white-space:normal!important;
  text-overflow:clip!important;
  overflow-wrap:anywhere!important;
  line-height:1.35!important;
}

body[data-game-brand] :is(.field,.card,.setup-card,.participant-edit-fields,.q-question-stage-v129,.question-card,.q-question-content-scroll,.q-question-control-dock){
  min-width:0!important;
}

body[data-game-brand] :is(input,select,textarea){
  max-width:100%!important;
  min-width:0!important;
}

/* Fbrkha critical game copy */
body[data-game-brand="fbrkha"] :is(
  .mobile-question-stage,.question-stage,.question-shell,.question-card,
  .answer-entry-card,.submission-card,.vote-card,.result-card,.host-player-vote-card
){
  min-width:0!important;
}
body[data-game-brand="fbrkha"] :is(
  .mobile-question-stage h1,.mobile-question-stage h2,.question-stage h1,.question-stage h2,
  .question-copy,.fabrication-shape-hint,.own-fake-preview,.vote-option,.result-answer,
  .player-chip-info b,.scoreboard-name,.participant-name
){
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  -webkit-line-clamp:unset!important;
  overflow-wrap:anywhere!important;
}
body[data-game-brand="fbrkha"] .host-tools-panel .btn{
  min-height:44px!important;
  height:auto!important;
  padding-block:9px!important;
}

/* Qadha: questions and controls must remain fully readable on TV and mobile */
body[data-game-brand="qadha"] :is(
  .q-question-header,.q-question-body-v129,.question-card,.q-question-content-scroll,
  .q-question-control-dock,.q-timer-block,.q-timer-buttons,.q-question-actions,
  .q-question-sidebar-v129,.qadha-solution-panel,.qadha-scoring-panel
){min-width:0!important}

body[data-game-brand="qadha"] :is(
  .question-text,.qadha-reveal-question,.qadha-solution-panel,.qadha-answer-explanation,
  .order-item-label,.q-meta span,.question-kind b,.drawing-host-heading p,
  .host-qr-privacy-note,.qr-local-warning,.participant-status
){
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  -webkit-line-clamp:unset!important;
  overflow-wrap:anywhere!important;
}
body[data-game-brand="qadha"] .q-question-actions .btn{
  height:auto!important;
  min-height:46px!important;
  padding:9px 13px!important;
}
body[data-game-brand="qadha"] .q-participant-direct-actions{
  display:flex!important;
  flex-wrap:wrap!important;
  justify-content:center!important;
  gap:9px!important;
  margin-top:14px!important;
}
body[data-game-brand="qadha"] .q-participant-direct-link,
body[data-game-brand="qadha"] .special-participant-link{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:44px!important;
  padding:9px 14px!important;
  border-radius:12px!important;
  text-decoration:none!important;
  font-weight:850!important;
  white-space:normal!important;
}
body[data-game-brand="qadha"] .special-participant-link{
  width:100%!important;
  margin-top:8px!important;
  border:1px solid rgba(255,255,255,.15)!important;
  background:rgba(255,255,255,.055)!important;
  color:inherit!important;
}
body[data-game-brand="qadha"] .special-qr-actions{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
}

/* Khaltaha / Top10 long labels */
body[data-game-brand="khaltaha"] :is(.k-card h1,.k-card h2,.k-card h3,.k-card p,.k-card small,.mode-toggle,.option-switch),
body[data-game-brand="top10"] :is(.t10-card h1,.t10-card h2,.t10-card h3,.t10-card p,.setup-card h2,.setup-card p,.team-name){
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  -webkit-line-clamp:unset!important;
  overflow-wrap:anywhere!important;
}

@media (max-width:720px){
  body[data-game-brand] :is(.btn,button){min-height:44px}
  body[data-game-brand="qadha"] .q-question-actions,
  body[data-game-brand="qadha"] .q-timer-buttons{
    flex-wrap:wrap!important;
  }
  body[data-game-brand="qadha"] .q-question-actions .btn,
  body[data-game-brand="qadha"] .q-timer-buttons .btn{
    flex:1 1 132px!important;
  }
}


/* r220b — Khaltaha finale decorative glow must never expand the document width. */
body[data-game-brand="khaltaha"] .khaltaha-final-v3235{
  overflow:hidden!important;
  contain:paint!important;
}
body[data-game-brand="khaltaha"] .khaltaha-final-v3235 .k-final-glow{
  inset:0!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  overflow:hidden!important;
  pointer-events:none!important;
}
