/* No selectors take effect unless the phone identity + touch gate is satisfied. */
.pool-phone body{position:fixed;top:var(--phone-top,0px);left:var(--phone-left,0px);width:var(--phone-width,100vw);height:var(--phone-height,100dvh);min-height:0;overflow:hidden;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);display:flex;flex-direction:column}
.pool-phone header{flex:0 0 46px;width:100%;padding:1px 6px;gap:4px;flex-wrap:nowrap}.pool-phone header>div:first-child{display:none}.pool-phone .head-actions{width:100%;gap:5px;justify-content:space-between}.pool-phone .head-actions button{min-height:44px;font-size:13px;padding:6px 12px}.pool-phone main{flex:1;min-height:0;width:100%;padding:3px 5px;overflow:hidden}.pool-phone body>footer{display:none}
.pool-phone #lobby{height:100%;overflow:auto;margin:0;padding:14px;display:block}.pool-phone #lobby .intro{display:none}.pool-phone #startForm{gap:12px}.pool-phone #game{height:100%;display:grid;grid-template-columns:minmax(0,1fr) 228px;grid-template-rows:62px 46px minmax(0,1fr);gap:3px 5px;min-width:0}.pool-phone .scoreboard{grid-column:1/-1;grid-template-columns:1fr 90px 1fr;gap:4px;min-height:0}.pool-phone .player{padding:3px 6px;overflow:hidden}.pool-phone .player h3{font:600 14px system-ui;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pool-phone .player.active h3:before{content:'▶ ';color:#f8d991}.pool-phone .player p{font-size:11px;line-height:1.1;margin:2px 0}.pool-phone .chips{gap:2px;flex-wrap:nowrap}.pool-phone .chip{width:16px;height:16px;font-size:9px;border-width:2px;flex-shrink:0}.pool-phone .match{gap:1px}.pool-phone .match strong{font-size:20px}.pool-phone .match .eyebrow{font-size:9px;letter-spacing:0}.pool-phone #network{font-size:9px;line-height:1.1}.pool-phone .statusbar{grid-column:1/-1;min-height:0;padding:0 2px;gap:6px;overflow:hidden}.pool-phone .statusbar strong{font-size:12px;line-height:1.2;max-height:44px;overflow:auto}.pool-phone .statusbar button{min-height:44px;flex-shrink:0}.pool-phone .table-wrap{grid-column:1;grid-row:3;position:relative;width:100%;height:100%;min-height:0;min-width:0;margin:0;filter:none;overflow:hidden}.pool-phone #table{position:absolute;top:50%;left:50%;margin:0;max-height:none;max-width:none;aspect-ratio:auto;transform-origin:center;user-select:none;-webkit-user-select:none}.pool-phone #pauseOverlay{inset:10%;padding:12px;font-size:20px;display:flex;align-items:center;justify-content:center;flex-direction:column;z-index:2}.pool-phone .controls{grid-column:2;grid-row:3;margin:0;padding:4px;gap:4px;display:grid;grid-template-columns:1fr 1fr;align-content:start;min-height:0;overflow:auto;overscroll-behavior:contain;border-radius:8px}.pool-phone .controls .eyebrow{font-size:10px;letter-spacing:0}.pool-phone .controls small{display:none}.pool-phone .buttonrow{margin:2px 0;gap:4px}.pool-phone .buttonrow button{flex:1;min-width:44px;min-height:44px;padding:2px}.pool-phone .phone-precision{font-size:11px;gap:1px}.pool-phone select{padding:4px;font-size:12px;min-height:44px}.pool-phone #phoneAngle{font-variant-numeric:tabular-nums;font-size:12px}.pool-phone .power input{height:44px;margin:0;touch-action:none}.pool-phone .power button{min-height:44px;margin:0}.pool-phone .power label{gap:1px;align-items:center}.pool-phone .pocketcall{grid-column:1/-1}.pool-phone .pocketcall label{gap:0}.pool-phone .pocketcall select{margin:1px 0}.pool-phone #phoneDock{display:grid;grid-template-columns:1fr 1fr;gap:4px;grid-column:1/-1}.pool-phone #phoneDock button{padding:4px;font-size:12px;min-height:44px}.pool-phone #phonePlacementStatus{grid-column:1/-1;font-size:11px;line-height:1.2}.pool-phone #phoneDetail{grid-column:1/-1;display:flex;align-items:center;gap:4px}.pool-phone #phoneLens{display:block;width:100px;height:100px;max-width:100%;border:1px solid #dcc088;border-radius:8px}.pool-phone #phoneLensMode{padding:3px;font-size:12px;flex:1;min-height:44px}
.pool-phone.pool-portrait #game{grid-template-columns:minmax(0,1fr) 128px}.pool-phone.pool-portrait .controls{display:flex;flex-direction:column}.pool-phone.pool-portrait #phoneDock{display:flex;flex-direction:column}.pool-phone.pool-portrait #phoneDetail{display:flex;flex-direction:column-reverse}.pool-phone.pool-portrait #phoneLensMode{width:100%}.pool-phone.pool-portrait .scoreboard{grid-template-columns:1fr 64px 1fr}.pool-phone.pool-portrait .player{padding:3px}.pool-phone.pool-portrait .chip{width:15px;height:15px}.pool-phone.pool-portrait .player p{font-size:10px}
.pool-phone dialog{max-height:calc(var(--phone-height,100dvh) - 12px);max-width:650px;width:calc(100% - 12px);padding:12px;overflow:auto;overscroll-behavior:contain}.pool-phone dialog h2{font-size:24px}.pool-phone dialog .close{position:sticky;top:0;background:#223b30;z-index:2}.pool-phone #phoneTools{padding:0;overflow:hidden}.pool-phone #phoneTools[open]{display:flex;flex-direction:column}.pool-phone .phone-panel-head{display:flex;justify-content:space-between;align-items:center;padding:6px 10px;flex-shrink:0;border-bottom:1px solid #dcb77d60;gap:8px}.pool-phone .phone-panel-body{padding:12px;overflow:auto;min-height:0;overscroll-behavior:contain;display:grid;gap:12px}.pool-phone .phone-panel-body label{font-size:14px}.pool-phone .phone-panel-body .spinrow canvas{width:132px;height:132px}.pool-phone .phone-panel-body .spinrow button{min-height:44px;font-size:14px}.pool-phone .footer-controls{margin:0;gap:12px}.pool-phone .placement{margin:0;padding:8px;gap:8px}.pool-phone .placement span{min-width:100%;font-size:13px}.pool-phone .placement label{font-size:13px}.pool-phone .placement input{width:90px}.pool-phone .history{padding:10px}.pool-phone .history summary{min-height:44px;display:flex;align-items:center}.pool-phone button:disabled{opacity:1;color:#b7bdb7;background:#27352f;border-color:#66766a}.pool-phone button:focus-visible{outline-offset:-3px}
/* Short landscape still gives the table the full available height; controls scroll internally. */
.pool-phone:not(.pool-portrait) #game{grid-template-rows:52px 44px minmax(0,1fr)}

.pool-phone .head-actions #phoneSettings{font-size:12px;padding:4px 8px}.pool-phone .pool-placing .controls{scroll-behavior:auto}
.pool-phone.pool-placing .controls>.aim,.pool-phone.pool-placing .controls>.power,.pool-phone.pool-placing .controls>.pocketcall{display:none}
.pool-phone:not(.pool-portrait) header{position:absolute;right:env(safe-area-inset-right);top:env(safe-area-inset-top);width:280px;z-index:3;padding:0 5px;height:46px}.pool-phone:not(.pool-portrait) .head-actions{gap:3px}.pool-phone:not(.pool-portrait) .head-actions button{padding:3px 6px;font-size:11px}.pool-phone:not(.pool-portrait) .head-actions #fullscreen span{display:none}.pool-phone:not(.pool-portrait) main{padding:3px 5px}.pool-phone:not(.pool-portrait) #game{grid-template-columns:minmax(0,1fr) 280px;grid-template-rows:108px 48px minmax(0,1fr)}.pool-phone:not(.pool-portrait) .scoreboard{grid-column:2;grid-row:1;height:62px;align-self:end;grid-template-columns:1fr 50px 1fr}.pool-phone:not(.pool-portrait) .statusbar{grid-column:2;grid-row:2}.pool-phone:not(.pool-portrait) .table-wrap{grid-row:1/4}.pool-phone:not(.pool-portrait) #lobby{padding-top:50px}.pool-phone:not(.pool-portrait) .player p{font-size:10px}.pool-phone:not(.pool-portrait) .match .eyebrow{font-size:8px}

.pool-phone .head-actions button{min-width:44px}.pool-phone:not(.pool-portrait) #fullscreen{max-width:55px}
