/* KARTA v1.4.526 – player-owned jail notices, nonblocking game overlays, portrait duels.
   Keep this file after 525. Rules deliberately scope to game UI and do not modify mechanics. */
#karta-jail-turn-intro-v526 {
 position:fixed;z-index:2147483500;top:max(12px,env(safe-area-inset-top));right:50%;
 transform:translate(50%,-16px);width:min(340px,calc(100vw - 22px));
 display:flex;direction:rtl;align-items:center;justify-content:flex-start;gap:10px;
 padding:10px 14px;border:1px solid #345a60;border-radius:13px;
 background:#0b151e;color:#fff;box-shadow:0 9px 24px #0008;
 opacity:0;visibility:hidden;pointer-events:none;transition:opacity .13s,transform .13s,visibility .13s;
 font-family:Cairo,Tahoma,Arial,sans-serif;box-sizing:border-box;
}
#karta-jail-turn-intro-v526.is-visible{opacity:1;visibility:visible;transform:translate(50%,0)}
#karta-jail-turn-intro-v526 .karta-jail-intro-ball{width:38px;height:38px;flex:0 0 38px;border-radius:50%;background:var(--karta-jail-intro-color,#35d7a0);display:grid;place-items:center;color:#14302c;font-size:19px}
#karta-jail-turn-intro-v526 span:last-child{display:flex;flex-direction:column;min-width:0;gap:1px}
#karta-jail-turn-intro-v526 small{font-size:10px;color:#adc5c6}
#karta-jail-turn-intro-v526 b{font-size:16px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:245px}
#karta-jail-turn-intro-v526 em{font-style:normal;font-size:10px;color:#adc5c6}

