/* POKERANDO V77: tavolo completo e margine sotto prima del dock. */
/* Pokerando V72 - una sola regia mobile, sopra i precedenti fogli iPhone.
   Non modifica gli stili inline dell'Editor né la grafica desktop. */
@media screen and (max-width:767px) and (orientation:portrait){
 html:has(body.pkr77-phone),body.pkr77-phone{
   width:100%!important;max-width:100%!important;height:100dvh!important;
   min-height:0!important;margin:0!important;overflow:hidden!important;
   overscroll-behavior:none!important;background:#020a09!important;
 }
 body.pkr77-phone *,body.pkr77-phone *::before,body.pkr77-phone *::after{box-sizing:border-box;}
 body.pkr77-phone .wrap,body.pkr77-phone #game,body.pkr77-phone #game .layout,
 body.pkr77-phone #game .table-column{
   position:relative!important;display:block!important;width:100%!important;
   max-width:100%!important;min-width:0!important;height:100dvh!important;
   max-height:100dvh!important;min-height:0!important;margin:0!important;
   padding:0!important;overflow:visible!important;transform:none!important;zoom:1!important;
 }
 body.pkr77-phone #game{position:fixed!important;inset:0!important;z-index:5!important;overflow:hidden!important;}
 body.pkr77-phone .top-head{
   position:fixed!important;top:var(--pkr77-top,52px)!important;left:0!important;right:0!important;
   width:100%!important;height:44px!important;min-height:44px!important;max-height:44px!important;
   display:flex!important;align-items:center!important;justify-content:space-between!important;
   gap:5px!important;margin:0!important;padding:3px 12px!important;overflow:hidden!important;
   border:0!important;border-bottom:1px solid #b28f5390!important;border-radius:0!important;
   background:#071913f7!important;z-index:330!important;box-shadow:none!important;
 }
 body.pkr77-phone .top-head .head-brand{flex:1 1 auto!important;min-width:0!important;overflow:hidden!important;display:flex!important;align-items:center!important;}
 body.pkr77-phone .top-head .head-brand h1{
   font:850 clamp(15px,4.7vw,19px)/1 system-ui,sans-serif!important;letter-spacing:.06em!important;
   white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
 }
 body.pkr77-phone .top-head .head-brand h1 em,
 body.pkr77-phone .top-head .head-brand p,
 body.pkr77-phone .top-head .brand-emblem,
 body.pkr77-phone .top-head .head-brand .pill,
 body.pkr77-phone .top-head .pkr77-hide,
 body.pkr77-phone .top-head .header-actions>a,
 body.pkr77-phone .top-head .header-actions>.pill,
 body.pkr77-phone .top-head .sound-controls,
 body.pkr77-phone .top-head .pkr-settings-label,
 body.pkr77-phone .top-head .head-brand small{display:none!important;}
 body.pkr77-phone .top-head .header-actions{flex:0 0 auto!important;display:flex!important;gap:6px!important;flex-wrap:nowrap!important;align-items:center!important;margin:0!important;padding:0!important;}
 body.pkr77-phone .top-head #chatToggle,body.pkr77-phone .top-head #pkrSettingsBtn{
   position:relative!important;display:flex!important;align-items:center!important;justify-content:center!important;
   width:37px!important;height:35px!important;min-width:37px!important;min-height:35px!important;
   max-width:37px!important;max-height:35px!important;border:1px solid #977a4c!important;
   border-radius:9px!important;padding:0!important;margin:0!important;background:#11221d!important;
   color:#f4d997!important;box-shadow:none!important;font-size:0!important;line-height:0!important;
   text-indent:-9999px!important;overflow:hidden!important;
 }
 body.pkr77-phone .top-head #chatToggle::before{content:'💬';}
 body.pkr77-phone .top-head #pkrSettingsBtn::before{content:'⚙';}
 body.pkr77-phone .top-head #chatToggle::before,body.pkr77-phone .top-head #pkrSettingsBtn::before{
   position:absolute!important;inset:0!important;display:grid!important;place-items:center!important;
   font:normal 17px/1 system-ui!important;text-indent:0!important;color:#f3dfb4!important;
 }
 body.pkr77-phone .top-head #pkrSettingsBtn>*,body.pkr77-phone .top-head #chatToggle>*{display:none!important;}
 body.pkr77-phone #game .game-meta{
   position:fixed!important;top:calc(var(--pkr77-top,52px) + 44px)!important;
   left:0!important;right:0!important;width:100%!important;height:25px!important;
   min-height:25px!important;max-height:25px!important;
   display:flex!important;align-items:center!important;justify-content:space-between!important;
   padding:1px 14px!important;margin:0!important;overflow:hidden!important;gap:10px!important;
   border:0!important;border-bottom:1px solid #8e734270!important;border-radius:0!important;
   background:#081711f7!important;color:#f2ddab!important;font:800 12px/1 system-ui!important;
   z-index:320!important;pointer-events:none!important;
 }
 body.pkr77-phone #game .game-meta> :first-child{display:none!important;}
 body.pkr77-phone #game .game-meta #handNum{font:800 12px/1 system-ui!important;white-space:nowrap!important;}
 body.pkr77-phone #game .game-meta> :last-child{font:700 11px/1 system-ui!important;white-space:nowrap!important;}
 /* Superficie interamente compresa fra barre. Riduciamo la larghezza, non la centriamo con zoom. */
 body.pkr77-phone #game .table-outer{
   position:fixed!important;
   top:var(--pkr77-stage-top,126px)!important;bottom:auto!important;
   left:50%!important;right:auto!important;
   width:min(calc(100% - var(--pkr77-side-gap,30px)*2), var(--pkr77-max-width,344px))!important;
   height:var(--pkr77-stage-height,548px)!important;
   min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;
   margin:0!important;padding:0!important;transform:translateX(-50%)!important;scale:1!important;zoom:1!important;
   overflow:visible!important;border-radius:48% / 32%!important;z-index:3!important;
 }
 body.pkr77-phone #game .table-shell{
   position:absolute!important;top:2%!important;right:3%!important;bottom:2%!important;left:3%!important;
   width:94%!important;height:96%!important;min-width:0!important;min-height:0!important;
   max-width:none!important;max-height:none!important;margin:0!important;padding:0!important;
   transform:none!important;scale:1!important;zoom:1!important;overflow:visible!important;
   border-radius:48% / 33%!important;
 }
 body.pkr77-phone #game #seats{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;
   overflow:visible!important;transform:none!important;pointer-events:none!important;}
 body.pkr77-phone #game #seats>.seat{position:absolute!important;max-width:none!important;pointer-events:auto!important;}
 body.pkr77-phone #game #seats .seat .seat-mini{overflow:visible!important;}
 /* Nessuna grandezza fissa per carte e box degli avversari: vincono i dati Editor. */
 body.pkr77-phone #game .community{
   position:absolute!important;left:50%!important;top:49%!important;
   display:flex!important;justify-content:center!important;gap:2px!important;
   width:auto!important;max-width:91%!important;transform:translate(-50%,-50%)!important;
   white-space:nowrap!important;z-index:8!important;
 }
 body.pkr77-phone #game .community>.poker-card{
   width:clamp(32px,8.8vw,42px)!important;height:clamp(45px,12.3vw,59px)!important;
   min-width:0!important;max-width:none!important;flex:none!important;
 }
 body.pkr77-phone #game #pot{
   position:absolute!important;top:65%!important;left:50%!important;
   transform:translate(-50%,-50%)!important;min-width:86px!important;max-width:65%!important;
   z-index:9!important;font-size:12px!important;white-space:nowrap!important;
 }
 body.pkr77-phone #game .vip-croupier,body.pkr77-phone #game .deal-deck,
 body.pkr77-phone #game .dealer-caption,body.pkr77-phone #game .legend,
 body.pkr77-phone #game .casino-room,body.pkr77-phone #game #dealStatus,
 body.pkr77-phone #game .deal-status,body.pkr77-phone #game .pkr70-status,
 body.pkr77-phone #game .pkr69-status,body.pkr77-phone #game .pkr67-status,
 body.pkr77-phone #pkr24Hud,body.pkr77-phone .pkr24-hud,
 body.pkr77-phone .pkr67-menu,body.pkr77-phone .pkr69-menu{display:none!important;}
 body.pkr77-phone #game .phase-label{max-width:60%!important;font-size:10px!important;z-index:9!important;}
 /* Dock e carte personali: sezioni distinte, sopra l'indicatore Home iOS. */
 body.pkr77-phone #game .actions{
   position:fixed!important;left:0!important;right:0!important;
   bottom:var(--pkr77-bottom,0px)!important;width:100%!important;
   display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
   align-content:center!important;align-items:stretch!important;justify-items:stretch!important;
   gap:5px!important;margin:0!important;padding:8px 10px!important;
   min-height:58px!important;height:auto!important;max-height:148px!important;
   background:#06120ff8!important;border:0!important;border-top:1px solid #997d4f8f!important;
   border-radius:0!important;box-shadow:0 -5px 16px #0008!important;z-index:360!important;
 }
 body.pkr77-phone #game .actions>.hidden{display:none!important;}
 body.pkr77-phone #game .actions>button:not(.hidden){
   width:100%!important;min-width:0!important;max-width:none!important;
   min-height:44px!important;height:auto!important;max-height:52px!important;
   margin:0!important;padding:8px 5px!important;border-radius:10px!important;
   font:800 clamp(11px,3.3vw,14px)/1.15 system-ui!important;white-space:normal!important;
   touch-action:manipulation!important;
 }
 body.pkr77-phone #game .actions>#join:not(.hidden){grid-column:1/-1!important;max-width:none!important;}
 body.pkr77-phone #game .actions>#leave:not(.hidden){grid-column:1/-1!important;}
 body.pkr77-phone #game .actions>#raiseBox:not(.hidden){
   grid-column:span 2!important;display:flex!important;align-items:center!important;justify-content:center!important;
   gap:3px!important;min-width:0!important;min-height:42px!important;height:42px!important;
   padding:3px!important;margin:0!important;font:700 10px system-ui!important;
 }
 body.pkr77-phone #game .actions #raiseAmount{height:32px!important;min-width:38px!important;max-width:55px!important;width:50px!important;padding:2px!important;font-size:12px!important;}
 body.pkr77-phone #game .actions .pkr-raise-step{height:30px!important;width:26px!important;min-width:26px!important;padding:0!important;}
 body.pkr77-phone #game #myHand:not(.hidden){
   position:fixed!important;left:0!important;right:0!important;
   bottom:calc(var(--pkr77-bottom,0px) + var(--pkr77-dock-h,60px))!important;
   width:100%!important;height:var(--pkr77-hand-h,85px)!important;min-height:0!important;
   max-height:94px!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;
   padding:3px 10px!important;gap:8px!important;margin:0!important;background:#081610f4!important;
   border:0!important;border-top:1px solid #6e6a45!important;border-radius:0!important;
   z-index:350!important;overflow:hidden!important;
 }
 body.pkr77-phone #game #myHand .hand-title{display:none!important;}
 body.pkr77-phone #game #myCards{display:flex!important;flex:0 0 auto!important;gap:3px!important;width:auto!important;}
 body.pkr77-phone #game #myCards>.poker-card{width:clamp(45px,13vw,57px)!important;height:clamp(64px,18vw,79px)!important;flex:none!important;}
 body.pkr77-phone #game #myBetInfo{flex:1!important;min-width:0!important;max-width:none!important;font-size:11px!important;overflow:hidden!important;}
 body.pkr77-phone #game #notice:not(.hidden){
   position:fixed!important;left:0!important;right:0!important;
   bottom:calc(var(--pkr77-bottom,0px) + var(--pkr77-dock-h,60px) + var(--pkr77-hand-h,0px))!important;
   height:23px!important;min-height:23px!important;max-height:23px!important;
   margin:0!important;padding:4px 10px!important;border:0!important;border-radius:0!important;
   background:#081610e8!important;z-index:320!important;pointer-events:none!important;
   font:700 11px/1.25 system-ui!important;text-align:center!important;
   white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
 }
 body.pkr77-phone.pkr77-guest #game #notice{display:none!important;}
 body.pkr77-phone.pkr77-winning #game #notice{display:none!important;}
 body.pkr77-phone #game .winner-banner:not(.hidden){
   position:fixed!important;left:8px!important;right:8px!important;
   bottom:calc(var(--pkr77-bottom,0px) + var(--pkr77-dock-h,60px) + var(--pkr77-hand-h,0px) + 3px)!important;
   top:auto!important;width:auto!important;height:auto!important;max-height:38px!important;
   margin:0!important;padding:6px 8px!important;z-index:335!important;
   background:#0b3526f4!important;border:1px solid #bd995c!important;border-radius:10px!important;
   overflow:hidden!important;white-space:nowrap!important;text-overflow:ellipsis!important;
   font:800 12px/1.25 system-ui!important;text-align:center!important;
 }
 body.pkr77-phone #game #sidePanel.open,body.pkr77-phone #game #sidePanel.is-open{
   position:fixed!important;inset:calc(var(--pkr77-top,52px) + 44px) 0 0!important;
   width:100%!important;max-width:100%!important;height:auto!important;
   overflow-y:auto!important;background:#061710f7!important;z-index:450!important;
 }
 body.pkr77-phone .pkr-settings-backdrop:not([hidden]){z-index:470!important;}
 body.pkr77-phone #pkr70-debug,body.pkr77-phone #pkr69-debug{display:none!important;}
}

