/* v3.1.1 — paid-quality Qadha final layout overrides */
.qadha-v311{
  --q311-card-dark:#211b31;
  --q311-card-dark-2:#2b2340;
  --q311-card-light:#ffffff;
  --q311-card-light-2:#f4f1fb;
  --q311-border-dark:rgba(255,255,255,.16);
  --q311-border-light:rgba(43,31,65,.13);
  --q311-accent:#ff7548;
  --q311-accent-soft:rgba(255,117,72,.14);
}
.qadha-v311 .qadha-initial-home .actions button{min-width:148px}
.qadha-v311 .qadha-initial-home .actions button.is-busy{opacity:.82;cursor:progress}

/* Presets are a true grid: no carousel, no sideways arrows, no hidden choices. */
.qadha-v311 .qadha-content-packs{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr))!important;
  gap:10px!important;
  overflow:visible!important;
  padding:6px 0 12px!important;
}
.qadha-v311 .qadha-pack-chip{
  min-width:0!important;
  width:100%!important;
  min-height:74px!important;
  background:color-mix(in srgb,var(--card,#1b1727) 88%,var(--q311-accent-soft))!important;
  border:1px solid color-mix(in srgb,var(--line,rgba(255,255,255,.14)) 68%,var(--q311-accent) 32%)!important;
  box-shadow:0 8px 24px rgba(0,0,0,.12)!important;
}

/* Category cards keep the strong Qadha visual language without black slabs. */
.qadha-v311 .setup-page .cat-card{
  background:linear-gradient(155deg,var(--q311-card-dark-2),var(--q311-card-dark))!important;
  border:1px solid var(--q311-border-dark)!important;
  box-shadow:0 13px 28px rgba(0,0,0,.18)!important;
}
.qadha-v311 .setup-page .cat-card.selected{
  background:linear-gradient(155deg,color-mix(in srgb,var(--q311-card-dark-2) 78%,var(--q311-accent)),var(--q311-card-dark))!important;
  border-color:var(--q311-accent)!important;
  box-shadow:0 0 0 3px var(--q311-accent-soft),0 16px 32px rgba(0,0,0,.2)!important;
}
.qadha-v311 .setup-page .cat-card h3{color:#fff!important}
.qadha-v311 .setup-page .cat-card p{color:#d8d2e4!important}
.qadha-v311 .setup-page .cat-cover{background:linear-gradient(135deg,#342b4a,#272039)!important}
html[data-theme="light"] .qadha-v311 .setup-page .cat-card{
  background:linear-gradient(155deg,var(--q311-card-light),var(--q311-card-light-2))!important;
  color:#211a2d!important;
  border-color:var(--q311-border-light)!important;
  box-shadow:0 12px 26px rgba(50,35,75,.10)!important;
}
html[data-theme="light"] .qadha-v311 .setup-page .cat-card.selected{
  background:linear-gradient(155deg,#fff7f2,#fff)!important;
  border-color:var(--q311-accent)!important;
}
html[data-theme="light"] .qadha-v311 .setup-page .cat-card h3{color:#211a2d!important}
html[data-theme="light"] .qadha-v311 .setup-page .cat-card p{color:#655c73!important}
html[data-theme="light"] .qadha-v311 .setup-page .cat-cover{background:#f1edf7!important}

/* One responsive question surface. Internal content should reflow, not scroll. */
.qadha-v311 .qadha-v260 .q-question-body-v129,
.qadha-v311 .qadha-v260 .q-question-stage-v129,
.qadha-v311 .qadha-v260 .question-card{min-height:0!important;overflow:hidden!important}
.qadha-v311 .qadha-v260 .q-question-content-scroll{
  min-height:0!important;
  overflow:hidden!important;
  display:grid!important;
  place-items:center!important;
  align-content:center!important;
  padding:clamp(8px,1.7vh,20px)!important;
}
.qadha-v311 .qadha-v260 .question-text{
  font-size:clamp(22px,min(3.4vw,4.7vh),52px)!important;
  line-height:1.42!important;
  text-wrap:balance;
}
.qadha-v311 .qadha-v260 .order-question-shell{
  width:100%!important;
  min-height:0!important;
  height:auto!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  gap:clamp(8px,1.4vh,14px)!important;
  padding:0!important;
}
.qadha-v311 .qadha-v260 .order-area{
  width:min(920px,96%)!important;
  min-height:0!important;
  overflow:visible!important;
  padding:0!important;
  margin-inline:auto!important;
  display:grid!important;
  gap:clamp(7px,1vh,11px)!important;
}
.qadha-v311 .qadha-v260 .order-list{
  max-height:none!important;
  overflow:visible!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:clamp(7px,1vh,10px) clamp(8px,1.2vw,16px)!important;
}
.qadha-v311 .qadha-v260 .order-item{
  min-height:clamp(44px,6.2vh,58px)!important;
  padding:6px 10px!important;
  font-size:clamp(13px,1.25vw,19px)!important;
}
.qadha-v311 .qadha-v260 .order-fixed-actions{
  position:static!important;
  margin:2px auto 0!important;
  padding:0!important;
  flex:0 0 auto!important;
}
.qadha-v311 .qadha-v260 .order-fixed-actions .btn{min-height:46px!important}
.qadha-v311 .qadha-v260 .order-timer-bar{position:static!important;margin-top:2px!important;flex:0 0 auto!important}
.qadha-v311 .qadha-v260 .order-results{overflow:visible!important;align-content:center!important}
.qadha-v311 .qadha-v260 .order-results-grid{max-height:none!important;overflow:visible!important}

/* Normal browser windows and short screens: shrink secondary chrome before content. */
@media(max-height:760px) and (min-width:760px){
  .qadha-v311 .qadha-v260 .premium-qadha-toolbar{height:52px!important;min-height:52px!important}
  .qadha-v311 .qadha-v260 .q-question-body-v129{height:calc(100% - 52px)!important;padding:6px!important;gap:6px!important}
  .qadha-v311 .qadha-v260 .q-question-header{min-height:38px!important;padding:4px 9px!important}
  .qadha-v311 .qadha-v260 .question-text{font-size:clamp(20px,min(3vw,4vh),38px)!important}
  .qadha-v311 .qadha-v260 .q-question-control-dock{min-height:76px!important;padding:5px 8px!important}
  .qadha-v311 .qadha-v260 .order-item{min-height:42px!important}
}
@media(max-width:760px){
  .qadha-v311 .qadha-content-packs{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .qadha-v311 .qadha-pack-chip{min-height:68px!important;padding:8px!important}
  .qadha-v311 .qadha-v260 .order-list{grid-template-columns:1fr!important}
  .qadha-v311 .qadha-v260 .q-question-content-scroll{overflow:visible!important;padding:8px!important}
  .qadha-v311 .qadha-v260 .question-card{overflow:visible!important}
  .qadha-v311.q-game-active{overflow-y:auto!important}
  .qadha-v311 .qadha-v260.q-game-screen{min-height:100dvh!important;height:auto!important}
}

/* Order questions: use the whole center area and never bury the sortable list. */
.qadha-v311 .qadha-v260.qadha-question-order .question-turn-banner{display:none!important}
.qadha-v311 .qadha-v260.qadha-question-order .q-question-header{min-height:48px!important;padding:5px 12px!important}
.qadha-v311 .qadha-v260.qadha-question-order .qadha-double-surprise{min-height:44px!important;padding:6px 14px!important;margin:2px auto 4px!important}
.qadha-v311 .qadha-v260 .question-card.order-mode .q-question-content-scroll{
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:stretch!important;
  overflow:hidden!important;
  padding:8px 12px!important;
}
.qadha-v311 .qadha-v260 .question-card.order-mode .order-question-shell{
  min-height:0!important;
  height:100%!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  gap:8px!important;
  padding:0!important;
}
.qadha-v311 .qadha-v260 .question-card.order-mode .order-question-text{
  flex:0 0 auto!important;
  width:min(920px,94%)!important;
  min-height:0!important;
  margin:0 auto!important;
  padding:8px 14px!important;
  font-size:clamp(20px,min(2.65vw,3.8vh),38px)!important;
  line-height:1.35!important;
}
.qadha-v311 .qadha-v260 .question-card.order-mode .order-area{
  width:min(900px,96%)!important;
  min-height:0!important;
  overflow:visible!important;
  padding:0!important;
  margin:0 auto!important;
  display:flex!important;
  flex-direction:column!important;
  gap:7px!important;
}
.qadha-v311 .qadha-v260 .question-card.order-mode .order-step{min-height:30px!important;gap:8px!important}
.qadha-v311 .qadha-v260 .question-card.order-mode .order-step h2{font-size:clamp(13px,1.25vw,17px)!important}
.qadha-v311 .qadha-v260 .question-card.order-mode .order-list{
  flex:0 0 auto!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  grid-auto-rows:minmax(42px,auto)!important;
  max-height:none!important;
  overflow:visible!important;
  gap:7px 12px!important;
  padding:0!important;
}
.qadha-v311 .qadha-v260 .question-card.order-mode .order-item{
  min-height:42px!important;
  padding:4px 9px!important;
  font-size:clamp(13px,1.15vw,17px)!important;
}
.qadha-v311 .qadha-v260 .question-card.order-mode .order-fixed-actions{margin:0 auto!important}
.qadha-v311 .qadha-v260 .question-card.order-mode .order-fixed-actions .btn{min-height:42px!important;padding:7px 16px!important}

@media(max-width:760px){
  .qadha-v311 .qadha-v260 .question-card.order-mode .q-question-content-scroll{overflow:visible!important;padding:7px!important}
  .qadha-v311 .qadha-v260 .question-card.order-mode .order-question-shell{height:auto!important}
  .qadha-v311 .qadha-v260 .question-card.order-mode .order-list{grid-template-columns:1fr!important}
  .qadha-v311 .qadha-v260 .question-card.order-mode .order-item{min-height:46px!important}
}

/* Balanced preset rows and brighter fallback covers. */
@media(min-width:1100px){.qadha-v311 .qadha-content-packs{grid-template-columns:repeat(4,minmax(0,1fr))!important}}
@media(min-width:700px) and (max-width:1099px){.qadha-v311 .qadha-content-packs{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
.qadha-v311 .setup-page .cat-cover{background:linear-gradient(135deg,#51406f,#31274a)!important}
html[data-theme="light"] .qadha-v311 .setup-page .cat-cover{background:linear-gradient(135deg,#f2eaff,#fff1ea)!important}
