#seed-picker{width:min(760px,calc(100% - 20px));max-height:calc(var(--game-visible-height,100dvh) - 16px);padding:18px;border:3px solid #e6c574;color:#fff2c6;background:#142437;overflow:auto}
#seed-picker::backdrop{background:#050c18ce}#seed-picker h2{font-size:23px}#seed-picker p{font-size:12px;line-height:1.5;margin:7px 0;color:#d6dcc7}
.seed-preview{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin:8px 0;font-size:12px}.seed-preview span{padding:5px 9px;background:#223c45;border:1px solid #7b966a}
#seed-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:12px 0}#seed-options button{position:relative;display:grid;grid-template-columns:38px 1fr;align-items:center;gap:4px;min-height:78px;padding:6px;border:2px solid #7e9270;background:#253b40;color:#fff2c6;text-align:left}
#seed-options .sprite{width:38px;height:42px}#seed-options strong{font-size:12px}#seed-options small{grid-column:1/-1;font-size:10px;line-height:1.3;color:#d5dfcb}#seed-options button[aria-pressed=true]{background:#516b3e;border-color:#ffe295;box-shadow:inset 0 0 0 1px #ffe295}
.seed-actions{display:flex;justify-content:space-between;align-items:center;gap:8px;position:sticky;bottom:-18px;background:#142437;padding:10px 0}#seed-count{font-size:12px}#seed-warning{min-height:18px;color:#ffd37b!important}
#game .hud-actions #shovel{font-size:11px;padding:4px 7px;white-space:nowrap}#shovel[aria-pressed=true]{background:#e8c16e;color:#192838}#game .tile.inactive-lane{opacity:.25;pointer-events:none}#game .tile.gravestone{background:#526058!important;box-shadow:inset 0 0 0 4px #273d39}#game .tile.gravestone::before{content:'墓';position:absolute;inset:12% 15%;background:#94a39a;border:3px solid #d1d6c4;border-radius:40% 40% 0 0;font-size:clamp(10px,2vw,24px);display:grid;place-items:center;color:#263d37;text-shadow:none}
#game .plant.sleeping .sprite{opacity:.6;filter:saturate(.4)}#game .plant.sleeping::after{content:'Zz';position:absolute;right:0;top:0;color:#fff3a9;font-weight:bold;font-size:13px}.sprite.repeater{background-image:url('./pixel/peashooter.png');filter:hue-rotate(25deg) saturate(1.5)}.sprite.repeater::after{content:'×2';position:absolute;right:0;bottom:0;background:#183722;color:#fff7ad;font:bold 12px sans-serif}
.sprite.fumeShroom{background-image:url('./pixel/puffShroom.png');filter:hue-rotate(65deg) saturate(1.2)}.sprite.squash{background-image:url('./pixel/wallnut.png');filter:hue-rotate(65deg) saturate(1.5)}.sprite.graveBuster{background:repeating-linear-gradient(65deg,#648a4c 0 4px,#254c35 5px 9px);border:3px solid #a6c77e;border-radius:25% 35% 20% 30%;width:70%;height:70%;margin:auto}.sprite.graveBuster::after{content:'吞';display:grid;place-items:center;height:100%;color:#fff3c7;font-size:14px}.sprite.coffeeBean{background:radial-gradient(ellipse at 50% 40%,#b77744 0 30%,#653b25 32% 52%,transparent 54%);position:relative}.sprite.coffeeBean::after{content:'☕';font-size:22px;position:absolute;inset:0;display:grid;place-items:center}
#game .bullet.bowling{z-index:4;width:var(--cell-width,10%);height:var(--cell-height,20%)}#game .bullet.bowling .pea{width:80%;height:90%;background:url('./pixel/wallnut.png') center/contain no-repeat;box-shadow:none;border:0;animation:nut-roll .6s linear infinite}@keyframes nut-roll{to{rotate:360deg}}
#game .card .belt-count{position:absolute;top:1px;right:2px;font:bold 11px sans-serif;background:#123322;color:#fff6b1;padding:2px}#game .card.belt-empty{opacity:.45}#game .sun.small{font-size:10px}
#audio-samples{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;margin-top:8px}#audio-samples button{font-size:10px;min-height:28px;padding:4px}.sound-controls .audio-note{font-size:10px;line-height:1.4;margin-top:7px;color:#d7ddc8}
#game .sound-controls{max-height:calc(var(--game-visible-height,100dvh) - 80px);overflow:auto}
#fullscreen-help{width:min(540px,calc(100% - 24px));max-height:calc(var(--game-visible-height,100dvh) - 24px);overflow:auto;padding:20px;background:#142437;color:#fff2c6;border:3px solid #e6c574}#fullscreen-help::backdrop{background:#050c18ce}#fullscreen-help h2{font-size:22px}#fullscreen-help p,#fullscreen-help li{font-size:13px;line-height:1.7;margin:10px 0}#fullscreen-help ol{padding-left:24px}#fullscreen-help .primary{min-height:40px}#home .wallet [data-pvz-fullscreen]{font-size:10px;padding:3px 6px;min-height:26px;height:26px}#game [data-pvz-fullscreen]{white-space:nowrap}
@media(orientation:portrait) and (max-width:700px){body[data-game-viewport=pvz] #game .battle-hud{grid-template-columns:minmax(0,1fr) auto}body[data-game-viewport=pvz] #game .battle-brand{grid-row:1;grid-column:1}body[data-game-viewport=pvz] #game .wave-panel{grid-row:1;grid-column:2}body[data-game-viewport=pvz] #game .hud-actions{grid-row:2;grid-column:1/-1;display:flex;justify-content:flex-end}body[data-game-viewport=pvz] #game .battle-brand h1{white-space:nowrap}body[data-game-viewport=pvz] #game .battle-hud{padding-top:3px;padding-bottom:3px;gap:3px}body[data-game-viewport=pvz] #game .hud-actions .hud-button{min-height:30px;height:30px;font-size:11px;padding:3px 7px}body[data-game-viewport=pvz] #game .wave-panel{font-size:10px}}
@media(orientation:landscape) and (max-height:600px){body[data-game-viewport=pvz] #game .battle-brand h1{font-size:14px}body[data-game-viewport=pvz] #game [data-pvz-fullscreen]{font-size:10px;min-width:32px;padding:3px 5px}}
/* Keep the entire illustrated world and its five/six playable rows in one frame. */
@media(orientation:landscape) and (min-width:461px){
 body[data-game-viewport=pvz] main:has(#game:not([hidden])){position:fixed;top:var(--pvz-visual-top,0px);left:var(--pvz-visual-left,0px);width:var(--pvz-visual-width,100%);max-width:none;height:var(--pvz-visual-height,100dvh);min-height:0;margin:0;padding:4px max(6px,env(safe-area-inset-right)) 4px max(6px,env(safe-area-inset-left));display:flex}
 body[data-game-viewport=pvz] #game:not([hidden]){display:grid;grid-template-rows:clamp(32px,5vh,48px) minmax(0,1fr) clamp(30px,5vh,44px) clamp(26px,5vh,44px);gap:4px;width:100%;height:100%;min-height:0;padding:4px}
 body[data-game-viewport=pvz] #game .battle-hud{position:static;display:grid;grid-template-columns:auto minmax(0,1fr) 100px auto;min-height:0;height:100%;padding:0;gap:6px}
 body[data-game-viewport=pvz] #game .battle-brand{grid-column:2;grid-row:1}body[data-game-viewport=pvz] #game #back{display:block;grid-column:1;grid-row:1}body[data-game-viewport=pvz] #game .wave-panel{grid-column:3;grid-row:1}body[data-game-viewport=pvz] #game .hud-actions{grid-column:4;grid-row:1}body[data-game-viewport=pvz] #game .battle-brand a{display:none}body[data-game-viewport=pvz] #game .battle-brand h1{font-size:18px;white-space:nowrap}
 body[data-game-viewport=pvz] #game #stage-caption{position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden}
 body[data-game-viewport=pvz] #game .combat-layout{display:grid;grid-template-columns:104px minmax(0,1fr);grid-template-rows:clamp(24px,4vh,36px) minmax(0,1fr);gap:4px 6px;min-height:0;height:100%}
 body[data-game-viewport=pvz] #game .seed-rail{grid-column:1;grid-row:1/3;display:flex;flex-direction:column;height:100%;min-height:0;padding:3px;gap:3px}
 body[data-game-viewport=pvz] #game .sun-counter{min-height:24px;height:28px;flex:none;padding:0;font-size:20px}body[data-game-viewport=pvz] #game .cards{flex:1;min-height:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:1fr;gap:3px}
 body[data-game-viewport=pvz] #game .card{min-height:0;height:100%;padding:2px;display:grid;grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) 15px;justify-items:center}body[data-game-viewport=pvz] #game .card:only-child{max-height:130px}body[data-game-viewport=pvz] #game .card .sprite{width:100%;height:100%;max-height:48px;grid-column:1;grid-row:1}body[data-game-viewport=pvz] #game .card .plant-name{position:absolute;clip-path:inset(50%)}body[data-game-viewport=pvz] #game .plant-cost{grid-column:1;grid-row:2;font-size:13px}
 body[data-game-viewport=pvz] #game .battle{grid-column:2;grid-row:2;width:100%;max-width:none;height:100%;min-height:0;aspect-ratio:auto;align-self:stretch;justify-self:stretch;padding:0;grid-template-columns:7% minmax(0,1fr) 3%}
 body[data-game-viewport=pvz] #game .battle::before{background-size:100% 100%}body[data-game-viewport=pvz] #game .field{top:8%;height:86%;margin:0}
 body[data-game-viewport=pvz] #game .battle-footer{display:flex;flex-wrap:nowrap;height:100%;min-height:0;padding:0;margin:0;gap:6px}body[data-game-viewport=pvz] #game .battle-footer .help{flex:1;flex-basis:auto;min-width:0;margin:0;font-size:11px;max-height:28px;overflow:auto}body[data-game-viewport=pvz] #game #mobile-map{display:none}
 body[data-game-viewport=pvz] #game .game-sponsors{height:100%;min-height:0;margin:0;width:100%;max-width:none}body[data-game-viewport=pvz] #game .sponsors-top{grid-column:2;grid-row:1}body[data-game-viewport=pvz] #game .sponsors-bottom{display:grid;grid-template-columns:1fr 1fr;gap:6px}body[data-game-viewport=pvz] #game .sponsor-link{display:grid;grid-template-columns:auto auto auto auto;grid-template-areas:'badge name domain arrow';align-items:center;justify-content:center;gap:6px;height:100%;min-height:0;padding:2px 8px;aspect-ratio:auto}body[data-game-viewport=pvz] #game .sponsor-name{font-size:14px;line-height:1.1}body[data-game-viewport=pvz] #game .sponsor-domain{font-size:10px;padding:0;border:0}body[data-game-viewport=pvz] #game .sponsor-badge{font-size:9px;padding:2px}body[data-game-viewport=pvz] #game .sponsor-arrow{width:12px;height:12px}
 body[data-game-viewport=pvz] #game .hud-button,body[data-game-viewport=pvz] #game .game-feedback button,body[data-game-viewport=pvz] #game .sound-settings summary{min-height:28px;height:28px;padding:3px 6px;font-size:11px}
 html.pvz-safari-browser{overflow-y:auto;overscroll-behavior-y:auto}html.pvz-safari-browser body[data-game-viewport=pvz]{overflow:visible;height:auto;min-height:calc(100svh + 180px);touch-action:pan-y pinch-zoom}
}
@media(orientation:landscape) and (min-width:461px) and (max-height:600px){
 body[data-game-viewport=pvz]{overflow:hidden}
 body[data-game-viewport=pvz] main{position:fixed;top:var(--pvz-visual-top,0px);left:var(--pvz-visual-left,0px);width:var(--pvz-visual-width,100%);height:var(--pvz-visual-height,var(--game-visible-height,100dvh));margin:0}
 body[data-game-viewport=pvz] #game .battle{width:100%;height:100%;max-width:none;aspect-ratio:auto;justify-self:stretch;grid-template-columns:7% minmax(0,1fr) 3%;background:#28442f}
 body[data-game-viewport=pvz] #game .battle::before{background-size:100% 100%;background-position:center}
 body[data-game-viewport=pvz] #game .field{top:8%;height:86%;margin:0}
 body[data-game-viewport=pvz] #game:not([hidden]){grid-template-rows:32px minmax(0,1fr) 30px 26px}
 body[data-game-viewport=pvz] #game .battle-hud{height:32px}
 body[data-game-viewport=pvz] #game .combat-layout{grid-template-columns:104px minmax(0,1fr);grid-template-rows:24px minmax(0,1fr)}
 body[data-game-viewport=pvz] #game .combat-layout:has(.cards:not(:has(.card:nth-child(3)))){grid-template-columns:80px minmax(0,1fr)}
 body[data-game-viewport=pvz] #game .battle-footer{height:30px}
 body[data-game-viewport=pvz] #game .hud-button,body[data-game-viewport=pvz] #game .game-feedback button,body[data-game-viewport=pvz] #game .sound-settings summary{height:28px;min-height:28px}
}
#game .fume-cloud{z-index:3;pointer-events:none;background:radial-gradient(ellipse at left,#b689d5a8,transparent 90%);width:calc(100% / 9);box-shadow:18px 0 14px #b689d566,36px 0 16px #b689d544;animation:fume-fade .35s ease-out both}@keyframes fume-fade{from{opacity:.9}to{opacity:0}}
@media(orientation:portrait) and (max-width:700px){body[data-game-viewport=pvz] #game .combat-layout{min-height:0}body[data-game-viewport=pvz] #game .combat-layout>.battle{min-height:0}body[data-game-viewport=pvz] #game #battle-help{min-width:0}}
@media(max-width:350px){body[data-game-viewport=pvz] #game .battle-hud{gap:4px}body[data-game-viewport=pvz] #game .battle-brand h1{font-size:12px;white-space:nowrap}body[data-game-viewport=pvz] #game .wave-panel{min-width:54px}}
@media(max-width:460px){#seed-picker{padding:12px}#seed-picker h2{font-size:20px}#seed-options{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}#seed-options button{grid-template-columns:28px 1fr;padding:4px;min-height:85px}#seed-options .sprite{width:28px;height:36px}#seed-options strong{font-size:11px}.seed-actions{bottom:-12px}#seed-options small{font-size:9px}#game .hud-actions{gap:3px}#game .hud-actions #shovel{padding:3px 5px;min-width:32px}}
@media(orientation:landscape) and (max-height:600px){#seed-picker{padding:10px 14px}#seed-picker h2{font-size:18px}#seed-picker p{margin:3px 0;font-size:11px}#seed-options{grid-template-columns:repeat(6,minmax(0,1fr));gap:5px;margin:6px 0}#seed-options button{display:flex;flex-wrap:wrap;justify-content:center;min-height:72px;padding:3px;gap:2px}#seed-options .sprite{width:26px;height:28px}#seed-options strong{font-size:10px}#seed-options small{font-size:9px;width:100%;text-align:center}.seed-actions{bottom:-10px;padding:5px 0}.seed-preview{margin:4px 0;gap:4px}.seed-preview span{padding:3px 6px}#seed-warning{margin:2px 0}body[data-game-viewport=pvz] #game .battle-brand h1{font-size:16px}body[data-game-viewport=pvz] #game .hud-actions #shovel{min-width:32px;height:32px;padding:3px 5px;font-size:10px}}