/* HTML dialog.show(), never showModal(), so the native backdrop never locks the board. */
#wof-jail-dialog-v328[open] {
 inset:auto!important;top:auto!important;bottom:max(10px,env(safe-area-inset-bottom))!important;
 right:max(10px,env(safe-area-inset-right))!important;left:auto!important;margin:0!important;
 transform:none!important;position:fixed!important;z-index:20000!important;
 width:min(410px,calc(100vw - 20px))!important;max-width:calc(100vw - 20px)!important;
 max-height:min(78dvh,calc(var(--jail-viewport-height,100dvh) - 18px))!important;
 display:block!important;overflow:hidden!important;
}
#wof-jail-dialog-v328::backdrop{background:transparent!important;backdrop-filter:none!important}
#wof-jail-dialog-v328 .wof-jail-card-v328{min-height:0!important;max-height:inherit!important;overflow:hidden!important;grid-template-rows:auto minmax(0,1fr) auto!important}
#wof-jail-dialog-v328 .wof-jail-head{padding:8px 12px!important}
#wof-jail-dialog-v328 .wof-jail-body{padding:8px 12px!important;min-height:0!important;overflow-y:auto!important}
#wof-jail-dialog-v328 .wof-jail-footer{padding:6px 12px!important}
#wof-jail-dialog-v328 .wof-jail-player{gap:6px!important;margin-top:3px!important}
#wof-jail-dialog-v328 .wof-jail-player h2{font-size:clamp(13px,3.6vw,17px)!important}
#wof-jail-dialog-v328 .wof-jail-options{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
#wof-jail-dialog-v328 .wof-jail-option{min-width:0!important;min-height:42px!important;padding:6px 8px!important;line-height:1.35!important}
#wof-jail-dialog-v328 .wof-jail-question-meta{gap:5px!important;font-size:10px!important}
#wof-jail-dialog-v328 #wof-jail-question-v328{margin:4px 0 8px!important;font-size:clamp(12px,3.4vw,15px)!important;line-height:1.45!important}
#wof-jail-dialog-v328 .wof-jail-note{font-size:10px!important;line-height:1.4!important}
#wof-jail-dialog-v328 .wof-jail-turn-owner-v526{display:block!important;border:1px solid #a68bdd;color:#fff;background:#463560;border-radius:8px;padding:4px 8px;font-size:12px;font-weight:900;text-align:center}
#wof-jail-dialog-v328.karta-jail-watching-v526{width:min(325px,calc(100vw - 20px))!important;max-height:min(48dvh,calc(var(--jail-viewport-height,100dvh) - 15px))!important;opacity:.98}
#wof-jail-dialog-v328.karta-jail-watching-v526 .wof-jail-options{display:none!important}
#wof-jail-dialog-v328.karta-jail-watching-v526 .wof-jail-note{display:none!important}
#wof-jail-dialog-v328.karta-jail-watching-v526 .wof-jail-head{padding:5px 9px!important}
#wof-jail-dialog-v328.karta-jail-watching-v526 .wof-jail-body{padding:6px 10px!important}
#wof-jail-dialog-v328.karta-jail-watching-v526 .wof-jail-footer{padding:2px 10px!important}
#wof-jail-dialog-v328.karta-jail-watching-v526 .wof-jail-lock{display:none!important}
#wof-jail-dialog-v328.karta-jail-while-dealing-v526{width:min(290px,calc(100vw - 20px))!important}
@media (max-height:600px){
 #wof-jail-dialog-v328[open]{max-height:calc(var(--jail-viewport-height,100dvh) - 12px)!important;bottom:6px!important}
 #wof-jail-dialog-v328.karta-jail-watching-v526{max-height:48dvh!important}
 #wof-jail-dialog-v328 .wof-jail-head{padding:4px 8px!important}
 #wof-jail-dialog-v328 .wof-jail-footer{padding:3px 8px!important}
}
@media (max-width:350px){
 #wof-jail-dialog-v328 .wof-jail-options{grid-template-columns:1fr!important}
}
/* Noninteractive backdrops must not intercept tapping a board tile, trade or chat. */
#karta-stadium-test .game-state-modal-wrap.active,
#karta-stadium-test .game-state-modal-wrap.karta-auction-fullscreen-v525,
#karta-stadium-test .game-state-modal-wrap.karta-challenge-fluid-v526,
#karta-stadium-test .game-state-modal-wrap .game-state-backdrop {pointer-events:none!important}
#karta-stadium-test .game-state-modal-wrap .game-state-backdrop{background:transparent!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
#karta-stadium-test .game-state-modal-wrap .game-state-modal{pointer-events:none!important}
#karta-stadium-test .game-state-modal-wrap .game-state-modal > :is(.knowledge-card,.movement-quiz-card,.auction-popup-card){pointer-events:auto!important}