/* V75: geometria governata da misure reali dello schermo, senza CSS multipli. */
@media screen and (max-width:767px) and (orientation:portrait){
 body.pkr77-phone{background:#020a09!important;isolation:isolate}
 body.pkr77-phone .top-head{height:46px!important;min-height:46px!important;max-height:46px!important;padding:4px 10px!important;gap:8px!important}
 body.pkr77-phone .top-head .head-brand{min-width:0!important;max-width:calc(100% - 100px)!important; flex:1!important;overflow:hidden!important}
 body.pkr77-phone .top-head .head-brand>div{min-width:0!important;max-width:100%!important;overflow:hidden!important}
 body.pkr77-phone .top-head .head-brand>div>:not(h1){display:none!important}
 body.pkr77-phone .top-head .head-brand h1{font:900 clamp(15px,4.4vw,19px)/1 system-ui,sans-serif!important;letter-spacing:.025em!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important}
 body.pkr77-phone .top-head .header-actions{flex:0 0 auto!important;gap:8px!important;max-width:90px!important}
 body.pkr77-phone .top-head #chatToggle,body.pkr77-phone .top-head #pkrSettingsBtn{width:38px!important;min-width:38px!important;max-width:38px!important;height:36px!important;min-height:36px!important;max-height:36px!important}
 body.pkr77-phone #game .game-meta{height:28px!important;min-height:28px!important;max-height:28px!important;top:calc(var(--pkr77-top,52px) + 46px)!important;padding:3px 12px!important}
 body.pkr77-phone #game .table-outer{
  position:fixed!important;top:var(--pkr77-stage-top,132px)!important;left:50%!important;right:auto!important;bottom:auto!important;
  width:var(--pkr77-table-width,86vw)!important;height:var(--pkr77-stage-height,480px)!important;
  min-width:0!important;max-width:none!important;min-height:0!important;max-height:none!important;
  transform:translate3d(-50%,0,0)!important;transform-origin:50% 50%!important;
  margin:0!important;padding:0!important;scale:1!important;zoom:1!important;
  overflow:visible!important;contain:layout!important;z-index:4!important;
 }
 body.pkr77-phone #game .table-shell{box-sizing:border-box!important;position:absolute!important;top:2%!important;left:3%!important;right:3%!important;bottom:2%!important;width:94%!important;height:96%!important;max-width:none!important;max-height:none!important;min-height:0!important}
 body.pkr77-phone #game #seats{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;overflow:visible!important}
 body.pkr77-phone #game .community{max-width:94%!important}
 body.pkr77-phone #game #myHand:not(.hidden){height:var(--pkr77-hand-h,78px)!important;max-height:94px!important}
 body.pkr77-phone #game .actions{min-height:60px!important;padding:8px 10px!important;bottom:var(--pkr77-bottom,0px)!important}
 body.pkr77-phone #game .actions>#join:not(.hidden){font:900 clamp(15px,4.4vw,20px)/1.15 system-ui!important;min-height:50px!important;height:50px!important;max-height:50px!important}
 body.pkr77-phone #game .actions>#leave:not(.hidden){font:800 13px/1.2 system-ui!important;min-height:44px!important;height:44px!important;max-height:44px!important}
 body.pkr77-phone #game #notice{display:none!important}
 body.pkr77-phone #game .winner-banner:not(.hidden){bottom:calc(var(--pkr77-bottom,0px) + var(--pkr77-dock-h,64px) + var(--pkr77-hand-h,0px) + 7px)!important;max-height:33px!important}
 /* Il nome/saldo personale non deve mai finire nell'area orologio/batteria. */
 body.pkr77-phone #pkr28OwnLabel,body.pkr77-phone #game #pkr28OwnLabel{
  position:fixed!important;top:auto!important;bottom:calc(var(--pkr77-bottom,0px) + var(--pkr77-dock-h,64px) + var(--pkr77-hand-h,0px) + 5px)!important;
  left:8px!important;right:auto!important;z-index:300!important;max-width:54vw!important;
  font-size:11px!important;transform:none!important;translate:none!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
 }
 /* Il testo ornamentale dell'intestazione non deve coprire le icone. */
 body.pkr77-phone .top-head .head-brand [class*="cornice"],body.pkr77-phone .top-head .head-brand [class*="badge"]{display:none!important}
 body.pkr77-phone #game .table-outer .seat{max-width:100%!important}
 /* I messaggi lunghi possono essere letti in chat; non invadono il tavolo. */
 body.pkr77-phone.pkr77-guest #pkr28OwnLabel{display:none!important}
 body.pkr77-phone #game .dealer-caption,body.pkr77-phone #game .legend{display:none!important}
}

