/* r939 — focused game ENTRY/SETUP clarity, mobile-first, scoped per brand.
   Do not repaint active gameplay boards, card reveals or drawings. */
:root[data-ui-mode="modern"] body[data-game-brand]{
 --r939-text:#faf8ff;
 --r939-muted:#ddd5e8;
 --r939-panel:#1b1530;
 --r939-line:rgba(239,232,255,.28);
 --r939-glow:rgba(214,186,255,.22);
}
:root[data-ui-mode="modern"] body[data-game-brand="fbrkha"]{--r939-accent:#bd9cff;--r939-accent-text:#180e28}
:root[data-ui-mode="modern"] body[data-game-brand="qadha"]{--r939-accent:#79ebdc;--r939-accent-text:#0b2928}
:root[data-ui-mode="modern"] body[data-game-brand="khaltaha"]{--r939-accent:#ffc18f;--r939-accent-text:#301713}
:root[data-ui-mode="modern"] body[data-game-brand="top10"]{--r939-accent:#ffadd9;--r939-accent-text:#31112a}
/* Home and settings surfaces only, never live game scenes. */
:root[data-ui-mode="modern"] body[data-game-brand="fbrkha"] #app.home-shell,
:root[data-ui-mode="modern"] body[data-game-brand="fbrkha"] #app.public-screen:has(> .page-head),
:root[data-ui-mode="modern"] body[data-game-brand="qadha"] .qadha-initial-home,
:root[data-ui-mode="modern"] body[data-game-brand="top10"] #setupView,
:root[data-ui-mode="modern"] body[data-game-brand="top10"] #authView,
:root[data-ui-mode="modern"] body[data-game-brand="top10"] #errorView,
:root[data-ui-mode="modern"] body[data-game-brand="khaltaha"] :is(.k-setup,.k-home,.k-lobby,.k-settings){
 color:var(--r939-text)!important;
}
:root[data-ui-mode="modern"] body[data-game-brand] :is(
 .home-shell,.qadha-initial-home,#setupView,#authView,#errorView,
 .k-setup,.k-home,.k-lobby,.k-settings
) :is(p,small,.description,.section-title p,.section-title small,.muted,.hint,.subtext){
 color:var(--r939-muted)!important;
 opacity:1!important;
 text-shadow:none!important;
}
:root[data-ui-mode="modern"] body[data-game-brand] :is(
 .home-shell,.qadha-initial-home,#setupView,#authView,#errorView,
 .k-setup,.k-home,.k-lobby,.k-settings
) :is(h1,h2,h3,strong,.section-title h2){
 color:var(--r939-text)!important;
 text-shadow:none!important;
}
/* Unified readability, distinct accents and no clipped setup controls. */
:root[data-ui-mode="modern"] body[data-game-brand] :is(
 .home-actions .home-action,.qadha-initial-home .actions .btn,
 #setupView .setup-card,#setupView .round-option,#setupView .timer-options button,
 #setupView .segmented button,#setupView .t10-btn,
 #authView .t10-btn,#errorView .t10-btn,
 .k-setup .k-btn,.k-home .k-btn,.k-settings .k-btn
){
 min-width:0!important;
 border-color:var(--r939-line)!important;
 overflow-wrap:anywhere!important;
 text-overflow:clip!important;
}
:root[data-ui-mode="modern"] body[data-game-brand] :is(
 .home-actions .home-action,.qadha-initial-home .actions .btn,
 #setupView .t10-btn,#setupView .round-option,
 #setupView .timer-options button,#setupView .segmented button,
 .k-setup .k-btn,.k-home .k-btn
){
 min-height:48px!important;
 cursor:pointer;
 touch-action:manipulation;
 -webkit-tap-highlight-color:transparent;
 transition:background-color .14s ease,border-color .14s ease,transform .14s ease!important;
}
:root[data-ui-mode="modern"] body[data-game-brand="fbrkha"] .home-actions{
 display:grid!important;
 grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));
 gap:clamp(10px,2vw,17px)!important;
 align-items:stretch;
}
:root[data-ui-mode="modern"] body[data-game-brand="fbrkha"] .home-actions .home-action{
 display:flex!important;
 align-items:center!important;
 justify-content:flex-start!important;
 gap:12px!important;
 width:100%!important;
 max-width:100%!important;
 height:auto!important;
 min-height:76px!important;
 padding:15px 19px!important;
 border-radius:18px!important;
 background:#231a39!important;
 color:#faf8ff!important;
}
:root[data-ui-mode="modern"] body[data-game-brand="fbrkha"] .home-actions .home-action-create{
 background:linear-gradient(115deg,#49336c,#342249)!important;
 border-color:#b89fe6!important;
}
:root[data-ui-mode="modern"] body[data-game-brand="fbrkha"] .home-actions .home-action small{
 color:#e2d6ed!important;
 opacity:1!important;
 white-space:normal!important;
}
:root[data-ui-mode="modern"] body[data-game-brand="top10"] #setupView .setup-card{
 background:rgba(32,23,50,.96)!important;
 border:1px solid var(--r939-line)!important;
 box-shadow:0 8px 25px rgba(7,5,17,.18)!important;
}
:root[data-ui-mode="modern"] body[data-game-brand="top10"] #setupView :is(
 .setup-card p,.setup-card small,.setup-card label,.setup-summary,
 .category-choice small,.round-option span,.round-option small
){
 color:#e6daed!important;
 opacity:1!important;
}
:root[data-ui-mode="modern"] body[data-game-brand="top10"] #setupView :is(
 .round-option.active,.timer-options button.active,.segmented button.active
){
 background:var(--r939-accent)!important;
 color:var(--r939-accent-text)!important;
 border-color:var(--r939-accent)!important;
}
:root[data-ui-mode="modern"] body[data-game-brand="top10"] #setupView :is(
 .round-option.active,.timer-options button.active,.segmented button.active
) :is(span,b,small){color:var(--r939-accent-text)!important}
:root[data-ui-mode="modern"] body[data-game-brand] :is(
 #setupView,.qadha-initial-home,.home-shell,.k-setup,.k-home
) :is(input,select,textarea){
 min-height:46px!important;
 max-width:100%!important;
 min-width:0!important;
 font-size:max(16px,1rem)!important;
}
:root[data-ui-mode="modern"] body[data-game-brand] :is(
 #setupView,.qadha-initial-home,.home-shell,.k-setup,.k-home
) :is(input,select,textarea):not([type=checkbox]):not([type=radio]){
 background:#211a33!important;
 color:#fff9ff!important;
 border:1px solid rgba(239,232,255,.43)!important;
}
:root[data-ui-mode="modern"] body[data-game-brand] :is(
 #setupView,.qadha-initial-home,.home-shell,.k-setup,.k-home
) :is(input,textarea)::placeholder{color:#c9bfd2!important;opacity:1!important}
:root[data-ui-mode="modern"] body[data-game-brand] :is(
 #setupView,.qadha-initial-home,.home-shell,.k-setup,.k-home
) :is(button,a,input,select,textarea):focus-visible{
 outline:3px solid var(--r939-accent)!important;
 outline-offset:3px!important;
 box-shadow:0 0 0 6px rgba(28,20,47,.76)!important;
}
:root[data-ui-mode="modern"] body[data-game-brand] :is(
 #setupView,.qadha-initial-home,.home-shell,.k-setup,.k-home
) :is(button,a)[disabled]{
 cursor:not-allowed!important;
 opacity:.68!important;
}
@media(max-width:680px){
 :root[data-ui-mode="modern"] body[data-game-brand="fbrkha"] .home-actions{
   grid-template-columns:1fr!important;
 }
 :root[data-ui-mode="modern"] body[data-game-brand="fbrkha"] .home-actions .home-action{
   min-height:68px!important;
 }
 :root[data-ui-mode="modern"] body[data-game-brand="top10"] #setupView .setup-card{
   padding:clamp(14px,4vw,20px)!important;
 }
}
@media(prefers-reduced-motion:reduce){
 :root[data-ui-mode="modern"] body[data-game-brand] :is(
  .home-actions .home-action,.qadha-initial-home .actions .btn,
  #setupView .t10-btn,#setupView .round-option
 ){transition:none!important;animation:none!important}
}