/* Portrait: give the attacker/defender question proper viewport space, not the tiny pitch box. */
@media (orientation:portrait) and (pointer:coarse), (orientation:portrait) and (max-width:700px){
 #karta-stadium-test .stadium-layout .game-state-modal-wrap.karta-challenge-fluid-v526{
  position:fixed!important;inset:0!important;z-index:9997!important;
  width:100%!important;height:var(--stadium-available-height,100dvh)!important;
  max-width:none!important;max-height:none!important;min-height:0!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
  overflow:visible!important;pointer-events:none!important;
 }
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .game-state-backdrop{display:none!important}
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .game-state-modal{
  position:absolute!important;inset:0!important;transform:none!important;margin:0!important;
  width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;
  box-sizing:border-box!important;padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))!important;
  display:flex!important;justify-content:center!important;align-items:center!important;
  background:transparent!important;border:0!important;overflow:hidden!important;
  pointer-events:none!important;
 }
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 :is(.knowledge-card,.movement-quiz-card){
  position:relative!important;inset:auto!important;transform:none!important;
  margin:auto!important;width:min(100%,510px)!important;max-width:510px!important;
  min-width:0!important;height:auto!important;max-height:100%!important;min-height:0!important;
  display:flex!important;flex-direction:column!important;gap:0!important;
  box-sizing:border-box!important;overflow:hidden!important;
  border-radius:15px!important;pointer-events:auto!important;
 }
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-duel-head{
  display:grid!important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;
  gap:6px!important;align-items:center!important;padding:10px!important;min-height:0!important;
 }
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-player{
  display:flex!important;min-width:0!important;flex-direction:column!important;align-items:center!important;
  justify-content:center!important;gap:3px!important;text-align:center!important;overflow:hidden!important;
 }
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-player-avatar{
  display:grid!important;place-items:center!important;width:clamp(32px,10vw,46px)!important;height:clamp(32px,10vw,46px)!important;
  flex:none!important;max-width:100%!important;overflow:hidden!important;
 }
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-player-avatar :is(img,svg){max-width:100%!important;max-height:100%!important;object-fit:contain!important}
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-player > span:last-child{max-width:100%!important;min-width:0!important}
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-player b{
  display:block!important;font-size:clamp(10px,3vw,13px)!important;line-height:1.25!important;
  overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;max-width:100%!important;
 }
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-player small{font-size:10px!important}
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-title{
  min-width:48px!important;max-width:108px!important;text-align:center!important;
  display:flex!important;flex-direction:column!important;align-items:center!important;gap:2px!important;
 }
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-title b{font-size:18px!important}
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-title small{
  font-size:9px!important;white-space:normal!important;line-height:1.35!important;overflow-wrap:anywhere!important;
 }
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-timer{
  flex:none!important;display:flex!important;align-items:center!important;gap:7px!important;
  width:100%!important;padding:6px 10px!important;min-height:0!important;
 }
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-timer > div{min-width:0!important;flex:1 1 auto!important}
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-question{
  flex:1 1 auto!important;min-height:0!important;display:flex!important;flex-direction:column!important;
  overflow-y:auto!important;overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important;
  padding:10px 12px!important;gap:7px!important;
 }
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-question h3{
  font-size:clamp(13px,3.8vw,18px)!important;line-height:1.5!important;overflow-wrap:anywhere!important;
  margin:0 0 4px!important;text-align:right!important;
 }
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-options{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;width:100%!important;min-width:0!important;
 }
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-options button{
  min-width:0!important;min-height:47px!important;height:auto!important;max-width:100%!important;
  display:flex!important;align-items:center!important;gap:7px!important;text-align:right!important;
  padding:9px!important;font-size:clamp(11px,2.9vw,13px)!important;
  white-space:normal!important;overflow-wrap:anywhere!important;
 }
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-options button b{font-size:inherit!important;line-height:1.4!important;white-space:normal!important}
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-status,
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-response-times{flex:0 0 auto!important;padding:8px 11px!important;font-size:11px!important;white-space:normal!important}
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .challenge-result-main,
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .movement-quiz-card > main{
  flex:1 1 auto!important;min-height:0!important;min-width:0!important;overflow-y:auto!important;
  padding:9px 12px!important;max-width:100%!important;
 }
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .challenge-result-players{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;
 }
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .challenge-result-player{min-width:0!important;overflow-wrap:anywhere!important}
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .movement-question{min-width:0!important}
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .movement-quiz-card .guess-form{
  display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:7px!important;
 }
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .movement-quiz-card .guess-form input{min-width:0!important;width:100%!important}
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .movement-quiz-card .guess-target{
  max-width:min(180px,48vw)!important;max-height:180px!important;margin-inline:auto!important;
 }
}
@media (orientation:portrait) and (max-width:370px){
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-options{grid-template-columns:minmax(0,1fr)!important;gap:6px!important}
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-options button{min-height:42px!important}
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-duel-head{padding:6px!important}
 #karta-stadium-test .stadium-layout .karta-challenge-fluid-v526 .knowledge-player-avatar{width:29px!important;height:29px!important}
}
@media (prefers-reduced-motion:reduce){#karta-jail-turn-intro-v526{transition:none}}
