/* r1032 | Qadha responsive host board visual restoration.
   CSS only: no changes to room state, score logic, questions or history. */
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board{
  --q1032-surface:#19142a;
  --q1032-panel:#2a203e;
  --q1032-edge:#5d4b7c;
  --q1032-ink:#faf8ff;
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-qadha-toolbar{
  background:#241b38!important;
  border:1px solid #615079!important;
  color:var(--q1032-ink)!important;
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel{
  background:linear-gradient(160deg,#2b2141,#191527)!important;
  border:1px solid #584873!important;
  box-shadow:none!important;
  overflow:hidden!important;
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel .board-cat{
  display:grid!important;
  grid-template-rows:minmax(0,1fr) auto!important;
  grid-template-columns:minmax(0,1fr)!important;
  align-items:stretch!important;
  min-width:0!important;
  overflow:hidden!important;
  background:#211a32!important;
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel .board-cat-art{
  display:flex!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  min-height:0!important;
  height:100%!important;
  flex:1 1 auto!important;
  align-items:center!important;
  justify-content:center!important;
  position:relative!important;
  margin:0!important;
  background:#302547!important;
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel .board-cat-art :is(img.cat-cover,.board-cat-fallback){
  width:100%!important;
  max-width:100%!important;
  height:100%!important;
  max-height:100%!important;
  min-width:0!important;
  object-fit:contain!important;
  object-position:center!important;
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel .board-cat-art .board-cat-fallback{
  display:grid!important;
  place-items:center!important;
  font-size:clamp(28px,4vw,58px)!important;
  background:transparent!important;
  overflow:hidden!important;
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel .board-cat strong{
  color:#fff!important;
  background:rgba(42,30,68,.97)!important;
  text-shadow:none!important;
  line-height:1.22!important;
  font-weight:850!important;
  margin:0!important;
  padding:5px 3px!important;
  min-width:0!important;
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel .slot.available{
  background:#e9def8!important;
  color:#271838!important;
  border:1px solid #b29dce!important;
  box-shadow:none!important;
  opacity:1!important;
  font-weight:950!important;
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel .slot.available:focus-visible{
  outline:3px solid #ffdb85!important;
  outline-offset:1px!important;
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer.qadha-reference-footer{
  background:#221a35!important;
  border:1px solid #5f4b7d!important;
  box-shadow:none!important;
  color:#faf7ff!important;
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer .premium-team-box{
  background:#2d2341!important;
  border:1px solid #63517f!important;
  color:#fff!important;
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer .team-name-button{
  color:#fff!important;
  background:#5d4484!important;
  min-width:0!important;
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer .team-1 .team-name-button{
  background:#365b82!important;
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer .premium-score-control output{
  background:#f1eafb!important;
  color:#30203f!important;
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .modern-turn-arrow{
  color:#fff!important;
  background:#574079!important;
  border:1px solid #c4abeb!important;
}
@media (min-width:560px) and (max-width:1024px) and (orientation:landscape) and (max-height:560px){
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus):has(.qadha-reference-board){
    overflow:hidden!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus):has(.qadha-reference-board) #qApp{
    height:100dvh!important;
    min-height:0!important;
    padding:4px!important;
    overflow:hidden!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board{
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    display:grid!important;
    grid-template-rows:44px minmax(0,1fr) 66px!important;
    gap:4px!important;
    overflow:hidden!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-qadha-toolbar{
    min-height:0!important;
    height:44px!important;
    padding:3px 7px!important;
    grid-template-columns:minmax(0,1fr) 105px 110px!important;
    grid-template-rows:minmax(0,1fr)!important;
    grid-template-areas:"actions brand turn"!important;
    gap:6px!important;
    overflow:hidden!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-qadha-toolbar .premium-turn-pill{min-height:32px!important;height:34px!important;min-width:0!important;padding:1px 4px!important}
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-qadha-toolbar .q-toolbar-action{
    min-height:36px!important;
    height:36px!important;
    padding:2px 6px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-grid.qadha-reference-grid{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    grid-auto-rows:minmax(0,1fr)!important;
    gap:4px!important;
    min-height:0!important;
    max-height:100%!important;
    height:100%!important;
    overflow:hidden!important;
    padding:0!important;
    align-content:stretch!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel{
    min-height:0!important;
    height:100%!important;
    padding:3px!important;
    gap:3px!important;
    grid-template-columns:minmax(42px,.74fr) minmax(62px,1fr) minmax(42px,.74fr)!important;
    grid-template-rows:minmax(0,1fr)!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .category-value-column{
    display:grid!important;
    grid-template-rows:repeat(3,minmax(0,1fr))!important;
    gap:2px!important;
    min-height:0!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel .slot{
    min-width:0!important;
    min-height:0!important;
    height:100%!important;
    font-size:clamp(13px,2.1vw,20px)!important;
    border-radius:7px!important;
    padding:0!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel .board-cat{
    min-height:0!important;
    padding:2px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel .board-cat-art{
    min-height:0!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel .board-cat strong{
    font-size:clamp(10px,1.5vw,13px)!important;
    padding:3px 2px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer.qadha-reference-footer{
    position:static!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 100px minmax(0,1fr)!important;
    grid-template-rows:minmax(0,1fr)!important;
    gap:4px!important;
    height:66px!important;
    max-height:66px!important;
    min-height:0!important;
    padding:3px!important;
    margin:0!important;
    width:100%!important;
    overflow:hidden!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer .team-0{
    grid-column:3!important;grid-row:1!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer .team-1{
    grid-column:1!important;grid-row:1!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-team-box{
    min-height:0!important;
    height:100%!important;
    display:grid!important;
    /* r1322: keep score number legible while expanding +/- hit areas. */
    grid-template-columns:minmax(0,1fr) 120px!important;
    grid-template-rows:minmax(0,1fr)!important;
    grid-template-areas:"name score"!important;
    padding:3px!important;
    gap:3px!important;
    overflow:hidden!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-team-box .team-name-button{
    min-width:0!important;
    max-height:100%!important;
    padding:2px 4px!important;
    font-size:11px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-score-control{
    width:100%!important;
    grid-area:score!important;
    display:grid!important;
    grid-template-columns:36px minmax(0,1fr) 36px!important;
    gap:2px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .score-step{
    min-width:36px!important;width:36px!important;
    min-height:38px!important;height:38px!important;
    padding:0!important;font-size:19px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-score-control output{
    min-width:0!important;font-size:18px!important;
    min-height:32px!important;height:32px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .modern-turn-arrow{
    grid-column:2!important;grid-row:1!important;
    width:100%!important;min-height:0!important;
    height:100%!important;padding:3px!important;
    font-size:11px!important;
  }
}
@media (max-width:760px) and (orientation:portrait){
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus):has(.qadha-reference-board){
    overflow:hidden!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus):has(.qadha-reference-board) #qApp{
    height:100dvh!important;
    min-height:0!important;
    overflow:hidden!important;
    padding:4px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board{
    height:100%!important;
    max-height:100%!important;
    min-height:0!important;
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr) auto!important;
    gap:5px!important;
    overflow:hidden!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-qadha-toolbar{
    position:relative!important;
    top:0!important;
    min-height:0!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-grid.qadha-reference-grid{
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-rows:none!important;
    grid-auto-rows:minmax(147px,auto)!important;
    height:100%!important;
    min-height:0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-width:thin!important;
    padding:3px 3px 8px!important;
    gap:5px!important;
    align-content:start!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel{
    width:100%!important;
    min-height:147px!important;
    height:auto!important;
    padding:4px!important;
    grid-template-columns:minmax(55px,.72fr) minmax(90px,1fr) minmax(55px,.72fr)!important;
    gap:4px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel .board-cat{
    min-height:0!important;
    padding:3px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel .board-cat-art{
    min-height:0!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel .slot{
    min-height:39px!important;
    font-size:17px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer.qadha-reference-footer{
    position:static!important;
    left:auto!important;right:auto!important;bottom:auto!important;
    width:100%!important;
    min-height:0!important;
    max-height:170px!important;
    height:auto!important;
    margin:0!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:auto auto!important;
    gap:4px!important;
    padding:4px!important;
    overflow:hidden!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .modern-turn-arrow{
    grid-column:1/-1!important;grid-row:1!important;
    min-height:28px!important;
    height:28px!important;
    padding:2px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-team-box{
    min-height:0!important;
    height:auto!important;
    padding:3px!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-areas:"name" "score"!important;
    gap:2px!important;
    overflow:hidden!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-team-box .team-name-button{
    min-height:35px!important;
    max-height:44px!important;
    min-width:0!important;
    padding:2px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-score-control{
    grid-template-columns:30px minmax(0,1fr) 30px!important;
    gap:2px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .score-step{
    width:30px!important;min-width:30px!important;
    height:30px!important;min-height:30px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-score-control output{
    height:30px!important;min-height:30px!important;
    font-size:19px!important;
  }
}

/* r1032 second-pass: neutralize legacy two-column category internals and oversized value rails. */
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel .board-cat{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  grid-template-columns:none!important;
  grid-auto-flow:row!important;
  gap:0!important;
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel .board-cat-art{
  display:flex!important;
  flex:1 1 0%!important;
  width:100%!important;
  height:auto!important;
  max-height:none!important;
  min-height:0!important;
  overflow:hidden!important;
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel .board-cat strong{
  flex:0 0 auto!important;
  width:100%!important;
}
@media (min-width:560px) and (max-width:1024px) and (orientation:landscape) and (max-height:560px){
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-qadha-toolbar .q-board-brand{
    display:flex!important;align-items:center!important;justify-content:center!important;
    grid-area:brand!important;min-width:0!important;
    color:#fff!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-qadha-toolbar .premium-turn-pill{
    display:flex!important;align-items:center!important;justify-content:center!important;
    grid-area:turn!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer.qadha-reference-footer{
    display:flex!important;
    flex-direction:row!important;
    justify-content:stretch!important;
    align-items:stretch!important;
    gap:5px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer.qadha-reference-footer .modern-turn-arrow{
    display:none!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer.qadha-reference-footer .premium-team-box{
    flex:1 1 0%!important;
    width:0!important;
    max-width:none!important;
    min-width:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    flex-direction:row!important;
    grid-area:auto!important;
    grid-column:auto!important;
    grid-row:auto!important;
    padding:4px!important;
    gap:4px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer.qadha-reference-footer .premium-team-box .team-name-button{
    display:flex!important;
    flex:1 1 0%!important;
    width:0!important;
    min-width:0!important;
    max-width:none!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    padding:1px 4px!important;
    overflow:hidden!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer.qadha-reference-footer .premium-team-box .premium-score-control{
    display:grid!important;
    flex:0 0 106px!important;
    width:106px!important;
    min-width:0!important;
    height:100%!important;
    grid-template-columns:36px minmax(0,1fr) 36px!important;
    gap:2px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer.qadha-reference-footer .premium-team-box .score-step{
    /* r1324: the high-specificity footer rule must not undo the 36×38
       landscape tap-size requirement from the earlier grid rules. */
    min-width:36px!important;width:36px!important;min-height:38px!important;height:38px!important;
    padding:0!important;flex-shrink:0!important;
  }
}
@media(max-width:760px) and (orientation:portrait){
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel .category-value-column{
    display:grid!important;
    grid-template-rows:repeat(3,minmax(0,1fr))!important;
    grid-auto-rows:minmax(0,1fr)!important;
    height:100%!important;
    max-height:100%!important;
    min-height:0!important;
    gap:3px!important;
    align-content:stretch!important;
    overflow:hidden!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .board-category-panel .category-value-column .slot{
    min-height:0!important;
    max-height:100%!important;
    height:100%!important;
    padding:0!important;
    font-size:18px!important;
    line-height:1!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer .team-name-button strong{
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    line-height:1.1!important;
    max-height:2.4em!important;
    font-size:12px!important;
  }
}

/* Keep focus-mode accessible without covering either team's score. */
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:has(.qadha-reference-board) #fbrkhHostFocusToggle{
  position:fixed!important;inset:16px auto auto 27px!important;
  width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;
  padding:0!important;margin:0!important;
  font-size:0!important;
  display:grid!important;place-items:center!important;
  transform:none!important;
  color:#fff!important;background:#423259!important;border:1px solid #9d82bd!important;
  border-radius:10px!important;box-shadow:none!important;z-index:120!important;
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:has(.qadha-reference-board) #fbrkhHostFocusToggle span{
  font-size:19px!important;
}
@media (min-width:560px) and (max-width:1024px) and (orientation:landscape) and (max-height:560px){
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-qadha-toolbar{
    grid-template-columns:minmax(0,1fr) 180px!important;
    grid-template-areas:"actions turn"!important;
    grid-template-rows:minmax(0,1fr)!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-qadha-toolbar .q-board-brand{
    display:none!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-qadha-toolbar .premium-turn-pill{
    width:100%!important;max-width:100%!important;min-width:0!important;
    overflow:hidden!important;grid-area:turn!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer.qadha-reference-footer .team-roster{
    display:none!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer.qadha-reference-footer .team-name-button strong{
    color:#fff!important;
    font-size:clamp(10px,1.3vw,13px)!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
}

@media (min-width:560px) and (max-width:1024px) and (orientation:landscape) and (max-height:560px){
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:has(.qadha-reference-board) #fbrkhHostFocusToggle{
    left:220px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-qadha-toolbar .premium-turn-pill{
    background:#493368!important;border:1px solid #a48ace!important;
    color:#fff!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-qadha-toolbar .premium-turn-pill :is(small,strong){
    color:#fff!important;opacity:1!important;display:block!important;
    font-size:11px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer.qadha-reference-footer .team-help-block{
    flex:0 0 105px!important;
    width:105px!important;
    min-width:0!important;
    max-width:105px!important;
    display:flex!important;
    align-items:center!important;
    overflow:hidden!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer.qadha-reference-footer .team-help-buttons{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:2px!important;
    min-width:0!important;
    width:100%!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer.qadha-reference-footer .team-help-buttons .help-btn{
    flex:0 0 31px!important;
    width:31px!important;
    min-width:31px!important;
    max-width:31px!important;
    height:35px!important;
    min-height:35px!important;
    padding:1px!important;
    display:flex!important;justify-content:center!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer.qadha-reference-footer .team-help-buttons .help-copy{display:none!important}
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .qadha-reference-board .premium-board-footer.qadha-reference-footer .team-help-buttons .help-icon{font-size:17px!important}
}

/* r1032: compact and scroll-safe question view. The question stays before scores
   in visual reading order; all actions and help buttons remain functional. */
@media (max-width:1024px){
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus):has(.q-question-screen-v129){
    position:relative!important;
    height:auto!important;
    min-height:100dvh!important;
    width:100%!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus):has(.q-question-screen-v129) #qApp{
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    height:auto!important;
    min-height:100dvh!important;
    padding:5px!important;
    margin:0!important;
    overflow:visible!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129{
    position:relative!important;
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    min-height:calc(100dvh - 10px)!important;
    display:flex!important;
    flex-direction:column!important;
    gap:8px!important;
    padding:0!important;
    margin:0!important;
    overflow:visible!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .premium-qadha-toolbar{
    position:relative!important;
    top:auto!important;
    left:auto!important;
    min-height:56px!important;
    height:auto!important;
    max-width:100%!important;
    flex:0 0 auto!important;
    overflow:visible!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .q-question-body-v129{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    min-height:0!important;
    height:auto!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    gap:8px!important;
    overflow:visible!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .q-question-stage-v129{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:auto!important;
    min-height:0!important;
    flex:0 0 auto!important;
    grid-column:auto!important;
    grid-row:auto!important;
    overflow:visible!important;
    padding:0!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .question-card{
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    min-height:290px!important;
    min-width:0!important;
    overflow:visible!important;
    display:flex!important;
    flex-direction:column!important;
    gap:6px!important;
    margin:0!important;
    padding:10px!important;
    border:2px solid #876cb3!important;
    border-radius:17px!important;
    background:#21182f!important;
    color:#fff!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .q-question-header{
    width:100%!important;
    min-width:0!important;
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    justify-content:space-between!important;
    padding:3px!important;
    gap:6px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .q-question-content-scroll{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:auto!important;
    min-height:100px!important;
    max-height:none!important;
    padding:8px!important;
    overflow:visible!important;
    flex:1 1 auto!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .question-text{
    color:#fff!important;
    font-size:clamp(20px,4.8vw,34px)!important;
    font-weight:800!important;
    line-height:1.4!important;
    text-align:center!important;
    overflow-wrap:anywhere!important;
    white-space:normal!important;
    padding:14px 8px!important;
    max-width:100%!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .question-turn-banner{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    display:flex!important;
    flex-wrap:wrap!important;
    justify-content:center!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .q-question-control-dock{
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    max-width:100%!important;
    min-height:0!important;
    height:auto!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-rows:auto!important;
    gap:7px!important;
    overflow:visible!important;
    flex:0 0 auto!important;
    margin:4px 0 0!important;
    padding:7px!important;
    border-radius:12px!important;
    background:#261d38!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .q-timer-block{
    position:relative!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    min-height:44px!important;
    height:auto!important;
    display:grid!important;
    grid-template-columns:auto auto minmax(0,1fr)!important;
    gap:6px!important;
    padding:6px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .q-timer-buttons,
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .q-question-actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    min-width:0!important;
    width:100%!important;
    gap:6px!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .q-timer-buttons .btn,
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .q-question-actions .btn{
    display:flex!important;
    justify-content:center!important;
    min-width:0!important;
    min-height:44px!important;
    height:auto!important;
    padding:8px!important;
    font-size:12px!important;
    line-height:1.25!important;
    white-space:normal!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .q-question-sidebar-v129{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:auto!important;
    min-height:0!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:auto!important;
    gap:6px!important;
    grid-column:auto!important;
    grid-row:auto!important;
    overflow:visible!important;
    padding:0!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .side-team{
    position:relative!important;
    display:grid!important;
    width:100%!important;
    min-width:0!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-rows:auto auto!important;
    grid-template-areas:"name score" "help help"!important;
    gap:6px!important;
    overflow:hidden!important;
    padding:6px!important;
    border-radius:14px!important;
    background:#241a37!important;
    color:#fff!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .side-team-name{
    display:flex!important;
    flex-direction:column!important;
    align-items:flex-start!important;
    justify-content:center!important;
    grid-area:name!important;
    min-width:0!important;
    width:100%!important;
    height:auto!important;
    min-height:52px!important;
    padding:5px!important;
    border-radius:10px!important;
    background:#614787!important;
    color:#fff!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .team-1 .side-team-name{
    background:#3b6288!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .side-team-name strong{
    font-size:clamp(12px,2vw,18px)!important;
    line-height:1.22!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    text-align:right!important;
    max-height:none!important;
    color:#fff!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .side-team .big-score{
    display:grid!important;
    place-items:center!important;
    grid-area:score!important;
    min-width:55px!important;
    width:auto!important;
    height:auto!important;
    min-height:52px!important;
    padding:2px 5px!important;
    border-radius:10px!important;
    background:#eee5fa!important;
    color:#342044!important;
    font-size:clamp(22px,3.5vw,31px)!important;
    line-height:1!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .side-help-shell{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    grid-area:help!important;
    width:100%!important;
    min-width:0!important;
    min-height:0!important;
    height:auto!important;
    gap:5px!important;
    padding:0!important;
    overflow:hidden!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .side-help-shell h3{
    display:none!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .side-team-helps{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    min-width:0!important;
    gap:3px!important;
    flex-wrap:wrap!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .side-team-helps .help-btn{
    min-width:35px!important;
    width:35px!important;
    min-height:35px!important;
    height:35px!important;
    max-width:35px!important;
    flex:0 0 35px!important;
    padding:2px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .side-team-helps .help-copy{display:none!important}
}
@media(max-width:560px){
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .q-question-actions,
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .q-timer-buttons{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .question-text{
    font-size:clamp(21px,6vw,28px)!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:not(.qadha-drawing-focus) .q-question-screen-v129 .side-team .big-score{
    min-width:52px!important;font-size:24px!important;
  }
}

/* Keep the optional focus control away from question timer and team scores. */
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:has(.q-question-screen-v129) #fbrkhHostFocusToggle{
  position:fixed!important;inset:14px auto auto 17px!important;
  width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;
  padding:0!important;margin:0!important;
  font-size:0!important;display:grid!important;place-items:center!important;
  transform:none!important;
  color:#fff!important;background:#423259!important;border:1px solid #9d82bd!important;
  border-radius:10px!important;box-shadow:none!important;z-index:120!important;
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active:has(.q-question-screen-v129) #fbrkhHostFocusToggle span{font-size:18px!important}
/* Harmonize question-side score cards with the board's calm dark palette. */
@media (min-width:1025px){
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active .q-question-screen-v129 .side-team{
    background:linear-gradient(160deg,#2a1f3c,#181226)!important;
    border:1px solid #71548e!important;
    color:#fff!important;
    box-shadow:none!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active .q-question-screen-v129 .side-team-name{
    width:100%!important;
    min-width:0!important;
    min-height:72px!important;
    height:auto!important;
    border-radius:14px!important;
    background:#654788!important;
    padding:10px!important;
    color:#fff!important;
    box-shadow:none!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active .q-question-screen-v129 .side-team.team-1 .side-team-name{
    background:#365e85!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active .q-question-screen-v129 .side-team-name strong{
    max-width:100%!important;
    min-width:0!important;
    font-size:clamp(18px,1.7vw,27px)!important;
    line-height:1.2!important;
    text-align:center!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    color:#fff!important;
  }
  html[data-ui-mode="modern"] body[data-game-brand="qadha"].q-game-active .q-question-screen-v129 .big-score{
    font-size:clamp(42px,4vw,62px)!important;
    color:#f7edff!important;
  }
}

/* r1067 | Keep game name only in welcome hero, restore header text in active game. */
html[data-ui-mode="modern"] body.qadha-v2-home[data-game-brand="qadha"]:not(.q-game-active) #qNav .q-brand > span{display:none!important}
/* r1327: the modern welcome has a pale mint backdrop even with dark preference.
   Dark teal title and subtitle keep actual text legible; never touch games/rounds. */
html[data-theme="dark"][data-ui-mode="modern"] body[data-game-brand="qadha"] #qApp#qApp .hero-q.qadha-initial-home h1{
color:#f1fffc!important;-webkit-text-fill-color:#f1fffc!important;text-shadow:0 3px 20px #0011167a!important}
html[data-theme="dark"][data-ui-mode="modern"] body[data-game-brand="qadha"] #qApp#qApp .hero-q.qadha-initial-home h1 span{
color:#83efd8!important;-webkit-text-fill-color:#83efd8!important}
html[data-theme="dark"][data-ui-mode="modern"] body[data-game-brand="qadha"] #qApp#qApp .hero-q.qadha-initial-home p{
color:#d7eee9!important;-webkit-text-fill-color:#d7eee9!important}
html[data-theme="dark"][data-ui-mode="modern"] body[data-game-brand="qadha"] #qApp#qApp .hero-q.qadha-initial-home #qInitialNewGame {
color:#fff!important;-webkit-text-fill-color:#fff!important;
background:linear-gradient(135deg,#6933d1,#4524a2)!important;border-color:#b89dff!important;
box-shadow:0 8px 24px #190b4299!important}

/* r1073 — Qadha JS recreates the welcome screen as section.hero-q without
   .qadha-initial-home after bootstrap. Cover both real DOM variants while
   excluding active matches, boards and questions from this color correction. */
html[data-theme="dark"][data-ui-mode="modern"]
body[data-game-brand="qadha"].qadha-v2-home:not(.q-game-active)
#qApp#qApp > section.hero-q h1 {
  color:#f1fffc!important;
  -webkit-text-fill-color:#f1fffc!important;
  text-shadow:0 3px 20px #0011167a!important;
}
html[data-theme="dark"][data-ui-mode="modern"]
body[data-game-brand="qadha"].qadha-v2-home:not(.q-game-active)
#qApp#qApp > section.hero-q h1 > span {
  color:#83efd8!important;
  -webkit-text-fill-color:#83efd8!important;
}
html[data-theme="dark"][data-ui-mode="modern"]
body[data-game-brand="qadha"].qadha-v2-home:not(.q-game-active)
#qApp#qApp > section.hero-q p {
  color:#d7eee9!important;
  -webkit-text-fill-color:#d7eee9!important;
}
html[data-theme="dark"][data-ui-mode="modern"]
body[data-game-brand="qadha"].qadha-v2-home:not(.q-game-active)
#qApp#qApp > section.hero-q :is(#qInitialNewGame,#newGame) {
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  background:linear-gradient(135deg,#6933d1,#4524a2)!important;
  border-color:#b89dff!important;
  box-shadow:0 8px 24px #190b4299!important;
}


/* r1334 — one real CSS variable drives the welcome canvas for BOTH themes.
   Avoid a stale dark :has() background when the user flips data-theme on
   <html> without reloading. Scope to pre-game landing; never affect rounds.
   Dark theme uses pale text; light and unset themes use dark teal text. */
html[data-ui-mode="modern"]{
  --qadha-welcome-canvas:linear-gradient(145deg,#e6f2ea 0%,#edf7ed 64%,#e3f1ee 100%);
}
html[data-ui-mode="modern"][data-theme="dark"]{
  --qadha-welcome-canvas:linear-gradient(145deg,#09272b 0%,#07191b 62%,#111426 100%);
}
html[data-ui-mode="modern"] body[data-game-brand="qadha"].qadha-v2-home:not(.q-game-active):has(#qApp > .hero-q){
  background:var(--qadha-welcome-canvas)!important;
}
/* Strong theme-specific welcome text remains in r1030 for light and
   r1073 for dark, scoped to the two actual runtime hero variants. */

/* r1336: explicitly resolve welcome background by selected theme.
   The inherited canvas variable computed light in real Chromium/WebKit while
   the body kept the previously painted dark gradient after a theme switch.
   Force the two final welcome backgrounds directly; never touch game boards. */
html[data-theme="light"][data-ui-mode="modern"]
 body[data-game-brand="qadha"].qadha-v2-home:not(.q-game-active):has(#qApp > section.hero-q){
  background-color:#e6f2ea!important;
  background-image:linear-gradient(145deg,#e6f2ea 0%,#edf7ed 64%,#e3f1ee 100%)!important;
}
html[data-theme="dark"][data-ui-mode="modern"]
 body[data-game-brand="qadha"].qadha-v2-home:not(.q-game-active):has(#qApp > section.hero-q){
  background-color:#07191b!important;
  background-image:linear-gradient(145deg,#09272b 0%,#07191b 62%,#111426 100%)!important;
}