/* r940 — actual dynamic Qadha/Khaltaha host setup (not just their landing pages). */
:root[data-ui-mode="modern"] body[data-game-brand="qadha"] #qApp .qadha-setup-v217,
:root[data-ui-mode="modern"] body[data-game-brand="khaltaha"] #kApp .k-setup-shell{
 color:var(--r939-text)!important;
}
:root[data-ui-mode="modern"] body[data-game-brand="qadha"] #qApp .qadha-setup-v217 :is(
 .field label,.field small,.page-title-row .pill,.qadha-team-split small,
 .qadha-category-heading small,.qadha-pack-chip small
),
:root[data-ui-mode="modern"] body[data-game-brand="khaltaha"] #kApp .k-setup-shell :is(
 .setup-panel small,.section-title span,.k-hero p,.mode-toggle small,.setup-options small
){
 color:var(--r939-muted)!important;
 opacity:1!important;
}
:root[data-ui-mode="modern"] body[data-game-brand="qadha"] #qApp .qadha-setup-v217 :is(
 input,select,textarea
),
:root[data-ui-mode="modern"] body[data-game-brand="khaltaha"] #kApp .k-setup-shell :is(
 input,select,textarea
){
 font-size:max(16px,1rem)!important;
 max-width:100%!important;
 min-width:0!important;
}
:root[data-ui-mode="modern"] body[data-game-brand="qadha"] #qApp .qadha-setup-v217 :is(
 .btn,.qadha-pack-chip,.category-choice
),
:root[data-ui-mode="modern"] body[data-game-brand="khaltaha"] #kApp .k-setup-shell :is(
 .k-btn,.mode-toggle,.round-choice button
){
 min-height:46px!important;
 white-space:normal!important;
 overflow-wrap:anywhere!important;
 touch-action:manipulation;
}
:root[data-ui-mode="modern"] body[data-game-brand="qadha"] #qApp .qadha-setup-v217 :is(
 input,select,textarea,button
):focus-visible,
:root[data-ui-mode="modern"] body[data-game-brand="khaltaha"] #kApp .k-setup-shell :is(
 input,select,textarea,button
):focus-visible{
 outline:3px solid var(--r939-accent)!important;
 outline-offset:3px!important;
}
@media(max-width:720px){
 :root[data-ui-mode="modern"] body[data-game-brand="qadha"] .qadha-setup-v217 .qadha-setup-actions,
 :root[data-ui-mode="modern"] body[data-game-brand="khaltaha"] .k-setup-shell .setup-footer{
   position:sticky;
   bottom:env(safe-area-inset-bottom,0px);
   z-index:5;
   padding:12px!important;
   border-radius:16px!important;
   border:1px solid var(--r939-line)!important;
   background:#181127!important;
 }
 :root[data-ui-mode="modern"] body[data-game-brand="khaltaha"] .k-setup-shell .setup-footer .primary-create,
 :root[data-ui-mode="modern"] body[data-game-brand="qadha"] .qadha-setup-v217 .start-game-btn{
   min-height:50px!important;
   font-size:1.05rem!important;
 }
}


/* r940 Top10 one-click setup: default values remain fully editable below. */
:root[data-ui-mode="modern"] body[data-game-brand="top10"] #setupView .top10-fast-start{
 display:flex;
 align-items:center;
 justify-content:space-between;
 flex-wrap:wrap;
 gap:10px 18px;
 padding:13px 17px;
 margin:8px 0 18px;
 border:1px solid rgba(255,173,217,.5);
 border-radius:16px;
 background:#281931;
}
:root[data-ui-mode="modern"] body[data-game-brand="top10"] #setupView .top10-fast-start small{
 color:#e7dcec!important;
 opacity:1!important;
}
:root[data-ui-mode="modern"] body[data-game-brand="top10"] #top10QuickStart{
 min-height:50px!important;
 background:var(--r939-accent)!important;
 color:var(--r939-accent-text)!important;
 border:1px solid var(--r939-accent)!important;
 border-radius:13px!important;
 font-weight:800!important;
}
@media(max-width:680px){
 :root[data-ui-mode="modern"] body[data-game-brand="top10"] #top10QuickStart{width:100%!important}
 :root[data-ui-mode="modern"] body[data-game-brand="top10"] #setupView .top10-fast-start{padding:12px}
}
