/* Fixed working canvas: the outer window stays fixed; each content block can scroll independently. */
html,body{height:100%;min-height:0;overflow:hidden;overscroll-behavior:none}
:root{--viewport-height:100dvh;--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px)}
body>footer{display:none!important}
body.game-mode #app{position:fixed;inset:56px 0 0 230px;margin:0;padding:18px 24px;min-height:0;max-width:none;overflow:hidden;display:flex}
.game-topbar{display:flex!important;height:56px;left:230px;padding:0 24px;background:var(--ground)}
.game-sidebar{width:230px}.game-sidebar nav a{min-height:44px}
.game-mode .advance-button{display:none}.game-mode .game-date small{display:none}
.screen-frame{display:flex;flex-direction:column;gap:12px;width:100%;height:100%;min-height:0;min-width:0}
.screen-frame>.heading,.screen-frame>.office-heading{flex:none;margin:0;min-width:0;gap:12px}
.screen-frame h1{font-size:24px;line-height:1.3;margin:0 0 4px}.screen-frame .heading p{margin:0;font-size:13px;line-height:1.5}
.screen-frame .context{display:none}.screen-frame .panel{padding:18px;margin:0;min-height:0}
.screen-frame>.filters{margin:0;gap:12px;flex:none}.filters input,.filters select{min-height:38px}
.workspace{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0;overflow:hidden;background:var(--surface);border:1px solid var(--border)}
.view-tabs{display:flex;flex:none;gap:4px;padding:8px 12px;border-bottom:1px solid var(--border);min-width:0}
.view-tabs button{flex:1;border:0;border-radius:0;background:transparent;color:var(--muted);font-size:14px;min-width:0;min-height:44px;padding:8px 10px;white-space:nowrap}
.view-tabs button[aria-selected=true]{background:var(--raised);color:var(--text)}
.view-pane{flex:1;min-height:0;min-width:0;display:flex;flex-direction:column;padding:16px;overflow:auto;overscroll-behavior:contain}
.view-pane.panel{border:0;padding:16px}.view-pane>.panel{border:0;background:transparent;padding:0}
.scroll-block{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;gap:10px;overflow:hidden}
.scroll-block>.block-body{flex:1;height:0;min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--control) transparent}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.grid-page{display:flex;flex-direction:column;min-height:0;flex:1}
.team-grid,.club-selection{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0}
.team-item{padding:14px}.team-item h2{font-size:17px;margin:5px 0}.team-item p{font-size:13px;margin:5px 0}.team-item code{display:none}
.team-item button{margin-top:8px;min-height:40px}.team-item>span{display:block;font-size:12px}
.panel.scroll-block table{min-width:0;width:100%;table-layout:auto}.panel.scroll-block td,.panel.scroll-block th{padding:9px 10px}
.panel.scroll-block td:first-child,.panel.scroll-block th:first-child{min-width:0;position:static}
.panel.scroll-block .num{white-space:nowrap}.panel.scroll-block td small{font-size:12px}
.screen-staff>.muted{margin:0;font-size:12px}.office-metrics{flex:none;margin:0;border:1px solid var(--border)}
.office-metrics>div{padding:10px 16px}.office-metrics strong{font-size:24px!important;line-height:1.3}.office-metrics strong small{display:inline;margin-left:6px}
.player-heading .back{display:inline-block;font-size:12px;margin-bottom:5px}.player-heading h1{margin-bottom:3px}
.player-summary.panel{padding:12px 18px;flex:none}.rating-summary{justify-content:flex-start}.rating-summary>div{padding:0 24px;min-width:120px}
.rating-summary strong{font-size:30px;line-height:1.2}.rating-summary span{font-size:12px;margin-bottom:3px}
.skill-rows{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 30px}
.skill-cell{display:grid;grid-template-columns:minmax(0,1fr) max-content;gap:6px 12px;align-items:center;min-width:0;min-height:44px;padding:5px 0}
.skill-cell>span{font-size:14px;white-space:nowrap}.skill-cell>b{font-size:19px;font-weight:500;white-space:nowrap;word-break:normal;overflow-wrap:normal}.skill-cell .skill-value-unit{font-size:.68em;margin-left:.2em;font-weight:400}.skill-cell>.track{grid-column:1/-1;height:3px}
.skill-cell .track i{height:100%;display:block;background:#a8b5ac}
.contract-grid,.record-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px 24px;margin:0}
.contract-grid>div,.record-fields>div{min-width:0;padding:12px 0;border-bottom:1px solid var(--border)}
.contract-grid dt,.record-fields dt{color:var(--muted);font-size:13px;margin:0 0 7px}.contract-grid dd,.record-fields dd{font-size:17px;margin:0;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.money-detail{font-size:12px;line-height:1.5;margin-top:4px}
.history-list{display:grid;gap:0}.history-row{display:flex;align-items:center;gap:22px;padding:12px 0;border-bottom:1px solid var(--border);min-width:0}
.history-identity{min-width:0;flex:1}.history-identity strong{font-size:14px;font-weight:500}.history-identity small{display:block;font-size:12px;line-height:1.4;color:var(--muted);margin-top:4px}
.history-numbers{display:grid;grid-template-columns:repeat(4,65px);gap:16px;margin:0}.history-numbers dt{font-size:12px;color:var(--muted);margin:0 0 3px}.history-numbers dd{font-size:16px;text-align:right;margin:0}
.history-row>button{min-height:44px;font-size:13px}.empty-state{padding:18px;font-size:14px}
.record-dialog{position:fixed;inset:24px;width:min(900px,calc(100vw - 32px));height:min(720px,calc(100dvh - 48px));max-height:none;max-width:none;margin:auto;padding:20px;background:var(--surface);color:var(--text);border:1px solid var(--control);overflow:hidden}
.record-dialog[open]{display:flex;flex-direction:column;gap:14px}.record-dialog::backdrop{background:#000b}.record-dialog header{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:0;min-height:44px;background:none;border:0;position:static}
.record-dialog h2{font-size:18px;margin:0}.record-dialog .record-context,.record-dialog .record-source{margin:0;font-size:13px;line-height:1.5}.record-dialog .record-fields{grid-template-columns:repeat(4,minmax(0,1fr))}
.screen-home .club-masthead{padding:12px 18px;flex:none;min-width:0}.club-masthead h2{font-size:22px;margin:3px 0}.club-masthead .crest-large{width:48px;height:56px}.club-masthead .crest-large b{font-size:24px}
.screen-home .office-metrics{margin-top:-12px}.screen-home .office-heading h1{font-size:23px}.office-actions{display:none}
.screen-home .field-panel,.screen-tactics .field-panel{display:flex;flex-direction:column;align-items:stretch;min-height:0;overflow:hidden}
.field-panel .panel-title{flex:none;margin-bottom:6px}.field-panel h2{font-size:15px;margin:0}.field-panel .diamond-board{flex:none;min-height:0;max-width:100%;margin:auto;position:relative}
.diamond-board .field-player{font-size:12px;min-width:58px}.diamond-board .field-player a{max-width:128px;padding:3px 4px}.diamond-board .field-player small,.diamond-board .field-position{font-size:11px}
.field-panel .board-caption{flex:none;text-align:center;font-size:12px;margin:6px 0 0}.screen-tactics .field-panel>.board-caption{display:none}
.inbox-items{display:grid}.inbox-item{padding:14px 0}.inbox-item h3{font-size:16px}.key-player-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.lineup-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 24px}.lineup-row{display:grid;grid-template-columns:36px minmax(0,1fr);gap:8px;margin:0;min-height:48px}
.lineup-row select{min-width:0;width:100%;min-height:44px;font-size:13px}.screen-tactics form .panel-title{flex:none;margin-bottom:8px}.screen-tactics form>button{flex:none;min-height:44px}.screen-tactics #lineup-error:empty{display:none}.screen-tactics #lineup-error{margin:0;color:var(--accent);font-size:13px}
.content-blocks{display:grid;gap:10px}.content-blocks p{font-size:14px;line-height:1.6;margin:0}.content-blocks table{min-width:0;width:100%}.content-blocks td:first-child{min-width:0;white-space:normal}
.screen-menu .slot,.screen-load .slot{padding:12px 0;min-height:70px}.slot h2,.slot h3{font-size:16px;margin:0 0 3px}.slot p{font-size:13px;line-height:1.5}.slot>div:last-child{white-space:nowrap}.slot button{min-height:40px;font-size:13px}
.screen-menu .filters{margin:10px 0 0;gap:10px}.screen-menu .filters button,.screen-menu .filters .button{min-height:40px;font-size:13px}.screen-menu .panel>h2{font-size:16px;flex:none;margin:0 0 12px}
.screen-menu .panel>dl{font-size:14px;line-height:1.6}.screen-menu .panel>p{font-size:14px}.screen-menu .panel>.button{display:inline-flex;margin:4px 4px 0 0}
body.front-mode #app{position:fixed;inset:0;margin:0;min-height:0;max-width:none;padding:24px;display:flex;overflow:hidden}
.front-mode .screen-frame{max-width:1000px;margin:auto}.front-mode .front-panel{display:flex;flex-direction:column;min-height:0;height:100%;width:100%;margin:0;padding:22px}
.front-panel>h1{margin:8px 0 12px}.front-panel>p{flex:none;font-size:13px;line-height:1.5;margin:6px 0}.front-panel>.context{display:none}
.career-setup{display:flex;flex-direction:column;gap:12px;height:100%;min-height:0;min-width:0;margin:0;padding:0}.setup-header{margin:0;flex:none}.setup-heading{margin:0}.setup-heading h1{font-size:24px;margin:0}
.setup-league-line{display:none}.career-setup .setup-bottom{flex:none;display:flex;flex-direction:row;justify-content:space-between;gap:14px;margin:0;padding:12px 16px}.career-setup .setup-bottom p{font-size:13px;line-height:1.5;margin:2px 0}.career-setup .setup-bottom small{display:none}.career-setup .setup-bottom button{min-width:180px;min-height:44px}
.setup-regions{flex:none;margin:0;gap:10px}.setup-regions button{min-height:44px}.club-option{display:flex;min-height:66px;align-items:center;gap:12px;padding:10px 12px}.club-option strong{font-size:14px;line-height:1.4}.club-option small{font-size:12px}.club-option .select-mark{margin-left:auto}
body.title-mode #app{padding:0}.title-mode .screen-frame{max-width:none}.title-scene{height:100%;min-height:0;padding:24px 40px;display:flex;flex-direction:column}.title-content{flex:1;min-height:0;padding:20px 0}.title-top,.title-bottom{flex:none}.title-action{min-height:56px}.title-actions{max-width:520px}
@media(max-width:1100px){
 body.game-mode #app{inset:56px 0 64px;padding:14px 20px}.game-topbar{left:0;height:56px;padding:0 20px}
 .game-sidebar{position:static;width:auto;border:0}.game-sidebar .sidebar-logo,.game-sidebar .club-context,.game-sidebar .nav-caption,.game-sidebar .sidebar-bottom{display:none}
 .game-sidebar nav{position:fixed;inset:auto 0 0;height:64px;display:flex;flex-direction:row;justify-content:space-around;background:var(--ground);padding:0 8px;border-top:1px solid var(--border);z-index:6;gap:0}
 .game-sidebar nav a{display:flex;flex-direction:column;justify-content:center;gap:3px;padding:8px;min-height:64px;font-size:12px}.game-sidebar nav a span{width:auto}.game-sidebar nav a .nav-icon{width:18px;height:18px}
 .team-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.club-selection{grid-template-columns:repeat(2,minmax(0,1fr))}
 .history-row{gap:14px}.history-numbers{grid-template-columns:repeat(4,48px);gap:10px}.contract-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
 body.game-mode #app{padding:12px 16px}.screen-frame{gap:10px}.screen-frame h1{font-size:22px}.screen-frame .heading p{font-size:12px}.screen-frame .heading .button{font-size:12px;min-height:40px;padding:7px 10px}
 .game-topbar{padding:0 16px}.game-topbar .topbar-club span{font-size:12px}.game-topbar .game-date strong{font-size:11px}.game-topbar .topbar-club .crest{width:24px;height:30px}.topbar-club{gap:8px}.game-date{margin-left:6px}
 .screen-frame .panel{padding:12px}.player-heading .back{font-size:12px;margin-bottom:4px}.player-heading h1{font-size:23px}.screen-frame .player-heading p{font-size:12px;line-height:1.4}
 .player-summary.panel{padding:9px 14px}.rating-summary{width:100%;justify-content:space-between}.rating-summary>div{min-width:0;flex:1;padding:0 16px}.rating-summary>div:last-child{padding-right:0}.rating-summary strong{font-size:26px}.rating-summary span{font-size:11px;margin-bottom:2px}
 [data-tabset=player]>.view-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px;padding:5px}
 .view-tabs{gap:0;padding:4px}.view-tabs button{min-height:40px;padding:7px 4px;font-size:13px}.view-pane,.view-pane.panel{padding:12px}
 .skill-rows{gap:10px 18px}.skill-cell{min-height:40px;gap:4px 5px;padding:3px 0}.skill-cell>span{font-size:12px}.skill-cell>b{font-size:17px}.skill-cell>.track{height:2px}
 .contract-grid,.record-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px}.contract-grid>div,.record-fields>div{padding:7px 0}.contract-grid dt,.record-fields dt{font-size:12px;margin-bottom:4px}.contract-grid dd,.record-fields dd{font-size:14px;line-height:1.5}
 .history-row{display:grid;grid-template-columns:minmax(0,1fr) 64px;gap:8px 10px;padding:10px 0}.history-identity{grid-column:1/-1}.history-identity strong{font-size:13px}.history-identity small{font-size:11px}.history-numbers{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.history-numbers dd{font-size:14px}.history-numbers dt{font-size:11px;white-space:nowrap}.history-row>button{min-height:44px;padding:7px 8px;font-size:12px}
 .record-dialog{padding:14px;inset:12px;height:calc(100dvh - 24px)}.record-dialog .record-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.record-dialog .record-context{font-size:12px}.record-dialog .record-source{font-size:12px}
 .screen-players>.filters{display:grid;grid-template-columns:1fr 1fr;gap:8px}.screen-players>.filters label{min-width:0;font-size:11px;gap:2px}.screen-players>.filters label input,.screen-players>.filters label select{min-width:0;width:100%;font-size:12px;min-height:36px}
 .screen-players table,.screen-players tbody{display:block;min-width:0;width:100%;white-space:normal}.screen-players thead{display:none}
 .screen-players tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto auto;gap:5px 10px;padding:10px 0;border-bottom:1px solid var(--border)}
 .screen-players td{padding:0!important;border:0;min-width:0;font-size:12px}.screen-players td:first-child{grid-area:1/1/2/4;min-width:0}.screen-players td:first-child a{font-size:14px}.screen-players td:first-child small{font-size:11px;line-height:1.4}
 .screen-players td.ovr{grid-area:1/4;font-size:22px;align-self:center}.screen-players td:nth-child(2){grid-area:2/1/3/3;color:var(--muted)}.screen-players td:nth-child(3){grid-area:2/3}.screen-players td[data-label="疲労"]{grid-area:2/4}
 .screen-players td[data-label="疲労"]::before{content:attr(data-label) ' ';font:11px 'Yu Gothic UI',sans-serif;color:var(--muted)}.screen-players td:nth-child(3)::after{content:'歳';font-size:11px;color:var(--muted)}
 .staff-table tr{padding:10px 0;gap:6px 10px}.staff-table td{font-size:12px!important}.staff-table td:first-child small{font-size:11px}.staff-table td:first-child{max-width:160px}.staff-table td:last-child{font-size:11px!important}
 .office-metrics>div{padding:8px 10px}.office-metrics span{font-size:11px}.office-metrics strong{font-size:20px!important}.office-metrics strong small{font-size:11px}.screen-staff>.muted{font-size:11px;line-height:1.4}
 .screen-home .office-heading{display:none}.screen-home .club-masthead{padding:10px 12px;gap:8px}.screen-home .club-masthead>div:first-child{gap:10px}.screen-home .club-masthead h2{font-size:15px;line-height:1.4}.screen-home .club-masthead p{font-size:11px;margin:0}.screen-home .club-masthead span{font-size:11px}.screen-home .club-masthead .crest-large{width:32px;height:38px}.screen-home .club-record{display:none}.screen-home .office-metrics{margin-top:-10px}
 .field-panel .panel-title h2{font-size:13px}.field-panel .panel-title a{font-size:11px}.diamond-board .field-player{min-width:48px;font-size:11px;max-width:90px}.diamond-board .field-player a{max-width:86px;padding:2px 3px;font-size:11px}.diamond-board .field-player small,.diamond-board .field-position{font-size:11px}
 .lineup-fields{grid-template-columns:1fr;gap:6px}.lineup-row{min-height:44px;gap:8px}.lineup-row select{min-height:44px;font-size:12px}.screen-tactics .heading p{display:none}.screen-tactics form .panel-title h2{font-size:14px}.screen-tactics form .text-button{font-size:12px}
 .team-grid,.club-selection{grid-template-columns:1fr;gap:10px}.team-item{padding:12px}.team-item h2{font-size:16px}.team-item p,.team-item small{font-size:12px}.team-item button{min-height:40px;font-size:12px}
 .content-blocks{gap:10px}.content-blocks p{font-size:13px;line-height:1.6}.content-blocks .table-wrap{overflow:visible;max-height:none}.content-blocks td,.content-blocks th{padding:7px 4px;font-size:11px}.content-blocks td:first-child,.content-blocks th:first-child{min-width:0;position:static;white-space:normal}.content-blocks td{white-space:normal}
 .screen-menu .heading p{display:none}.screen-menu .slot,.screen-load .slot{gap:10px;padding:10px 0;align-items:center}.slot h2,.slot h3{font-size:14px}.slot p{font-size:12px}.slot button{font-size:12px;padding:7px 9px;min-height:40px}.slot button+button{margin-left:5px}.slot small{font-size:11px}
 .screen-menu .filters{display:flex;flex-wrap:wrap;gap:8px}.screen-menu .filters button,.screen-menu .filters .button{font-size:12px;margin:0;min-height:40px}.screen-menu .panel>dl{grid-template-columns:80px 1fr;font-size:13px;gap:10px}.screen-menu .panel>p{font-size:12px}.screen-menu .panel>.button{font-size:12px;min-height:40px}
 body.front-mode #app{padding:16px}.front-mode .front-panel{padding:16px}.front-panel>h1{font-size:22px;margin:5px 0 8px}.front-panel>.back{font-size:12px}.front-panel>p{font-size:12px;line-height:1.5}
 .career-setup{gap:10px}.setup-header{font-size:12px}.setup-header .small-brand{font-size:14px}.setup-heading h1{font-size:23px}.career-setup .setup-bottom{display:flex;flex-direction:column;gap:8px;padding:10px 12px;align-items:stretch}.career-setup .setup-bottom strong{font-size:14px}.career-setup .setup-bottom p{font-size:11px;line-height:1.4}.career-setup .setup-bottom button{min-height:42px;min-width:0;width:100%;font-size:13px}.setup-regions button{font-size:13px;min-height:42px}.club-option{min-height:62px;padding:9px 10px}.club-option strong{font-size:13px}.club-option small{font-size:11px}.club-option .club-initial{width:30px;height:34px;font-size:18px}
 .title-scene{padding:18px 20px}.title-top,.title-bottom{font-size:11px}.title-content{padding:12px 0}.game-logo{font-size:clamp(40px,12vw,60px)}.title-actions{width:100%}.title-action{min-height:52px;padding:12px 0}.title-action strong{font-size:16px}.title-action small{font-size:12px}
}
@media(max-height:700px){.screen-frame{gap:8px}.screen-frame .heading p{font-size:12px}.screen-frame .context{display:none}.player-heading .back{margin:0;font-size:11px}.player-summary.panel{padding:6px 14px}.rating-summary strong{font-size:24px}.skill-cell{min-height:34px}.view-tabs button{min-height:38px}.screen-home .office-heading{display:none}.office-metrics>div{padding-top:6px;padding-bottom:6px}.career-setup .setup-bottom p{display:none}.title-content{padding:8px 0}.title-action{min-height:44px}.game-logo{font-size:clamp(36px,10vh,68px)}}

