/* Fbrkh v3.2.0 — Khaltaha live, reveal and finale hardening */
body.k-has-host-tools #kApp{min-width:0}
.k-v320-host-tools{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:7px;
  max-width:calc(100vw - max(20px,env(safe-area-inset-left)) - max(20px,env(safe-area-inset-right)));
}
.k-v320-host-tools .k-settings-button{min-width:44px;max-width:100%}
.k-v320-host-tools .k-end-session{min-width:0}
.k-v320-host-tools .k-end-session b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

body:is(.k-phase-play,.k-phase-guessing) #kApp{
  width:min(1420px,calc(100% - 24px));
}
body:is(.k-phase-play,.k-phase-guessing) .game-shell{
  min-width:0;
  min-height:0;
  gap:clamp(7px,1.25vh,14px);
}
body:is(.k-phase-play,.k-phase-guessing) .prompt-card{
  min-width:0;
  min-height:clamp(180px,35vh,320px);
  padding:clamp(12px,2vh,22px) clamp(14px,2vw,28px);
  gap:clamp(8px,1.6vh,17px);
}
body:is(.k-phase-play,.k-phase-guessing) .prompt-main{
  min-width:0;
  min-height:clamp(96px,20vh,210px);
}
body:is(.k-phase-play,.k-phase-guessing) .prompt-main h1{
  max-width:min(1180px,100%);
  font-size:clamp(25px,4vw,58px);
  line-height:1.18;
  text-wrap:balance;
  overflow-wrap:anywhere;
}
body:is(.k-phase-play,.k-phase-guessing) .answer-form,
body:is(.k-phase-play,.k-phase-guessing) .order-form{
  min-width:0;
  max-width:100%;
}
body:is(.k-phase-play,.k-phase-guessing) .order-list{min-width:0}
body:is(.k-phase-play,.k-phase-guessing) .order-item{
  min-width:0;
  grid-template-columns:auto auto minmax(9rem,1fr) auto;
  grid-template-areas:"drag number label controls";
}
body:is(.k-phase-play,.k-phase-guessing) .order-item .drag-handle{grid-area:drag}
body:is(.k-phase-play,.k-phase-guessing) .order-item>b{grid-area:number}
body:is(.k-phase-play,.k-phase-guessing) .order-item>span{grid-area:label}
body:is(.k-phase-play,.k-phase-guessing) .order-item .order-fallback{grid-area:controls}
body:is(.k-phase-play,.k-phase-guessing) .order-item>span{min-width:0;overflow-wrap:normal;word-break:keep-all;hyphens:none;direction:rtl;unicode-bidi:isolate}

