@charset "UTF-8";
:root{--forest:#193c2d;--deep:#11281f;--leaf:#bddf73;--leaf-dark:#648937;--cream:#fff1c2;--muted:#abc0a8;--wood:#65472c;--purple:#c4a2ef;--ink:#203622;--line:#ffffff20;font-family:"Microsoft YaHei","PingFang SC","Noto Sans CJK SC",system-ui,sans-serif;color:var(--cream);background:var(--deep);font-synthesis:none}
*{box-sizing:border-box}body{margin:0;min-width:320px;background:radial-gradient(ellipse at 15% 0,#36503c88,transparent 50%),var(--deep)}button,input,a{-webkit-tap-highlight-color:transparent}button,input{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed}button,a,input{touch-action:manipulation}button{color:inherit}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #e7c868;outline-offset:4px}button{transition:transform .15s,filter .15s,background .15s}button:hover:not(:disabled){filter:brightness(1.1)}button:active:not(:disabled){transform:translateY(2px)}button:disabled{opacity:.45}a{color:inherit;text-decoration:none}.hidden{display:none!important}.app-shell{width:min(1480px,100%);margin:auto;padding:0 42px}.topbar{height:100px;display:flex;align-items:center;justify-content:space-between;gap:20px}.brand{display:flex;align-items:center;gap:10px;font-size:23px;font-weight:900;letter-spacing:2px}.brand-sun{color:var(--leaf);font-size:48px;line-height:1}.brand small{display:block;letter-spacing:2.3px;font-size:8px;font-weight:500;line-height:1.7;color:var(--muted)}.top-actions{display:flex;gap:10px;align-items:center}.network{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:11px;margin-right:12px}.network i,.play-note i{height:6px;width:6px;display:inline-block;flex-shrink:0;border-radius:50%;background:#bad98c;box-shadow:0 0 8px #b9d77966}.network.offline i{background:#f08c62}.icon-button{background:transparent;border:1px solid var(--line);border-radius:50%;width:40px;height:40px;font-size:21px;display:flex;align-items:center;justify-content:center;position:relative}.icon-button span{display:none}.icon-button.muted{opacity:.45;text-decoration:line-through}.screen{animation:enter .45s ease-out}.landing{position:relative;min-height:710px;isolation:isolate;border-top:1px solid var(--line);overflow:hidden}.hero-art{position:absolute;z-index:-1;inset:0 -42px 35px 25%;background:radial-gradient(ellipse at 75% 40%,#899945,#273f2b 70%);overflow:hidden}.hero-art img{width:100%;height:100%;object-fit:cover;object-position:center}.hero-shade{position:absolute;inset:0;background:linear-gradient(90deg,var(--deep) 0%,#11281fcc 8%,#11281f22 42%,#11281f00 75%),linear-gradient(0deg,var(--deep),transparent 33%)}.vs-mark{position:absolute;top:44%;left:61%;font:italic 900 80px Georgia,serif;color:#fff6cb;text-shadow:4px 5px #44322e;transform:rotate(-12deg);opacity:0}.hero-name{position:absolute;bottom:80px;padding:9px 14px;border-left:3px solid var(--leaf);background:#173126c7;backdrop-filter:blur(5px);font-weight:900;font-size:19px;letter-spacing:2px;transform:rotate(-3deg)}.hero-name span{display:block;font-size:9px;letter-spacing:4px;line-height:2;color:var(--muted)}.hero-name-plant{left:32%}.hero-name-zombie{right:8%;border-color:var(--purple);transform:rotate(3deg)}.landing-content{position:relative;padding:61px 0 84px;max-width:495px}.edition,.eyebrow{font-size:11px;font-weight:700;letter-spacing:2px;color:var(--leaf)}.edition span{margin:0 8px;color:#78916c}h1,h2,h3,p{margin:0}.landing h1{font-family:"STKaiti","KaiTi","Noto Serif CJK SC",serif;font-size:clamp(52px,5.5vw,82px);font-weight:900;line-height:1.17;letter-spacing:-2px;margin:21px 0 24px;text-shadow:0 3px 0 #0002}.landing h1 em{font-style:normal;color:var(--leaf)}.hero-copy{font-size:14px;line-height:1.9;letter-spacing:.5px;color:#c0cdb3}.play-box{width:388px;max-width:100%;margin-top:30px}.name-label{display:flex;align-items:center;font-size:11px;letter-spacing:1px;color:var(--muted);gap:14px;margin-bottom:12px}.name-label input{width:0;flex:1;background:#132c20bb;border:1px solid #859d7155;border-radius:5px;color:var(--cream);padding:10px 12px;font-size:12px;min-height:38px}.name-label input::placeholder{color:#83977d}.button{border:0;border-radius:6px;min-height:46px;padding:13px 20px;font-weight:750;font-size:13px;display:inline-flex;align-items:center;justify-content:center;gap:10px;letter-spacing:.3px}.button-primary{background:var(--leaf);color:#253c25;box-shadow:0 4px 0 #59743a}.button-secondary{background:#34543d;color:var(--cream);border:1px solid #597349}.button-outline{border:1px solid #85977666;color:var(--cream);background:#18332666}.button-cream{background:var(--cream);color:var(--ink)}.solo-button{width:100%;justify-content:stretch;padding:15px 18px;min-height:77px;text-align:left;font-size:17px}.button-icon{font-size:30px}.solo-button small{display:block;font-size:10px;font-weight:500;letter-spacing:1px;margin-top:5px;opacity:.7}.solo-button b{margin-left:auto;font-size:24px;font-weight:500}.multiplayer-row{display:flex;gap:9px;margin-top:13px}.multiplayer-row .button{flex:1;padding:13px 8px;font-size:11px}.play-note{font-size:9px;display:flex;align-items:center;gap:7px;color:var(--muted);margin-top:17px;white-space:nowrap}.landing-footer{position:absolute;bottom:15px;left:0;right:0;display:flex;justify-content:space-between;gap:12px;font-size:10px;color:#a4b296;letter-spacing:.5px}.text-button{border:0;background:none;color:var(--leaf);font-size:11px;padding:0}.lobby{padding:35px 50px 50px;max-width:1100px;margin:auto;border-top:1px solid var(--line)}.room-header{display:flex;align-items:center;justify-content:space-between;gap:20px}.room-header h1{font-size:32px;letter-spacing:-1px;margin-top:10px}.invite-plank{background:#43604345;border:1px solid #98b96b50;border-radius:8px;padding:18px 22px;display:flex;justify-content:space-between;align-items:center;margin:30px 0 18px;gap:15px}.invite-plank>div{display:flex;align-items:center;gap:24px}.invite-plank span{font-size:11px;color:var(--muted)}.invite-plank strong{font-size:34px;letter-spacing:9px;font-variant-numeric:tabular-nums}.faction-grid{display:grid;grid-template-columns:1fr 1fr;gap:28px;position:relative}.faction-card{position:relative;min-height:380px;padding:215px 28px 23px;border-radius:10px;border:1px solid #b8d78650;background:radial-gradient(ellipse at 50% 0,#6c963e70,transparent 75%),#1e3b29;overflow:hidden}.zombie-faction{border-color:#bba1e357;background:radial-gradient(ellipse at 50% 0,#6c59815c,transparent 75%),#303132}.faction-sprite{position:absolute;width:236px;height:236px;top:-9px;left:50%;transform:translateX(-50%);background-size:300% 200%;background-repeat:no-repeat;background-position:0 0;filter:drop-shadow(0 16px 20px #0004)}.plant-sprite{background-image:url('/assets/plant-expressions.png')}.zombie-sprite{background-image:url('/assets/zombie-expressions.png')}.faction-tag{font-size:10px;letter-spacing:2px;color:var(--leaf)}.zombie-faction .faction-tag{color:var(--purple)}.faction-card h2{font-family:"STKaiti","KaiTi",serif;font-size:31px;margin:7px 0}.faction-card p{font-size:11px;color:var(--muted)}.player-slot{margin-top:22px;padding-top:16px;border-top:1px solid #ffffff18;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px}.player-slot .ready-state{font-size:10px;color:var(--leaf)}.player-slot .not-ready{color:#b3ad96}.lobby-vs{position:absolute;z-index:2;left:50%;top:48%;transform:translate(-50%,-50%) rotate(-10deg);font:bold italic 43px Georgia,serif;text-shadow:3px 3px #11281f}.lobby-bottom{display:flex;align-items:center;justify-content:flex-end;gap:15px;margin-top:25px}.lobby-bottom p{margin-right:auto;max-width:330px;font-size:12px;line-height:1.8;color:var(--muted)}.lan-address{font-size:10px;text-align:center;color:#8b9d81;line-height:1.8;margin-top:22px;overflow-wrap:anywhere}.game{max-width:1250px;margin:auto;padding-bottom:25px}.match-bar{display:flex;justify-content:space-between;align-items:center;padding:0 5px 16px}.match-title{display:flex;gap:10px;align-items:center}.match-title>span{font-size:30px}.match-title strong{display:block;font-size:16px}.match-title small{display:block;font-size:10px;color:var(--muted);margin-top:4px}.match-info{display:flex;gap:18px;align-items:center}.wave-tag{font-size:12px;color:var(--leaf)}.clock{font:750 23px ui-monospace,monospace;color:var(--cream)}.match-info .icon-button{width:34px;height:34px;font-size:18px}.battle-layout{background:#5e472a;border:4px solid #3b2d20;border-radius:12px;box-shadow:0 10px 0 #071c13,0 22px 40px #0004;overflow:hidden}.seed-tray{display:flex;align-items:stretch;gap:9px;padding:9px 10px;background:linear-gradient(#79603e,#624626);border-bottom:5px solid #382c1b;box-shadow:inset 0 2px #ac9264;min-height:114px}.resource-meter{background:linear-gradient(#fff4c8,#e6cd82);color:#4e4429;border:2px solid #453a25;border-radius:7px;width:92px;flex-shrink:0;display:flex;align-items:center;justify-content:center;flex-direction:column;box-shadow:inset 0 2px #fff9dc}.resource-meter>span{font-size:27px;color:#d39d20;line-height:1.1}.resource-meter strong{font-size:25px;line-height:1.1;font-variant-numeric:tabular-nums}.resource-meter small{font-size:9px;margin-top:4px;font-weight:600}.deck{display:flex;flex:1;min-width:0;gap:7px;overflow-x:auto;scrollbar-width:none}.deck::-webkit-scrollbar{display:none}.seed-card{position:relative;min-width:74px;max-width:112px;flex:1;border:2px solid #473b25;border-radius:5px;background:#e2d9a5;color:#2e3c24;padding:5px 3px 4px;display:flex;flex-direction:column;align-items:center;justify-content:space-between;overflow:hidden;box-shadow:inset 0 2px #fff2cc;isolation:isolate}.seed-card.selected{outline:3px solid #fff29a;outline-offset:-3px;background:#f7eaae}.seed-card.unaffordable{filter:saturate(.35);opacity:.65}.seed-card .card-art{width:45px;height:45px;background-repeat:no-repeat;background-position:center;background-size:contain;font-size:30px;line-height:45px;text-align:center;filter:drop-shadow(0 2px #0002);z-index:1}.seed-card .card-art.atlas{background-image:url('/assets/units.png');background-size:400% 200%;width:52px;height:44px}.seed-card .card-art.boss{background-size:300% 200%;width:50px;height:45px;background-position:0 0}.seed-card .card-name{font-size:10px;font-weight:750;white-space:nowrap;z-index:1}.seed-card .card-cost{font:700 12px ui-monospace,monospace;z-index:1;color:#6e5b25}.seed-card kbd{position:absolute;top:3px;left:4px;font:9px system-ui;color:#4c4a33;z-index:2}.seed-card .cooldown-mask{position:absolute;inset:0;background:#1f2a25a8;transform-origin:top;z-index:3;pointer-events:none}.seed-card .cooldown-number{position:absolute;z-index:4;top:32px;color:white;font:bold 18px ui-monospace,monospace;text-shadow:1px 1px #000}.tools{display:flex;gap:7px;margin-left:2px;flex-shrink:0}.tool-button{border:2px solid #403222;background:#8c7857;border-radius:6px;padding:5px;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:53px;color:#fff1c2;position:relative}.tool-button>span{font-size:29px;line-height:1.25}.tool-button small{font-size:9px;white-space:nowrap}.tool-button.selected{border-color:#fff4a9;background:#967a49}.tool-button kbd{font-size:8px;color:#d5c9ad;background:none;padding:0}.skill-tool{background:#59466d}.skill-tool b{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#342340a8;font-size:20px;border-radius:4px}.skill-tool b:empty{display:none}.board-frame{position:relative;background:#6f8d43;line-height:0}#board{width:100%;height:auto;display:block;touch-action:none;cursor:crosshair}.board-message{position:absolute;left:50%;top:31%;transform:translate(-50%,-50%);background:#203d28ed;border:2px solid #d8e499;padding:18px 30px;color:var(--cream);font-weight:900;font-size:24px;line-height:1.3;border-radius:8px;white-space:nowrap;pointer-events:none;box-shadow:0 10px 30px #0005;animation:enter .2s ease}.pause-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:16px;background:#14281dcc;backdrop-filter:blur(3px);line-height:1.4;z-index:5}.pause-overlay strong{font-size:25px}.pause-overlay span{font-size:12px;color:#ccdac1}.battle-bottom{display:flex;justify-content:space-between;gap:15px;align-items:center;margin:24px 4px 11px;font-size:11px;color:var(--muted)}.battle-bottom p{line-height:1.7}.battle-bottom>div{display:flex;gap:15px;white-space:nowrap;font-size:10px}.progress-track{height:8px;border-radius:4px;background:#071f15;margin:0 4px 18px;position:relative;box-shadow:inset 0 1px 3px #0003}.progress-track>div{height:100%;background:linear-gradient(90deg,#537a3b,#b6d269);border-radius:4px;transition:width .2s}.progress-track>span{position:absolute;top:13px;font-size:8px;color:#7f9478}.progress-track>span:last-child{right:0}.modal{width:min(510px,calc(100% - 30px));border:1px solid #8cab5e90;border-radius:14px;background:#213e2d;color:var(--cream);padding:35px;box-shadow:0 24px 90px #0007}.modal::backdrop{background:#07160ed9;backdrop-filter:blur(7px)}.modal h2{font-size:27px;letter-spacing:-.7px;margin:10px 0 15px}.modal p{font-size:12px;color:#b8c9ad;line-height:1.9}.modal-close{position:absolute;top:10px;right:10px;border:none;border-radius:50%;font-size:26px;color:#bdd0b1;background:none;width:34px;height:34px}.choose-faction{display:flex;gap:12px;margin:24px 0}.choose-faction label{flex:1;min-width:0}.choose-faction input{position:absolute;opacity:0;width:1px;height:1px}.choose-faction label>span{display:flex;flex-direction:column;align-items:center;gap:8px;padding:22px 10px;border:2px solid #ffffff20;border-radius:8px;font-size:36px;cursor:pointer}.choose-faction strong{font-size:16px}.choose-faction small{font-size:9px;color:#aabd9d}.choose-faction input:checked+span{border-color:var(--leaf);background:#8ca74b1c}.choose-faction label:last-child input:checked+span{border-color:var(--purple);background:#84679a22}.choose-faction input:focus-visible+span{outline:3px solid #e7c868;outline-offset:3px}.full-width{width:100%;margin-top:14px}.code-input{display:block;width:100%;padding:15px 5px;margin:22px 0 6px;text-align:center;font:750 36px ui-monospace,monospace;letter-spacing:12px;border:1px solid #b9d37799;border-radius:6px;background:#102c1d;color:var(--cream)}.code-input::placeholder{color:#52754c}.help-modal{width:min(640px,calc(100% - 30px))}.help-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin:25px 0}.help-grid h3{font-size:15px;margin-bottom:10px}.rules-note{padding-top:15px;margin-top:15px!important;border-top:1px solid #ffffff17}kbd{background:#ffffff12;border-radius:3px;padding:1px 5px;color:#e9e8bd;font-size:10px}.lan-urls{display:flex;flex-direction:column;gap:10px;margin:23px 0}.lan-urls a{display:block;overflow-wrap:anywhere;font:700 16px ui-monospace,monospace;background:#153121;padding:15px;border:1px solid #b6d27377;border-radius:6px;color:var(--leaf)}.result-modal{text-align:center;padding:36px}.result-icon{font-size:55px;margin-bottom:10px}.result-modal h2{font-size:35px}.toast{position:fixed;z-index:100;bottom:35px;left:50%;transform:translateX(-50%);max-width:calc(100% - 28px);width:max-content;padding:15px 25px;background:#fff0bf;color:#29432c;border-radius:8px;box-shadow:0 10px 35px #0005;border:1px solid #d9c884;font-size:13px;line-height:1.5}.toast.error{background:#f9d8b9;color:#673826}.connection-message{color:#efc89c}@keyframes enter{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@media(min-width:1450px){.landing{min-height:790px}.landing-content{padding-top:85px}.hero-art{inset:0 -42px 30px 22%}}
@media(max-width:1100px){.app-shell{padding:0 25px}.topbar{height:82px}.landing{min-height:700px}.hero-art{inset:0 -25px 25px 20%}.landing-content{padding-top:64px;max-width:420px}.landing h1{font-size:65px}.hero-name-plant{left:42%}.hero-name-zombie{right:3%;bottom:130px}.hero-name{font-size:15px}.seed-tray{gap:6px;padding:7px}.resource-meter{width:72px}.seed-card{min-width:65px}.deck{gap:5px}.tool-button{min-width:45px}.tools{gap:4px}.lobby{padding:25px 20px 45px}.game .topbar{height:65px}}
@media(max-width:760px){.app-shell{padding:0 16px}.topbar{height:73px}.brand{font-size:18px;gap:6px}.brand-sun{font-size:36px}.brand small{font-size:6px;letter-spacing:1.5px}.network{font-size:0;gap:0;margin-right:0}.network i{height:7px;width:7px}.top-actions{gap:6px}.icon-button{width:33px;height:33px;font-size:18px}.landing{min-height:900px;padding-top:325px;border-top:0;overflow:visible}.hero-art{inset:0 -16px auto;height:385px;border-top:1px solid #ffffff15}.hero-shade{background:linear-gradient(0deg,var(--deep) 0%,#11281f00 75%),linear-gradient(90deg,#11281f40,#11281f00 50%)}.hero-art img{object-position:50% 40%}.hero-name{bottom:72px;font-size:15px;padding:7px 10px}.hero-name-plant{left:8%}.hero-name-zombie{right:8%;bottom:72px}.hero-name span{font-size:8px}.landing-content{max-width:100%;padding:0 10px 90px;text-align:center}.edition{font-size:9px;letter-spacing:2px}.landing h1{font-size:58px;line-height:1.04;letter-spacing:-3px;margin:17px 0}.landing h1 br{display:none}.landing h1 em{display:block;margin-top:4px}.hero-copy{font-size:12px;line-height:1.8}.play-box{margin:25px auto 0;width:395px;text-align:left}.play-note{justify-content:center;font-size:8px}.landing-footer{bottom:15px;font-size:8px;align-items:center}.landing-footer>span{max-width:180px;line-height:1.7}.landing-footer .text-button{font-size:9px}.room-header h1{font-size:23px}.room-header .button{font-size:10px;padding:10px;min-height:40px}.lobby{padding:17px 0 35px}.eyebrow{font-size:9px}.invite-plank{padding:13px;margin:24px 0 15px}.invite-plank>div{gap:8px;flex-direction:column;align-items:flex-start}.invite-plank strong{font-size:26px;letter-spacing:6px}.invite-plank .button{font-size:10px;padding:10px}.faction-grid{gap:12px}.faction-card{min-height:315px;padding:175px 12px 16px}.faction-sprite{width:190px;height:190px;top:-5px}.faction-tag{font-size:8px;letter-spacing:.3px}.faction-card h2{font-size:26px;margin:9px 0}.faction-card p{font-size:9px;min-height:28px;line-height:1.7}.player-slot{font-size:10px;gap:7px;flex-direction:column;align-items:flex-start;margin-top:11px;padding-top:11px}.lobby-vs{font-size:31px;top:41%}.lobby-bottom{flex-wrap:wrap;gap:10px}.lobby-bottom p{width:100%;max-width:none;flex-shrink:0;margin-bottom:5px}.lobby-bottom .button{flex:1}.game{margin:0 -8px}.match-bar{padding:0 4px 12px}.match-title strong{font-size:13px}.match-title small{font-size:8px}.match-title>span{font-size:24px}.match-info{gap:12px}.wave-tag{font-size:10px}.clock{font-size:20px}.battle-layout{border-width:3px;border-radius:8px}.seed-tray{padding:6px 5px;gap:5px;min-height:101px}.resource-meter{width:48px}.resource-meter>span{font-size:22px}.resource-meter strong{font-size:20px}.resource-meter small{font-size:8px}.deck{gap:4px}.seed-card{min-width:57px;padding:4px 2px}.seed-card .card-art{width:40px;height:38px;font-size:25px;line-height:38px}.seed-card .card-art.atlas{width:44px;height:39px}.seed-card .card-name{font-size:9px}.seed-card .card-cost{font-size:10px}.seed-card kbd{display:none}.tools{gap:3px;flex-direction:column;margin-left:0}.tool-button{min-width:35px;width:35px;height:40px;min-height:0;padding:1px}.tool-button>span{font-size:21px;line-height:1}.tool-button small{font-size:7px;line-height:1.7}.tool-button kbd{display:none}.skill-tool b{font-size:16px}.board-message{font-size:14px;padding:10px 16px;border-width:1px}.pause-overlay strong{font-size:17px}.pause-overlay span{font-size:10px}.battle-bottom{margin-top:20px;font-size:10px;align-items:flex-start;flex-direction:column;gap:5px}.battle-bottom>div{font-size:8px;justify-content:space-between;width:100%}.progress-track{margin-top:10px}.modal{padding:29px 23px}.modal h2{font-size:25px}.help-grid{gap:18px}.help-grid h3{font-size:13px}.help-grid p,.modal p{font-size:11px}.choose-faction label>span{padding:20px 7px}.choose-faction strong{font-size:14px}.choose-faction small{font-size:8px}.code-input{font-size:31px;letter-spacing:9px}}
@media(max-width:380px){.landing h1{font-size:50px}.hero-name{font-size:13px}.landing-content{padding-left:0;padding-right:0}.multiplayer-row .button{font-size:10px}.play-note{font-size:7px}.hero-art{height:345px}.landing{padding-top:287px}.seed-card{min-width:53px}.resource-meter{width:43px}}
@media(max-height:560px) and (orientation:landscape){.topbar{height:52px}.brand{font-size:16px}.brand-sun{font-size:32px}.game{max-width:880px}.match-bar{padding-bottom:8px}.match-title strong{font-size:11px}.match-title small{display:none}.match-title>span{font-size:20px}.seed-tray{min-height:70px;padding:3px 6px}.seed-card .card-art,.seed-card .card-art.atlas{height:29px;width:39px;line-height:29px;font-size:24px}.seed-card .card-name{font-size:8px}.seed-card .card-cost{font-size:9px}.resource-meter>span{font-size:19px}.resource-meter strong{font-size:18px}.resource-meter small{display:none}.seed-card{min-width:53px;padding:1px}.tools{flex-direction:row}.tool-button{height:auto;width:40px}.board-frame{max-height:none}.battle-bottom{margin-top:14px}.landing{min-height:680px;padding-top:0}.hero-art{inset:0 -16px 40px 25%;height:auto}.landing-content{text-align:left;padding:35px 0 90px;width:400px}.landing h1{font-size:50px;line-height:1.12}.landing h1 br{display:block}.landing h1 em{display:inline}.hero-copy{font-size:11px}.play-box{margin-left:0;max-width:350px}.hero-shade{background:linear-gradient(90deg,var(--deep),transparent 70%),linear-gradient(0deg,var(--deep),transparent 35%)}.hero-name-plant{display:none}.hero-name-zombie{bottom:70px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

.seed-card .card-art.zombie-atlas{background-image:url('/assets/zombies.png');background-size:300% 200%;width:45px;height:45px}
.seed-card .card-art.atlas{width:34px;height:45px}
@media(max-width:760px){.seed-card .card-art.atlas{width:29px;height:39px}.seed-card .card-art.zombie-atlas{width:39px;height:39px}}
@media(max-height:560px) and (orientation:landscape){.seed-card .card-art.atlas{width:23px;height:31px}.seed-card .card-art.zombie-atlas{width:31px;height:31px}}

/* Keep the complete lawn in the viewport on desktop and phone landscape. */
.in-game .topbar{height:62px}
.game{max-width:min(1200px,calc((100dvh - 345px)*1.66154))}
@media(max-width:760px) and (orientation:portrait){.game{max-width:none}.in-game .topbar{height:66px}}
@media(max-height:600px) and (orientation:landscape){
  .in-game .topbar{display:none}
  .game{max-width:calc((100dvh - 115px)*1.66154);min-width:320px;margin:0 auto;padding-bottom:0}
  .match-bar{padding:5px 3px 6px}.match-title strong{font-size:11px}.match-title small{display:none}.match-title>span{font-size:20px}.match-info{gap:10px}.match-info .icon-button{height:25px;width:28px;font-size:15px}.clock{font-size:17px}.wave-tag{font-size:9px}
  .seed-tray{min-height:70px;height:70px;padding:3px 5px}.seed-card{min-width:51px;padding:1px 2px}.seed-card .card-art.atlas{width:23px;height:31px}.seed-card .card-art.zombie-atlas,.seed-card .card-art.boss{width:31px;height:31px}.seed-card .card-name{font-size:8px}.seed-card .card-cost{font-size:9px}.seed-card kbd{display:none}
  .resource-meter{width:42px}.resource-meter>span{font-size:20px}.resource-meter strong{font-size:18px}.resource-meter small{display:none}.tools{flex-direction:row;gap:3px}.tool-button{width:36px;min-width:36px;height:auto}.tool-button>span{font-size:23px}.tool-button small{font-size:7px}.tool-button kbd{display:none}
  .battle-bottom,.progress-track{display:none}
}

@media(max-width:760px){
  .icon-button,.match-info .icon-button{min-width:40px;min-height:40px}
  .tool-button{width:40px;min-width:40px;height:40px;min-height:40px}
}
@media(max-height:600px) and (orientation:landscape){
  .game{max-width:calc((100dvh - 125px)*1.66154)}
  .match-bar{padding-top:1px;padding-bottom:3px}
  .match-info .icon-button{width:40px;min-width:40px;height:40px;min-height:40px}
  .tool-button{width:40px;min-width:40px;min-height:40px;height:auto}
}

/* Landscape puts the deck beside a cropped lawn, preserving large touch cells. */
@media(max-height:600px) and (orientation:landscape){
  .in-game .app-shell{padding-left:8px;padding-right:8px}
  .game{width:100%;max-width:min(100%,calc((100dvh - 50px)*2.11765 + 112px));min-width:0}
  .battle-layout{position:relative;padding-left:106px;border-width:3px}
  .seed-tray{position:absolute;inset:0 auto 0 0;width:106px;min-height:0;height:auto;padding:4px;display:grid;grid-template-rows:34px minmax(0,1fr) 40px;grid-template-columns:minmax(0,1fr);gap:4px;border-bottom:0;border-right:3px solid #382c1b}
  .resource-meter{width:auto;height:34px;flex-direction:row;gap:6px;border-radius:4px}
  .resource-meter>span{font-size:21px}.resource-meter strong{font-size:20px}.resource-meter small{display:none}
  .deck{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:57px;align-content:start;gap:4px;padding:2px;overflow-y:auto;overflow-x:hidden;min-height:0;scrollbar-width:thin;scrollbar-color:#ac995f transparent}
  .seed-card{width:auto;min-width:0;max-width:none;min-height:57px;height:57px;padding:1px;border-width:1px;border-radius:3px}
  .seed-card .card-art.atlas{width:23px;height:31px}.seed-card .card-art.zombie-atlas,.seed-card .card-art.boss{width:31px;height:31px}
  .seed-card .card-name{font-size:7px;letter-spacing:-.3px}.seed-card .card-cost{font-size:9px}.seed-card .cooldown-number{font-size:15px;top:18px}
  .tools{flex-direction:row;display:flex;gap:4px;min-width:0;margin:0}
  .tool-button{flex:1;width:40px;min-width:40px;height:40px;min-height:40px;padding:1px}.tool-button>span{font-size:22px}.tool-button small{font-size:7px}
  .board-frame{width:100%;min-width:0}
  #board{width:100%;height:auto}
  .board-message{top:23%;font-size:15px;padding:9px 16px}
  .pause-overlay strong{font-size:19px}
}

/* Safari's visible viewport and hardware safe areas keep play controls reachable. */
:root{--viewport-h:100vh;--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px);--page-gutter:42px}
@supports(height:100dvh){:root{--viewport-h:100dvh}}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
.app-shell{padding-top:var(--safe-top);padding-bottom:var(--safe-bottom);padding-left:max(var(--page-gutter),var(--safe-left));padding-right:max(var(--page-gutter),var(--safe-right))}
.game{max-width:min(1200px,calc((var(--viewport-h) - var(--safe-top) - var(--safe-bottom) - 355px)*1.66154))}
.match-audio{display:none;align-items:center;gap:4px}
.modal{max-height:calc(var(--viewport-h) - var(--safe-top) - var(--safe-bottom) - 24px);overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.modal-close{width:44px;height:44px;top:4px;right:4px}
.toast{bottom:calc(20px + var(--safe-bottom));max-width:calc(100% - var(--safe-left) - var(--safe-right) - 28px)}
.icon-button,.match-info .icon-button{min-width:44px;min-height:44px}
.text-button{min-height:44px}
.edition b{font-weight:inherit}
@media(max-width:1100px){:root{--page-gutter:25px}}
@media(max-width:760px){
  :root{--page-gutter:16px}
  .icon-button,.match-info .icon-button{width:44px;height:44px;font-size:19px}
  .tool-button{width:44px;min-width:44px;height:44px;min-height:44px}
  .top-actions{gap:3px}.brand{font-size:17px}.brand-sun{font-size:32px}
  .room-header .button{min-height:44px}
}
@media(pointer:coarse){.name-label input{font-size:16px;min-height:44px}.deck,.modal{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}}
@media(max-width:760px) and (orientation:portrait){.game{max-width:none}}
@media(max-height:600px) and (orientation:landscape){
  .in-game .app-shell{--page-gutter:8px;padding-left:max(8px,var(--safe-left));padding-right:max(8px,var(--safe-right));padding-top:var(--safe-top);padding-bottom:var(--safe-bottom)}
  .game{max-width:min(100%,calc((var(--viewport-h) - var(--safe-top) - var(--safe-bottom) - 56px)*2.11765 + 124px))}
  .match-bar{padding:1px 3px 5px;min-height:50px;gap:8px}
  .match-title{min-width:0;gap:6px}.match-title>div{min-width:0}.match-title strong{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.match-title>span{font-size:19px}
  .match-info{gap:8px;flex-shrink:0}.match-audio{display:flex}.match-info .icon-button{width:44px;height:44px;font-size:19px}
  .battle-layout{padding-left:118px}
  .seed-tray{width:118px;grid-template-rows:34px minmax(0,1fr) 44px}
  .seed-card{min-width:44px}
  .tools{gap:4px}.tool-button{width:44px;min-width:44px;height:44px;min-height:44px}
  .tool-button>span{font-size:23px}.tool-button small{font-size:8px}
}