/* Primary data remains readable; scroll belongs to the content frame. */
@media(max-width:700px){.skill-cell>span{font-size:13px}.rating-summary span{font-size:12px}.view-tabs button{font-size:14px}.contract-grid dt,.record-fields dt{font-size:13px}.history-identity strong{font-size:14px}}

.club-picker{overflow:hidden}.club-picker .block-body{scrollbar-gutter:stable}
.career-setup>.setup-header,.career-setup>.setup-heading,.career-setup>.setup-regions,.career-setup>.setup-bottom{flex-shrink:0}
.screen-home .office-heading{display:flex}.screen-home .office-heading h1{font-size:22px;margin:0}
.diamond-board .field-player a{font-size:13px}.diamond-board .field-player small,.diamond-board .field-position{font-size:12px}
.panel.scroll-block td small{font-size:13px}
@media(max-width:700px){
 .screen-frame .heading p,.screen-frame .player-heading p{font-size:13px}.player-heading .back{font-size:13px}.rating-summary span{font-size:13px}
 .screen-players>.filters label{font-size:13px}.screen-players>.filters label input,.screen-players>.filters label select{font-size:13px}
 .screen-players td,.screen-players td:first-child small{font-size:13px}.screen-players td[data-label="疲労"]::before{font-size:12px}
 .diamond-board .field-player a{font-size:13px;max-width:96px}.diamond-board .field-player{max-width:100px}
 .club-option strong,.club-option small{font-size:13px}.career-setup .setup-bottom p{font-size:13px}
}

