/* Measured board dimensions preserve aspect ratio; ancillary content uses dialogs. */
[hidden]{display:none!important}body.zar-playing{height:var(--zar-height,100dvh);min-height:0;padding:0}body.zar-playing #lobby,body.zar-playing #globalSeo{display:none!important}
#gameView:not([hidden]){height:var(--zar-height,100dvh);display:grid;grid-template-rows:48px minmax(0,1fr);padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
#gameView>.top{min-height:0;height:48px;padding:4px 8px;gap:4px;flex-wrap:nowrap}#gameView .brand{font-size:16px}#gameView .brand small,#gameView .crest,#gameView .wordmark small{display:none}#gameView .wordmark{font-size:24px}#gameView .top-actions{gap:4px;align-items:center}#gameView .top-actions button,#gameView .global-language{font-size:12px;min-height:36px;padding:5px 7px;width:auto}
#gameView>.shell{width:100%;height:100%;max-width:none;padding:6px;display:grid;grid-template-columns:minmax(0,1fr);min-height:0;gap:0;align-items:stretch}
#gameView .game{display:grid;grid-template-rows:56px minmax(0,1fr) auto 30px 30px;min-height:0;height:100%;gap:5px;max-width:1440px;width:100%;margin:auto;align-items:center}
#gameView .matchhead{width:min(100%,900px);margin:0 auto;height:56px;gap:5px}#gameView .player,#gameView .matchtitle{padding:4px 8px;min-height:0;height:100%}#gameView .player .avatar{width:30px;height:30px}#gameView .player b,#gameView .matchtitle strong{font-size:20px}#gameView .player strong{font-size:13px}#gameView .matchtitle small{display:none}
#gameView .boardframe{width:var(--zar-board-width,300px);margin:auto;padding:14px 12px 20px;box-sizing:border-box;max-width:100%;flex:none}#gameView .board{width:100%;aspect-ratio:1.56;height:auto;min-height:0}#gameView .brandplaque{font-size:11px;padding:0 12px;line-height:16px}#gameView .toporn{font-size:10px;line-height:13px}#gameView .die{width:clamp(20px,3vw,40px);padding:12%;gap:7%}#gameView .checker{max-height:22%;width:85%;aspect-ratio:1;object-fit:contain}#gameView .checker em{font-size:10px}#gameView .point .num{font-size:9px}#gameView .barstack .checker{width:90%;max-width:30px;max-height:none}
#gameView .controls{margin:0;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px;width:min(100%,900px);justify-self:center}#gameView .controls button{font-size:12px;padding:6px 3px;min-height:40px;white-space:normal;line-height:1.15;min-width:0}
#gameView .zar-trays{display:flex;gap:8px;align-items:center;justify-content:center;min-width:0}#gameView .zar-trays .tray{height:28px;margin:0;width:min(42%,220px);min-width:0;padding:3px}#gameView .zar-trays .tray span{white-space:nowrap;font-size:11px}#gameView .zar-trays .tray i{height:17px;min-width:0}#gameView .status{padding:2px 6px;min-height:0;font-size:12px;line-height:1.1;margin:0}
#gameView>.guide,#gameView>footer{display:none}#gameView .shell>aside{display:none}#zarPanel{width:min(560px,96vw);max-width:96vw;max-height:90dvh;overflow:auto;padding:12px}#zarPanel .left,#zarPanel .right{display:block;width:100%;margin-top:8px}#zarPanel .left .nav{width:100%;display:block;margin:6px 0}#zarPanel .left label,#zarPanel .left select{display:block;width:100%}#zarPanel .guide{display:block;margin:0}#zarPanel .zar-panel-close{position:sticky;top:0;z-index:4;display:block;margin-left:auto}#zarPanel::backdrop{background:#02050bdc}#zarPanel .social-chat{max-height:45dvh;overflow:auto}
@media(max-width:600px){#gameView>.top{height:42px;padding:3px 4px}#gameView:not([hidden]){grid-template-rows:42px minmax(0,1fr)}#gameView .brand,#gameView #sound,#gameView .wordmark{display:none}#gameView .top-actions{width:100%;justify-content:space-between}#gameView .top-actions button,#gameView .global-language{font-size:11px;padding:3px;min-height:34px}#gameView .game{grid-template-rows:50px minmax(0,1fr) auto 30px 32px;gap:4px}#gameView .controls{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}#gameView .controls button{min-height:38px;font-size:12px}#gameView .player{gap:3px;padding:3px}#gameView .player small{display:none}#gameView .player .avatar{width:24px;height:24px}#gameView .matchhead{height:50px}#gameView .matchtitle span{font-size:10px}}
@media(max-height:500px) and (orientation:landscape){#gameView:not([hidden]){grid-template-rows:36px minmax(0,1fr)}#gameView>.top{height:36px}#gameView .game{grid-template-rows:36px minmax(0,1fr) 36px 24px 20px;gap:2px}#gameView .matchhead{height:36px}#gameView .player span,#gameView .player small,#gameView .matchtitle span,#gameView .avatar{display:none}#gameView .controls{grid-template-columns:repeat(6,minmax(0,1fr))}#gameView .controls button{min-height:34px;font-size:11px}#gameView .zar-trays .tray{height:22px}#gameView .status{font-size:11px}#gameView .boardframe{padding:8px 9px 15px}#gameView .toporn{display:none}}

@media(max-width:600px){#gameView:not([hidden]){grid-template-rows:78px minmax(0,1fr)}#gameView>.top{height:78px}#gameView .top-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px}#gameView .top-actions button,#gameView .global-language{width:100%;max-width:100%;font-size:10px;min-width:0;min-height:34px}#gameView .global-language{grid-column:span 2}}
@media(min-width:601px) and (max-width:1100px){#gameView .brand,#gameView .wordmark{display:none}#gameView .top-actions{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));width:100%}#gameView .top-actions button,#gameView .global-language{width:100%;min-width:0;max-width:100%;white-space:normal;font-size:10px;padding:3px}}
@media(max-height:500px) and (orientation:landscape){#gameView:not([hidden]){grid-template-rows:40px minmax(0,1fr)}#gameView>.top{height:40px}#gameView .brand,#gameView .wordmark{display:none}#gameView .top-actions{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));width:100%}#gameView .top-actions button,#gameView .global-language{width:100%;min-width:0;max-width:100%;white-space:normal;font-size:10px;padding:2px;min-height:34px;grid-column:auto}}

body.zar-fullscreen #gameView{position:fixed;inset:0;z-index:9999;background:#080b10}