/* Finale: primary result and actions come first; secondary awards remain available below. */
.finale.v320-final-shell{
  width:min(1100px,100%)!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
  align-content:start;
}
.finale.v320-final-shell>.secret-scene{order:0}
.finale.v320-final-shell>.final-title{order:1}
.finale.v320-final-shell>.podium{order:2}
.finale.v320-final-shell>.share-actions{order:3}
.finale.v320-final-shell>.v320-final-actions{order:4}
.finale.v320-final-shell>.k-awards{order:5}
.finale.v320-final-shell>.fingerprint{order:6}
.finale.v320-final-shell>.mission-reveal{order:7}
.finale.v320-final-shell>.end-credits{order:8}
.finale.v320-final-shell .final-title h1{
  font-size:clamp(34px,5.6vw,70px);
  line-height:1.04;
  text-wrap:balance;
  overflow-wrap:anywhere;
}
.finale.v320-final-shell .podium{min-height:clamp(170px,29vh,260px);gap:8px}
.finale.v320-final-shell .place{min-width:0;max-width:250px;padding:clamp(8px,1.7vh,16px)}
.finale.v320-final-shell .place.first{min-height:clamp(175px,28vh,225px)}
.finale.v320-final-shell .place.second{min-height:clamp(145px,23vh,185px)}
.finale.v320-final-shell .place.third{min-height:clamp(125px,20vh,155px)}
.finale.v320-final-shell .k-final-rank-mark{
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border-radius:50%;
  background:linear-gradient(145deg,#ffe58d,#dca128);
  color:#26162f;
  border:1px solid rgba(255,255,255,.5);
  font-weight:1000;
  font-style:normal;
}
.finale.v320-final-shell .final-actions.v320-final-actions{
  position:static!important;
  bottom:auto!important;
  z-index:auto;
  width:min(1000px,100%);
  padding:8px!important;
  background:color-mix(in srgb,var(--panel) 92%,transparent);
}

@media (max-width:600px){
  .k-v320-host-tools{max-width:calc(100vw - 16px)}
  body.k-has-host-tools #kApp{padding-top:52px}
  body:is(.k-phase-play,.k-phase-guessing) #kApp{width:calc(100% - 12px)}
  body:is(.k-phase-play,.k-phase-guessing) .order-item{grid-template-columns:auto auto minmax(0,1fr);grid-template-areas:"drag number controls" "label label label"}
  body:is(.k-phase-play,.k-phase-guessing) .order-item>span{grid-column:1/-1;width:100%;text-align:center}
  body:is(.k-phase-play,.k-phase-guessing) .answer-form,
  body:is(.k-phase-play,.k-phase-guessing) .order-form{
    position:relative!important;
    bottom:auto!important;
    max-height:none!important;
    overflow:visible!important;
  }
  .finale.v320-final-shell .podium{min-height:190px}
  .finale.v320-final-shell .final-actions.v320-final-actions{grid-template-columns:1fr}
}

@media (max-height:620px) and (orientation:landscape){
  body.k-has-host-tools #kApp{padding-top:0!important}
  .k-v320-host-tools{
    top:max(56px,calc(env(safe-area-inset-top) + 52px))!important;
    right:max(6px,env(safe-area-inset-right))!important;
  }
  .k-v320-host-tools .k-settings-button{min-height:36px!important;height:36px;padding:5px 8px!important}
  .k-v320-host-tools .k-end-session b{display:none}
  body:is(.k-phase-play,.k-phase-guessing) #kApp{padding-top:5px;padding-bottom:8px}
  body:is(.k-phase-play,.k-phase-guessing) .game-shell{gap:5px}
  body:is(.k-phase-play,.k-phase-guessing) .game-head{gap:6px}
  body:is(.k-phase-play,.k-phase-guessing) :is(.round-pill,.mode-pill,.timer-shell){min-height:42px;padding:4px 9px;border-radius:12px}
  body:is(.k-phase-play,.k-phase-guessing) .prompt-card{
    min-height:0!important;
    padding:6px 10px!important;
    gap:5px!important;
  }
  body:is(.k-phase-play,.k-phase-guessing) .mode-explain{padding:5px 8px;gap:7px}
  body:is(.k-phase-play,.k-phase-guessing) .mode-explain>span{font-size:21px}
  body:is(.k-phase-play,.k-phase-guessing) .mode-explain h2{font-size:16px}
  body:is(.k-phase-play,.k-phase-guessing) .mode-explain p{font-size:11px;line-height:1.25}
  body:is(.k-phase-play,.k-phase-guessing) .prompt-main{min-height:0!important;gap:5px}
  body:is(.k-phase-play,.k-phase-guessing) .prompt-main h1{font-size:clamp(20px,6.2vh,31px)!important;line-height:1.08!important}
  body:is(.k-phase-play,.k-phase-guessing) .progress-shell{padding-block:4px}
  body:is(.k-phase-play,.k-phase-guessing) .player-grid.compact{gap:4px}
  body:is(.k-phase-play,.k-phase-guessing) .player-chip{padding:4px 7px;min-height:38px}
  body:is(.k-phase-play,.k-phase-guessing) .answer-form,
  body:is(.k-phase-play,.k-phase-guessing) .order-form{
    position:relative!important;
    bottom:auto!important;
    max-height:none!important;
    overflow:visible!important;
    padding:6px!important;
    gap:5px!important;
  }
  body:is(.k-phase-play,.k-phase-guessing) .order-list{gap:4px!important}
  body:is(.k-phase-play,.k-phase-guessing) .order-item{min-height:34px!important;padding:3px 6px!important}
  body:is(.k-phase-play,.k-phase-guessing) .order-item :is(.drag-handle,.order-fallback button){min-height:30px!important;height:30px!important}
  .finale.v320-final-shell{gap:5px!important;padding-top:3px!important}
  .finale.v320-final-shell .secret-scene{padding:5px!important}
  .finale.v320-final-shell .final-title>span{padding:3px 8px}
  .finale.v320-final-shell .final-title h1{font-size:clamp(24px,7vh,38px)!important;margin:3px 0!important}
  .finale.v320-final-shell .final-title p{font-size:12px!important}
  .finale.v320-final-shell .podium{min-height:125px!important;gap:5px!important}
  .finale.v320-final-shell .place{padding:4px!important;gap:3px!important}
  .finale.v320-final-shell .place.first{min-height:118px!important}
  .finale.v320-final-shell .place.second{min-height:98px!important}
  .finale.v320-final-shell .place.third{min-height:88px!important}
  .finale.v320-final-shell .podium-avatar{width:42px!important;height:42px!important}
  .finale.v320-final-shell .k-final-rank-mark{width:28px;height:28px;font-size:14px}
  .finale.v320-final-shell .share-actions{gap:6px!important}
  .finale.v320-final-shell .final-actions.v320-final-actions{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px!important;padding:4px!important}
  .finale.v320-final-shell .final-actions .k-btn{min-height:34px!important;padding:4px 6px!important;font-size:11px!important}
}
