.global-setup{height:100dvh;min-height:0;overflow:hidden;display:flex;flex-direction:column}
.global-setup header,.global-setup footer{flex:none}
.global-setup .setup-fields{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:20px 24px;scroll-padding:20px}
.global-setup h1{font-size:clamp(1.4rem,5vw,2rem);line-height:1.4}
.global-setup .location-filters{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.global-setup .field-label{min-width:0;margin:12px 0}
.global-setup input,.global-setup select,.league-hub input,.league-hub select{font-size:16px;width:100%;min-width:0;min-height:44px;box-sizing:border-box}
.global-setup #hometown{width:100%;max-width:100%;text-overflow:ellipsis}
.global-setup .start-fields{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.start-town-card{margin:18px 0;padding:16px;border:1px solid #c7d2b9;border-radius:14px;background:#eef3e7;overflow-wrap:anywhere}
.start-town-card h2{margin:7px 0;font-size:1.3rem}.start-town-card p{line-height:1.7}
.start-town-card dl{display:grid;grid-template-columns:90px 1fr;gap:9px;font-size:.87rem}
.start-town-card dt{color:#626859}.start-town-card dd{margin:0;font-weight:600}
.start-town-card summary,.club-setup-details summary{cursor:pointer;padding:12px 0;min-height:44px;box-sizing:border-box}
.global-setup footer{padding:12px 24px max(12px,env(safe-area-inset-bottom));background:#fffaf0;border-top:1px solid #d9d0c2}
.global-setup footer p{margin:8px 0 0;text-align:center}
.league-hub{max-width:940px;margin:0 auto;overflow-wrap:anywhere}.league-hub h1{font-size:1.6rem;margin:6px 0 16px}
.league-hub-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;border-radius:12px;background:#e7dfd0;padding:4px;margin-bottom:16px}
.league-hub-tabs button{min-height:46px;background:transparent;border:0;border-radius:9px;color:#605c51;font:inherit;font-weight:700}
.league-hub-tabs .selected{background:#34594b;color:#fff}
.league-hub .current-route{display:grid;grid-template-columns:1fr 1fr;gap:12px;background:#ecefdf;border-radius:12px;padding:14px}
.current-route small,.current-route b{display:block}.current-route small{font-size:.72rem;color:#646c58;margin-bottom:5px}
.current-route b{font-size:.95rem;line-height:1.5}
.league-hub .panel{margin:14px 0;padding:16px}.league-hub h2{font-size:1.08rem;margin:0 0 10px}.league-hub h3{font-size:1rem}
.league-hub .panel>summary,.cup-details>summary{min-height:44px;padding:12px 0;cursor:pointer;box-sizing:border-box;font-weight:600}
.cup-details{border-top:1px solid #ddd4c2}.cup-details summary small{display:block;font-weight:400;margin-top:5px;color:#69715d}
.cup-score{padding-bottom:8px;border-bottom:1px solid #e3dbc9;line-height:1.7;font-size:.82rem}
.league-hub .table-scroll{max-width:100%;overflow-x:auto}
.table-club-link{border:0;background:transparent;color:inherit;text-align:left;font:inherit;padding:8px 0;min-height:44px;cursor:pointer;overflow-wrap:anywhere}
.league-hub .compact-table{min-width:0;width:100%;font-size:.8rem}
.league-hub .compact-table th,.league-hub .compact-table td{padding:7px 5px}
.league-hub .table-club-identity{min-width:0;gap:6px}.league-hub .table-club-identity>span{min-width:0}
.league-hub .table-club-identity .crest{flex-shrink:0}
@media(max-width:560px){.global-setup header{padding:12px 18px}.global-setup header img{max-height:45px}.global-setup .setup-fields{padding:14px 18px}.global-setup .start-fields{grid-template-columns:1fr;gap:0}.global-setup footer{padding:10px 18px max(10px,env(safe-area-inset-bottom))}.league-hub .panel{padding:12px}.league-hub .table-club-identity .crest{display:none}.league-hub .compact-table th:nth-child(2){width:47%}}
@media(max-height:450px){.global-setup header{display:none}.global-setup footer p{display:none}.global-setup footer{padding:6px 16px}.global-setup .setup-fields{padding:10px 18px}.global-setup .location-filters,.global-setup .start-fields{grid-template-columns:1fr 1fr}}

/* v36: one primary next action; secondary systems stay accessible. */
.league-hub-tabs{grid-template-columns:repeat(2,1fr)}
.domestic-setup .start-town-card{margin:14px 0;padding:12px 16px}
.domestic-setup .start-town-card h2{font-size:1.1rem;margin:5px 0}
.domestic-setup .start-town-card p{margin:6px 0}
.place-search-details>summary{cursor:pointer;padding:10px 0;min-height:44px;box-sizing:border-box}
.setup-links{display:flex;gap:20px;align-items:center;justify-content:center;font-size:.8rem}
.setup-links .text-button{padding:6px;min-height:36px}
.update-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#b75a32;margin-left:5px;vertical-align:middle}
.first-month-home{width:min(100%,680px);margin:0 auto;overflow-wrap:anywhere;padding:12px 0}
.first-month-home h1{font-size:clamp(1.3rem,4vw,1.9rem);line-height:1.5;margin:12px 0}
.first-month-home>small{color:#5c6a51}.first-month-home>p{line-height:1.8}
.first-month-scene{position:relative;height:clamp(155px,30vh,270px);border-radius:16px;overflow:hidden;background:#dbd1b9}
.first-month-scene>.scene-art{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto}
.first-coach{position:absolute;bottom:-18%;left:42%;height:85%;width:25%;pointer-events:none}
.first-coach .avatar{height:100%;width:100%}
.contextual-advance{gap:14px}.contextual-advance>span{font-size:.8rem;line-height:1.5;color:#5c6657}
.contextual-advance .advance-button{display:flex;align-items:center;justify-content:center;min-height:48px;white-space:normal;line-height:1.5}
.context-tip{display:flex;align-items:center;gap:14px;background:#edf1e6;border:1px solid #ced9bf;border-radius:12px;padding:12px 16px;margin-bottom:16px}
.context-tip p{font-size:.85rem;line-height:1.6;margin:5px 0}.context-tip button{flex:none}
.intro-step .dialog-content{line-height:1.8}.intro-step .dialog-footer{flex-wrap:wrap}
.intro-step .first-companion-list article{min-width:0}.intro-step .first-companion-list b{overflow-wrap:anywhere}
.release-note{line-height:1.8}.release-note h4{margin:18px 0 5px}.release-note ul{padding-left:1.3em}.release-note li{margin:8px 0}
.legacy-save-page{max-width:720px;padding:28px 20px;margin:0 auto;line-height:1.9}.legacy-save-page>img{max-width:280px}.legacy-save-page .panel{padding:20px}.legacy-save-page .button{margin:8px 6px 8px 0}
@media(max-width:600px){.contextual-advance{display:flex;align-items:center;justify-content:space-between}.contextual-advance>span{max-width:37%;font-size:.68rem}.contextual-advance .advance-button{font-size:.85rem;flex:1;padding:10px 12px}.first-month-home{padding:0}.first-month-scene{height:170px}.first-month-home>p{font-size:.88rem}.context-tip{align-items:flex-start;flex-direction:column}.intro-step .first-companion-list{grid-template-columns:1fr}}
@media(max-height:470px){.first-month-scene{height:110px}.first-month-home>p{margin:8px 0}.contextual-advance>span{display:none}.contextual-advance .advance-button{width:100%}}


/* Keep number and rank together without growing the portrait badge vertically. */
.player-rating{min-width:3.3em;white-space:nowrap}.ability-chip{white-space:nowrap}.xi-ability{white-space:nowrap;font-size:.9rem}.formation-overall{white-space:nowrap;font-size:.75rem}.detail-rating strong{white-space:nowrap}

/* v39: a character-led opening, with one scene and one next action. */
.guided-shell .topbar,.guided-shell .sidebar,.guided-shell .mobile-nav{display:none}
.game-shell.guided-shell{grid-template-columns:1fr}
.guided-shell .game-body{margin-left:0;grid-template-rows:minmax(0,1fr) auto}
.guided-shell #main{padding:20px 24px 18px;background:#182c29;color:#f8f4e8}
.guided-shell .view-content{max-width:760px;margin:auto}
.story-intro .intro-topline{display:flex;align-items:center;justify-content:space-between;gap:16px;font-size:.75rem;color:#d7dfd2}
.story-intro .text-button{color:#d7dfd2;min-height:44px}
.intro-topline>span{overflow-wrap:anywhere}
.intro-chapters{display:flex;gap:6px;align-items:center;margin:12px 0}
.intro-chapters>span{width:24px;height:3px;border-radius:4px;background:#4a5e55}
.intro-chapters>span.reached{background:#d8e491}.intro-chapters>small{margin-left:5px;color:#c5d2bf;font-size:.65rem}
.story-intro h1{font-size:clamp(1.35rem,4.6vw,2rem);line-height:1.4;margin:10px 0 16px;color:#fff9ed;letter-spacing:.02em}
.story-intro .first-month-scene{height:clamp(160px,28vh,280px);border-radius:16px;background:#314740}
.intro-scene-shade{position:absolute;inset:0;background:linear-gradient(90deg,rgba(9,24,22,.5),transparent 70%)}
.intro-scene-caption{position:absolute;left:16px;bottom:16px;font-size:.65rem;letter-spacing:.18em;color:#fff}
.story-intro .first-coach{left:auto;right:7%;bottom:0;width:150px;height:180px;display:flex;align-items:end;justify-content:center;filter:drop-shadow(0 6px 10px #14252080)}
.story-intro .first-coach .avatar{width:150px;height:180px;min-width:0;border-radius:12px 12px 0 0;aspect-ratio:auto;border:0;box-shadow:none}
.story-intro .first-coach .staff-avatar{width:130px;height:160px}
.intro-dialogue{margin:0 10px;position:relative;padding:16px 18px;background:#f8f4e8;color:#26352e;border-radius:0 0 14px 14px}
.intro-dialogue>small{font-size:.7rem;font-weight:700;color:#647052}
.intro-dialogue>p{font-size:.92rem;line-height:1.75;margin:6px 0 0}
.story-intro .first-companion-list{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:16px}
.story-intro .first-companion-list article{display:flex;align-items:center;gap:12px;padding:12px;background:#29413a;border:1px solid #435b4d;border-radius:12px;min-width:0}
.story-intro .first-companion-list article>div{display:grid;gap:5px;min-width:0}
.story-intro .first-companion-list small,.story-intro .first-companion-list span{font-size:.65rem;color:#d2dec9}
.story-intro .first-companion-list b{font-size:.9rem;overflow-wrap:anywhere}
.story-intro .intro-player{width:66px;height:78px;min-width:66px;border-radius:8px}
.intro-policy-choices{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}
.intro-policy-choices .button{flex:1;min-width:150px;background:#f7f4e8;color:#253d30;min-height:48px}
.intro-fixture{display:grid;gap:6px;text-align:center;margin:16px 0;color:#f2efdb}.intro-fixture small{font-size:.68rem;color:#c1cfb9}
.intro-finances{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:16px}.intro-finances>span{display:grid;gap:6px;font-size:.7rem;color:#ced9c3}.intro-finances b{font-size:1rem;color:#fff}
.intro-explore{display:flex;justify-content:space-between;gap:8px;margin-top:8px;font-size:.7rem}
.guided-shell .advance-bar{position:relative;bottom:auto;background:#182c29;border-top:1px solid #45604a;padding:12px 24px max(12px,env(safe-area-inset-bottom));color:#fff}
.guided-shell .advance-bar>span{color:#c6d5bc}.guided-shell .advance-button{background:#deea9d;color:#233b2b;border:0;border-radius:12px;box-shadow:none}
.decision-list{display:grid;gap:14px}.decision-list article{border:1px solid #d5d9c9;border-radius:12px;padding:16px}.decision-list small{color:#687157}.decision-list h3{margin:8px 0 12px}.decision-list .button{margin:4px 6px 4px 0}
.ability-display{display:inline-flex!important;align-items:center;gap:.28em;white-space:nowrap;vertical-align:baseline;line-height:1.1}
.ability-display .ability-value{font:inherit;font-weight:850;letter-spacing:-.035em}
.ability-display .ability-rank{display:inline-flex;align-items:center;justify-content:center;min-width:1.65em;height:1.65em;padding:0 .25em;border-radius:.35em;font:800 .52em/1 system-ui,sans-serif;letter-spacing:0;color:#f8fff6;background:#324b3c;border:1px solid #ffffff65;box-shadow:0 1px 2px #0003}
.ability-display .rank-S{background:linear-gradient(135deg,#ffe8a0,#c39026);color:#36280c;border-color:#fff2bd}
.ability-display .rank-A{background:#684780;color:#fff1ff}.ability-display .rank-B{background:#245e92;color:white}.ability-display .rank-C{background:#386642;color:white}.ability-display .rank-D{background:#e6e9db;color:#344434}.ability-display .rank-E{background:#f5f0e3;color:#665d4c}
.player-rating .ability-value,.detail-rating .ability-value{font-size:1.15em}
@media(max-width:600px){.guided-shell #main{padding:12px 16px}.guided-shell .advance-bar{padding:12px 16px max(12px,env(safe-area-inset-bottom))}.guided-shell .advance-bar>span{display:none}.guided-shell .advance-button{width:100%;min-height:50px}.story-intro .first-month-scene{height:170px}.story-intro .first-coach,.story-intro .first-coach .avatar{width:128px;height:154px}.story-intro .first-companion-list{grid-template-columns:1fr}.intro-dialogue{padding:12px 14px}.intro-dialogue>p{font-size:.85rem}.story-intro h1{margin:8px 0 12px}.intro-finances b{font-size:.85rem}}
@media(max-height:470px){.story-intro .first-month-scene{height:120px}.story-intro .first-coach,.story-intro .first-coach .avatar{height:116px;width:98px}.guided-shell .advance-bar{padding-top:6px;padding-bottom:6px}.story-intro h1{font-size:1.25rem}.story-intro .first-companion-list{grid-template-columns:1fr 1fr}}
@media(prefers-reduced-motion:no-preference){.intro-dialogue{animation:intro-arrive .3s ease-out}@keyframes intro-arrive{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}}

.guided-shell .game-body{height:100dvh;min-height:0;padding-bottom:0}.guided-shell #main{flex:1;min-height:0;overflow:auto}.guided-shell .advance-bar{flex:none;min-height:70px}.story-intro .first-coach .staff-face{width:130px;height:130px;border-radius:14px}.ability-display .ability-rank{font-size:clamp(10px,.52em,18px)}
.guided-shell.game-shell{height:var(--app-height,100dvh);min-height:0}.guided-shell .game-body{height:100%}.guided-shell #main[data-view="home"]>.view-content{display:block;flex:none;min-height:auto;width:100%}
.story-intro .first-coach{z-index:3;filter:none;top:auto;transform:none}.story-intro .first-coach>.avatar{display:block;position:relative;inset:auto;transform:none;opacity:1;visibility:visible}.intro-scene-caption{z-index:2}
.story-intro .first-coach,.story-intro .first-coach>.avatar{width:150px;height:150px;aspect-ratio:1}.story-intro .first-coach>.avatar{border-radius:14px 14px 0 0}
@media(max-width:600px){.story-intro .first-coach,.story-intro .first-coach>.avatar{width:128px;height:128px}}
@media(max-height:470px){.story-intro .first-coach,.story-intro .first-coach>.avatar{width:98px;height:98px}}

.ability-rank[data-action]{cursor:help}#ability-popover{max-width:min(320px,calc(100vw - 32px));padding:20px;border:1px solid #73815d;border-radius:14px;background:#fffdf3;color:#28392e;box-shadow:0 12px 40px #12281e40;font-size:.9rem;line-height:1.8}#ability-popover::backdrop{background:#16291c20}
/* Override the legacy automatic portrait height; the surrounding frame stays square. */
.story-intro .first-coach>.avatar{width:100%;height:100%!important;aspect-ratio:1}
.story-intro .first-coach>.staff-face{flex:0 0 100%;width:100%;height:100%;aspect-ratio:1;border-radius:14px 14px 0 0}
