/* Spacious tablet layouts. Phones keep their portrait composition. */
@media (min-width:600px) and (min-height:600px){
  #game-container,body.is-playing #game-container{width:min(100%,1200px);height:100dvh}
  #splav-home{width:min(100%,1100px)}
  #splav-home .home-shell{padding:24px 36px max(24px,env(safe-area-inset-bottom));gap:20px}
  #splav-home .home-header{min-height:88px}
  #splav-home .home-player .identity-badge{width:86px;height:90px}
  #splav-home .home-player-info>b{font-size:18px;max-width:220px}
  #splav-home .home-wallet{height:52px;font-size:19px!important;padding:8px 14px;gap:10px}
  #splav-home .home-wallet b{max-width:140px}
  #splav-home .home-settings{width:52px;height:56px}
  #splav-home .home-hero{min-height:260px;flex-basis:280px;margin:-6px -36px -25px}
  #splav-home .home-brand h1{font-size:70px}
  #splav-home .home-brand p{font-size:12px;letter-spacing:4px}
  #splav-home .home-world{height:170%;top:-10%;object-position:center 30%}
  #splav-home .home-launch{padding:18px 20px 6px}
  #splav-home .home-mode-art{width:58px;height:62px}
  #splav-home .home-mode b{font-size:25px}
  #splav-home .home-mode small{font-size:12px}
  #splav-home .home-change{font-size:14px}
  #splav-home .home-play{min-height:72px;font-size:29px!important}
  #splav-home .home-new,#splav-home .home-mode-note{font-size:13px!important;min-height:27px}
  #splav-home .home-path{padding:18px 22px;gap:22px;min-height:120px}
  #splav-home .home-path b{font-size:23px}
  #splav-home .home-path em{font-size:13px;max-width:none}
  #splav-home .home-path small{font-size:11px}
  #splav-home .home-activities button{min-height:95px;padding:16px 20px;gap:16px}
  #splav-home .home-activities .home-art{width:55px;height:60px}
  #splav-home .home-activities b{font-size:17px}
  #splav-home .home-activities small{font-size:11px}
  #splav-home .home-dock{padding-top:17px;gap:16px}
  #splav-home .home-dock button{font-size:13px!important;min-height:85px;gap:9px}
  #splav-home .home-dock .home-art{width:56px;height:58px}
  .hub-overlay{align-items:center;padding:24px}
  .hub-overlay .hub-sheet,.hub-overlay .hub-sheet[data-screen]{width:100%;max-width:760px;height:min(90dvh,1020px);border:1px solid var(--game-line,#54706b);border-radius:28px}
  .hub-head{padding:24px 28px 45px}.hub-head h2{font-size:28px}.hub-head p{font-size:13px}
  .hub-body{padding:12px 28px 24px}.hub-foot{padding:16px 28px 22px}
  .hub-close{width:48px;height:48px}.hub-primary,.hub-secondary{min-height:54px}
  .hub-mode-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
  .hub-mode,.hub-mode[aria-pressed=true]{min-height:160px;padding:18px 13px;grid-template-columns:70px minmax(0,1fr) 20px}
  .hub-mode-copy>span{font-size:13px}.hub-mode strong{font-size:20px}
  .cosmetic-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
  .cosmetic-grid>button{min-height:190px;padding:16px 10px}.cosmetic-grid .identity-portrait{height:116px}
  .cosmetic-grid button>b{font-size:15px}.cosmetic-grid button>small{font-size:11px}
  .cosmetic-grid .identity-badge{width:104px;height:110px}.cosmetic-filters button{font-size:13px;min-height:40px;padding:9px 16px}
  .hub-skin-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
  .hub-skin-card{min-height:100px}.hub-skin-copy strong{font-size:15px}.hub-skin-copy small{font-size:12px}
}
@media (min-width:600px) and (min-height:600px) and (min-aspect-ratio:1.15){
  #splav-home .home-shell{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);grid-template-rows:88px 1fr auto auto auto;column-gap:32px;row-gap:20px;min-height:100%;padding:20px 32px}
  #splav-home .home-header{grid-column:1/-1;grid-row:1}
  #splav-home .home-hero{grid-column:1;grid-row:2/6;min-height:400px;margin:0 -20px 0 -32px;border-radius:0 28px 0 0}
  #splav-home .home-world{height:100%;top:0;object-position:center;object-fit:cover}
  #splav-home .home-brand{padding-top:26px}
  #splav-home .home-brand h1{font-size:clamp(54px,6vw,76px)}
  #splav-home .home-brand p{font-size:10px;letter-spacing:3px}
  #splav-home .home-launch{grid-column:2;grid-row:2;align-self:end;padding:16px 14px 4px}
  #splav-home .home-path{grid-column:2;grid-row:3;padding:12px 14px;gap:12px;min-height:105px}
  #splav-home .home-path b{font-size:20px}.home-path .rank-crest{width:65px;height:70px}
  #splav-home .home-path em{font-size:11px}.home-path small{font-size:9px}
  #splav-home .home-activities{grid-column:2;grid-row:4}
  #splav-home .home-activities button{padding:10px;gap:8px;min-height:80px}
  #splav-home .home-activities .home-art{width:43px;height:49px}
  #splav-home .home-activities b{font-size:14px}.home-activities small{font-size:10px}
  #splav-home .home-dock{grid-column:2;grid-row:5;gap:6px;padding-top:12px}
  #splav-home .home-dock .home-art{width:44px;height:48px}
  #splav-home .home-dock button{font-size:11px!important;min-height:70px}
}
/* Short landscape screens use the same board, with controls beside it. */
@media (min-width:600px) and (min-height:320px) and (max-height:599px) and (min-aspect-ratio:1.15){
 #game-container,body.is-playing #game-container{width:100%;height:100dvh}
 #splav-home{width:100%;max-width:none}
 #splav-home .home-shell{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:58px minmax(108px,1fr) auto auto;gap:10px 24px;padding:10px max(20px,env(safe-area-inset-right)) 10px max(20px,env(safe-area-inset-left));min-height:100%;height:auto}
 #splav-home .home-header{grid-column:1/-1;grid-row:1;min-height:52px}
 #splav-home .home-hero{position:absolute;inset:50px 50% 0 0;margin:0;min-height:0;opacity:.55;pointer-events:none}
 #splav-home .home-brand{display:none}
 #splav-home .home-world{height:100%;top:0;object-fit:cover;object-position:center}
 #splav-home .home-launch{grid-column:1;grid-row:2/4;align-self:center;z-index:1;padding:12px}
 #splav-home .home-play{min-height:56px}
 #splav-home .home-path{grid-column:2;grid-row:2;min-height:96px;padding:10px 14px}
 #splav-home .home-activities{grid-column:2;grid-row:3}
 #splav-home .home-activities button{min-height:65px}
 #splav-home .home-dock{grid-column:1/-1;grid-row:4;padding-top:6px;display:flex;justify-content:space-evenly}
 #splav-home .home-dock button{flex:1;max-width:180px;min-height:53px;flex-direction:row;gap:8px;font-size:12px!important}
 #splav-home .home-dock .home-art{height:40px;width:40px}
 .hub-overlay{padding:12px;align-items:center}.hub-overlay .hub-sheet,.hub-overlay .hub-sheet[data-screen]{max-width:720px;height:calc(100dvh - 24px);border-radius:22px;border:1px solid var(--game-line)}
 .hub-head{padding:12px 22px 35px;min-height:70px}.hub-head h2{font-size:22px}.hub-head p{font-size:11px}.hub-body{padding:8px 22px 16px}.hub-foot{padding:8px 22px 12px}.hub-primary,.hub-secondary{min-height:44px}
 .hub-mode-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.hub-mode{min-height:110px;padding:12px}.cosmetic-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
}

/* Give the catalogue room on a rotated phone; actions stay in a side rail. */
@media (min-width:600px) and (max-height:599px) and (min-aspect-ratio:1.15){
 .hub-overlay .hub-head{padding:10px 18px;min-height:70px}.hub-head>div:not(.hub-wallet){flex:1}.hub-head .hub-close{order:4;margin-left:8px}.hub-head .hub-wallet{position:static;margin-left:auto;flex:none}
 .hub-overlay .hub-sheet[data-screen=skins]{display:grid;grid-template-columns:minmax(0,1fr) 260px;grid-template-rows:auto minmax(0,1fr) auto}
 .hub-sheet[data-screen=skins]>.hub-head{grid-column:1/-1;padding:10px 18px}
 .hub-sheet[data-screen=skins]>.hub-body{grid-column:1;grid-row:2/4;padding:8px 14px 18px}
 .hub-sheet[data-screen=skins]>.hub-preview{grid-column:2;grid-row:2;min-height:0;overflow-y:auto;padding:4px 12px}
 .hub-sheet[data-screen=skins]>.hub-foot{grid-column:2;grid-row:3;padding:8px 12px}
 .hub-sheet[data-screen=skins] .hub-selection{flex-wrap:wrap;gap:4px}.hub-sheet[data-screen=skins] .hub-selection>*{min-width:0}
 .hub-sheet:is([data-screen=cosmetics],[data-screen=audio],[data-screen=identity],[data-screen=shop]){display:grid;grid-template-columns:minmax(0,1fr) 200px;grid-template-rows:auto minmax(0,1fr)}
 .hub-sheet:is([data-screen=cosmetics],[data-screen=audio],[data-screen=identity],[data-screen=shop])>.hub-head{grid-column:1/-1}
 .hub-sheet:is([data-screen=cosmetics],[data-screen=audio],[data-screen=identity],[data-screen=shop])>.hub-body{grid-column:1;grid-row:2;padding-right:14px}
 .hub-sheet:is([data-screen=cosmetics],[data-screen=audio],[data-screen=identity],[data-screen=shop])>.hub-foot{grid-column:2;grid-row:2;display:flex;flex-direction:column;justify-content:center;gap:8px;padding:14px;border-top:0;border-left:1px solid var(--game-line);overflow-y:auto}
 .hub-sheet:is([data-screen=cosmetics],[data-screen=audio],[data-screen=identity],[data-screen=shop])>.hub-foot button{flex-shrink:0;font-size:13px}
 .hub-sheet:is([data-screen=cosmetics],[data-screen=audio],[data-screen=identity],[data-screen=shop])>.hub-foot .hub-secondary{margin-top:0}
 .hub-sheet[data-screen=cosmetics] .shop-stage{gap:10px;padding-bottom:8px}.hub-sheet[data-screen=cosmetics] .shop-stage>.identity-badge{width:52px;height:56px}.hub-sheet[data-screen=cosmetics] .shop-stage h3{font-size:17px}.hub-sheet[data-screen=cosmetics] .shop-stage small{font-size:8px}.hub-sheet[data-screen=cosmetics] .shop-stage p{display:none}
 .hub-sheet[data-screen=cosmetics] .cosmetic-filters{margin:8px 0}.hub-sheet[data-screen=cosmetics] .hub-tabs{margin-bottom:8px}
 .hub-sheet[data-screen=cosmetics] .audio-list,.hub-sheet[data-screen=audio] .audio-list{grid-template-columns:1fr}
 .hub-sheet[data-screen=shop] .treasury-earn{display:flex;flex-direction:column;text-align:center}.hub-sheet[data-screen=shop] .treasury-earn .hub-primary{width:100%}
}
/* Phone UI uses readable CSS pixels; small screens scroll instead of shrinking labels. */
@media(max-width:599px){
 #splav-home .home-shell{padding-inline:16px;gap:14px}
 #splav-home .home-header{min-height:76px;gap:8px;height:auto}
 #splav-home .home-player-info>b{font-size:14px;max-width:100%}
 #splav-home .home-settings{width:48px;height:48px}
 #splav-home .home-wallet{height:48px;font-size:18px!important;padding:6px 9px;gap:6px}
 #splav-home .home-wallet b{max-width:75px}.home-wallet .home-plus{width:24px;height:24px}
 #splav-home .home-mode small{font-size:11px;letter-spacing:1px}
 #splav-home .home-mode b{font-size:23px}
 #splav-home .home-mode-art{width:48px;height:50px}
 #splav-home .home-change{font-size:13px}
 #splav-home .home-play{min-height:64px;font-size:25px!important}
 #splav-home .home-new{min-height:42px;font-size:13px!important}
 #splav-home .home-path b{font-size:19px}.home-path em{font-size:12px;line-height:1.5}
 #splav-home .home-path small{font-size:10px;letter-spacing:.6px}
 #splav-home .home-activities button{min-height:90px;padding:12px 10px;gap:8px}
 #splav-home .home-activities .home-art{width:36px;height:44px}
 #splav-home .home-activities b{font-size:14px}.home-activities small{font-size:11px;line-height:1.4}
 #splav-home .home-dock button{font-size:12px!important;min-height:82px;padding:0 2px;gap:8px}
 #splav-home .home-dock .home-art{width:50px;height:52px}
 .hub-head h2{font-size:24px}.hub-head p{font-size:12px;line-height:1.45}.hub-head .hub-art{width:44px;height:48px}
 .hub-head .hub-wallet{font-size:18px}.hub-primary{font-size:17px;min-height:58px}.hub-secondary{font-size:15px;min-height:50px}
 .hub-foot p{font-size:12px}.hub-tabs button,.hub-language button{font-size:14px;min-height:46px}
 .hub-setting h3,.hub-goal h3{font-size:17px}.hub-setting p,.hub-goal p,.hub-mode-copy>span{font-size:14px;line-height:1.5}
 .hub-goal-progress,.hub-row-foot,.hub-skin-copy small{font-size:12px}.hub-skin-copy strong{font-size:15px}
 .hub-mode strong{font-size:21px}.hub-mode small{font-size:12px}.hub-mode{min-height:138px}
 .hub-claim{min-height:46px;font-size:14px}.hub-toggle{font-size:14px;min-height:46px}
 .hub-empty p,.hub-notice,.profile-name small,.profile-note,.profile-cost,.profile-stage>small,.profile-section small{font-size:13px}
 .profile-avatars{grid-template-columns:repeat(3,minmax(0,1fr))}.profile-avatars button,.profile-frames button{font-size:12px;padding:9px 6px}
 .profile-frames button>small{font-size:11px}.profile-frames button>b{font-size:14px}
 .cosmetic-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.cosmetic-grid button b{font-size:15px}.cosmetic-grid .cosmetic-copy small{font-size:12px}
 .rank-stop-copy>p,.rank-gift{font-size:13px}.rank-stop h4{font-size:20px}.audio-selection small{font-size:11px;letter-spacing:.6px}
 .audio-select strong{font-size:16px}.audio-select small{font-size:12px}
 .hub-best small,.hub-rank small{font-size:12px}.hub-rank{font-size:14px}
}
@media(max-width:359px){
 #splav-home .home-shell{padding-inline:12px}
 #splav-home .home-player .identity-badge{width:56px;height:60px}
 #splav-home .home-wallet{font-size:16px!important;padding:5px 7px}
 #splav-home .home-player-info>b{font-size:12px}
 #splav-home .home-activities button{flex-direction:column;align-items:center;text-align:center;gap:6px}
 #splav-home .home-path{gap:9px}.home-path .rank-crest{width:54px;height:64px}
 #splav-home .home-path b{font-size:17px}
 .hub-head h2{font-size:22px}.hub-head p{font-size:11px}.hub-head{gap:8px}
}