/* V75 - Guadagno verticale senza coprire l'orologio e la batteria di iOS.
   Le barre occupano 40 + 22 CSS px; il tavolo comincia subito dopo. */
@media screen and (max-width:767px) and (orientation:portrait){
 body.pkr77-phone .top-head{
  height:40px!important;min-height:40px!important;max-height:40px!important;
  padding:2px 10px!important;
 }
 body.pkr77-phone .top-head #chatToggle,
 body.pkr77-phone .top-head #pkrSettingsBtn{
  height:32px!important;min-height:32px!important;max-height:32px!important;
  width:36px!important;min-width:36px!important;max-width:36px!important;
 }
 body.pkr77-phone #game .game-meta{
  top:calc(var(--pkr77-top,52px) + 40px)!important;
  height:22px!important;min-height:22px!important;max-height:22px!important;
  padding:1px 12px!important;
 }
 body.pkr77-phone #game .table-outer{
  top:var(--pkr77-stage-top,116px)!important;
 }
}

/* V77: mai estendere il tavolo sotto il dock. I valori sono calcolati dal JS. */
@media screen and (max-width:767px) and (orientation:portrait) {
 body.pkr77-phone #game .table-outer {
  top:var(--pkr77-stage-top,112px)!important;
  left:50%!important;right:auto!important;
  width:var(--pkr77-table-width,84vw)!important;
  height:var(--pkr77-stage-height,400px)!important;
  transform:translate3d(-50%,0,0)!important;
  margin:0!important;
  overflow:visible!important;
 }
 body.pkr77-phone #game .actions {z-index:360!important;}
 body.pkr77-phone .top-head {z-index:330!important;}
 body.pkr77-phone #game .game-meta {z-index:320!important;}
}

