/* Sunny Garden — presentation only. Game constants and state are untouched. */
:root{--ink:#173c22;--cream:#fff0ca;--wood:#9b5a27;--gold:#f4cb69;--green:#82bb20;--safe-l:max(12px,env(safe-area-inset-left));--safe-r:max(12px,env(safe-area-inset-right));--safe-b:max(8px,env(safe-area-inset-bottom));--field-art:url('art/lawn.webp');color-scheme:light}
*{box-sizing:border-box}html,body{font-family:'Trebuchet MS','Arial',sans-serif;color:var(--ink);background:#293e1d}button,input{font:inherit}button{cursor:pointer}button:focus-visible{outline:3px solid #fff;box-shadow:0 0 0 6px #235936!important}button:disabled{opacity:.6;cursor:wait}.hidden{display:none!important}img{user-select:none;-webkit-user-drag:none}button{touch-action:manipulation}body{isolation:isolate}
.wood-panel,.wood-button,.level-card{background:linear-gradient(110deg,#fffae3,#f9dfab 80%,#f2cc8c);border:2px solid #a96329;box-shadow:inset 0 2px 0 #fff9e9,0 4px 0 #75421f,0 9px 20px #34231238;color:var(--ink)}
.wood-button{min-height:48px;padding:10px 18px;border-radius:16px;display:inline-flex;align-items:center;justify-content:center;gap:9px;font-weight:900;transition:transform .16s,filter .16s}.wood-button:hover{filter:brightness(1.07);transform:translateY(-2px)}.wood-button:active,.green-button:active{transform:translateY(3px);box-shadow:inset 0 2px 4px #0003,0 1px 0 #75421f}.icon-button{width:50px;min-width:44px;padding:8px;font-size:24px}.green-button{background:linear-gradient(#cdf44a,#89c91d 55%,#65a711);border:3px solid #53711a;border-radius:20px;box-shadow:inset 0 3px 0 #edff98,0 5px 0 #516d18,0 8px 18px #35501338;color:#193c0a;font-size:clamp(17px,2.4vw,29px);font-weight:1000;padding:15px 36px;transition:transform .15s,filter .15s;min-height:48px}.green-button:hover{filter:brightness(1.08)}
.sunny-menu{position:absolute;inset:0;z-index:50;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.9fr);grid-template-rows:30% 1fr auto;gap:20px 4%;padding:clamp(18px,3vw,48px) max(30px,var(--safe-r)) var(--safe-b) max(30px,var(--safe-l));overflow:hidden;background:#5e7c30 url('art/menu.webp') center/cover no-repeat}
#menu-backdrop-container{display:none}.menu-dapple{position:absolute;inset:-3%;background:linear-gradient(90deg,#102e1333,transparent 58%);pointer-events:none;z-index:-1}.menu-heading{grid-column:1;grid-row:1;align-self:center;z-index:2}.eyebrow{font-size:clamp(9px,.9vw,13px);font-weight:900;letter-spacing:.14em;color:#fff2c8;text-shadow:0 2px 4px #143318}.menu-heading h1{margin:8px 0 5px;line-height:.94;font-size:clamp(32px,5.1vw,80px);font-weight:1000;letter-spacing:-.055em;filter:drop-shadow(0 5px 1px #173317)}.menu-heading h1>span{color:#bde750;-webkit-text-stroke:1.5px #244514;text-shadow:0 2px 0 #ecff93,0 4px 0 #548522}.menu-heading h1 small{display:block;margin-top:9px;font-size:.38em;letter-spacing:0;color:#fff1c7}.menu-heading h1 b{font-size:1.72em;color:#ffcb4a;-webkit-text-stroke:1px #6b3817;margin-left:8px;letter-spacing:-.03em}.menu-heading>p{font-size:clamp(11px,1vw,15px);font-weight:800;color:#fff9e6;text-shadow:0 2px 5px #14270d;margin:16px 0 0}
.menu-levels{grid-column:1;grid-row:2;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:16px;align-self:stretch;z-index:2;min-height:0;padding-bottom:8px}.level-card{position:relative;border-radius:25px;text-align:left;padding:16px 20px;display:flex;align-items:center;gap:14px;transition:transform .18s,filter .18s,box-shadow .18s;min-height:0;overflow:hidden}.level-card:before{content:'';position:absolute;inset:0;background:repeating-linear-gradient(0deg,#a6722110 0px,transparent 1px,transparent 7px);pointer-events:none}.level-card:hover,.level-card:focus-visible{background:linear-gradient(120deg,#eaff9c,#c2ef48 70%,#a5d72c);transform:translateY(-4px);box-shadow:inset 0 0 0 2px #f4ffd7,0 5px 0 #64852c,0 0 24px #daff6780}.level-card:active{transform:translateY(2px)}.level-icon{font-size:clamp(25px,3.6vw,55px);filter:drop-shadow(0 3px 2px #5c491b33)}.level-copy{display:flex;flex-direction:column;position:relative}.level-copy strong{font-size:clamp(15px,2.05vw,30px);font-weight:1000;line-height:1.1;white-space:nowrap}.level-copy b{font-size:clamp(12px,1.6vw,23px);margin-top:4px}.level-copy small{font-size:clamp(10px,.85vw,13px);margin-top:7px;color:#6b602e}.level-mult{position:absolute;bottom:10px;right:15px;font-size:11px;font-weight:900;color:#876128}.level-arrow{position:absolute;top:8px;right:14px;font-size:20px;opacity:.45}.level-3 .level-copy strong{color:#7b3525}
.menu-plant{position:absolute;bottom:10%;left:54%;height:36%;max-width:24%;object-fit:contain;z-index:1;transform-origin:50% 95%;animation:plant-idle 3.2s ease-in-out infinite;filter:drop-shadow(0 16px 10px #1f3d2855);pointer-events:none}.menu-table{grid-column:2;grid-row:2;align-self:end;justify-self:end;width:83%;position:relative;z-index:2;padding:25px;border-radius:22px;transform:rotate(-1deg);margin-bottom:12px}.menu-table h2{font-size:clamp(15px,1.5vw,24px);font-weight:1000;text-align:center;margin:0;white-space:nowrap}.menu-table>p{text-align:center;font-size:12px;color:#887044;margin:5px 0 14px}.table-tabs{display:grid;grid-template-columns:repeat(8,1fr);gap:5px}.tab-num-btn{padding:8px 0;min-height:36px;border:1px solid #c49a65;border-radius:8px;background:linear-gradient(#fff8e2,#f1d5a1);color:#594625;font-size:clamp(14px,1.35vw,22px);font-weight:900;transition:transform .15s,background .15s}.tab-num-btn:hover{transform:translateY(-2px)}.tab-num-btn.bg-yellow-500{background:linear-gradient(#77b532,#3d7b25)!important;color:#fff!important;border-color:#396a26!important;box-shadow:0 3px 6px #37542244}.menu-table #chalkboard-content{display:grid;grid-template-columns:1fr 1fr;gap:3px 18px;margin-top:14px;font-size:clamp(12px,1.2vw,19px);color:#2a5228;font-weight:900}.menu-table #chalkboard-content>div{border-bottom:1px solid #bd955441;display:flex;justify-content:space-between;padding:3px 0}.menu-table #chalkboard-content span{color:var(--ink)!important}.table-rule{display:flex;justify-content:space-between;border-top:1px solid #c89d63;margin-top:12px;padding-top:10px;font-size:12px;font-weight:800}.table-rule b{color:#33711d}.table-close{display:none;position:absolute;right:6px;top:6px;border:0;background:transparent;color:#5b4629;border-radius:10px}
.menu-footer{grid-row:3;grid-column:1/3;display:flex;align-items:center;gap:12px;z-index:3;padding-bottom:8px}.profile-button{min-width:155px}.profile-button>span:nth-child(2){text-align:left;display:flex;flex-direction:column}.profile-button small{font-size:10px;color:#61703b!important;line-height:1.2}.profile-button #profile-widget-name{color:var(--ink)!important;max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.profile-button #profile-widget-avatar{display:block;width:32px;height:32px}.table-toggle{display:none}#screen-menu #profile-widget-btn{position:static!important;padding:7px 15px!important}#screen-menu #profile-widget-avatar{width:32px!important;height:32px!important}#screen-menu #profile-widget-name{font-size:14px!important}
/* Battlefield: artwork underneath the unchanged entity / interaction layers. */
#screen-game{background:#866037;padding-top:env(safe-area-inset-top)}#game-area{background:var(--field-art) center/100% 100% no-repeat!important;box-shadow:none;min-height:0;isolation:isolate}#base-layer{display:none}#lanes-layer{left:0;right:0;pointer-events:none}.lane-bg{background-image:none!important;background-color:transparent!important;border:0;border-bottom:1px solid #ffffe31a;transition:box-shadow .15s,background .15s}.lane-bg:nth-child(even){background-color:#00000008!important}.lane-bg.skin-inactive{background:linear-gradient(90deg,#15220e65,#15220e80)!important}.lane-bg.skin-selected{box-shadow:inset 0 2px 0 #ffe76c,inset 0 -2px 0 #ffe76c,inset 0 0 15px #fbdc3455;background:linear-gradient(90deg,#ffe76c1c,transparent)!important}.lane-bg.error-flash{background-color:#dc393980!important}
#game-hud{height:60px!important;min-height:60px!important;max-height:60px!important;padding:7px var(--safe-r) 7px var(--safe-l)!important;border:0;background:linear-gradient(#b98445,#805021)!important;gap:8px;box-shadow:0 3px 9px #2e251c66;overflow:hidden;color:var(--ink)}#hud-stats-group,#hud-bonuses-group,#hud-controls-group{gap:12px;flex-shrink:0}#hud-stats-group,#hud-bonuses-group{height:44px;background:linear-gradient(#fff5d4,#f2d29c)!important;border:1px solid #a76630;border-radius:12px;padding:4px 13px;box-shadow:inset 0 2px 0 #fff9e8,0 2px 3px #48240b44}#hud-score-pill{color:#355523!important;background:none!important;border:0;padding:0;font-size:22px!important}.hud-stat-item{font-size:17px!important;color:#315029!important}.hud-stat-item:nth-child(3){color:#9d3c26!important}#hud-biome{font-size:11px!important;background:none!important;border:0;color:#594421!important;max-width:160px;padding:0!important}#hud-bonuses-group{margin-left:auto;gap:12px}.hud-bonus-item{font-size:24px!important}.hud-bonus-count{color:#5b401c!important;background:#ebc68b!important;font-size:12px!important;padding:2px 5px!important}#hud-controls-group{gap:5px}#hud-controls-group button{height:42px!important;min-width:42px;padding:8px!important;border:1px solid #aa723b;border-radius:10px;background:linear-gradient(#fff0c8,#e8be80)!important;color:#284725;font-size:16px!important;font-weight:900}#hud-controls-group button:last-child{background:linear-gradient(#c28643,#9d5d28)!important;color:#fff2d1;font-size:13px!important}
#numpad-panel{background:linear-gradient(#b5763c,#925723)!important;border-top:2px solid #e8bc71;padding:10px var(--safe-r) var(--safe-b) var(--safe-l)!important;box-shadow:0 -4px 12px #46301166}#numpad-grid{display:grid;grid-template-columns:repeat(11,minmax(0,1fr))!important;max-width:1600px;width:100%;gap:8px!important}.numpad-btn,.del-btn{height:clamp(52px,9vh,90px);padding:0!important;min-width:0;border:2px solid #c18b4d;border-radius:16px!important;background:linear-gradient(#fff5d6,#f1d29c)!important;color:#143e29!important;font-weight:1000;font-size:clamp(25px,4vw,54px)!important;box-shadow:inset 0 2px 0 #fffce8,0 4px 0 #6c3b1a!important;transition:transform .1s,filter .1s}.numpad-btn:hover{filter:brightness(1.05)}.numpad-btn:active,.del-btn:active,.numpad-btn.key-active{transform:translateY(3px);filter:brightness(.95);box-shadow:inset 0 1px 4px #92572355,0 1px 0 #6c3b1a!important}.del-btn{grid-column:auto!important;background:linear-gradient(#c87350,#a54f37)!important;color:#fff4d7!important;border-color:#d2946b}
.cannon-entity{width:clamp(55px,7.7vw,115px)!important;height:82%!important;max-height:115px;transform:translate(-10%,0);filter:none!important;z-index:3}.cannon-badge,.zombie-badge{background:linear-gradient(#fff8de,#f6d6a0)!important;border:2px solid #9c6532!important;color:#163f29!important;border-radius:9px!important;box-shadow:0 3px 4px #3a281655;font-size:clamp(12px,1.6vw,25px)!important;line-height:1.1;padding:3px 10px!important;bottom:-4px!important;z-index:6;white-space:nowrap}.cannon-badge span{color:#234c2c!important}.cannon-badge{bottom:0!important;left:88%!important;transform:none!important;font-size:clamp(12px,1.3vw,20px)!important}.cannon-entity .skin-plant{width:100%;height:100%;object-fit:contain;transform-origin:45% 92%;animation:plant-idle 2.8s ease-in-out infinite;filter:drop-shadow(0 4px 3px #10271155)}.cannon-entity.skin-shoot .skin-plant{animation:plant-recoil .23s ease-out}.skin-plant{pointer-events:none}.zombie-entity{width:clamp(48px,6vw,96px)!important;height:clamp(65px,13vh,145px)!important;top:calc(var(--lane)*20% + 10%)!important;transform:translate(-25%,-52%);overflow:visible!important}.zombie-entity>div:first-child{height:100%}.zombie-badge{bottom:-7px!important}.skin-zombie{display:block;width:100%;height:100%;position:relative;filter:drop-shadow(0 4px 3px #18200c55)}.zombie-atlas{width:100%;height:100%;background-image:url('art/zombies.webp');background-size:400% 400%;background-position-y:var(--sprite-row);background-repeat:no-repeat;animation:zombie-walk .95s steps(1,end) infinite;transform-origin:50% 95%}.boss-entity .skin-zombie{filter:drop-shadow(0 8px 5px #18200c77)}.boss-entity{width:clamp(85px,12vw,170px)!important;height:60%!important;top:20%!important;max-height:360px;transform:translateX(-25%)}.boss-entity>div:first-child{transform:none!important}.boss-entity .zombie-atlas{animation-duration:1.3s}#boss-badge{font-size:clamp(21px,3vw,38px)!important;background:var(--cream)!important;color:var(--ink)!important;border:3px solid #9c6532!important;bottom:28px;box-shadow:0 3px 6px #29170a66}#boss-hp-wrap{background:#602e1e!important;border-color:#ffdfa0!important;height:17px;bottom:0}#boss-hp-bar{background:linear-gradient(#d77a43,#b44b28)!important}.mower-entity{width:clamp(40px,6vw,90px)!important;height:clamp(40px,10vh,85px)!important;top:calc(var(--lane)*20% + 10%)!important;transform:translate(-32%,-43%)}.skin-mower{height:100%;width:100%;object-fit:contain;filter:drop-shadow(0 4px 3px #272c1655)}.mower-body{height:100%}.mower-wheel{display:none}.mower-shake{animation:mower-vibrate .12s linear infinite!important}.car-effect,.jet-effect{filter:drop-shadow(0 7px 5px #151c1355)}
/* Results / overlays */
.skin-dialog{position:absolute;inset:0;z-index:55;display:flex;align-items:center;justify-content:center;padding:14px max(20px,var(--safe-r)) max(14px,var(--safe-b)) max(20px,var(--safe-l));background:#15200b94;backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px)}.defeat-dialog{background:linear-gradient(#12220c8c,#16220fbd),url('art/lawn.webp') center/cover;z-index:45}.result-card{width:min(960px,90%);max-height:94%;border:7px solid #a56832;border-radius:34px;position:relative;text-align:center;padding:22px 40px 24px;box-shadow:inset 0 0 0 3px #ffe9b2,0 8px 0 #653c20,0 20px 70px #12220c80;animation:card-enter .38s cubic-bezier(.18,.9,.3,1.2);overflow:visible}.result-card header h2{font-size:clamp(26px,4.6vw,64px);font-weight:1000;letter-spacing:-.04em;margin:0;line-height:1.05;color:#b64c2b;text-shadow:0 2px 0 #fff5dd}.result-card header p{font-size:clamp(14px,2vw,27px);font-weight:900;margin:10px 0 20px}.result-body{display:grid;grid-template-columns:1fr 1.45fr;gap:20px}.score-card,.result-stat{border:1px solid #d4aa67;border-radius:20px;background:linear-gradient(125deg,#fff6da,#f4d49a);box-shadow:inset 0 2px 0 #fff8e7,0 3px 7px #79532922}.score-card{padding:10px;display:flex;flex-direction:column;align-items:center;justify-content:center}.score-star{font-size:clamp(35px,5vw,75px);color:#ffcf31;text-shadow:0 2px 0 #bb7b1c,0 0 25px #fff86b}.score-card h3{font-size:clamp(12px,1.5vw,21px);font-weight:900;margin:5px}.score-card>strong{font-size:clamp(38px,6vw,80px);line-height:1.1}.result-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.result-stat{padding:12px 5px;display:flex;flex-direction:column;justify-content:center}.result-stat>span{font-size:clamp(22px,3vw,38px)}.result-stat small{font-size:clamp(11px,1.4vw,18px);font-weight:900}.result-stat strong{font-size:clamp(21px,3vw,38px);line-height:1.1}.result-card>.green-button{margin-top:22px;min-width:42%}.defeat-plant{position:absolute;width:23%;bottom:-4%;left:-15%;transform:rotate(-12deg);filter:drop-shadow(0 5px 10px #1b381e88);pointer-events:none}.victory-card header h2{color:#d88c18}.victory-card .eyebrow{color:#967039;text-shadow:none}.victory-card header p{margin:7px 0}.victory-body{display:grid;grid-template-columns:1.5fr 1fr;gap:25px;align-items:center;max-height:32vh}.victory-plant{height:26vh;width:100%;object-fit:contain;animation:plant-idle 2.7s infinite ease-in-out;filter:drop-shadow(0 9px 5px #2a531b33)}#zombie-note-box{background:#ffe9b5!important;border:1px dashed #ae7737!important;border-radius:5px;padding:20px!important;box-shadow:0 5px 8px #6e441a22;transform:rotate(-2deg);position:relative;text-align:left}#zombie-note-box h3{font-size:clamp(12px,1.5vw,19px);font-weight:900;border-bottom:2px solid #bf8c44;padding-bottom:8px;color:#765021}#zombie-note-text{font-size:clamp(13px,1.7vw,24px)!important;font-weight:800;line-height:1.4;color:#523c1d!important;margin-top:10px}#zombie-note-box>span{position:absolute;right:12px;bottom:0;font-size:26px;opacity:.3}#stage-next-biome{margin:18px 0 0!important;font-size:clamp(12px,1.5vw,21px)!important;font-weight:900;color:#4b5a29!important}.celebration{position:absolute;inset:0;pointer-events:none;font-size:28px;color:#d8a124;overflow:hidden}.celebration>i{position:absolute;left:10%;top:5%;animation:confetti-fall 4s linear infinite;font-style:normal}.celebration>i:nth-child(2){left:30%;animation-delay:-2s;color:#97b730}.celebration>i:nth-child(3){left:70%;animation-delay:-1s}.celebration>i:nth-child(4){left:85%;animation-delay:-3s;color:#6b9c2d}.celebration>i:nth-child(5){left:95%;animation-delay:-1.7s}.help-card{position:relative;padding:30px;border-radius:25px;max-width:650px;max-height:95%;overflow-y:auto;text-align:center}.help-card .table-close{display:block}.help-card .eyebrow{color:#82703b;text-shadow:none}.help-card h2{font-size:25px;font-weight:1000;margin:12px}.help-equation{font-size:40px;font-weight:1000;background:#f4d79f;padding:15px;border-radius:14px}.help-equation span{color:#a77a32}.help-card p{margin:14px 0;font-weight:700;line-height:1.5}.help-bonuses{font-size:25px;margin:15px}.help-card .green-button{font-size:20px}
/* Restyle existing profile / leaderboard without changing their behavior. */
#screen-leaderboard{background:linear-gradient(#173513b3,#173513c4),url('art/menu.webp') center/cover!important;color:var(--ink)}#leaderboard-card,#profile-modal-card,#modal-password>div,#modal-ios-fullscreen>div{background:linear-gradient(120deg,#fff3d1,#efd29f)!important;border:4px solid #996332!important;box-shadow:inset 0 0 0 2px #ffefc5,0 8px 0 #654020,0 20px 50px #14230f66;border-radius:24px!important;color:var(--ink);max-height:92%;overflow-y:auto}#leaderboard-card [class*=text-],#profile-modal-card [class*=text-],#modal-password [class*=text-],#modal-ios-fullscreen [class*=text-]{color:var(--ink)!important}#leaderboard-card button,#profile-modal-card button,#modal-password button,#modal-ios-fullscreen button{min-height:40px;background:#f6dca8!important;color:var(--ink)!important;border:1px solid #bb8c50!important;border-radius:10px;box-shadow:0 2px 0 #ae7b3a}#profile-save-btn{background:#a7d53d!important}#leaderboard-table-wrap,#profile-pincode-wrap,#profile-modal-card label,#lb-weekly-banner,#lb-reset-timer{background:#f9e6be!important;border-color:#d8b57b!important;color:var(--ink)!important}#leaderboard-table-wrap thead{background:#e8c48b!important;color:var(--ink)!important}#leaderboard-table-wrap td{border-color:#d4ae72!important}#leaderboard-table-wrap tr{border-color:#d4ae72!important}#profile-modal-card input,#modal-password input{background:#fff8e4!important;border-color:#b98d4f!important;color:var(--ink)!important}#profile-modal-card .avatar-option-btn{background:#f8e5bd!important}#profile-modal-card .avatar-option-btn.bg-emerald-700\/60{background:#c7e677!important}#profile-status-msg{background:#fff0cd!important}#rotate-warning{background:linear-gradient(#173718b8,#173718e8),url('art/menu.webp') center/cover!important;color:#fff2d4}#rotate-warning h2{color:#e4f197!important}#rotate-warning p{color:#fff2d4!important}#rotate-warning button{background:#8fbd33!important;color:#163d21!important;border-color:#d0e993!important}
/* Landscape tablets and phones. Portrait remains the original rotate prompt. */
@media(max-width:1100px){.sunny-menu{gap:14px 3%;padding-left:var(--safe-l);padding-right:var(--safe-r)}.level-card{padding:13px;gap:8px}.level-copy small{display:none}.menu-table{width:90%;padding:16px}.menu-footer{gap:8px}.wood-button{padding:8px 12px;min-height:44px}.menu-table h2{font-size:17px}#hud-biome{display:none!important}.hud-stat-item{font-size:15px!important}#hud-stats-group,#hud-bonuses-group{gap:10px;padding:4px 10px}#hud-score-pill{font-size:20px!important}.result-card{width:90%;padding:18px 28px}}
@media(max-height:600px) and (orientation:landscape){.sunny-menu{grid-template-columns:55% 1fr;grid-template-rows:28% 1fr auto;gap:10px;padding-top:10px;padding-bottom:var(--safe-b)}.menu-heading h1{font-size:clamp(28px,5vw,54px);margin:3px 0}.menu-heading h1 small{margin-top:5px}.menu-heading>p,.menu-heading .eyebrow{display:none}.menu-levels{gap:10px;padding-bottom:0}.level-card{border-radius:17px;padding:8px 12px;gap:10px}.level-icon{font-size:30px}.level-copy strong{font-size:clamp(15px,2vw,23px)}.level-copy b{font-size:clamp(12px,1.5vw,17px);margin-top:2px}.level-copy small,.level-mult,.level-arrow{display:none}.menu-plant{height:48%;left:60%;bottom:17%;max-width:28%}.menu-table{display:none}.menu-footer{padding-bottom:0;gap:6px}.menu-footer .wood-button{height:44px;min-height:44px;padding:5px 9px;border-radius:12px;font-size:12px}.menu-footer .icon-button{width:44px;min-width:44px;font-size:22px}.profile-button{min-width:130px}.table-toggle{display:inline-flex;margin-left:auto}#screen-menu #profile-widget-btn{padding:4px 8px!important}#screen-menu #profile-widget-avatar{height:28px!important;width:28px!important}#screen-menu #profile-widget-name{font-size:12px!important}.menu-table.table-open{display:block;position:absolute;z-index:20;left:50%;top:50%;transform:translate(-50%,-50%);width:min(510px,90%);margin:0;padding:18px 25px;box-shadow:0 0 0 200vmax #11260bbd,0 10px 30px #0005;max-height:92%;overflow:auto}.table-open .table-close{display:block}.table-open h2{font-size:20px}.table-open #chalkboard-content{font-size:16px}.table-open .tab-num-btn{min-height:36px}.table-open>p{margin:3px 0 8px}.table-open #chalkboard-content{margin-top:8px}.table-rule{margin-top:6px;padding-top:6px}#game-hud{height:44px!important;min-height:44px!important;max-height:44px!important;padding:3px var(--safe-r) 3px var(--safe-l)!important;gap:5px}#hud-stats-group,#hud-bonuses-group{height:36px;padding:3px 7px;gap:8px;border-radius:9px}#hud-score-pill{font-size:17px!important}.hud-stat-item{font-size:13px!important}#hud-bonuses-group{gap:7px}.hud-bonus-item{font-size:18px!important}.hud-bonus-count{font-size:10px!important;padding:1px 3px!important}#hud-controls-group button{height:36px!important;min-width:36px;padding:4px!important;font-size:18px!important}#hud-controls-group button:last-child{font-size:11px!important}#numpad-panel{padding:6px var(--safe-r) var(--safe-b) var(--safe-l)!important}#numpad-grid{gap:6px!important}.numpad-btn,.del-btn{height:48px;border-radius:10px!important;font-size:29px!important}.cannon-entity{width:7.5vw!important;height:85%!important;max-height:none}.cannon-badge{font-size:12px!important;padding:2px 5px!important;border-width:1px!important}.zombie-entity{width:6vw!important;height:17vh!important}.zombie-badge{font-size:14px!important;padding:2px 7px!important;bottom:-4px!important;border-width:1px!important}.mower-entity{width:6vw!important;height:13vh!important}.result-card{width:min(770px,88%);padding:12px 24px;border-width:5px;border-radius:24px;max-height:96%}.result-card header h2{font-size:34px}.result-card header p{font-size:17px;margin:5px 0 10px}.result-body{gap:14px}.score-star{font-size:36px}.score-card h3{font-size:12px}.score-card>strong{font-size:45px}.result-stats{gap:6px}.result-stat{padding:5px}.result-stat>span{font-size:22px}.result-stat small{font-size:11px}.result-stat strong{font-size:23px}.result-card>.green-button{font-size:19px;padding:9px 26px;min-height:44px;margin-top:12px}.victory-card .eyebrow{display:none}.victory-body{max-height:none;gap:16px;grid-template-columns:1.6fr 1fr}.victory-plant{height:30vh}#zombie-note-box{padding:10px 14px!important}#zombie-note-box h3{font-size:12px;padding-bottom:4px}#zombie-note-text{font-size:14px!important;line-height:1.3;margin-top:6px}#stage-next-biome{font-size:13px!important;margin-top:7px!important}.defeat-plant{width:19%;left:-12%;bottom:0}#profile-modal-card,#leaderboard-card{padding:14px!important;max-height:96%}#leaderboard-table-wrap{max-height:48vh}.help-card{padding:15px 30px}.help-card h2{font-size:20px;margin:5px}.help-equation{font-size:27px;padding:5px}.help-card p{font-size:13px;margin:8px 0}.help-bonuses{font-size:19px;margin:5px}.help-card .green-button{padding:8px 20px;font-size:16px;min-height:40px}}
@media(max-width:740px) and (orientation:landscape){.sunny-menu{grid-template-columns:58% 1fr}.menu-footer .profile-button{min-width:44px}#screen-menu #profile-widget-btn>span:nth-child(2),#screen-menu #profile-widget-btn>span:last-child{display:none}.table-toggle{font-size:10px!important}.menu-footer #leaderboard-btn{font-size:11px}.level-icon{font-size:24px}.level-card{gap:6px}.level-copy strong{font-size:16px}.level-copy b{font-size:13px}#hud-stats-group{gap:6px;padding:3px 5px}.hud-stat-item{font-size:12px!important}#hud-score-pill{font-size:15px!important}#hud-bonuses-group{gap:4px;padding:3px 4px}.hud-bonus-item{font-size:15px!important}.hud-bonus-count{font-size:9px!important}#hud-controls-group{gap:3px}#hud-controls-group button{min-width:32px}#hud-controls-group button:first-child{display:none}.result-card header h2{font-size:29px}.result-card header p{font-size:15px}.cannon-badge{left:76%!important}.table-toggle b{font-size:10px}}
@media(max-height:350px) and (orientation:landscape){.menu-heading h1{font-size:30px}.menu-footer .wood-button{height:40px;min-height:40px}.menu-levels{gap:7px}.level-card{padding:5px 10px}.level-copy strong{font-size:15px}.level-copy b{font-size:12px}.level-icon{font-size:23px}#game-hud{height:39px!important;min-height:39px!important;max-height:39px!important}#hud-stats-group,#hud-bonuses-group{height:32px}#hud-controls-group button{height:32px!important}.numpad-btn,.del-btn{height:44px;font-size:26px!important}.result-card{padding:8px 20px}.result-card header h2{font-size:26px}.result-card header p{margin:3px 0 6px}.score-card>strong{font-size:34px}.score-star{font-size:24px}.result-stat>span{font-size:18px}.result-stat strong{font-size:19px}.result-card>.green-button{margin-top:8px;min-height:40px;font-size:17px}.victory-plant{height:25vh}#zombie-note-text{font-size:12px!important}}
@media(orientation:portrait){#rotate-warning{display:flex!important}}
@keyframes plant-idle{0%,100%{transform:rotate(-2deg) scaleY(1)}50%{transform:rotate(2deg) scaleY(.97)}}@keyframes plant-recoil{0%{transform:translateX(0)}25%{transform:translateX(-8%) rotate(-7deg) scaleX(.94)}100%{transform:translateX(0)}}@keyframes zombie-walk{0%,100%{background-position-x:0%}25%{background-position-x:33.333333%}50%{background-position-x:66.666667%}75%{background-position-x:100%}}@keyframes mower-vibrate{0%,100%{transform:translateY(-1px) rotate(-1deg)}50%{transform:translateY(1px) rotate(1deg)}}@keyframes card-enter{from{opacity:0;transform:translateY(20px) scale(.92)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes confetti-fall{from{transform:translateY(-50px) rotate(0);opacity:0}15%{opacity:.8}to{transform:translateY(400px) rotate(250deg);opacity:0}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}}
html,body{font-family:Nunito,'Trebuchet MS',Arial,sans-serif}
.menu-table .tab-num-btn{color:#594625!important;font-weight:900}
.menu-table .tab-num-btn.bg-yellow-500{color:white!important}
#game-area{background-size:100% 145%!important;background-position:center 60%!important}
.cannon-badge,.zombie-badge{line-height:1.1!important}
.zombie-entity{height:calc(var(--lane-px,90px)*.94)!important;width:calc(var(--lane-px,90px)*.7)!important;transform:translate(-25%,-55%)}
.zombie-badge{bottom:0!important}
@media(max-height:600px) and (orientation:landscape){#menu-table.table-open{position:fixed;grid-area:auto;left:50%;top:50%;width:min(510px,90vw);max-height:92dvh;transform:translate(-50%,-50%);margin:0}.table-open .table-close{top:3px;right:3px}}

/* Approved Sunny Garden art: full framed illustrations with live controls. */
.garden-avatar{display:block;width:100%;height:100%;aspect-ratio:1;border-radius:50%;background-image:url('art/avatars.webp');background-repeat:no-repeat;background-size:445% 297%;background-position:var(--ax) var(--ay);overflow:hidden}
.bonus-art{display:inline-block;width:1.8em;height:1.4em;object-fit:contain;vertical-align:middle}.hud-bonus-item{display:flex;align-items:center}.result-stat .bonus-art{width:2.3em;height:1.6em;margin:auto}.transport-art{width:100%;height:100%;object-fit:contain;pointer-events:none}
#screen-menu.sunny-menu{display:block;padding:0;background-position:center;background-size:cover}
.menu-heading{position:absolute;left:2.5%;top:2%;width:52%;height:34%;display:flex;flex-direction:column;justify-content:center;align-items:center}
.menu-heading h1{width:100%;height:86%;margin:0!important;filter:none;line-height:1}.menu-heading h1 img{width:100%;height:100%;object-fit:contain}
.menu-heading>p{display:block!important;margin:0!important;background:linear-gradient(#fff0ca,#efd197);border:2px solid #ac783d;box-shadow:0 3px 0 #674525;border-radius:6px;padding:3px 25px;color:#583516;text-shadow:none;font-size:clamp(10px,1.65vw,26px);font-weight:900}
.menu-levels{position:absolute;left:2.5%;top:39%;width:47%;height:43%;gap:1.3vh 1vw;padding:0}
.level-card{background:transparent url('art/cream-button.webp') center/100% 115% no-repeat!important;border:0;box-shadow:none!important;border-radius:20px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:0;padding:7% 5%;overflow:visible}
.level-card:before{display:none}.level-card:hover,.level-card:focus-visible{filter:sepia(.25) saturate(2) hue-rotate(26deg) drop-shadow(0 0 7px #e7ff75);transform:translateY(-3px)}
.level-icon{width:clamp(25px,4.1vw,64px);height:clamp(25px,4.1vw,64px);display:block;font-size:0;filter:none}.level-icon img{width:100%;height:100%;object-fit:contain}.level-copy strong{font-size:clamp(16px,2.4vw,38px);font-weight:1000;letter-spacing:-.035em;color:#153d1b;text-shadow:0 2px #fff9df}
.level-copy b{font-size:clamp(11px,1.65vw,26px);margin-top:1px;color:#664322}.level-copy small,.level-mult,.level-arrow{display:none!important}.level-3 .level-copy strong{color:#153d1b}
.menu-plant{left:50%;bottom:12%;height:37%;max-width:23%;z-index:1}
#menu-table{display:block;position:absolute;left:auto;top:44%;right:1.5%;bottom:14%;width:29%;padding:7% 2.8% 2%;margin:0;border:0;border-radius:0;box-shadow:none;background:transparent url('art/table-frame.webp') center/100% 100% no-repeat;transform:rotate(-2deg);z-index:3}
#menu-table h2{position:absolute;top:10%;left:11%;width:78%;white-space:normal;font-size:clamp(11px,1.45vw,24px);line-height:1.05;text-align:center;font-weight:1000}
#menu-table>p,.table-rule{display:none}.table-expand{position:absolute;bottom:9%;left:25%;width:50%;font-size:clamp(9px,.9vw,14px);font-weight:900;border-bottom:1px solid #9d773f;color:#6d4c25;background:none}
.table-tabs{gap:2px}.tab-num-btn{min-height:24px;padding:3px 0;font-size:clamp(11px,1.3vw,21px);border-radius:5px}
#menu-table #chalkboard-content{display:flex;flex-direction:column;gap:1px;font-size:clamp(12px,1.8vw,29px);margin-top:5px;font-weight:1000}
#menu-table:not(.table-open) #chalkboard-content>div{display:none}#menu-table:not(.table-open) #chalkboard-content>div:nth-child(n+5):nth-child(-n+7){display:flex;justify-content:center;gap:5px;border:0;padding:0}
.menu-footer{position:absolute;left:2.5%;right:auto;width:47%;bottom:3.5%;height:9%;padding:0;gap:8px;grid-area:auto}
.menu-footer .wood-button{background:transparent url('art/cream-button.webp') center/100% 115% no-repeat;border:0;box-shadow:none;padding:6px 10px;min-height:40px;height:100%;border-radius:12px;font-weight:1000}
.menu-footer #leaderboard-btn{font-size:clamp(11px,1.5vw,24px)}.profile-button{min-width:100px;flex:1}.menu-footer .icon-button{width:clamp(38px,4vw,65px);min-width:38px;font-size:clamp(18px,2vw,30px)}.table-toggle{display:none!important}
#screen-menu #profile-widget-btn{padding:5px 10px!important}#screen-menu #profile-widget-name{font-size:clamp(11px,1.3vw,21px)!important}#screen-menu #profile-widget-avatar{width:clamp(25px,3vw,48px)!important;height:clamp(25px,3vw,48px)!important}.profile-button small{display:none}
#menu-table.table-open{display:block;position:fixed;inset:auto;left:50%;top:50%;width:min(580px,92vw);height:min(450px,92dvh);max-height:92dvh;padding:70px 55px 45px;transform:translate(-50%,-50%);z-index:50;overflow:auto;box-shadow:0 0 0 200vmax #18270cbd;background-size:100% 100%}
#menu-table.table-open h2{font-size:20px;top:8%}.table-open .table-close{display:block;top:9%;right:10%;font-size:20px;width:24px;height:24px;min-height:24px;padding:0;background:none}.table-open .table-expand{display:none}
#menu-table.table-open #chalkboard-content{display:grid;grid-template-columns:1fr 1fr;gap:5px 20px;font-size:20px}.table-open .tab-num-btn{min-height:34px;font-size:18px}
/* No zoom: the house, rear fence, horizon and flower borders remain visible. */
#game-area{background-size:100% 100%!important;background-position:center!important;--lane-px:70px}
#lanes-layer{z-index:1}.lane-bg{left:18%;width:79%;right:3%;border-bottom:1px solid #ffffcf55;background:transparent!important;box-shadow:inset 0 1px #5d6b3033}
.lane-bg:nth-child(even){background:#ffffff06!important}.lane-bg.skin-selected{background:#ffdf4310!important;box-shadow:inset 0 2px #ffe56c,inset 0 -2px #ffe56c,0 0 6px #ffd84b66}
.lane-bg.skin-inactive{border:0;background:transparent!important;box-shadow:none;pointer-events:none}
.lane-bg.skin-inactive:after{content:'';position:absolute;left:0;right:0;top:-40%;height:180%;background:url('art/garden-bed.webp') center/100% 100% no-repeat}
#game-area[data-biome=ice] .lane-bg.skin-inactive:after{filter:saturate(.35) brightness(1.45)}#game-area[data-biome=ash] .lane-bg.skin-inactive:after{filter:saturate(.35) brightness(.65)}
.lane-hit{overflow:visible;z-index:35}.cannon-entity{width:calc(var(--lane-px)*1.12)!important;height:calc(var(--lane-px)*1.12)!important;max-height:none!important;transform:translate(-18%,-7%);overflow:visible}
.cannon-badge{font-size:clamp(12px,1.25vw,22px)!important;bottom:0!important;left:85%!important;line-height:1.05!important;padding:2px 6px!important}
.zombie-entity{height:calc(var(--lane-px)*1.95)!important;width:calc(var(--lane-px)*1.65)!important;top:calc(var(--lane)*15% + 37%)!important;transform:translate(-30%,-87%)!important;overflow:visible!important}
.skin-zombie{width:100%;height:100%;overflow:visible;filter:drop-shadow(0 3px 2px #15220b44)}.skin-zombie img{width:100%;height:100%;object-fit:contain;transform-origin:52% 85%;animation:zombie-shamble .8s ease-in-out infinite;animation-delay:var(--step-delay,0s)}
.zombie-badge{bottom:7%!important;font-size:clamp(13px,1.65vw,26px)!important;line-height:1.05!important;padding:2px 8px!important}
.mower-entity{height:calc(var(--lane-px)*1.24)!important;width:calc(var(--lane-px)*1.65)!important;top:calc(var(--lane)*15% + 35%)!important;transform:translate(-42%,-65%)!important;overflow:visible}
.boss-entity{width:min(38vw,calc(var(--lane-px)*4.5))!important;height:calc(var(--lane-px)*3.2)!important;max-height:none;top:24%!important;transform:translateX(-30%)!important}
.skin-boss,.skin-boss img{height:100%;width:100%;object-fit:contain}.skin-boss img{transform-origin:50% 95%;animation:boss-step 1.3s ease-in-out infinite}#boss-badge{bottom:10%!important;line-height:1.1!important}#boss-hp-wrap{bottom:3%;width:75%;height:13px}
.car-effect{width:calc(var(--lane-px)*2.5)!important;height:calc(var(--lane-px)*1.8)!important;top:calc(var(--lane)*15% + 37%)!important;transform:translateY(-80%)}.combine-art{animation:harvester-rumble .12s infinite alternate}
.jet-effect{width:clamp(160px,28vw,420px)!important;height:clamp(100px,22vw,300px)!important;top:7%!important;filter:drop-shadow(20px 35px 12px #1c321a66)}.cornplane-art{animation:corn-flight .8s ease-in-out infinite alternate}
@keyframes zombie-shamble{0%,100%{transform:translateY(0) rotate(-3deg)}50%{transform:translateY(-4%) rotate(3deg)}}
@keyframes boss-step{0%,100%{transform:translateY(0) rotate(-1deg)}50%{transform:translateY(-3%) rotate(1deg)}}@keyframes harvester-rumble{to{transform:translateY(-2%) rotate(.8deg)}}@keyframes corn-flight{to{transform:translateY(-5%) rotate(-3deg)}}
/* Result panels use the approved illustrated framing, not a generic card. */
.result-card{container-type:inline-size;width:min(96vw,164vh)!important;aspect-ratio:1672/941;height:auto!important;max-height:none!important;padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background-color:transparent!important;background-size:100% 100%!important;background-position:center!important;overflow:visible!important}
.defeat-card{background-image:url('art/defeat-panel.webp')!important}.victory-card{background-image:url('art/victory-panel.webp')!important}
.result-card header h2{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.result-card .eyebrow,.defeat-plant,.victory-plant{display:none!important}
.result-card header p{position:absolute;left:22%;right:16%;top:25%;margin:0!important;font-size:2.1cqw;font-weight:1000}
.result-body{position:absolute;left:24%;top:35%;width:58%;height:40%;grid-template-columns:1fr 1.6fr;gap:1cqw}
.score-card,.result-stat{border-radius:1.2cqw;border-color:#d5ae6c;background:linear-gradient(#fff0cb,#f5d89e);box-shadow:inset 0 2px #fff8e2,0 3px 5px #7c551f22;padding:.6cqw}
.score-star{font-size:5cqw;line-height:1}.score-card h3{font-size:1.3cqw;margin:.4cqw 0}.score-card>strong{font-size:6.5cqw}.result-stats{gap:.6cqw}.result-stat>span{font-size:2.3cqw;line-height:1}.result-stat small{font-size:1.15cqw;line-height:1.2}.result-stat strong{font-size:2.6cqw;line-height:1.05}
#gameover-btn{position:absolute;left:34%;top:79%;width:31%;height:14%;padding:0;min-height:0;min-width:0;margin:0;background:transparent;border:0;box-shadow:none;color:#fff1c3;font-size:3cqw;text-shadow:0 3px #274415;font-weight:1000}
#gameover-btn:hover{filter:brightness(1.15);transform:scale(1.03)}
.victory-card header p{top:30%;left:10%;right:10%;font-size:2cqw}.victory-body{position:static;display:block;max-height:none}
#zombie-note-box{position:absolute;left:17%;top:41%;width:25%;height:28%;padding:0!important;transform:rotate(-5deg);background:transparent!important;border:0!important;box-shadow:none!important;overflow:auto}
#zombie-note-box h3{font-size:1.35cqw;color:#68411e;padding-bottom:.3cqw;border-bottom:1px solid #a97a39}#zombie-note-text{font-size:1.5cqw!important;line-height:1.3;margin-top:.5cqw}#zombie-note-box>span{display:none}
#stage-next-biome{position:absolute;left:12%;right:12%;top:75%;margin:0!important;font-size:1.6cqw!important;color:#274420!important}
#stage-clear-btn{position:absolute;left:29%;top:83%;width:43%;height:11%;min-height:0;min-width:0;margin:0;padding:0;font-size:2.3cqw;border:.35cqw solid #95632d;box-shadow:0 .4cqw 0 #63451e,inset 0 .3cqw #efff9f;border-radius:2cqw}
@media(max-height:600px) and (orientation:landscape){
 .menu-heading{height:35%;top:1%}.menu-heading>p{font-size:12px;padding:1px 20px}.menu-levels{top:39%;height:43%}.level-card{padding:5%}.level-icon{width:30px;height:30px}.level-copy strong{font-size:clamp(16px,2.4vw,24px)}.level-copy b{font-size:clamp(11px,1.6vw,16px)}
 #menu-table{top:40%;bottom:14%;padding-top:6.5%;width:30%;transform:rotate(-2deg)}#menu-table h2{font-size:12px}.tab-num-btn{min-height:22px;font-size:11px;padding:2px 0}#menu-table #chalkboard-content{font-size:16px;margin-top:3px}.table-expand{font-size:10px}.menu-plant{height:40%;left:49%;bottom:13%;max-width:23%}
 .menu-footer{width:49%;height:10%;bottom:3%;gap:4px}.menu-footer .wood-button{height:100%;min-height:36px;padding:4px 6px}.menu-footer #leaderboard-btn{font-size:11px}.menu-footer .icon-button{width:36px;min-width:32px;font-size:19px}.profile-button{min-width:80px}.menu-footer #profile-widget-btn>span:last-child{display:none}.menu-footer #profile-widget-btn>span:nth-child(2){display:flex!important}
 #menu-table.table-open{inset:auto;left:50%;top:50%;height:94dvh;width:min(540px,94vw);padding:55px 50px 25px;transform:translate(-50%,-50%)}#menu-table.table-open h2{top:8%;font-size:18px}#menu-table.table-open #chalkboard-content{font-size:17px;gap:3px 20px}.table-open .tab-num-btn{min-height:30px;font-size:16px}
 .result-card{width:min(96vw,164vh)!important}.skin-dialog{padding:0}.cannon-badge{font-size:12px!important}.zombie-badge{font-size:15px!important}
}
@media(max-width:740px) and (orientation:landscape){.menu-footer #profile-widget-btn>span:nth-child(2){display:none!important}.profile-button{min-width:36px;flex:0}.menu-footer{width:48%;gap:3px}.level-icon{height:24px;width:24px}.menu-heading>p{font-size:10px}#menu-table{width:31%;padding-left:3%;padding-right:3%}#menu-table h2{font-size:10px}#menu-table #chalkboard-content{font-size:13px}.table-expand{font-size:9px}.menu-table .tab-num-btn{font-size:10px;min-height:20px}}
@media(prefers-reduced-motion:reduce){.skin-zombie img,.skin-boss img,.transport-art{animation:none!important}}
/* Final scale pass: feet stay on their lane while heads extend above. */
.zombie-entity{height:calc(var(--lane-px)*2.5)!important;width:calc(var(--lane-px)*2.2)!important;transform:translate(-32%,-87%)!important}
.cannon-entity{width:calc(var(--lane-px)*1.5)!important;height:calc(var(--lane-px)*1.5)!important;transform:translate(-18%,-10%)}
.mower-entity{width:calc(var(--lane-px)*2.2)!important;height:calc(var(--lane-px)*1.7)!important;transform:translate(-46%,-65%)!important}
#menu-table:not(.table-open){padding-top:5.5%}
#menu-table:not(.table-open) .table-expand{bottom:8%;font-size:clamp(9px,.85vw,13px)}
@media(max-height:600px) and (orientation:landscape){#menu-table:not(.table-open){padding-top:5.6%}#menu-table:not(.table-open) #chalkboard-content{font-size:14px;line-height:1.35}.cannon-badge{left:78%!important}}
#menu-table.table-open{padding-top:100px}
#menu-table.table-open h2{top:14%;font-size:18px;pointer-events:none}
#menu-table.table-open .table-close{z-index:5;right:6%;top:7%;width:34px;height:34px;border-radius:50%;background:#fff1cf;box-shadow:0 2px 4px #54321555;color:#45351b;font-size:22px;display:block}
@media(max-height:600px) and (orientation:landscape){#menu-table.table-open{padding-top:70px}#menu-table.table-open h2{top:13%;font-size:16px}}
#menu-table:not(.table-open) #chalkboard-content>div{padding:0!important;line-height:1.25}
#menu-table:not(.table-open) .table-expand{bottom:-9%;left:25%;width:50%;padding:2px 5px;border:1px solid #9d773f;border-radius:6px;background:#fff0cb;line-height:1.25}

/* Each type has its own four-frame strip. Quarter-cell boundaries never cross. */
.zombie-entity{width:calc(var(--lane-px)*1.65)!important;height:calc(var(--lane-px)*2.2)!important}
.zombie-walk-strip{width:100%;height:100%;background-size:400% 100%;background-repeat:no-repeat;animation:garden-walk-cycle .88s steps(1,end) infinite;animation-delay:var(--step-delay,0s)}
.zombie-football .zombie-walk-strip{animation-duration:.64s}
@keyframes garden-walk-cycle{0%{background-position:0% 0}25%{background-position:33.333333% 0}50%{background-position:66.666667% 0}75%{background-position:100% 0}100%{background-position:0% 0}}
/* Keep the whole answer beside the plant, including its idle sway. */
.cannon-badge{left:calc(100% + 8px)!important;top:50%!important;bottom:auto!important;transform:translateY(-50%)!important;min-width:76px;width:max-content;min-height:30px;padding:4px 9px!important;font-size:clamp(17px,2vw,26px)!important;line-height:1.2!important;letter-spacing:.02em;font-variant-numeric:tabular-nums;z-index:50;box-shadow:0 2px 0 #6d4b24,0 3px 7px #24351555!important}
.mower-entity{width:calc(var(--lane-px)*1.3)!important;height:calc(var(--lane-px)*1.05)!important;transform:translate(-36%,-65%)!important}
@media(prefers-reduced-motion:reduce){.zombie-walk-strip{animation:none!important}}

/* Sixteen individually drawn poses; the gait changes every 65 ms. */
.zombie-walk-strip{background-size:400% 400%;animation:garden-walk-16 1.04s steps(1,end) infinite;animation-delay:var(--step-delay,0s)}
.zombie-football .zombie-walk-strip{animation-duration:.8s}
@keyframes garden-walk-16{0%{background-position:0% 0%}
6.25%{background-position:33.333333333333336% 0%}
12.5%{background-position:66.66666666666667% 0%}
18.75%{background-position:100% 0%}
25%{background-position:0% 33.333333333333336%}
31.25%{background-position:33.333333333333336% 33.333333333333336%}
37.5%{background-position:66.66666666666667% 33.333333333333336%}
43.75%{background-position:100% 33.333333333333336%}
50%{background-position:0% 66.66666666666667%}
56.25%{background-position:33.333333333333336% 66.66666666666667%}
62.5%{background-position:66.66666666666667% 66.66666666666667%}
68.75%{background-position:100% 66.66666666666667%}
75%{background-position:0% 100%}
81.25%{background-position:33.333333333333336% 100%}
87.5%{background-position:66.66666666666667% 100%}
93.75%{background-position:100% 100%}
100%{background-position:0% 0%}}
@media(prefers-reduced-motion:reduce){.zombie-walk-strip{animation:none!important}}

/* Plant roots and zombie soles use the lane centre as their groundline. */
.cannon-entity{left:18.5%!important;top:50%;width:calc(var(--lane-px)*1.25)!important;height:calc(var(--lane-px)*1.25)!important;transform:translate(-18%,-88%)!important}
.cannon-badge{top:77%!important}
.zombie-entity{top:calc(var(--lane)*15% + 31.5%)!important;transform:translate(-32%,-94%)!important}
.mower-entity{top:calc(var(--lane)*15% + 31.5%)!important;transform:translate(-36%,-80%)!important}
#entities-layer>.bg-gradient-to-br{margin-top:calc(var(--lane-px)*-.65)}
.boss-walk-strip{width:100%;height:100%;background:url('art/boss-walk16.webp') 0 0/400% 400% no-repeat;animation:garden-walk-16 1.6s steps(1,end) infinite}
.boss-entity{width:calc(var(--lane-px)*4.5)!important;height:calc(var(--lane-px)*3)!important;top:54%!important;transform:translate(-30%,-90%)!important}
/* The expanded table has its own fluid layout, independent of the menu card. */
#menu-table.table-open{display:flex!important;flex-direction:column;gap:12px;position:fixed!important;inset:auto!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;width:min(680px,94vw)!important;height:auto!important;max-height:94dvh!important;padding:24px 30px!important;box-sizing:border-box;border:7px solid #946130!important;border-radius:24px!important;background:linear-gradient(135deg,#fff7dc,#f0d2a0)!important;box-shadow:0 0 0 200vmax #15220cba,inset 0 0 0 2px #f8dfaa,0 12px 40px #17200b80!important;overflow:auto!important;z-index:100!important}
#menu-table.table-open h2{position:static!important;inset:auto!important;transform:none!important;width:auto!important;margin:0 40px 0 0!important;font-size:clamp(18px,2.5vw,26px)!important;line-height:1.2!important;text-align:left!important;color:#274526!important;pointer-events:auto!important}
#menu-table.table-open>p{display:block!important;margin:0!important;font-size:14px;line-height:1.3}
#menu-table.table-open .table-close{position:absolute!important;top:10px!important;right:10px!important;width:34px!important;height:34px!important;display:grid!important;place-items:center;padding:0!important;line-height:1!important;z-index:2}
#menu-table.table-open .table-tabs{position:static!important;display:grid!important;grid-template-columns:repeat(8,minmax(0,1fr));gap:8px;margin:0!important;width:100%!important}
#menu-table.table-open .tab-num-btn{min-width:0;min-height:40px;height:40px;padding:0!important;font-size:20px!important;line-height:1!important;border-radius:10px}
#menu-table.table-open #chalkboard-content{position:static!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(4,auto);grid-auto-flow:column;gap:8px 18px;margin:0!important;width:100%;font-size:24px!important;line-height:1.25!important}
#menu-table.table-open #chalkboard-content>div{display:flex!important;align-items:center;justify-content:space-between;gap:12px;padding:8px 14px!important;border:1px solid #c8a571!important;border-radius:10px;background:#fffae9;font-variant-numeric:tabular-nums}
#menu-table.table-open .table-rule{display:flex!important;position:static!important;margin:0!important;padding-top:8px!important;gap:10px;font-size:14px!important;line-height:1.25}
#menu-table.table-open .table-expand{display:none!important}
@media(max-height:600px) and (orientation:landscape){
 #menu-table.table-open{gap:8px;padding:14px 22px!important;border-width:5px!important;border-radius:18px!important}
 #menu-table.table-open h2{font-size:20px!important}#menu-table.table-open>p{display:none!important}
 #menu-table.table-open .tab-num-btn{height:34px;min-height:34px;font-size:18px!important}
 #menu-table.table-open #chalkboard-content{font-size:20px!important;gap:5px 16px}
 #menu-table.table-open #chalkboard-content>div{padding:5px 12px!important}
 #menu-table.table-open .table-rule{font-size:12px!important;padding-top:5px!important}
}
@media(prefers-reduced-motion:reduce){.boss-walk-strip{animation:none!important}}

/* Compact garden chalkboard; the expanded table keeps its own v5 layout. */
#menu-table:not(.table-open){top:38%!important;bottom:11%!important;right:2%!important;width:29%!important;height:auto;transform:none!important;padding:12px!important;display:flex!important;flex-direction:column;gap:8px;border:7px solid #a36b36!important;border-radius:18px!important;background:radial-gradient(ellipse at 25% 10%,#376341,#173e2c 85%)!important;box-shadow:inset 0 0 0 2px #d6b47c,inset 0 0 24px #102c2677,0 4px 0 #67401f,0 8px 14px #19371666!important;color:#fff5d6}
#menu-table:not(.table-open) h2{position:static!important;width:100%!important;margin:0!important;font-size:clamp(12px,1.5vw,23px)!important;line-height:1.2!important;color:#ffe4a8;text-shadow:0 2px #122d22;letter-spacing:.04em}
#menu-table:not(.table-open) .table-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;width:100%;margin:0}
#menu-table:not(.table-open) .tab-num-btn{height:clamp(23px,3.5vh,38px);min-height:0;padding:0!important;font-size:clamp(12px,1.5vw,21px)!important;line-height:1;border:1px solid #b9c49b!important;background:#315943!important;color:#fff0c9!important;border-radius:7px;box-shadow:inset 0 1px #ffffff22;transition:background .15s,transform .15s}
#menu-table:not(.table-open) .tab-num-btn.bg-yellow-500{background:linear-gradient(#ffe3a0,#e8b969)!important;color:#3a3018!important;border-color:#fff0bd!important;box-shadow:0 2px 0 #8a642f!important}
#menu-table:not(.table-open) #chalkboard-content{display:flex!important;flex:1;justify-content:center;gap:3px;margin:0!important;font-size:clamp(14px,2vw,28px)!important;line-height:1.2!important;font-variant-numeric:tabular-nums}
#menu-table:not(.table-open) #chalkboard-content>div:nth-child(n+5):nth-child(-n+7){display:flex;justify-content:space-between;gap:8px;padding:2px 8px!important;border-bottom:1px solid #c4d0a933!important}
#menu-table:not(.table-open) #chalkboard-content span{color:#fff9e4!important}#menu-table:not(.table-open) #chalkboard-content span:last-child{color:#ffe09a!important}
#menu-table:not(.table-open) .table-expand{position:static!important;display:block;width:100%!important;min-height:28px;padding:5px 8px!important;border:1px solid #bd884c!important;border-radius:8px;background:linear-gradient(#ffe7b2,#e7bb78)!important;color:#3e321c!important;box-shadow:0 2px 0 #7a5228;font-size:clamp(11px,1.1vw,17px)!important;line-height:1.2;font-weight:1000;text-align:center}
#menu-table:not(.table-open) .table-expand:hover{filter:brightness(1.1)}
#menu-table:not(.table-open) h2{order:0}#menu-table:not(.table-open) .table-tabs{order:1}#menu-table:not(.table-open) #chalkboard-content{order:2}#menu-table:not(.table-open) .table-expand{order:3;flex-shrink:0}
@media(max-height:600px) and (orientation:landscape){#menu-table:not(.table-open){top:36%!important;bottom:7%!important;width:29%!important;padding:7px 9px!important;gap:5px;border-width:5px!important;border-radius:14px!important}#menu-table:not(.table-open) h2{font-size:12px!important;letter-spacing:0}#menu-table:not(.table-open) .table-tabs{gap:3px}#menu-table:not(.table-open) .tab-num-btn{height:23px;font-size:13px!important}#menu-table:not(.table-open) #chalkboard-content{font-size:16px!important;gap:1px}#menu-table:not(.table-open) #chalkboard-content>div:nth-child(n+5):nth-child(-n+7){padding:0 5px!important}#menu-table:not(.table-open) .table-expand{min-height:25px;padding:4px 6px!important;font-size:11px!important}}
/* Covers are clipped to the empty interior of each lane. Side and front scenery stays visible. */
.lane-bg.skin-inactive{left:24%!important;width:66%!important;right:10%!important;overflow:hidden!important;clip-path:inset(0);pointer-events:none}
.lane-bg.skin-inactive:after{inset:0!important;width:100%;height:100%!important;filter:none!important;background-image:url('art/biome-covers.webp')!important;background-repeat:no-repeat!important;background-size:100% var(--cover-scale)!important;background-position:0 var(--cover-y)!important}
.lane-bg.skin-inactive,#lane-bg-3.skin-inactive{height:10%!important}
#game-area[data-biome=lawn]{--cover-scale:682.6667%;--cover-y:6.865%}
#game-area[data-biome=sand]{--cover-scale:640%;--cover-y:25.463%}
#game-area[data-biome=stone]{--cover-scale:682.6667%;--cover-y:44.622%}
#game-area[data-biome=earth]{--cover-scale:640%;--cover-y:63.657%}
#game-area[data-biome=ice]{--cover-scale:787.6923%;--cover-y:80.537%}
#game-area[data-biome=ash]{--cover-scale:731.4286%;--cover-y:98.416%}

/* Every screen shares the usable rectangle, including keyboard and Safari chrome. */
:root{--viewport-width:100vw;--viewport-height:100vh;--viewport-height:100dvh;--viewport-left:0px;--viewport-top:0px;--inset-l:env(safe-area-inset-left,0px);--inset-r:env(safe-area-inset-right,0px);--inset-t:env(safe-area-inset-top,0px);--inset-b:env(safe-area-inset-bottom,0px);--app-width:calc(var(--viewport-width) - var(--inset-l) - var(--inset-r));--app-height:calc(var(--viewport-height) - var(--inset-t) - var(--inset-b));--safe-l:12px;--safe-r:12px;--safe-b:8px}
html{position:fixed;inset:0;width:100%;height:100%;background:#173c22;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{position:fixed;left:calc(var(--viewport-left) + var(--inset-l));top:calc(var(--viewport-top) + var(--inset-t));width:var(--app-width);height:var(--app-height);background:#173c22}
#screen-game{padding-top:0!important}
#game-hud{padding-left:12px!important;padding-right:12px!important;flex-shrink:0}
#numpad-panel{padding-left:12px!important;padding-right:12px!important;padding-bottom:8px!important;flex-shrink:0}
#rotate-warning,#modal-ios-fullscreen{position:absolute!important}
#menu-table.table-open{position:absolute!important;width:min(680px,94%)!important;max-height:94%!important}
#menu-table.table-open .table-close{top:4px!important;right:8px!important;width:32px!important;height:32px!important}
.result-card{width:min(96%,calc(var(--app-height)*1.64))!important}
.result-card header p{font-size:max(11px,2cqw)!important}
.score-card h3{font-size:max(10px,1.3cqw)}.result-stat small{font-size:max(10px,1.15cqw)}.result-stat strong{font-size:max(15px,2.6cqw)}
#zombie-note-box h3{font-size:max(10px,1.35cqw)}#zombie-note-text{font-size:max(11px,1.5cqw)!important}
#stage-next-biome{font-size:max(10px,1.6cqw)!important}
#stage-clear-btn{font-size:max(13px,2.3cqw);min-height:30px}
#gameover-btn{font-size:max(14px,3cqw);min-height:30px}
#modal-profile,#modal-password,#modal-ios-fullscreen,#screen-leaderboard,.skin-dialog{box-sizing:border-box;max-height:100%}
#profile-modal-card,#leaderboard-card,#modal-password>div,#modal-ios-fullscreen>div,.help-card{max-height:94%!important;min-height:0;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
#profile-modal-card input,#modal-password input{font-size:16px!important}
#profile-modal-card>*,#leaderboard-card>*{flex-shrink:0}
#leaderboard-table-wrap{flex-shrink:1;min-height:50px}
#rotate-warning{padding:16px;overflow:auto}
/* Approved variant 2 is an illustrated object, with a real button over the chalk stroke. */
#menu-table:not(.table-open){display:none!important}
#fence-board{position:absolute;right:.5%;bottom:6%;width:min(45%,calc(var(--app-height)*.78));aspect-ratio:4/3;z-index:3;filter:drop-shadow(3px 8px 4px #1d240b66)}
#fence-board>img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
#fence-table-open{position:absolute;left:17%;top:70%;width:74%;height:18%;min-height:32px;background:transparent;border:0;border-radius:12px;transform:rotate(-3deg);cursor:pointer}
#fence-table-open:hover{box-shadow:0 0 12px 4px #ffefac66;background:#ffe3a51a}
#fence-table-open:focus-visible{outline:3px dashed #fff5ad;outline-offset:2px}
.menu-plant{left:49%;max-width:19%;height:33%}
/* Natural image proportions: repeat sideways instead of stretching a single sprite. */
.lane-bg.skin-inactive:after{background-size:auto var(--cover-scale)!important;background-repeat:repeat-x!important}
/* Compact landscape layouts, including a visible browser toolbar. */
@media(max-height:440px) and (orientation:landscape){
 .menu-heading{height:34%;top:1%}.menu-heading>p{font-size:10px;padding:1px 12px}
 .menu-levels{top:38%;height:42%}.level-card{padding:2px 5px;gap:0}.level-icon{width:22px;height:22px}.level-copy strong{font-size:clamp(14px,2.1vw,22px)}.level-copy b{font-size:clamp(10px,1.4vw,15px)}
 .menu-footer{bottom:2%;height:14%;width:48%}.menu-footer .wood-button{min-height:32px}.menu-footer .icon-button{min-width:30px;width:34px}.menu-footer #profile-widget-btn>span:nth-child(2){display:none!important}.profile-button{min-width:32px;flex:0}
 #fence-board{width:min(46%,calc(var(--app-height)*.94));bottom:3%}
 #menu-table.table-open{gap:5px;padding:10px 16px!important}#menu-table.table-open h2{font-size:17px!important}#menu-table.table-open .table-tabs{gap:5px}#menu-table.table-open .tab-num-btn{min-height:30px;height:30px}#menu-table.table-open #chalkboard-content{font-size:18px!important;gap:4px 12px}#menu-table.table-open #chalkboard-content>div{padding:3px 8px!important}#menu-table.table-open .table-rule{font-size:11px!important;padding-top:3px!important}
}
@media(max-height:310px) and (orientation:landscape){
 .level-icon{display:none}.level-copy strong{font-size:15px}.level-copy b{font-size:11px}.menu-heading>p{display:none!important}.menu-heading h1{height:100%}
 #game-hud{height:36px!important;min-height:36px!important;max-height:36px!important}#hud-stats-group,#hud-bonuses-group{height:30px}#hud-controls-group button{height:30px!important;min-height:30px!important}
 #numpad-panel{padding-top:4px!important;padding-bottom:4px!important}.numpad-btn,.del-btn{height:38px;font-size:24px!important}
 .cannon-badge{min-width:60px;min-height:24px;font-size:15px!important;padding:2px 6px!important}.zombie-badge{font-size:12px!important;padding:1px 5px!important}
 #menu-table.table-open .table-rule{display:none!important}
}
@media(min-aspect-ratio:21/9){.menu-heading{width:45%}.menu-levels{width:42%}.menu-footer{width:42%}.menu-plant{left:48%}#fence-board{right:7%}}
@media(prefers-reduced-motion:reduce){#fence-table-open{transition:none}}


/* v8: all visual ground lines refer to the same four-row field. */
#game-area #lanes-layer,#game-area #interaction-layer,#game-area #entities-layer{position:absolute;inset:0;width:100%;height:100%;display:block;margin:0;padding:0;border:0}
#game-area .lane-bg,#game-area .lane-hit{position:absolute;top:calc(24% + var(--lane)*15%)!important;height:15%;flex:none}
#game-area .lane-bg[data-enabled=false]{height:10%!important}
#game-area .lane-hit{width:100%;left:0}
#game-area .cannon-entity{top:50%!important;transition:none!important}
#game-area .zombie-entity{top:calc(31.5% + var(--lane)*15%)!important;transform:translate(-32%,-94%)!important;transition-property:opacity!important}
#game-area .mower-entity{top:calc(31.5% + var(--lane)*15%)!important;transform:translate(-36%,-80%)!important;transition:none!important}
#game-area .car-effect{top:calc(31.5% + var(--lane)*15%)!important}
