:root{--home-panel:#d2d2d2;--home-dark:#202020;--home-shadow:#080808;--home-green:#238c13;--home-green-dark:#126607;--home-gold:#f3c93b}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.main-menu-screen{padding:calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) calc(8px + var(--safe-b)) calc(12px + var(--safe-l));background:linear-gradient(90deg,rgba(2,9,12,.76),rgba(2,10,13,.34) 36%,rgba(3,11,15,.29) 68%,rgba(2,8,11,.73)),linear-gradient(0deg,rgba(1,7,10,.48),rgba(7,25,32,.18));isolation:isolate}
.main-menu-screen:before{content:"";position:absolute;z-index:-1;inset:0;background:radial-gradient(ellipse at 50% 20%,transparent 0 26%,rgba(0,0,0,.14) 60%,rgba(0,0,0,.43) 100%);pointer-events:none}
.main-menu-shell{width:min(1320px,100%);grid-template-rows:clamp(108px,18vh,170px) minmax(0,1fr) 24px;gap:10px}
.main-menu-brand{align-items:center;justify-content:flex-start;min-height:0;pointer-events:none}
.main-menu-brand .title-mark{display:flex;align-items:center;justify-content:flex-start;width:100%;height:100%}
.main-menu-brand .game-logo{width:min(620px,55vw);height:100%;max-width:none;object-position:left center;transform:scale(1.14);transform-origin:left center;filter:drop-shadow(0 7px 0 rgba(0,0,0,.48)) drop-shadow(0 14px 20px rgba(0,0,0,.55))}
.main-menu-heading{position:absolute;right:calc(12px + var(--safe-r));top:calc(10px + var(--safe-t));opacity:.8}
.main-menu-heading .tagline{display:none}
.main-menu-content{grid-template-columns:minmax(360px,1fr) clamp(240px,25vw,320px);gap:clamp(9px,1.2vw,16px);overflow:visible}
.menu-home-section{position:relative;display:block;min-width:0;min-height:0;padding:0;background:transparent;border:0;box-shadow:none;backdrop-filter:none}
.home-menu-layout{display:block;height:100%;min-height:0}
.home-shortcuts{display:flex;min-height:0;flex-direction:column;justify-content:flex-end;gap:9px;padding-bottom:2px}
.home-welcome{position:relative;display:flex;min-height:74px;flex-direction:column;justify-content:center;gap:5px;padding:12px 14px;background:linear-gradient(135deg,rgba(34,102,120,.95),rgba(16,49,60,.96));border:3px solid #e2e2e2;box-shadow:0 5px 0 var(--home-shadow),inset 2px 2px rgba(255,255,255,.18);overflow:hidden}
.home-welcome:after{content:"";position:absolute;width:100px;height:100px;right:-28px;top:-35px;transform:rotate(45deg);background:rgba(96,208,225,.2)}
.home-welcome b{position:relative;z-index:1;font-size:clamp(14px,1.65vw,21px);color:#fff;letter-spacing:.06em}.home-welcome small{position:relative;z-index:1;font-size:10px;color:#bdeef8}
.home-shortcut{position:relative;display:grid;grid-template-columns:52px minmax(0,1fr);align-items:center;gap:10px;min-height:66px;padding:8px 11px;border:3px solid var(--home-dark);background:var(--home-panel);color:#303030;text-align:left;box-shadow:inset 2px 2px #fff,inset -2px -2px #929292,0 5px 0 rgba(0,0,0,.65);cursor:pointer;touch-action:manipulation}
.home-shortcut:active{transform:translateY(3px);box-shadow:inset 2px 2px #fff,inset -2px -2px #929292,0 2px 0 rgba(0,0,0,.65)}
.home-shortcut>span{display:grid;place-items:center;width:48px;height:48px;background:#345464;border:2px solid #222;color:#fff;font-size:25px}.home-shortcut>div{display:flex;min-width:0;flex-direction:column;gap:4px}.home-shortcut b{font-size:13px;letter-spacing:.04em}.home-shortcut small{display:block;max-width:100%;font-size:8px;color:#555;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.home-shortcut em{position:absolute;right:7px;top:7px;padding:3px 5px;background:#303c41;color:#fff;font-size:7px;font-style:normal}
.profile-face{position:relative!important;width:40px!important;height:40px!important;background:#d59a6b!important;border:3px solid #4b3024!important;box-shadow:inset 0 10px #5b3728!important}.profile-face:before,.profile-face:after{content:"";position:absolute;top:19px;width:5px;height:6px;background:#17364c}.profile-face:before{left:8px}.profile-face:after{right:8px}.profile-face i{position:absolute;left:13px;bottom:6px;width:10px;height:3px;background:#7b4738}.profile-face.large{width:76px!important;height:76px!important;border-width:5px!important;box-shadow:inset 0 20px #5b3728!important}.profile-face.large:before,.profile-face.large:after{top:38px;width:8px;height:10px}.profile-face.large:before{left:15px}.profile-face.large:after{right:15px}.profile-face.large i{left:25px;bottom:11px;width:17px;height:5px}
.main-action-grid{display:grid;grid-template-columns:1fr;grid-template-rows:repeat(3,minmax(72px,1fr));gap:12px;height:100%;min-height:0;padding:0}
.main-action-card{grid-template-columns:72px minmax(0,1fr);gap:15px;min-height:0;padding:13px 20px;border:4px solid var(--home-dark);background:var(--home-panel);color:#282828;box-shadow:inset 3px 3px #fff,inset -3px -3px #8f8f8f,0 6px 0 rgba(0,0,0,.7);text-align:left}
.main-action-card:hover{filter:brightness(1.05)}.main-action-card:active{transform:translateY(4px);box-shadow:inset 3px 3px #fff,inset -3px -3px #8f8f8f,0 2px 0 rgba(0,0,0,.7)}
.main-action-card>span{width:60px;height:60px;border:2px solid rgba(0,0,0,.5);background:#42555d;color:#fff;font-size:28px}.main-action-card>div{gap:6px}.main-action-card b{font-size:clamp(22px,3vw,38px);letter-spacing:.035em}.main-action-card small{color:#555;font-size:10px}.main-action-card.new-world{border-color:#13220e;background:linear-gradient(#2da916,#1d860d);color:#fff;box-shadow:inset 3px 3px rgba(255,255,255,.35),inset -3px -3px var(--home-green-dark),0 6px 0 rgba(0,0,0,.7)}.main-action-card.new-world>span{background:rgba(12,85,7,.72);border-color:rgba(255,255,255,.42)}.main-action-card.new-world small{color:#e1ffdc}.main-action-card.settings-world{border-color:#242424;background:linear-gradient(#dedede,#bdbdbd);color:#282828;box-shadow:inset 3px 3px #fff,inset -3px -3px #888,0 6px 0 rgba(0,0,0,.7)}.main-action-card.settings-world>span{background:#40545d;color:#fff}.main-action-card.settings-world small{color:#555}.main-action-card.store-world{border-color:#372c0d;background:linear-gradient(#f6d64f,#e5b92d);color:#30280d;box-shadow:inset 3px 3px #fff4a4,inset -3px -3px #a77c13,0 6px 0 rgba(0,0,0,.7)}.main-action-card.store-world>span{background:#6d571c;color:#ffeb79}.main-action-card.store-world small{color:#574814}.main-action-card em{display:none}
.home-version{position:absolute;left:0;bottom:-22px;padding:3px 6px;background:rgba(4,15,19,.7);color:#d8e8ed;font-size:8px}
.menu-side{position:relative;grid-template-rows:minmax(170px,1fr) repeat(4,auto);gap:9px;padding:0;background:transparent;border:0;box-shadow:none;backdrop-filter:none}
.player-room-card{position:relative;display:block;min-height:0;background:linear-gradient(145deg,rgba(49,89,104,.93),rgba(10,31,39,.94));border:3px solid #cfcfcf;box-shadow:0 6px 0 rgba(0,0,0,.68),inset 2px 2px rgba(255,255,255,.14);overflow:hidden}
.player-room-card .menu-avatar-preview{position:absolute;inset:0;width:100%;height:100%;min-height:0;flex-basis:auto;border:0;background:radial-gradient(ellipse at 50% 76%,rgba(116,205,219,.28),transparent 46%)}
.player-room-card .player-room-copy{position:absolute;z-index:3;left:8px;right:8px;top:7px;display:flex;align-items:flex-start;justify-content:space-between;gap:7px;padding:0;pointer-events:none}.player-room-card .player-room-copy b{padding:4px 6px;background:rgba(4,15,20,.78);color:#ffdf5d;font-size:10px}.player-room-card .player-room-copy small{max-width:125px;padding:4px 5px;background:rgba(4,15,20,.6);color:#d9eef4;font-size:7px;text-align:right;line-height:1.25}
.menu-tile{grid-template-columns:45px minmax(0,1fr);min-height:61px;padding:8px 10px;border:3px solid #222;background:var(--home-panel);color:#282828;box-shadow:inset 2px 2px #fff,inset -2px -2px #929292,0 5px 0 rgba(0,0,0,.68)}.menu-tile>span{width:40px;height:40px;background:#3c5864;color:#ffe165;font-size:21px}.menu-tile b{font-size:12px}.menu-tile small{color:#555;font-size:8px}.no-ads-tile{min-height:48px;background:#c6b98e;border-color:#302b1d}.no-ads-tile>span{height:32px;width:40px;background:#6b5a29;color:#ffeb8a}.no-ads-tile b{font-size:9px}.no-ads-tile small{font-size:7px}
.player-room-card .menu-wallet{position:absolute;z-index:4;right:7px;bottom:7px;grid-template-columns:25px auto;min-height:0;padding:5px 7px;border:2px solid #31280f;background:rgba(59,48,21,.94);box-shadow:0 3px 0 rgba(0,0,0,.55)}.menu-wallet>span{width:24px;height:24px;font-size:14px}.menu-wallet b{font-size:10px}.menu-wallet small{display:none}
.main-menu-screen .menu-controls{align-self:end;margin:0;padding:4px 7px;background:rgba(3,13,17,.68);font-size:7px;opacity:.8}
.main-menu-screen.showing-modes .main-menu-content{grid-template-columns:minmax(0,1fr) clamp(240px,25vw,320px)}
.main-menu-screen.showing-modes .mode-section{padding:10px;background:rgba(12,28,35,.93)}
.profile-overlay{z-index:46;background:rgba(2,8,11,.78)}
.profile-panel{z-index:47;display:grid;grid-template-rows:auto minmax(0,1fr) auto;width:min(720px,94vw);max-height:90dvh;padding:0;overflow:hidden;background:#d2d2d2;border:4px solid #171717;color:#282828;box-shadow:0 18px 0 rgba(0,0,0,.3),0 30px 70px rgba(0,0,0,.65)}
.profile-panel>header{margin:0;padding:13px 16px;background:#efefef;border-bottom:3px solid #222}.profile-panel>header b{color:#222;font-size:23px}.profile-panel>header small{color:#666;font-size:9px}.profile-panel>header button{display:grid;place-items:center;width:46px;height:46px;border:3px solid #292929;background:#5c5c5c;color:#fff;font-size:27px;cursor:pointer}
.profile-body{display:grid;grid-template-columns:190px minmax(0,1fr);gap:16px;padding:17px;background:linear-gradient(#d3d3d3,#bcbcbc)}
.profile-emblem{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:9px;min-height:230px;padding:16px;background:linear-gradient(145deg,#315e70,#142f3a);border:3px solid #222;box-shadow:inset 2px 2px rgba(255,255,255,.2)}.profile-emblem b{color:#fff;font-size:14px;text-align:center}.profile-emblem small{padding:4px 7px;background:#267542;color:#fff;font-size:8px}
.profile-details{display:flex;min-width:0;flex-direction:column;gap:13px}.profile-details label{display:flex;flex-direction:column;gap:7px}.profile-details label span{font-size:10px;font-weight:900}.profile-details input{width:100%;min-height:48px;padding:0 12px;border:3px solid #353535;outline:0;background:#f2f2f2;color:#242424;font-family:inherit;font-size:17px;font-weight:900;box-shadow:inset 2px 2px #aaa}.profile-details input:focus{border-color:#d7a90e;box-shadow:0 0 0 3px rgba(255,211,59,.28)}
.profile-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.profile-stats>div{display:flex;min-height:72px;align-items:center;justify-content:center;flex-direction:column;gap:7px;padding:8px;border:2px solid #696969;background:#e2e2e2;text-align:center}.profile-stats small{color:#666;font-size:7px}.profile-stats b{max-width:100%;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.profile-details p{margin:0;padding:10px;border-left:5px solid #3d7187;background:#e1e1e1;color:#555;font-size:9px;line-height:1.5}
.profile-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;background:#ededed;border-top:3px solid #222}.profile-footer>span{color:#555;font-size:9px}.profile-footer .play{min-width:150px;min-height:45px;margin:0;border:3px solid #1d310f;background:linear-gradient(#2ca716,#1b7d0d);color:#fff;font-family:inherit;font-size:12px;font-weight:900;box-shadow:inset 2px 2px rgba(255,255,255,.35),0 4px #0e4908;cursor:pointer}
@media(max-width:900px){.main-menu-shell{grid-template-rows:clamp(96px,17vh,138px) minmax(0,1fr) 20px}.main-menu-brand .game-logo{width:min(540px,57vw)}.main-menu-content{grid-template-columns:minmax(0,1fr) clamp(215px,27vw,250px)}.main-action-card{grid-template-columns:57px minmax(0,1fr);padding:10px 13px}.main-action-card>span{width:49px;height:49px}.main-action-card b{font-size:23px}.menu-tile b{font-size:11px}}
@media(orientation:landscape) and (max-height:520px){
 .main-menu-screen{padding:calc(4px + var(--safe-t)) calc(6px + var(--safe-r)) calc(4px + var(--safe-b)) calc(6px + var(--safe-l))}
 .main-menu-shell{width:100%;grid-template-rows:84px minmax(0,1fr);gap:6px}
 .main-menu-brand .game-logo{width:min(410px,48vw);height:88px;max-width:none;transform:none}
 .main-menu-heading,.main-menu-screen .menu-controls{display:none!important}
 .main-menu-content{grid-row:2;grid-template-columns:minmax(0,1fr) clamp(190px,24vw,220px);gap:7px}
 .profile-face{width:34px!important;height:34px!important;border-width:2px!important;box-shadow:inset 0 9px #5b3728!important}.profile-face:before,.profile-face:after{top:16px;width:4px;height:5px}.profile-face:before{left:7px}.profile-face:after{right:7px}.profile-face i{left:11px;bottom:5px;width:9px}
 .main-action-grid{grid-template-rows:repeat(3,minmax(55px,1fr));gap:7px}.main-action-card{grid-template-columns:50px minmax(0,1fr);gap:10px;padding:7px 11px;border-width:3px;box-shadow:inset 2px 2px #fff,inset -2px -2px #8f8f8f,0 4px 0 rgba(0,0,0,.7)}.main-action-card>span{width:43px;height:43px;font-size:21px}.main-action-card b{font-size:clamp(19px,3.1vw,27px)}.main-action-card small{font-size:9px}.home-version{bottom:2px;left:5px;font-size:7px}
 .menu-side{grid-template-rows:minmax(86px,1fr) repeat(4,46px);gap:6px}.player-room-card{border-width:2px;box-shadow:0 4px rgba(0,0,0,.68)}.player-room-card .player-room-copy{top:5px;left:5px;right:5px}.player-room-card .player-room-copy b{font-size:8px}.player-room-card .player-room-copy small{display:none}.menu-tile{grid-template-columns:39px minmax(0,1fr);min-height:0;padding:4px 7px;border-width:2px;box-shadow:inset 2px 2px #fff,inset -2px -2px #929292,0 3px 0 rgba(0,0,0,.68)}.menu-tile>span{width:34px;height:34px;font-size:18px}.menu-tile b{font-size:9px}.menu-tile small{font-size:6px}.player-room-card .menu-wallet{right:5px;bottom:5px;grid-template-columns:21px auto;padding:3px 5px}.menu-wallet>span{width:20px;height:20px;font-size:12px}.menu-wallet b{font-size:9px}
 .main-menu-screen.showing-modes .main-menu-content{grid-template-columns:minmax(0,1fr) 190px}.main-menu-screen.showing-modes .main-menu-brand .game-logo{height:76px}.main-menu-screen.showing-modes .mode-section{padding:6px}
 .profile-panel{width:calc(100vw - var(--safe-l) - var(--safe-r) - 12px);height:calc(100dvh - var(--safe-t) - var(--safe-b) - 10px);max-height:none;border-width:3px}.profile-panel>header{padding:7px 10px;border-bottom-width:2px}.profile-panel>header b{font-size:20px}.profile-panel>header small{font-size:9px}.profile-panel>header button{width:40px;height:40px;border-width:2px}.profile-body{grid-template-columns:145px minmax(0,1fr);gap:9px;min-height:0;padding:8px}.profile-emblem{min-height:0;padding:8px;gap:5px;border-width:2px}.profile-face.large{width:58px!important;height:58px!important;border-width:4px!important;box-shadow:inset 0 15px #5b3728!important}.profile-face.large:before,.profile-face.large:after{top:29px;width:6px;height:8px}.profile-face.large:before{left:12px}.profile-face.large:after{right:12px}.profile-face.large i{left:20px;bottom:8px;width:13px}.profile-emblem b{font-size:11px}.profile-details{gap:7px}.profile-details label{gap:4px}.profile-details label span{font-size:9px}.profile-details input{min-height:42px;font-size:16px}.profile-stats{gap:5px}.profile-stats>div{min-height:55px;padding:5px;gap:4px}.profile-stats small{font-size:7px}.profile-stats b{font-size:10px}.profile-details p{padding:6px;font-size:8px}.profile-footer{padding:6px 9px;border-top-width:2px}.profile-footer>span{font-size:8px}.profile-footer .play{min-width:130px;min-height:39px;font-size:10px}
}
@media(pointer:coarse) and (orientation:portrait){.main-menu-shell{grid-template-rows:110px minmax(0,1fr)}.main-menu-brand .game-logo{width:min(520px,78vw)}.main-menu-content{grid-template-columns:1fr}.menu-side{display:none}.main-action-grid{grid-template-rows:repeat(3,minmax(76px,1fr))}.home-version{bottom:2px}.profile-body{grid-template-columns:1fr}.profile-emblem{min-height:150px}.profile-stats{grid-template-columns:1fr}.profile-panel{overflow-y:auto}}

/* V152: balanced tablet and desktop home layout */
.main-menu-screen{padding:calc(10px + var(--safe-t)) calc(14px + var(--safe-r)) calc(8px + var(--safe-b)) calc(14px + var(--safe-l))}
.main-menu-shell{width:min(1160px,100%);grid-template-rows:minmax(0,1fr) 22px;gap:8px}
.main-menu-content,.main-menu-screen.showing-modes .main-menu-content{grid-template-columns:minmax(480px,1fr) clamp(285px,29vw,340px);grid-template-rows:clamp(132px,20vh,178px) minmax(0,1fr);grid-template-areas:"brand side" "home side";gap:12px 16px;width:100%;height:min(780px,100%);min-height:0;align-self:center;justify-self:center;padding:clamp(8px,1vw,14px);overflow:hidden;background:linear-gradient(135deg,rgba(8,25,32,.78),rgba(5,17,23,.55));border:2px solid rgba(190,216,225,.44);box-shadow:0 18px 42px rgba(0,0,0,.42),inset 0 0 0 1px rgba(0,0,0,.35);backdrop-filter:blur(3px)}
.main-menu-brand{grid-area:brand;align-items:center;justify-content:flex-start;min-width:0;padding:0 8px;overflow:visible}
.main-menu-brand .title-mark{align-items:center;height:100%;overflow:visible}
.main-menu-brand .game-logo{width:min(460px,46vw);height:100%;max-width:100%;object-fit:contain;object-position:left center;transform:none;filter:drop-shadow(0 6px 0 rgba(0,0,0,.42)) drop-shadow(0 12px 18px rgba(0,0,0,.5))}
.main-menu-heading{display:none}
.menu-home-section,.mode-section{grid-area:home;min-height:0}
.home-menu-layout{display:grid;align-items:center;height:100%}
.main-action-grid{width:clamp(300px,50.4%,420px);grid-template-rows:repeat(3,clamp(74px,10vh,96px));align-content:center;justify-self:center;gap:12px;height:100%;margin-inline:auto}
.main-action-card{grid-template-columns:52px minmax(0,1fr);gap:12px;padding:9px 14px;border-width:3px;box-shadow:inset 2px 2px #fff,inset -2px -2px #8f8f8f,0 5px 0 rgba(0,0,0,.7)}
.main-action-card>span{width:44px;height:44px;font-size:22px}
.main-action-card b{font-size:clamp(18px,2vw,24px)}
.main-action-card small{font-size:8px}
.home-version{left:6px;bottom:4px}
.menu-side{grid-area:side;grid-template-rows:minmax(250px,1fr) repeat(4,58px);align-content:center;gap:8px;min-height:0}
.player-room-card{min-height:280px}
.menu-tile{min-height:0}
.main-menu-screen .menu-controls{grid-row:2}

@media(max-width:900px){
 .main-menu-content,.main-menu-screen.showing-modes .main-menu-content{grid-template-columns:minmax(390px,1fr) clamp(235px,28vw,275px);grid-template-rows:clamp(110px,18vh,142px) minmax(0,1fr);gap:9px 11px;padding:8px}
 .main-menu-brand{padding-left:5px}.main-menu-brand .game-logo{width:min(390px,48vw)}
 .main-action-grid{width:clamp(285px,50.4%,370px);grid-template-rows:repeat(3,clamp(68px,10vh,82px));gap:9px}
 .main-action-card{grid-template-columns:48px minmax(0,1fr);gap:10px;padding:8px 12px}.main-action-card>span{width:42px;height:42px}.main-action-card b{font-size:clamp(18px,2.4vw,22px)}
 .menu-side{grid-template-rows:minmax(205px,1fr) repeat(4,52px);gap:7px}.menu-tile{padding:5px 8px}.menu-tile>span{width:34px;height:34px}
}

@media(orientation:landscape) and (max-height:520px){
 .main-menu-screen{padding:calc(4px + var(--safe-t)) calc(6px + var(--safe-r)) calc(4px + var(--safe-b)) calc(6px + var(--safe-l))}
 .main-menu-shell{grid-template-rows:minmax(0,1fr);gap:0}
 .main-menu-content,.main-menu-screen.showing-modes .main-menu-content{grid-row:1;grid-template-columns:minmax(0,1fr) clamp(190px,24vw,220px);grid-template-rows:72px minmax(0,1fr);gap:6px 8px;padding:5px}
 .main-menu-brand{grid-row:1;padding-left:4px}.main-menu-brand .game-logo{width:min(280px,44vw);height:70px;max-width:100%}
 .main-action-grid{width:clamp(285px,49.2%,340px);grid-template-rows:repeat(3,56px);gap:7px}
 .main-action-card{grid-template-columns:40px minmax(0,1fr);gap:8px;padding:5px 9px}.main-action-card>span{width:35px;height:35px;font-size:18px}.main-action-card b{font-size:clamp(16px,2.4vw,20px)}.main-action-card small{font-size:7px}
 .home-version{bottom:2px}
 .menu-side{grid-template-rows:minmax(120px,1fr) repeat(4,39px);gap:5px}.player-room-card{min-height:120px}.menu-tile{grid-template-columns:34px minmax(0,1fr);padding:2px 5px}.menu-tile>span{width:30px;height:30px}.menu-tile b{font-size:8px}.menu-tile small{font-size:6px}
 .main-menu-screen .menu-controls{display:none!important}
}

@media(pointer:coarse) and (orientation:portrait){
 .main-menu-shell{grid-template-rows:minmax(0,1fr)}
 .main-menu-content,.main-menu-screen.showing-modes .main-menu-content{grid-template-columns:1fr;grid-template-rows:clamp(92px,14vh,120px) minmax(0,1fr);grid-template-areas:"brand" "home";gap:8px;padding:8px}
 .main-menu-brand{grid-area:brand}.main-menu-brand .game-logo{width:min(430px,76vw);height:100%;max-width:100%}
 .menu-home-section,.mode-section{grid-area:home}.menu-side{display:none}
 .main-action-grid{width:clamp(285px,52.8%,370px);grid-template-rows:repeat(3,clamp(72px,10vh,86px));gap:9px}
}

/* V162 cinematic first-launch menu reveal */
.menu-intro-overlay{position:absolute;z-index:20;inset:0;overflow:hidden;pointer-events:auto;background:transparent;text-align:center}
.menu-intro-eyelid{position:absolute;z-index:4;left:-3%;width:106%;height:52%;background:radial-gradient(ellipse at 50% 100%,#151a1d 0,#050607 67%,#000 100%);will-change:transform}
.menu-intro-eyelid-top{top:-1%;border-radius:0 0 48% 48%/0 0 10% 10%;box-shadow:0 10px 28px rgba(0,0,0,.9)}
.menu-intro-eyelid-bottom{bottom:-1%;border-radius:48% 48% 0 0/10% 10% 0 0;background:radial-gradient(ellipse at 50% 0,#151a1d 0,#050607 67%,#000 100%);box-shadow:0 -10px 28px rgba(0,0,0,.9)}
.menu-intro-overlay.is-opening .menu-intro-eyelid-top{animation:menu-eye-open-top 2.7s cubic-bezier(.45,0,.2,1) forwards}
.menu-intro-overlay.is-opening .menu-intro-eyelid-bottom{animation:menu-eye-open-bottom 2.7s cubic-bezier(.45,0,.2,1) forwards}
.menu-intro-welcome{position:absolute;z-index:2;left:50%;top:48%;display:flex;align-items:center;flex-direction:column;gap:7px;width:min(820px,90vw);padding:20px;transform:translate(-50%,-42%) scale(.94);opacity:0;filter:blur(7px);text-shadow:0 5px 0 rgba(0,0,0,.58),0 12px 28px rgba(0,0,0,.78);transition:opacity .52s ease,transform .7s cubic-bezier(.2,.75,.22,1),filter .6s ease;will-change:opacity,transform,filter}
.menu-intro-welcome small{color:#eefaff;font-size:clamp(12px,1.7vw,20px);font-weight:900;letter-spacing:.35em}
.menu-intro-welcome b{color:#fff;font-family:Impact,Haettenschweiler,sans-serif;font-size:clamp(48px,9.5vw,118px);font-style:italic;letter-spacing:.035em;line-height:.82;-webkit-text-stroke:2px #101719}
.menu-intro-welcome strong{color:#d5ed44;font-size:clamp(17px,3vw,38px);letter-spacing:.3em}
.menu-intro-overlay.show-welcome .menu-intro-welcome{transform:translate(-50%,-50%) scale(1);opacity:1;filter:blur(0)}
.menu-intro-overlay.hide-welcome .menu-intro-welcome{transform:translate(-50%,-58%) scale(1.035);opacity:0;filter:blur(3px)}
.menu-intro-skip{position:absolute;z-index:3;left:50%;bottom:calc(16px + var(--safe-b));transform:translateX(-50%);padding:6px 10px;background:rgba(4,15,20,.46);color:rgba(232,247,251,.76);font-size:clamp(7px,1vw,10px);font-weight:900;letter-spacing:.12em;text-shadow:0 2px #000;white-space:nowrap;opacity:0;animation:menu-intro-skip-in .35s 1.2s forwards}
.main-menu-screen.menu-intro-playing{background:linear-gradient(rgba(5,17,23,.05),rgba(5,17,23,.16))}
.main-menu-screen.menu-intro-playing:before{opacity:0}
.menu-intro-playing .main-menu-content{background:transparent;border-color:transparent;box-shadow:none;backdrop-filter:none}
.menu-intro-playing.menu-intro-revealing .main-menu-content{background:linear-gradient(135deg,rgba(8,25,32,.78),rgba(5,17,23,.55));border-color:rgba(190,216,225,.44);box-shadow:0 18px 42px rgba(0,0,0,.42),inset 0 0 0 1px rgba(0,0,0,.35);backdrop-filter:blur(3px)}
.menu-intro-playing .main-menu-brand,.menu-intro-playing .menu-home-section,.menu-intro-playing .menu-side,.menu-intro-playing .home-left-rail,.menu-intro-playing .menu-controls{opacity:0;will-change:opacity,transform;transition:opacity .58s ease,transform .74s cubic-bezier(.18,.76,.2,1)}
.menu-intro-playing .main-menu-brand{transform:translate3d(-42px,-16px,0) scale(.97)}
.menu-intro-playing .menu-home-section{transform:translate3d(0,34px,0) scale(.985);transition-delay:.1s}
.menu-intro-playing .menu-side{transform:translate3d(38px,0,0) scale(.985);transition-delay:.22s}
.menu-intro-playing .home-left-rail{transform:translate3d(-26px,0,0) scale(.985);transition-delay:.18s;pointer-events:none}
.menu-intro-playing .menu-controls{transform:translate3d(0,12px,0);transition-delay:.32s}
.menu-intro-active #fullscreen-button{opacity:0;pointer-events:none}
.menu-intro-playing.menu-intro-revealing .menu-intro-skip{opacity:0;transition:opacity .2s ease}
.menu-intro-playing.menu-intro-revealing .main-menu-brand,.menu-intro-playing.menu-intro-revealing .menu-home-section,.menu-intro-playing.menu-intro-revealing .menu-side,.menu-intro-playing.menu-intro-revealing .home-left-rail,.menu-intro-playing.menu-intro-revealing .menu-controls{opacity:1;transform:none}
.menu-intro-playing.menu-intro-revealing .home-left-rail{pointer-events:auto}
@keyframes menu-intro-skip-in{to{opacity:1}}
@keyframes menu-eye-open-top{0%{transform:translateY(0)}18%{transform:translateY(-36%)}30%{transform:translateY(-3%)}55%{transform:translateY(-78%)}65%{transform:translateY(-14%)}100%{transform:translateY(-103%)}}
@keyframes menu-eye-open-bottom{0%{transform:translateY(0)}18%{transform:translateY(36%)}30%{transform:translateY(3%)}55%{transform:translateY(78%)}65%{transform:translateY(14%)}100%{transform:translateY(103%)}}
@media(max-height:520px){.menu-intro-welcome{gap:4px}.menu-intro-welcome small{font-size:9px}.menu-intro-welcome b{font-size:clamp(40px,11vw,68px);-webkit-text-stroke:1px #101719}.menu-intro-welcome strong{font-size:clamp(13px,3.2vw,22px)}.menu-intro-skip{bottom:calc(7px + var(--safe-b));font-size:6px}}
@media(prefers-reduced-motion:reduce){.menu-intro-overlay.is-opening .menu-intro-eyelid{animation-duration:.12s}.menu-intro-welcome{transition-duration:.12s}.menu-intro-playing .main-menu-brand,.menu-intro-playing .menu-home-section,.menu-intro-playing .menu-side,.menu-intro-playing .home-left-rail,.menu-intro-playing .menu-controls{transition-duration:.12s;transition-delay:0s}.menu-intro-skip{display:none}}

/* V199 player identity and friends */
.friends-menu-tile{position:relative;background:linear-gradient(#d9e7ea,#b7cdd2)}.friends-menu-tile>span{background:#294d5d;color:#7ee6ff}.friends-menu-tile>em{position:absolute;right:7px;top:6px;display:grid;place-items:center;min-width:19px;height:19px;padding:0 4px;border:2px solid #fff;background:#d83d4e;color:#fff;font-size:8px;font-style:normal;box-shadow:0 2px #4e1720}
.friends-overlay{z-index:48;background:rgba(2,8,11,.82)}
.friends-panel{z-index:49;display:grid;grid-template-rows:auto auto auto auto minmax(0,1fr) auto;width:min(900px,96vw);height:min(720px,94dvh);max-height:94dvh;padding:0;overflow:hidden;background:#c8c8c8;border:4px solid #151515;color:#242424;box-shadow:0 20px 0 rgba(0,0,0,.28),0 34px 75px rgba(0,0,0,.7)}
.friends-panel>header{grid-row:1}.friends-account-card{grid-row:2}.friends-tabs{grid-row:3}.friends-add-box{grid-row:4}.friends-list{grid-row:5}.friends-panel>footer{grid-row:6}
.friends-panel>header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:#ededed;border-bottom:3px solid #222}.friends-panel>header>div{display:flex;flex-direction:column;gap:4px}.friends-panel>header b{font-size:24px}.friends-panel>header small{color:#607078;font-size:9px}.friends-panel>header button{display:grid;place-items:center;width:44px;height:44px;border:3px solid #252525;background:#5c5c5c;color:#fff;font-size:27px;cursor:pointer}
.friends-account-card{display:grid;grid-template-columns:54px minmax(0,1fr) repeat(4,auto);align-items:center;gap:8px;padding:11px 14px;background:linear-gradient(135deg,#204b5d,#122f3b);border-bottom:3px solid #17242a;color:#fff}.friends-account-avatar{display:grid;place-items:center;width:50px;height:50px;background:#356c7c;border:3px solid #9adce9;color:#ffe268;font-size:24px}.friends-account-card>div:nth-child(2){display:flex;min-width:0;flex-direction:column;gap:4px}.friends-account-card small{color:#80dfff;font-size:7px}.friends-account-card b{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.friends-account-card span{color:#c5dce3;font-size:8px}.friends-account-card strong{color:#ffe16b;letter-spacing:.08em;text-transform:lowercase}.friends-account-card>button{min-height:38px;padding:7px 10px;border:2px solid #9cb2ba;background:#31515d;color:#fff;font-family:inherit;font-size:8px;font-weight:900;cursor:pointer}.friends-account-card>.friends-apple{border-color:#eee;background:#050505;color:#fff}.friends-apple span{margin-right:3px;color:#fff}.friends-account-editor,.friends-profile-switcher{grid-column:1/-1;padding:10px;border:2px solid #6c9dac;background:#102a34}.friends-account-editor label{display:block;margin-bottom:6px;color:#ffe16b;font-size:8px;font-weight:900}.friends-account-editor>div{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:6px}.friends-account-editor>div>span{font-size:18px;font-weight:900}.friends-account-editor input,.friends-profile-switcher input{min-height:38px;padding:6px 9px;border:2px solid #9cb2ba;background:#f4f4f4;color:#222;font:900 12px monospace}.friends-account-editor input{text-transform:lowercase}.friends-account-editor button,.friends-profile-switcher button{min-height:36px;padding:6px 10px;border:2px solid #9cb2ba;background:#31515d;color:#fff;font-family:inherit;font-size:8px;font-weight:900}.friends-profile-switcher>header{display:flex;align-items:center;justify-content:space-between;margin-bottom:7px}.friends-profile-switcher>header b{color:#ffe16b;font-size:10px}.friends-profile-switcher>div{display:flex;gap:7px;overflow-x:auto;touch-action:pan-x;padding-bottom:7px}.friends-profile-choice{min-width:145px;text-align:left}.friends-profile-choice.selected{border-color:#ffe16b;background:#267d3d}.friends-profile-switcher>footer{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px}.friends-profile-switcher #friends-profile-create{border-color:#ffe16b}
.friends-tabs{display:grid;grid-template-columns:repeat(3,1fr);background:#7c7c7c;border-bottom:3px solid #222}.friends-tabs button{display:flex;align-items:center;justify-content:center;gap:8px;min-height:47px;border:0;border-right:2px solid #595959;background:transparent;color:#e5e5e5;font-family:inherit;font-size:10px;font-weight:900;cursor:pointer}.friends-tabs button:last-child{border-right:0}.friends-tabs button.selected{background:#3d6475;color:#fff;box-shadow:inset 0 -4px #6edbff}.friends-tabs em{display:grid;place-items:center;min-width:20px;height:20px;padding:0 4px;background:#263c45;color:#fff4a3;font-size:8px;font-style:normal}
.friends-add-box{display:flex;flex-direction:column;gap:6px;padding:10px 14px;background:#d9d9d9;border-bottom:2px solid #777}.friends-add-box label{font-size:8px;font-weight:900}.friends-add-box>div{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px}.friends-add-box input{min-height:42px;padding:7px 10px;border:3px solid #434343;background:#f5f5f5;color:#222;font:900 13px monospace;text-transform:lowercase;outline:0}.friends-add-box input:focus{border-color:#d6ad21}.friends-add-box button{padding:7px 13px;border:3px solid #173816;background:#2b921d;color:#fff;font-family:inherit;font-size:9px;font-weight:900;cursor:pointer}.friends-add-box small{color:#5c666a;font-size:7px}
.friends-list{display:flex;min-height:0;flex-direction:column;gap:7px;padding:11px 14px;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;background:linear-gradient(#c9c9c9,#b7b7b7)}
.friend-card{display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:10px;min-height:67px;padding:8px 10px;border:3px solid #696969;background:#e1e1e1;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0a0a0}.friend-avatar{display:grid;place-items:center;width:44px;height:44px;border:3px solid #263b43;background:linear-gradient(#4d8799,#274b59);color:#fff;font-size:19px}.friend-card>div:nth-child(2){display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px 8px}.friend-card b{font-size:11px}.friend-card small{grid-column:1;color:#68757a;font-size:7px}.friend-card em{grid-column:2;grid-row:1/3;padding:5px 7px;background:#777;color:#fff;font-size:7px;font-style:normal}.friend-card em[data-presence="online"],.friend-card em[data-presence="menu"],.friend-card em[data-presence="in_game"]{background:#287b45;color:#c9ffda}.friend-card em[data-presence="away"]{background:#806822;color:#fff0a5}.friend-card-actions{display:flex;gap:5px}.friend-card-actions button{min-height:34px;padding:6px 8px;border:2px solid #555;background:#777;color:#fff;font-family:inherit;font-size:7px;font-weight:900;cursor:pointer}.friend-card-actions button.primary{border-color:#185725;background:#289340}.friends-empty{display:flex;min-height:190px;align-items:center;justify-content:center;flex-direction:column;gap:9px;border:3px dashed #777;background:rgba(236,236,236,.48);text-align:center}.friends-empty span{color:#397185;font-size:37px}.friends-empty b{font-size:14px}.friends-empty small{max-width:420px;color:#56656a;font-size:9px;line-height:1.5}
.friends-panel>footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 13px;background:#ededed;border-top:3px solid #222}.friends-panel>footer span{color:#556269;font-size:8px}.friends-panel>footer span.error{color:#a12833}.friends-panel>footer button{min-width:130px;min-height:40px;border:3px solid #293e47;background:#405d69;color:#fff;font-family:inherit;font-size:10px;font-weight:900;cursor:pointer}
.friends-panel>footer .friends-delete-account{border-color:#6d2525;background:#a83b3b}.friends-panel>footer span{flex:1}
@media(orientation:landscape) and (max-height:520px){.friends-panel{width:calc(100vw - var(--safe-l) - var(--safe-r) - 10px);height:calc(100dvh - var(--safe-t) - var(--safe-b) - 8px);max-height:none;border-width:3px}.friends-panel>header{padding:6px 9px;border-bottom-width:2px}.friends-panel>header b{font-size:18px}.friends-panel>header small{font-size:7px}.friends-panel>header button{width:36px;height:36px;border-width:2px}.friends-account-card{grid-template-columns:40px minmax(0,1fr) auto auto;gap:7px;padding:6px 9px;border-bottom-width:2px}.friends-account-avatar{width:36px;height:36px;border-width:2px;font-size:18px}.friends-account-card b{font-size:10px}.friends-account-card>button{min-height:32px;padding:5px 8px;font-size:7px}.friends-tabs button{min-height:34px;font-size:8px}.friends-tabs em{height:17px;min-width:17px}.friends-add-box{padding:6px 9px}.friends-add-box input{min-height:34px;font-size:10px}.friends-add-box button{padding:4px 9px}.friends-list{gap:4px;padding:6px 9px}.friend-card{grid-template-columns:39px minmax(0,1fr) auto;min-height:48px;padding:4px 7px;border-width:2px}.friend-avatar{width:34px;height:34px;border-width:2px;font-size:15px}.friend-card b{font-size:9px}.friend-card-actions button{min-height:29px;padding:4px 6px}.friends-empty{min-height:90px}.friends-panel>footer{padding:5px 8px;border-top-width:2px}.friends-panel>footer button{min-height:32px}}
@media(max-width:650px){.friends-account-card{grid-template-columns:44px minmax(0,1fr) auto}.friends-account-avatar{width:40px;height:40px}.friends-account-card>.friends-apple{grid-column:1/-1}.friend-card{grid-template-columns:42px minmax(0,1fr)}.friend-card-actions{grid-column:1/-1;justify-content:flex-end}.friends-tabs button{font-size:8px}}
@media(max-width:900px){.friends-account-card{grid-template-columns:44px minmax(0,1fr) repeat(2,auto);row-gap:5px}.friends-account-card>.friends-apple{grid-column:3/5}.friends-account-card>#friends-switch-profile:not(.hidden)+.friends-apple{grid-column:auto}.friends-account-editor>div{grid-template-columns:auto minmax(0,1fr) auto auto}}
@media(max-width:650px){.friends-account-card{grid-template-columns:44px minmax(0,1fr) auto}.friends-account-card>button{font-size:7px;padding:6px}.friends-account-card>#friends-edit-username{grid-column:3}.friends-account-card>#friends-switch-profile:not(.hidden){grid-column:2}.friends-account-card>.friends-apple,.friends-account-card>#friends-switch-profile:not(.hidden)+.friends-apple{grid-column:1/-1}.friends-account-editor>div{grid-template-columns:auto minmax(0,1fr)}.friends-account-editor button{grid-row:2}.friends-account-editor #friends-username-save{grid-column:2}.friends-account-editor #friends-username-cancel{grid-column:2}.friends-profile-switcher>div{max-width:calc(100vw - 64px)}}

/* Compact two-row account controls on landscape iPhones. */
@media(pointer:coarse) and (orientation:landscape) and (max-height:520px){
 .friends-account-card{grid-template-columns:38px minmax(110px,1fr) repeat(2,minmax(72px,92px));grid-template-rows:repeat(2,32px);row-gap:4px}
 .friends-account-avatar{grid-column:1;grid-row:1/3;align-self:center}
 .friends-account-card>div:nth-child(2){grid-column:2;grid-row:1/3;align-self:center}
 .friends-account-card>#friends-copy-id{grid-column:3;grid-row:1}
 .friends-account-card>#friends-edit-username{grid-column:4;grid-row:1}
 .friends-account-card>#friends-switch-profile:not(.hidden){grid-column:3;grid-row:2}
 .friends-account-card>.friends-apple{grid-column:3/5!important;grid-row:2;width:auto;min-width:0;min-height:30px;padding:4px 7px;white-space:nowrap}
 .friends-account-card>.friends-apple.is-signout{grid-column:4!important}
}

/* V205 friend room invites */
.friend-card-actions{flex-wrap:wrap;justify-content:flex-end}.friend-card-actions button:disabled{opacity:.62;cursor:default}.room-invite-card{border-color:#b99221;background:linear-gradient(100deg,#fff4bd,#e5d486)}.friend-card em[data-presence="invite"]{background:#9a7418;color:#fff4b0}.room-invite-overlay{z-index:54;background:rgba(2,8,11,.84)}.room-invite-panel{z-index:55;display:grid;grid-template-columns:72px minmax(0,1fr) auto;align-items:center;gap:16px;width:min(720px,94vw);padding:18px;border:4px solid #e5c446;background:linear-gradient(135deg,#173b49,#0b222c);color:#fff;box-shadow:0 14px 0 rgba(0,0,0,.35),0 30px 70px rgba(0,0,0,.72)}.room-invite-icon{display:grid;place-items:center;width:68px;height:68px;border:3px solid #a3e8ff;background:#315f70;color:#ffe269;font-size:34px}.room-invite-panel>div:nth-child(2){display:flex;min-width:0;flex-direction:column;gap:7px}.room-invite-panel b{color:#ffe26d;font-size:18px}.room-invite-panel p{margin:0;color:#e7f7fb;font-size:11px}.room-invite-panel small{color:#9dbdc7;font-size:7px}.room-invite-panel>div:last-child{display:flex;gap:7px}.room-invite-panel button{min-height:44px;padding:8px 13px;font-family:inherit;font-size:9px;font-weight:900}.room-invite-panel .play{border:3px solid #f9e26f;background:#36943d;color:#fff}
@media(max-width:650px){.room-invite-panel{grid-template-columns:50px minmax(0,1fr);gap:10px;padding:12px}.room-invite-icon{width:46px;height:46px;font-size:24px}.room-invite-panel b{font-size:13px}.room-invite-panel>div:last-child{grid-column:1/-1;justify-content:flex-end}.room-invite-panel button{min-height:38px}}

/* V215 review fixes: larger mode choices and consistent dialog titles */
.friends-panel>header b{color:#222}
.main-menu-screen.showing-modes .main-menu-brand{display:none}
.main-menu-screen.showing-modes .main-menu-content{grid-template-rows:minmax(0,1fr);grid-template-areas:"home side"}
.main-menu-screen.showing-modes .mode-section{grid-row:1;padding:10px}
.main-menu-screen.showing-modes .mode-grid{grid-template-rows:repeat(2,minmax(0,1fr))}
@media(orientation:landscape) and (max-height:520px){
 .main-menu-screen.showing-modes .main-menu-content{grid-template-rows:minmax(0,1fr)}
 .main-menu-screen.showing-modes .mode-section{padding:5px}
}
@media(pointer:coarse) and (orientation:portrait){
 .main-menu-screen.showing-modes .main-menu-content{grid-template-rows:minmax(0,1fr);grid-template-areas:"home"}
}

/* V219: PLAY now separates saved worlds from creation. */
.world-section{grid-area:home;display:grid;grid-template-rows:auto minmax(0,1fr);gap:12px;min-width:0;min-height:0;padding:12px;background:rgba(12,28,35,.93);border:2px solid rgba(255,255,255,.38);box-shadow:0 12px 30px rgba(0,0,0,.38)}
.main-menu-screen.showing-play .main-menu-content{grid-template-columns:minmax(0,1fr) clamp(240px,25vw,320px)}
.world-choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;min-height:0}
.world-choice{position:relative;display:grid;grid-template-columns:74px minmax(0,1fr);align-items:center;gap:15px;min-width:0;padding:18px;border:3px solid #202020;color:#fff;text-align:left;box-shadow:inset 2px 2px rgba(255,255,255,.24),inset -2px -2px rgba(0,0,0,.3),0 6px 0 rgba(0,0,0,.58);cursor:pointer;touch-action:manipulation;overflow:hidden}
.world-choice:after{content:"";position:absolute;right:-44px;bottom:-70px;width:190px;height:190px;transform:rotate(45deg);background:rgba(255,255,255,.07);pointer-events:none}.world-choice:active{transform:translateY(4px);box-shadow:inset 2px 2px rgba(255,255,255,.24),inset -2px -2px rgba(0,0,0,.3),0 2px 0 rgba(0,0,0,.58)}
.world-choice>span{display:grid;place-items:center;width:68px;height:68px;border:2px solid rgba(255,255,255,.45);background:rgba(5,20,25,.4);font-size:36px}.world-choice>div{position:relative;z-index:1;display:flex;min-width:0;flex-direction:column;gap:8px}.world-choice small{color:#d9f4fb;font-size:8px;letter-spacing:.13em}.world-choice b{font-size:clamp(20px,2.3vw,31px);letter-spacing:.035em}.world-choice p{min-height:42px;margin:0;color:#e0edf0;font-size:9px;line-height:1.5}.world-choice em{align-self:flex-start;margin-top:5px;padding:7px 9px;background:rgba(6,20,26,.5);color:#fff2a0;font-size:8px;font-style:normal;font-weight:900}.create-world-choice{background:linear-gradient(145deg,#2f9730,#174d25)}.load-world-choice{background:linear-gradient(145deg,#3b7088,#1d3948)}
@media(max-width:900px){.world-choice{grid-template-columns:58px minmax(0,1fr);gap:10px;padding:12px}.world-choice>span{width:54px;height:54px;font-size:28px}.world-choice b{font-size:19px}.world-choice p{font-size:8px}}
@media(orientation:landscape) and (max-height:520px){.main-menu-screen.showing-play .main-menu-content{grid-template-columns:minmax(0,1fr) clamp(190px,24vw,220px);grid-template-rows:72px minmax(0,1fr)}.world-section{padding:6px;gap:6px}.world-choice-grid{gap:7px}.world-choice{grid-template-columns:43px minmax(0,1fr);gap:7px;padding:8px}.world-choice>span{width:39px;height:39px;font-size:22px}.world-choice>div{gap:4px}.world-choice b{font-size:14px}.world-choice p{min-height:0;font-size:7px}.world-choice em{margin-top:2px;padding:4px 6px;font-size:6px}}
@media(pointer:coarse) and (orientation:portrait){.main-menu-screen.showing-play .main-menu-content{grid-template-columns:1fr;grid-template-rows:clamp(92px,14vh,120px) minmax(0,1fr);grid-template-areas:"brand" "home"}.world-choice-grid{grid-template-columns:1fr}.world-choice p{min-height:0}}

/* V236: concept-led responsive home composition */
.main-menu-content,.main-menu-screen.showing-home .main-menu-content{width:min(1480px,100%);height:min(880px,100%);grid-template-columns:clamp(118px,13vw,172px) minmax(390px,1fr) clamp(278px,29vw,365px);grid-template-rows:minmax(0,1fr);grid-template-areas:"rail center side";column-gap:clamp(10px,1.25vw,18px);row-gap:0;padding:clamp(7px,.8vw,12px)}
.main-menu-center{grid-area:center;display:grid;grid-template-rows:clamp(170px,27vh,245px) auto;grid-template-areas:"brand" "home";align-content:center;gap:clamp(12px,2vh,22px);min-width:0;min-height:0}
.main-menu-screen.showing-home .main-menu-center{position:relative}
.main-menu-screen.showing-home .main-menu-brand{position:absolute;z-index:2;grid-area:auto;top:clamp(3px,.6vh,7px);left:0;right:0;height:clamp(170px,27vh,245px)}
.main-menu-brand{grid-area:brand;align-items:center;justify-content:center;padding:0;overflow:visible}
.main-menu-brand .title-mark{justify-content:center;overflow:visible}
.main-menu-brand .game-logo{width:min(540px,94%);height:100%;max-width:100%;object-fit:contain;object-position:center;filter:drop-shadow(0 6px 0 rgba(0,0,0,.42)) drop-shadow(0 13px 20px rgba(0,0,0,.54))}
.home-left-rail{grid-area:rail;display:flex;min-width:0;min-height:0;flex-direction:column;align-items:stretch;gap:18px;padding:12px 5px 3px}
.home-rail-button{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:7px;min-width:0;padding:5px;border:0;background:transparent;color:#fff;font-family:inherit;text-align:center;text-shadow:0 2px 3px #000;cursor:pointer;touch-action:manipulation}
.home-rail-button>span{display:grid;place-items:center;width:62px;height:62px;color:#fff;font-family:Arial,sans-serif;font-size:54px;line-height:1;filter:drop-shadow(0 4px 2px rgba(0,0,0,.65))}
.home-rail-button>div{display:flex;max-width:100%;flex-direction:column;gap:4px}.home-rail-button b{font-size:11px;letter-spacing:.025em}.home-rail-button small{max-width:100%;color:#d5e4e9;font-size:7px;line-height:1.3}
.home-rail-button:active{transform:translateY(2px);filter:brightness(1.2)}
.daily-gift-rail-button{position:relative;transition:transform .16s ease,filter .16s ease}.daily-gift-rail-button .daily-gift-art{position:relative;width:72px;height:72px;filter:drop-shadow(0 6px 3px rgba(0,0,0,.62))}.daily-gift-art img{display:block;width:100%;height:100%;object-fit:contain}.daily-gift-art em{position:absolute;right:-2px;top:-1px;display:grid;place-items:center;width:23px;height:23px;border:3px solid #fff;border-radius:50%;background:#d92727;color:#fff;font-family:Arial,sans-serif;font-size:14px;font-style:normal;font-weight:1000;line-height:1;box-shadow:0 3px 0 rgba(0,0,0,.42)}.daily-gift-rail-button.ready .daily-gift-art{animation:daily-gift-ready 1.75s ease-in-out infinite}.daily-gift-rail-button.waiting .daily-gift-art{opacity:.72;filter:grayscale(.18) drop-shadow(0 4px 2px rgba(0,0,0,.52))}.daily-gift-rail-button.claiming{pointer-events:none;filter:brightness(1.2)}
@keyframes daily-gift-ready{0%,72%,100%{transform:translateY(0) rotate(0)}78%{transform:translateY(-5px) rotate(-4deg)}84%{transform:translateY(-2px) rotate(4deg)}90%{transform:translateY(-5px) rotate(-2deg)}}
.profile-rail-button{display:grid;grid-template-columns:54px minmax(0,1fr);align-items:center;gap:5px;margin-top:auto;text-align:left;text-shadow:none}.profile-rail-button>span{filter:none}.profile-rail-button>div{width:auto;min-width:0;padding:7px 6px;border:2px solid #202020;background:#d7d7d7;color:#282828;box-shadow:inset 1px 1px #fff,0 3px rgba(0,0,0,.55)}.profile-rail-button b{font-size:9px}.profile-rail-button small{color:#555;font-size:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.profile-rail-button .profile-face{width:54px!important;height:54px!important;border-width:3px!important;box-shadow:inset 0 14px #5b3728!important}.profile-rail-button .profile-face:before,.profile-rail-button .profile-face:after{top:26px;width:6px;height:7px}.profile-rail-button .profile-face:before{left:11px}.profile-rail-button .profile-face:after{right:11px}.profile-rail-button .profile-face i{left:18px;bottom:8px;width:12px;height:4px}
.menu-home-section{grid-area:home}.home-menu-layout{align-items:start;padding-top:0}
.main-action-grid{width:min(520px,75%);height:auto;grid-template-rows:repeat(2,clamp(86px,12vh,112px));align-content:start;gap:15px;margin-inline:auto}
.main-action-card{grid-template-columns:68px minmax(0,1fr);gap:18px;padding:10px 18px;border-width:4px}.main-action-card>span{width:60px;height:60px;font-size:29px}.main-action-card b{font-size:clamp(25px,2.6vw,38px)}.main-action-card small{font-size:10px}
.menu-side{grid-area:side;grid-template-rows:minmax(310px,1fr) repeat(3,clamp(58px,7.5vh,70px));align-content:stretch;gap:10px}
.player-room-card{min-height:330px;border-color:#f2d54e;box-shadow:0 6px 0 rgba(0,0,0,.68),inset 0 0 0 2px rgba(255,248,170,.24)}
.player-room-card .menu-avatar-preview{inset:0;aspect-ratio:auto}
.player-room-card .player-room-copy small{display:none}
.daily-gift-result{position:fixed;z-index:82;left:50%;top:13%;display:grid;grid-template-columns:80px minmax(0,1fr);align-items:center;gap:14px;width:min(390px,calc(100vw - 28px));padding:12px 18px;transform:translate(-50%,-18px) scale(.92);opacity:0;border:3px solid #ffe26a;background:linear-gradient(120deg,rgba(14,48,60,.98),rgba(50,39,15,.98));color:#fff;box-shadow:0 8px 0 rgba(0,0,0,.45),0 20px 55px rgba(0,0,0,.58),inset 0 0 24px rgba(255,217,74,.14);pointer-events:none;transition:transform .24s cubic-bezier(.2,.85,.25,1.25),opacity .2s}.daily-gift-result.show{transform:translate(-50%,0) scale(1);opacity:1}.daily-gift-result>img{width:80px;height:80px;object-fit:contain;filter:drop-shadow(0 5px 3px rgba(0,0,0,.48));animation:daily-result-pop .55s cubic-bezier(.2,.85,.25,1.35)}.daily-gift-result>div{display:flex;min-width:0;flex-direction:column;gap:6px}.daily-gift-result small{color:#8be5f8;font-size:8px;letter-spacing:.13em}.daily-gift-result b{color:#ffe36b;font-size:23px;text-shadow:0 3px #6e5111}.daily-gift-result span{color:#e7f5f8;font-size:9px}.reward-flying-coin{position:fixed;z-index:84;left:0;top:0;display:grid;place-items:center;width:22px;height:22px;border:2px solid #705111;background:linear-gradient(135deg,#fff292 0 24%,#f2c733 25% 66%,#9e6d0d 67%);color:#6f4e08;font-family:Arial,sans-serif;font-size:10px;font-style:normal;font-weight:1000;box-shadow:inset 2px 2px rgba(255,255,255,.6),0 4px 5px rgba(0,0,0,.38);pointer-events:none;animation:daily-coin-flight 1.15s cubic-bezier(.22,.72,.18,1) both}.player-room-card .menu-wallet.coin-reward-pulse{animation:wallet-reward-pulse .62s ease-in-out 2}.player-room-card .menu-wallet.coin-reward-pulse b{color:#fff59b}
@keyframes daily-result-pop{0%{transform:scale(.55) rotate(-12deg)}70%{transform:scale(1.1) rotate(4deg)}100%{transform:scale(1) rotate(0)}}@keyframes daily-coin-flight{0%{transform:translate(var(--from-x),var(--from-y)) scale(.5) rotateY(0);opacity:0}10%{opacity:1}52%{transform:translate(var(--mid-x),var(--mid-y)) scale(1.12) rotateY(540deg)}88%{opacity:1}100%{transform:translate(var(--to-x),var(--to-y)) scale(.28) rotateY(900deg);opacity:0}}@keyframes wallet-reward-pulse{50%{transform:scale(1.14);filter:brightness(1.55);box-shadow:0 0 0 4px rgba(255,226,88,.28),0 5px 15px rgba(0,0,0,.48)}}
.menu-tile{min-height:0;grid-template-columns:48px minmax(0,1fr);padding:7px 10px}.menu-tile>span{width:42px;height:42px}.menu-tile b{font-size:11px}.menu-tile small{font-size:7px}
.main-menu-screen.showing-play .home-left-rail,.main-menu-screen.showing-modes .home-left-rail{display:none}
.main-menu-screen.showing-play .main-menu-content,.main-menu-screen.showing-modes .main-menu-content{grid-template-columns:minmax(0,1fr) clamp(278px,29vw,365px);grid-template-rows:minmax(0,1fr);grid-template-areas:"center side"}
.main-menu-screen.showing-play .main-menu-center,.main-menu-screen.showing-modes .main-menu-center{grid-template-rows:minmax(0,1fr);grid-template-areas:"home";align-content:stretch;gap:0}
.main-menu-screen.showing-play .main-menu-brand,.main-menu-screen.showing-modes .main-menu-brand{display:none}

@media(max-width:1024px){
 .main-menu-content,.main-menu-screen.showing-home .main-menu-content{grid-template-columns:clamp(100px,12vw,130px) minmax(330px,1fr) clamp(245px,29vw,285px);grid-template-rows:minmax(0,1fr);gap:0 10px;padding:7px}
 .main-menu-center{grid-template-rows:clamp(138px,24vh,190px) auto;gap:clamp(10px,1.6vh,15px)}
 .main-menu-screen.showing-home .main-menu-brand{height:clamp(138px,24vh,190px)}
 .home-left-rail{gap:11px;padding-top:7px}.home-rail-button>span{width:52px;height:52px;font-size:46px}.daily-gift-rail-button .daily-gift-art{width:60px;height:60px}.daily-gift-art em{width:20px;height:20px;border-width:2px;font-size:12px}.profile-rail-button .profile-face{width:46px!important;height:46px!important}.profile-rail-button .profile-face:before,.profile-rail-button .profile-face:after{top:22px}.profile-rail-button .profile-face i{left:15px;bottom:7px}
 .main-menu-brand .game-logo{width:min(440px,92%)}.main-action-grid{width:min(448px,76%);grid-template-rows:repeat(2,clamp(76px,11vh,96px));gap:11px}.main-action-card{grid-template-columns:54px minmax(0,1fr);gap:12px;padding:8px 13px;border-width:3px}.main-action-card>span{width:48px;height:48px;font-size:24px}.main-action-card b{font-size:clamp(21px,2.5vw,29px)}.main-action-card small{font-size:8px}
 .menu-side{grid-template-rows:minmax(235px,1fr) repeat(3,54px);gap:7px}.player-room-card{min-height:255px}.menu-tile{grid-template-columns:40px minmax(0,1fr);padding:5px 7px}.menu-tile>span{width:35px;height:35px}.menu-tile b{font-size:9px}.menu-tile small{font-size:6px}
 .main-menu-screen.showing-play .main-menu-content,.main-menu-screen.showing-modes .main-menu-content{grid-template-columns:minmax(0,1fr) clamp(235px,29vw,285px)}
}

@media(orientation:landscape) and (max-height:520px){
 .main-menu-content,.main-menu-screen.showing-home .main-menu-content{grid-template-columns:clamp(76px,11vw,98px) minmax(300px,1fr) clamp(205px,27vw,245px);grid-template-rows:minmax(0,1fr);gap:0 8px;padding:5px}
 .main-menu-center{grid-template-rows:clamp(84px,25vh,112px) auto;align-content:center;gap:7px}
 .main-menu-screen.showing-home .main-menu-brand{height:clamp(84px,25vh,112px)}
 .home-left-rail{gap:4px;padding:3px 2px 1px}.home-rail-button{gap:1px;padding:1px 2px}.home-rail-button>span{width:39px;height:39px;font-size:35px}.home-rail-button b{font-size:7px}.home-rail-button small{display:none}.daily-gift-rail-button .daily-gift-art{width:44px;height:44px}.daily-gift-art em{right:-3px;top:-3px;width:17px;height:17px;border-width:2px;font-size:10px}.daily-gift-result{top:7%;grid-template-columns:54px minmax(0,1fr);gap:9px;width:min(320px,calc(100vw - var(--safe-l) - var(--safe-r) - 20px));padding:8px 12px;border-width:2px}.daily-gift-result>img{width:54px;height:54px}.daily-gift-result b{font-size:17px}.daily-gift-result span{font-size:7px}.profile-rail-button{grid-template-columns:35px minmax(0,1fr);gap:3px}.profile-rail-button .profile-face{width:35px!important;height:35px!important;box-shadow:inset 0 9px #5b3728!important}.profile-rail-button .profile-face:before,.profile-rail-button .profile-face:after{top:16px;width:4px;height:5px}.profile-rail-button .profile-face:before{left:7px}.profile-rail-button .profile-face:after{right:7px}.profile-rail-button .profile-face i{left:11px;bottom:5px;width:9px;height:3px}.profile-rail-button>div{padding:5px 3px}.profile-rail-button b{font-size:7px}
 .main-menu-brand .game-logo{width:min(330px,90%);height:100%}.home-menu-layout{padding-top:0}.main-action-grid{width:min(400px,77%);grid-template-rows:repeat(2,66px);gap:8px}.main-action-card{grid-template-columns:44px minmax(0,1fr);gap:9px;padding:5px 9px;border-width:3px}.main-action-card>span{width:39px;height:39px;font-size:20px}.main-action-card b{font-size:clamp(18px,2.7vw,25px)}.main-action-card small{font-size:7px}
 .menu-side{grid-template-rows:minmax(126px,1fr) repeat(3,43px);gap:5px}.player-room-card{min-height:135px}.menu-tile{grid-template-columns:34px minmax(0,1fr);padding:3px 5px;border-width:2px}.menu-tile>span{width:30px;height:30px;font-size:16px}.menu-tile b{font-size:8px}.menu-tile small{font-size:5.5px}.player-room-card .menu-wallet{right:4px;bottom:4px}
 .main-menu-screen.showing-play .main-menu-content,.main-menu-screen.showing-modes .main-menu-content{grid-template-columns:minmax(0,1fr) clamp(205px,27vw,245px);grid-template-rows:minmax(0,1fr)}
}

@media(orientation:portrait){
 .main-menu-content,.main-menu-screen.showing-home .main-menu-content{height:100%;grid-template-columns:1fr;grid-template-rows:auto auto minmax(270px,1fr);grid-template-areas:"center" "rail" "side";gap:9px;padding:8px;overflow-y:auto}
 .main-menu-center{grid-template-rows:clamp(105px,15vh,145px) auto;align-content:start;gap:9px}
 .main-menu-screen.showing-home .main-menu-brand{height:clamp(105px,15vh,145px)}
 .main-menu-brand .game-logo{width:min(470px,82vw)}.home-menu-layout{padding:0}.main-action-grid{width:min(416px,75%);grid-template-rows:repeat(2,78px);gap:9px}.main-action-card b{font-size:23px}
 .home-left-rail{display:grid;grid-template-columns:repeat(auto-fit,minmax(82px,1fr));gap:7px;padding:0}.home-rail-button{min-height:70px}.daily-gift-rail-button .daily-gift-art{width:58px;height:58px}.profile-rail-button{display:flex;margin:0;align-items:center;text-align:center}.profile-rail-button>div{width:auto;min-width:90px}.home-rail-button small{display:none}
 .menu-side{display:grid;grid-template-rows:minmax(280px,1fr) repeat(3,55px);min-height:470px}.player-room-card{min-height:290px}
 .main-menu-screen.showing-play .main-menu-content,.main-menu-screen.showing-modes .main-menu-content{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr);grid-template-areas:"center"}.main-menu-screen.showing-play .menu-side,.main-menu-screen.showing-modes .menu-side{display:none}
}
@media(prefers-reduced-motion:reduce){.daily-gift-rail-button.ready .daily-gift-art,.daily-gift-result>img,.reward-flying-coin,.player-room-card .menu-wallet.coin-reward-pulse{animation:none!important}.daily-gift-result{transition:none}}

/* The cinematic owns the screen until MenuIntro.finish(). Hide the complete
   menu, including newly added profile/nav elements, rather than an old list of
   individual buttons. Keep layout intact for live 3D preview measurements.
   Descendants are explicit because some widgets set their own visibility.
   The world canvas, cinematic/skip layer and orientation notice stay available. */
html.menu-intro-active #main-menu-content,
html.menu-intro-active #main-menu-content *,
html.menu-intro-active #game > :not(#canvas-host):not(#start-screen):not(#rotate-notice),
html.menu-intro-active #game > :not(#canvas-host):not(#start-screen):not(#rotate-notice) *{
 visibility:hidden!important;
 pointer-events:none!important
}
html.menu-intro-active #main-menu-content{opacity:0!important}

/* V334 isolated advertising controls */
.remove-ads-rail-button>span{position:relative;width:60px;height:60px;border:5px solid #fff;border-radius:50%;background:#171b1d;box-shadow:inset 0 0 0 5px #ef4141,0 4px 2px rgba(0,0,0,.65);filter:none}.remove-ads-rail-button>span:after{content:"";position:absolute;width:50px;height:6px;transform:rotate(-45deg);background:#ef4141;box-shadow:0 0 0 2px #171b1d}.remove-ads-rail-button i{position:relative;z-index:1;color:#fff;font-size:15px;font-style:normal;font-weight:1000;text-shadow:0 2px #000}.no-ads #remove-ads-menu{display:none!important}
@media(max-height:700px){.remove-ads-rail-button>span{width:52px;height:52px}.remove-ads-rail-button>span:after{width:43px}}
@media(max-height:520px){.remove-ads-rail-button>span{width:39px;height:39px;border-width:3px;box-shadow:inset 0 0 0 3px #ef4141,0 3px 2px rgba(0,0,0,.65)}.remove-ads-rail-button>span:after{width:32px;height:4px}.remove-ads-rail-button i{font-size:9px}}