/* V77 - tutto il tavolo (cornice inclusa) ridimensionato in modo uniforme.
   Non cambiare coordinate/zoom salvati dall'Editor e non spostare i controlli. */
@media screen and (max-width:767px) and (orientation:portrait) {
 body.pkr77-phone #game .table-outer {
   position:fixed!important;
   left:50%!important;
   top:var(--pkr77-stage-top,118px)!important;
   width:var(--pkr77-table-width,342px)!important;
   height:var(--pkr77-stage-height,390px)!important;
   transform:translate3d(-50%,0,0) scale(var(--pkr77-uniform-scale,.80))!important;
   transform-origin:50% 0!important;
   scale:1!important;
   zoom:1!important;
   margin:0!important;
   overflow:visible!important;
 }
 body.pkr77-phone #game .actions {z-index:360!important}
 body.pkr77-phone #pkr28OwnLabel,
 body.pkr77-phone #game #pkr28OwnLabel {
   bottom:calc(var(--pkr77-bottom,0px) + var(--pkr77-dock-h,60px) + var(--pkr77-hand-h,0px) + 8px)!important;
   left:10px!important;max-width:70vw!important;z-index:340!important;
   font:800 11px/1.1 system-ui,sans-serif!important;
   background:#05120fde!important;border:1px solid #a68c5470!important;
   border-radius:7px!important;padding:4px 6px!important;
 }
 body.pkr77-phone #pkr77-diagnostic {
   position:fixed!important;top:calc(var(--pkr77-top,50px) + 65px)!important;
   right:8px!important;z-index:10000!important;pointer-events:none!important;
   background:#08211cee!important;color:#d7f6df!important;
   border:1px solid #60c694!important;border-radius:5px!important;
   font:700 11px/1.2 system-ui!important;padding:4px 6px!important;
 }
}
