/* Arcade cabinet, inside the existing poster column. */
#menu.menu-redesign .menu-poster:has(.home-practice){position:static;display:flex;flex-direction:column;justify-content:flex-start;align-items:center;gap:12px;padding:8px 0 18px}
#menu.menu-redesign .menu-poster:has(.home-practice)>.new-logo{width:auto;max-width:100%;height:clamp(92px,17vh,166px);object-fit:contain}
.home-practice{box-sizing:border-box;width:100%;padding:10px;border:2px solid #111f20;background:#284045;color:#ffedca;border-radius:13px;box-shadow:0 4px #11282b,inset 0 1px #70918a;font:600 14px/1.35 system-ui,sans-serif;text-align:left}
.hp-head,.hp-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.hp-head{padding:1px 4px 8px}.hp-head strong{color:#f2ce87;letter-spacing:.07em;text-transform:uppercase;font-size:14px}.hp-head small{color:#e4e5ce;font-size:12px}
.hp-field{position:relative;border-radius:5px;overflow:hidden;background:#223d39}
#menu .hp-field canvas{display:block;position:static;width:100%;height:auto;max-width:none;max-height:none;border:0;margin:0;box-shadow:none;touch-action:pan-y;cursor:crosshair}
.hp-field canvas:focus-visible{outline:2px solid #ffe19c;outline-offset:-3px}
#menu .home-practice .hp-field canvas.match-cursor-idle{cursor:none}
#menu .home-practice[data-state="playing"] canvas{touch-action:none}
.hp-hint{position:absolute;left:50%;bottom:6%;transform:translateX(-50%);width:max-content;max-width:84%;padding:6px 11px;background:#142825ee;color:#fff1cf;border-radius:6px;text-align:center;font:600 clamp(11px,1.1vw,14px)/1.35 system-ui,sans-serif;pointer-events:none}
.hp-hint[hidden]{display:none}
.hp-actions{margin-top:9px}.home-practice button{min-height:40px;padding:7px 13px;border:1px solid #172a28;border-radius:6px;background:#e6c384;color:#20332e;box-shadow:0 2px #122c2c;font:700 13px/1.2 system-ui,sans-serif;letter-spacing:0;text-transform:none}
.hp-actions .hp-settings{background:transparent;color:#ebdfc2;border-color:#768d83;box-shadow:none;font-weight:500}
#menu .home-practice button{width:auto;margin:0;padding:7px 13px;letter-spacing:normal}
#menu .home-practice .hp-dialog label{display:grid;grid-template-columns:minmax(0,1fr) minmax(58px,1fr) 24px;align-items:center;margin:6px 0;gap:8px}
.hp-pad{display:none}.hp-dialog{max-width:min(92vw,480px);max-height:82dvh;overflow:auto;background:#203b3b;color:#fff0c6;border:2px solid #bd9d6a;border-radius:12px;padding:18px}
.hp-dialog::backdrop{background:#0d1d1dc9}.hp-dialog h2{color:inherit;font-size:21px;margin:0 0 10px}.hp-dialog fieldset{border:1px solid #68817a;margin:0 0 8px;padding:8px}.hp-dialog label{display:grid;grid-template-columns:1fr minmax(75px,1fr) 24px;align-items:center;gap:8px;font-size:13px}.hp-dialog input{max-width:100%}
.hp-format{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 2px 12px}
#menu .home-practice .hp-format label{display:block}
.hp-format select{padding:6px 12px;background:#ead8ac;color:#203633}
@media(pointer:coarse){.hp-pad{display:flex;gap:5px;margin-top:8px}.hp-pad button{flex:1;min-height:44px;touch-action:none;font-size:18px;background:#cdd8c0}.hp-actions button{min-height:44px}}
@media(max-width:760px){#menu.menu-redesign .menu-poster:has(.home-practice){padding:5px 0 10px;gap:5px}#menu.menu-redesign .menu-poster:has(.home-practice)>.new-logo{height:92px}.home-practice{padding:7px}}

/* Scale the playing surface in both dimensions, keeping its real aspect ratio.
   The card's controls keep their own space, even for the wider doubles court. */
.hp-field{width:fit-content;max-width:100%;margin-inline:auto}
#menu .hp-field canvas{width:auto;height:auto;max-width:100%;max-height:var(--hp-room,52dvh)}
#menu.menu-redesign .menu-poster:has(.home-practice)>.new-logo{height:clamp(112px,24dvh,255px)}
@media(max-width:760px) and (orientation:portrait){
 #menu.menu-redesign .menu-poster:has(.home-practice)>.new-logo{height:clamp(92px,20dvh,200px)}
 #menu .pwt-pc-tip{gap:3px 8px;padding:7px 10px;font-size:13px}
 #menu .pwt-pc-tip button{min-height:36px;padding:4px 9px}
}
@media(pointer:coarse) and (orientation:landscape) and (max-height:520px){
 body.touch #menu.menu-redesign{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"poster tip" "poster modes";gap:6px 10px;align-items:start}
 body.touch #menu.menu-redesign .menu-poster{grid-area:poster;padding:0;gap:3px}
 body.touch #menu.menu-redesign .menu-poster:has(.home-practice)>.new-logo{height:38px}
 body.touch #menu .pwt-pc-tip{grid-area:tip}
 body.touch #menu .menu-play{grid-area:modes}
}
@media(pointer:coarse) and (max-width:480px) and (max-height:650px) and (orientation:portrait){
 body.touch #menu.menu-redesign:has(.pwt-pc-tip){display:grid;grid-template-columns:38% minmax(0,1fr);gap:6px;align-items:center}
 body.touch #menu.menu-redesign:has(.pwt-pc-tip) .menu-poster{display:contents}
 body.touch #menu.menu-redesign:has(.pwt-pc-tip) .new-logo{grid-area:1/1;width:100%;height:auto;justify-self:center}
 body.touch #menu.menu-redesign .pwt-pc-tip{grid-area:1/2;padding:5px 7px;line-height:1.2}
 body.touch #menu.menu-redesign .pwt-pc-tip button{margin:0}
 body.touch #menu.menu-redesign:has(.pwt-pc-tip) :is(.home-practice,.menu-play){grid-column:1/-1}
}

/* On a phone the brand lives on centre court. Swiping on that court still
   belongs to the scrolling homepage, including during play. */
#menu .home-practice.hp-phone canvas,
#menu .home-practice.hp-phone[data-state="playing"] canvas{touch-action:pan-y pinch-zoom;cursor:default}
body:has(#menu.hp-phone-portrait:not([hidden]))>main{padding:env(safe-area-inset-top) max(3px,env(safe-area-inset-right)) 12px max(3px,env(safe-area-inset-left));scroll-padding-top:0}
body #menu.menu-redesign.hp-phone-portrait:not([hidden]){display:flex;flex-direction:column;align-items:stretch;gap:12px;width:100%;padding:0}
body #menu.menu-redesign.hp-phone-portrait .menu-poster:has(.home-practice){display:block;order:0;min-height:0;padding:0;border:0}
body #menu.menu-redesign.hp-phone-portrait .menu-poster:has(.home-practice)>.new-logo{display:none}
#menu.hp-phone-portrait .pwt-pc-tip{order:1}
#menu.hp-phone-portrait .menu-play{order:2}
#menu.hp-phone-portrait #menuFullscreenBar{position:static;min-height:0;background:transparent}
#menu.hp-phone-portrait .home-practice{padding:5px;border-radius:8px}
#menu.hp-phone-portrait .hp-head{padding:2px 4px 5px}
#menu.hp-phone-portrait .hp-field{display:flex;justify-content:center;width:100%;background:transparent}
#menu.hp-phone-portrait .hp-field canvas{border-radius:4px}
#menu .home-practice.hp-phone .hp-pad{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-areas:". . up" "left right down";gap:4px 6px;margin:6px 0 2px}
#menu .hp-phone .hp-pad [data-code="ArrowLeft"]{grid-area:left}
#menu .hp-phone .hp-pad [data-code="ArrowRight"]{grid-area:right}
#menu .hp-phone .hp-pad [data-code="ArrowUp"]{grid-area:up}
#menu .hp-phone .hp-pad [data-code="ArrowDown"]{grid-area:down}
#menu.hp-phone-portrait .hp-pad button{flex:1;min-height:clamp(48px,7dvh,62px);touch-action:none;font-size:21px}
#menu.hp-phone-portrait .hp-hint{bottom:20%;max-width:75%}
