:root{color-scheme:dark;--bg:#171b24;--panel:#242a34;--line:#3f4851;--text:#f3f3dd;--muted:#a3aa9e;--green:#b8e85f;--lime:#8abc47;--orange:#ffc764;--red:#ef6660}
*{box-sizing:border-box}html,body{height:100%;margin:0}body{background:#171b24;color:var(--text);font-family:ui-rounded,"Arial Rounded MT Bold",system-ui,sans-serif;min-height:100svh;-webkit-tap-highlight-color:transparent;overflow:hidden}.game-shell{width:min(100%,520px);height:100svh;margin:auto;padding:env(safe-area-inset-top) 12px env(safe-area-inset-bottom);display:flex;flex-direction:column;background:linear-gradient(180deg,#4a5060 0%,#262d36 21%,#171b24 65%);overflow:hidden}.topbar{height:38px;flex:none;display:flex;align-items:center;justify-content:space-between;padding:0 3px}.brand{display:flex;align-items:center;gap:7px;color:#f4f2d6;text-decoration:none;font-size:10px;font-weight:900;letter-spacing:.17em}.brand-mark{width:21px;height:21px;border:1px solid #c5da7d;border-radius:7px;color:#c9ee73;display:grid;place-items:center;font-size:13px}.top-actions{display:flex;align-items:center;gap:8px}.level-tag{font-size:9px;color:#e3e9d2;background:#4b574e;border:1px solid #71815b;padding:5px 9px;border-radius:99px}.icon-button{width:30px;height:30px;border-radius:50%;border:1px solid #7f8971;background:#374039;color:#eff0de;font-weight:800;font-size:12px}.status-bar{height:54px;flex:none;display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 7px;padding:4px 11px;background:linear-gradient(180deg,#292e37dd,#1c2128ee);border:1px solid #515b60;border-radius:8px;box-shadow:0 4px 12px #0003}.stat{display:flex;align-items:center;gap:5px}.stat-icon{font-size:20px;line-height:1;text-shadow:0 2px 2px #111}.heart{color:#f36d62}.coin{color:#f3c45d}.stat small,.score-stat small,.wave-stat small{display:block;color:#aeb7a5;font-size:8px;font-weight:800;letter-spacing:.06em;margin-bottom:1px}.stat strong,.score-stat strong,.wave-stat strong{font-size:15px;line-height:1;font-weight:900;text-shadow:0 2px 2px #0008}.score-stat{text-align:center;min-width:43px}.score-stat strong{color:#c9ee73}.score-stat span{display:block;color:#d9dece;font-size:9px;font-weight:800;line-height:1}.wave-stat{text-align:right;min-width:46px}.wave-stat strong{font-size:12px}.wave-stat i{font-size:9px;color:#aeb7a5;font-style:normal}.wave-progress{height:3px;width:42px;background:#445044;border-radius:10px;overflow:hidden;margin:3px 0 0 auto}.wave-progress span{height:100%;display:block;width:0;background:var(--green);transition:width .25s}.board-wrap{position:relative;flex:1;min-height:220px;width:100%;border:2px solid #657642;border-radius:8px;overflow:hidden;background:#9acd58;box-shadow:0 6px 18px #0005,inset 0 0 0 3px #e8dfa530}.board-wrap canvas{display:block;width:100%;height:100%;touch-action:none}.toast{position:absolute;z-index:3;left:50%;top:10px;transform:translate(-50%,-8px);background:#161b20ec;color:#fff1c4;border:1px solid #85935d;border-radius:8px;padding:7px 10px;font-size:10px;font-weight:800;opacity:0;pointer-events:none;transition:.2s;white-space:nowrap;box-shadow:0 3px 12px #0005}.toast.show{opacity:1;transform:translate(-50%,0)}.controls{flex:none;padding:7px 0 4px}.section-heading{height:23px;display:flex;align-items:center;justify-content:space-between;padding:0 2px}.eyebrow{margin:0;color:#a8cc61;font-size:8px;font-weight:900;letter-spacing:.15em}.section-heading h2{font-size:12px;margin:0;line-height:1.1;letter-spacing:-.02em}.hint{font-size:9px;color:#abb4a2}.tower-list{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding:2px 1px 5px}.tower-list::-webkit-scrollbar{display:none}.tower-card{flex:1 0 70px;max-width:110px;height:51px;border:1px solid #525c53;border-radius:8px;background:linear-gradient(180deg,#3c4544,#272f32);color:var(--text);display:grid;grid-template-columns:25px 1fr;grid-template-rows:1fr 1fr;align-items:center;text-align:left;padding:5px 7px;position:relative;transition:transform .12s,border-color .12s,background .12s;box-shadow:0 2px 0 #111}.tower-card:active{transform:scale(.97)}.tower-card.selected{border-color:#c4f05f;background:linear-gradient(180deg,#536341,#354735);box-shadow:0 0 0 1px #b1d57355,0 2px 0 #111}.tower-art{grid-row:1/3;width:22px;height:25px;border-radius:5px;display:grid;place-items:center;font-size:15px}.pea-art{color:#ddf78a;background:#5b693a}.cannon-art{color:#ffc578;background:#65503a}.frost-art{color:#9ce4ec;background:#355866}.tower-name{font-size:9px;font-weight:900;align-self:end;white-space:nowrap}.tower-cost{font-size:8px;color:#f5d483;align-self:start;margin-top:1px}.bottom-row{height:40px;margin-top:2px;display:flex;align-items:center;justify-content:space-between;gap:8px}.selection-info{display:flex;align-items:center;gap:6px;min-width:0;color:#d0d5c8;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.selection-dot{width:7px;height:7px;flex:none;border-radius:50%;background:var(--green);box-shadow:0 0 8px #c9ee7380}.start-button{height:34px;flex:none;padding:0 12px;border:1px solid #8aae4f;border-radius:8px;background:linear-gradient(180deg,#c5ef69,#8fc84d);color:#1b2914;font-weight:900;font-size:10px;display:flex;align-items:center;gap:13px;box-shadow:0 3px 0 #5d8131;transition:transform .1s,filter .1s}.start-button:active{transform:translateY(2px);box-shadow:0 1px 0 #5d8131}.start-button:disabled{filter:grayscale(.6);opacity:.65}.start-arrow{font-size:14px}.map-legend{display:none}
@media(max-width:370px){.game-shell{padding-left:8px;padding-right:8px}.status-bar{padding:4px 7px;gap:4px}.tower-card{flex-basis:66px;padding-left:5px;padding-right:4px}.tower-name{font-size:8px}.selection-info{font-size:8px}.start-button{padding:0 9px;gap:8px}}
@media(min-width:650px){.game-shell{padding-left:16px;padding-right:16px}.board-wrap{border-radius:12px}.tower-card{height:55px}}