.install-action{width:100%;border:0;border-radius:0;background:transparent;color:inherit;text-align:left;font:inherit;cursor:pointer}
.title-content h1.game-logo{font-size:clamp(48px,7vw,92px);line-height:1.02;font-weight:400;letter-spacing:-.02em;margin:0 0 24px}
.title-top,.title-bottom{font-size:13px}.title-content{display:flex;flex-direction:column;justify-content:center}.title-actions{flex:none}
.install-dialog{height:min(540px,calc(100dvh - 48px))}.install-steps{overflow:auto;overscroll-behavior:contain;font-size:14px;line-height:1.7}.install-steps h3{font-size:17px;margin:10px 0}.install-steps ol{padding-left:22px;margin:0 0 22px}.install-steps li{margin:8px 0}.install-steps p{font-size:13px;color:var(--muted)}
@media(max-width:1100px){
 .game-topbar{height:calc(56px + env(safe-area-inset-top));padding-top:env(safe-area-inset-top)}
 body.game-mode #app{top:calc(56px + env(safe-area-inset-top));bottom:calc(64px + env(safe-area-inset-bottom))}
 .game-sidebar nav{height:calc(64px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom)}
 body.front-mode #app{padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
 body.title-mode #app{padding:0}.title-scene{padding-top:max(18px,env(safe-area-inset-top));padding-bottom:max(18px,env(safe-area-inset-bottom))}
}
@media(max-width:700px){.title-content h1.game-logo{font-size:clamp(44px,12vw,64px);margin-bottom:20px}.title-top,.title-bottom{font-size:12px}.install-action{font-size:14px}}
@media(max-height:620px){.title-content h1.game-logo{font-size:clamp(30px,9vh,55px);margin-bottom:12px}.title-scene{padding-top:12px;padding-bottom:12px}.title-content{padding:8px 0}.title-action{min-height:38px;padding:7px 0}.title-action.compact{min-height:34px}}

/* Fixed edges use the full layout viewport; visualViewport can under-report iOS height. */
body.front-mode #app{inset:0;height:auto}
body.game-mode #app{bottom:0;height:auto}
@media(max-width:1100px){
 body.game-mode #app{height:auto;bottom:calc(64px + var(--safe-bottom))}
 .game-sidebar nav{top:auto;bottom:0}
 body.front-mode #app{padding-top:calc(20px + var(--safe-top));padding-bottom:calc(16px + var(--safe-bottom))}
 body.title-mode #app{padding:0}
 .title-scene{padding-top:calc(36px + var(--safe-top));padding-bottom:calc(18px + var(--safe-bottom))}
 .title-content{justify-content:flex-end;padding-top:24px;padding-bottom:clamp(24px,7dvh,64px)}
}
@media(max-height:620px) and (max-width:1100px){
 .title-scene{padding-top:calc(20px + var(--safe-top));padding-bottom:calc(12px + var(--safe-bottom))}
 .title-content{justify-content:center;padding:8px 0}
}
/* Phone actions sit at the bottom edge, above the home indicator only. */
@media(max-width:700px){
 body.title-mode{isolation:isolate}
 body.title-mode::before{content:'';position:fixed;inset:0;z-index:-1;background:#090c0b url('assets/stadium-night.png') 40% center/cover no-repeat;pointer-events:none}
 .title-scene{background:none;padding-bottom:calc(12px + var(--safe-bottom))}
 .title-scene::before{position:fixed}
 .title-bottom{display:none}
 .title-content{flex:1;min-height:0;width:100%;margin:0;justify-content:flex-end;padding:24px 0 0}
 .title-actions{width:100%;max-width:none}
 .title-action{min-height:64px}
 .title-action.compact{min-height:56px}
}
@media(max-width:700px) and (max-height:620px){
 .title-content{padding-top:12px}
 .title-action{min-height:48px;padding:8px 0}
 .title-action.compact{min-height:44px}
}
.field-meta{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:3px;min-height:20px}
.field-meta .field-position{margin:0!important}.field-meta small{margin:0}
.field-player .field-meta button.field-position{width:auto;min-width:24px}
@media(max-width:700px){
 .screen-home .field-panel{overflow:auto;overscroll-behavior:contain}
 .screen-home .field-panel .diamond-board{margin:6px auto;flex-shrink:0}
 .screen-home .field-player{min-width:0;max-width:88px}
 .screen-home .field-player a{max-width:88px;font-size:13px;padding:3px 4px}
 body.game-mode #notice:not(:empty){bottom:calc(76px + var(--safe-bottom));max-width:calc(100vw - 32px);font-size:13px}
}
/* iOS Home Screen: normal document flow avoids WebKit's fixed-root clipping. */
html.ios-pwa{--app-height:100vh;height:var(--app-height);-webkit-text-size-adjust:100%;text-size-adjust:100%}
html.ios-pwa body{position:relative;height:var(--app-height);min-height:0;max-height:var(--app-height);overflow:hidden}
html.ios-pwa body.front-mode{display:flex;flex-direction:column}
html.ios-pwa body.front-mode #app{position:relative;inset:auto;flex:1;height:100%;min-height:0;width:100%}
html.ios-pwa body.game-mode{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:calc(56px + var(--safe-top)) minmax(0,1fr) calc(64px + var(--safe-bottom))}
html.ios-pwa #game-shell:not([hidden]),html.ios-pwa .game-sidebar{display:contents}
html.ios-pwa .game-sidebar>:not(nav){display:none}
html.ios-pwa .game-topbar{position:relative;inset:auto;grid-row:1;grid-column:1;width:100%;height:100%;min-height:0}
html.ios-pwa body.game-mode #app{position:relative;inset:auto;grid-row:2;grid-column:1;height:auto;min-height:0;width:100%;margin:0}
html.ios-pwa .game-sidebar nav{position:relative;inset:auto;grid-row:3;grid-column:1;width:100%;height:100%;min-height:0;display:flex;flex-direction:row;justify-content:space-around;padding:0 8px env(safe-area-inset-bottom);gap:0;background:var(--ground);border-top:1px solid var(--border)}
html.ios-pwa .game-sidebar nav a{display:flex;flex-direction:column;justify-content:center;gap:3px;min-height:64px;padding:8px;font-size:12px}
html.ios-pwa .game-sidebar nav a span{width:auto}html.ios-pwa .game-sidebar .nav-label{font-size:12px!important}
html.ios-pwa .title-scene::before,html.ios-pwa body.title-mode::before{position:absolute}
.display-check{gap:16px}.display-check pre{white-space:pre-wrap;overflow-wrap:anywhere;font:13px/1.6 Consolas,monospace}.display-check h1{margin:0}.display-check>.scroll-block{flex:1}.display-check>button,.display-check>p{flex:none}
