.td-shell{padding:28px;background:#152839;border:1px solid #52706855;border-radius:28px;color:#f0f4e8}.td-top{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:24px}.td-top h2{font-size:36px;margin:8px 0}.td-campaign-intro{display:flex;align-items:center;gap:24px;padding:28px;background:linear-gradient(120deg,#365947,#223b45);border-radius:20px}.td-campaign-intro>span{font-size:70px}.td-campaign-intro h3{font-size:26px;margin:0 0 10px}.td-campaign-intro p,.td-campaign-intro small{color:#c5d9ca;line-height:1.6}.td-campaign-intro>b{color:#ffe39b;white-space:nowrap}.td-world{margin-top:32px}.td-world>h3{font-size:22px}.td-world>h3>span{color:var(--world);margin-right:12px}.td-levels{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}.td-levels button{display:flex;flex-direction:column;text-align:left;gap:10px;border:1px solid #ffffff20;border-radius:16px;padding:18px;background:#203846;color:#f1f6e9;cursor:pointer;min-height:170px}.td-levels button:hover{background:#34524f;border-color:var(--world);transform:translateY(-3px)}.td-level-number{font-size:30px;font-weight:900;color:var(--world)}.td-levels small{color:#a7c0c0;font-size:11px}.td-stars{color:#ffe08b;letter-spacing:3px;margin-top:auto}.td-hud{display:grid;grid-template-columns:repeat(4,1fr);background:#0d202b;border:1px solid #698e8555;border-radius:16px;margin-bottom:16px}.td-hud>div{padding:14px 20px}.td-hud small,.td-panel small{display:block;color:#b0caca;font-size:11px;letter-spacing:1px}.td-hud strong{font-size:26px;color:#ffdf8a}.td-hud em{font-size:14px;font-style:normal;color:#a7bcbc}.td-layout{display:grid;grid-template-columns:minmax(0,1fr) 265px;gap:18px;align-items:start}.td-field{position:relative;overflow:hidden;border-radius:18px;border:3px solid #b7d8bd;background:#71bb8b}.td-field canvas{display:block;width:100%;height:auto;touch-action:manipulation;aspect-ratio:3/2}.td-field:fullscreen{display:flex;align-items:center;justify-content:center;background:#132536;border-radius:0}.td-field:fullscreen canvas{width:min(100vw,150vh);height:auto;max-height:100vh;object-fit:contain}.td-panel h3{font-size:22px;margin:8px 0}.td-panel p{font-size:12px;line-height:1.6;color:#c6d7cf}.td-shop{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:16px 0}.td-shop button{padding:12px 9px;background:#253e4c;border:2px solid #56777855;border-radius:12px;color:#edf2e7;cursor:pointer;text-align:left;min-height:103px}.td-shop button[aria-pressed=true]{border-color:#ffe293;background:#3b5356}.td-shop button>span{display:block;font-size:26px}.td-shop small{font-size:10px;line-height:1.5;letter-spacing:0;margin-top:6px}.td-shop .td-unaffordable{opacity:.6}.td-selection{padding:13px;border:1px solid #658a8a55;border-radius:12px;min-height:77px}.td-selection strong{display:block;font-size:13px;margin-bottom:9px}.td-selection small{font-size:11px;letter-spacing:0;line-height:1.4}.td-selection button{background:#38515a;color:white;border:1px solid #72978d;padding:10px 8px;border-radius:8px;font:inherit;font-size:11px;cursor:pointer}.td-selection button:disabled{opacity:.45;cursor:default}.td-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.td-actions .control-button{font-size:11px;padding:9px}.td-panel>.primary-button{width:100%;background:linear-gradient(120deg,#ffcc69,#ffa766);color:#243442;border:0}.td-panel>.primary-button:disabled{opacity:.55}.td-panel details{margin-top:20px;font-size:12px}.td-panel summary{cursor:pointer;color:#ffdf8a}.td-overlay{position:absolute;inset:0;background:#182e48aa;display:grid;place-items:center;padding:16px;overflow:auto;backdrop-filter:blur(3px)}.td-overlay[hidden],#tdBattle[hidden],#tdMenu[hidden]{display:none}.td-overlay>div{width:min(360px,100%);padding:24px;border-radius:20px;background:#152c3a;text-align:center;border:1px solid #abcda777;box-shadow:0 20px 40px #14253966}.td-overlay h3{font-size:26px;margin:12px 0}.td-overlay p{color:#bccfc9;line-height:1.6;font-size:13px}.td-overlay button{display:block;width:100%;padding:13px;margin-top:8px;background:#ffdb8b;border:0;border-radius:10px;color:#203343;font-weight:800;cursor:pointer}.td-result-icon{font-size:36px;letter-spacing:6px;color:#ffdb8b}.td-shell button:focus-visible{outline:3px solid #87eafa;outline-offset:3px}
@media(max-width:1100px){.td-levels{grid-template-columns:repeat(3,1fr)}.td-layout{grid-template-columns:1fr}.td-panel{display:grid;grid-template-columns:1fr 1fr;gap:12px}.td-shop{margin:0;grid-row:span 3}.td-panel details{grid-column:1/-1}.td-panel>p{margin:0}.td-field{max-width:960px;width:100%;margin:auto}.td-overlay{min-height:0}}@media(max-width:600px){.td-shell{padding:12px;border-radius:18px}.td-top{align-items:flex-start}.td-top h2{font-size:25px}.td-top .control-button{font-size:10px;padding:10px}.td-top .eyebrow{font-size:9px}.td-campaign-intro{padding:18px;gap:12px;flex-wrap:wrap}.td-campaign-intro>span{font-size:40px}.td-campaign-intro h3{font-size:21px}.td-campaign-intro>b{font-size:15px}.td-levels{grid-template-columns:repeat(2,1fr)}.td-levels button{padding:14px;min-height:155px}.td-hud>div{padding:10px 8px}.td-hud small{font-size:8px;letter-spacing:0}.td-hud strong{font-size:20px}.td-hud em{font-size:10px}.td-panel{display:block}.td-shop{grid-template-columns:repeat(4,1fr);margin:14px 0}.td-shop button{padding:8px 5px;min-height:105px}.td-shop strong{font-size:11px}.td-shop small{font-size:9px}.td-panel>.primary-button{margin-top:10px}.td-overlay{position:relative;inset:auto;background:#182e48;padding:12px;overflow:visible}.td-overlay>div{padding:16px}.td-field:fullscreen .td-overlay{position:absolute;inset:0;overflow:auto}.td-field:fullscreen .td-overlay[hidden]{display:none}.td-result-icon{font-size:26px}.td-overlay h3{font-size:23px}}

.td-levels svg{width:100%;height:auto;border-radius:8px;aspect-ratio:3/2}.td-levels strong{min-height:2.5em}

.td-difficulty{display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin-top:22px;padding:20px;background:#263d4b;border-radius:16px}.td-difficulty label{font-size:11px;color:#ffdc91;font-weight:800;letter-spacing:1px}.td-difficulty select,.td-target-label select{padding:10px;background:#152c3a;color:#eff6ee;border:1px solid #719084;border-radius:8px;font:inherit}.td-difficulty p{font-size:12px;line-height:1.6;color:#bed0ca;margin:0;flex:1;min-width:220px}.td-difficulty-badge{display:inline-block;background:#354a55;color:#ffdc91;padding:5px 10px;font-size:11px;border-radius:7px}.td-powers{padding:12px;background:#233449;border:1px solid #879bc566;border-radius:12px;margin:12px 0}.td-powers>strong{font-size:10px;letter-spacing:1px;color:#c6dafa}.td-powers button{display:block;width:100%;padding:12px 8px;border:1px solid #dbb566;border-radius:8px;color:#ffe4a8;background:#394752;margin:8px 0;font:inherit;font-size:12px;cursor:pointer}.td-powers button:disabled{opacity:.45;cursor:default}.td-powers button[aria-pressed=true]{background:#ffcf72;color:#243b46}.td-powers small{font-size:10px;letter-spacing:0}.td-forecast{font-size:12px;line-height:1.6;padding:10px 0;color:#ffe8b8}.td-target-label{display:block;font-size:11px;color:#b8cbd1}.td-target-label select{display:block;width:100%;margin:8px 0;font-size:11px}.td-branches{display:grid;gap:6px}.td-branches button{text-align:left}.td-branches small{font-size:10px;margin-top:4px;line-height:1.4}

@media(min-width:1101px){.td-field{position:sticky;top:94px}}
@media(max-width:1100px){.td-layout{display:block}.td-field{position:sticky;top:80px;z-index:2}.td-panel{display:block;margin-top:16px}.td-shop{grid-template-columns:repeat(4,1fr)}.td-field:has(.td-overlay:not([hidden])){position:relative;top:0}.td-field:fullscreen{top:0}}

@media(max-height:600px){.td-field{position:relative;top:0}}

/* Warm miniature neighbourhood, with controls outside the playable grid. */
.td-field{background:#f4d5ac;border-color:#d2ac79;box-shadow:0 15px 35px #101b3233;overflow:hidden}
.td-field canvas{display:block;touch-action:manipulation}
.td-camera{display:flex;align-items:center;gap:8px;padding:8px 12px;background:#344451;color:#ffe3ac}
.td-camera span{flex:1;font-size:9px;letter-spacing:1.4px;font-weight:800}
.td-camera button{width:34px;height:30px;background:#506170;border:1px solid #9f9e90;border-radius:6px;color:#fff1ce;font-size:20px;cursor:pointer}
.td-scene-status{position:absolute;left:50%;top:12px;transform:translateX(-50%);z-index:1;background:#344451ed;color:#fff1c5;border:1px solid #d8b884;border-radius:8px;padding:12px 18px;max-width:90%;text-align:center;pointer-events:none;font-weight:800;font-size:12px}
.td-scene-status[hidden]{display:none}
.td-field:fullscreen{flex-direction:column}.td-field:fullscreen canvas{width:min(100vw,calc((100vh - 46px)*1.5));height:auto;max-height:calc(100vh - 46px)}.td-field:fullscreen .td-camera{width:100%;box-sizing:border-box}
@media(max-width:600px){.td-camera{gap:5px;padding:6px}.td-camera span{font-size:8px;letter-spacing:.6px}.td-scene-status{font-size:10px;padding:8px;top:5px}}

/* Fullscreen includes the real HUD and construction panel, without duplicate controls. */
.td-shell:fullscreen{box-sizing:border-box;width:100vw;height:100dvh;padding:12px;background:#172d3a;overflow:auto;border-radius:0}
.td-shell:fullscreen .td-top{margin-bottom:8px}.td-shell:fullscreen .td-top h2{font-size:22px;margin:2px 0}
.td-shell:fullscreen .td-hud{margin:8px 0}.td-shell:fullscreen .td-hud>div{padding:8px}
.td-shell:fullscreen .td-layout{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:12px;align-items:start}
.td-shell:fullscreen .td-field{position:relative;top:0;display:flex;flex-direction:column;align-items:center}
.td-shell:fullscreen .td-field canvas{width:min(100%,calc((100dvh - 205px)*1.5));height:auto;aspect-ratio:3/2}
.td-shell:fullscreen .td-camera{width:100%;box-sizing:border-box}.td-shell:fullscreen .td-panel{max-height:calc(100dvh - 175px);overflow:auto;margin:0;padding-right:5px;display:block}
.td-shell:fullscreen .td-shop{grid-template-columns:repeat(2,1fr);margin-top:0}
.td-online{padding:12px;border:1px solid #698779;border-radius:12px;margin:12px 0;color:#dae8df;background:#203946}
.td-online summary{cursor:pointer;font-weight:800;color:#ffdf9b}.td-online p,.td-online small{font-size:12px;line-height:1.5}
.td-room-form{display:flex;gap:10px;flex-wrap:wrap;align-items:end}.td-room-form label{display:grid;gap:5px;font-size:12px}
.td-online input,.td-online select,.td-online button{padding:9px;border-radius:7px;border:1px solid #78928c;background:#304958;color:#fff3da;font:inherit;max-width:100%}.td-online button{cursor:pointer}.td-online button:disabled{opacity:.5}
.td-room-heading{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.td-room-players{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px;margin:12px 0}.td-room-players>div{padding:10px;background:#172d3a;border:1px solid #4b6570;border-radius:8px}.td-room-players small{display:block}.td-room-players .is-you{border-color:#efc77c}
@media(max-width:650px){.td-shell:fullscreen .td-layout{display:flex;flex-direction:column}.td-shell:fullscreen .td-field{width:100%}.td-shell:fullscreen .td-field canvas{width:min(100%,calc(42dvh*1.5))}.td-shell:fullscreen .td-panel{width:100%;max-height:none}.td-shell:fullscreen .td-shop{grid-template-columns:repeat(4,1fr)}.td-shell:fullscreen .td-top{display:none}}

.td-shell:fullscreen #tdLevel{display:none}
@media(max-height:600px){.td-shell:fullscreen .td-top{display:none}.td-shell:fullscreen .td-online{padding:6px 10px;margin:2px 0}.td-shell:fullscreen .td-online summary{font-size:11px}.td-shell:fullscreen .td-hud strong{font-size:20px}.td-shell:fullscreen .td-hud small{font-size:8px}.td-shell:fullscreen .td-hud{margin:5px 0}.td-shell:fullscreen .td-field canvas{width:min(100%,calc((100dvh - 135px)*1.5))}.td-shell:fullscreen .td-panel{max-height:calc(100dvh - 100px)}}

.td-bestiary{margin:12px 0}.td-bestiary article{padding:10px 0;border-bottom:1px solid #6b858344}.td-bestiary small{display:block;font-size:11px;line-height:1.5}
.td-camera span{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.td-camera #tdPlace{width:auto;min-width:74px;font-size:12px;background:#347b69}.td-camera button[hidden]{display:none}.td-field canvas{touch-action:none}
/* The board and controls each own a bounded area: the page never pushes the board away. */
.td-shell:fullscreen{display:flex;flex-direction:column;overflow:hidden;gap:6px;padding:8px}
.td-shell:fullscreen .td-top{display:none}.td-shell:fullscreen #tdRoom{flex:none;max-height:35dvh;overflow:auto}.td-shell:fullscreen .td-online{margin:0;padding:6px 10px}
.td-shell:fullscreen #tdBattle{display:flex;flex:1;min-height:0;flex-direction:column;gap:6px}.td-shell:fullscreen #tdBattle[hidden]{display:none}
.td-shell:fullscreen .td-hud{flex:none;margin:0}.td-shell:fullscreen .td-hud>div{padding:6px 8px}.td-shell:fullscreen .td-hud strong{font-size:22px}
.td-shell:fullscreen .td-layout{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) clamp(210px,25vw,300px);grid-template-rows:minmax(0,1fr);align-items:stretch;gap:8px}
.td-shell:fullscreen .td-field{display:grid;grid-template-rows:minmax(0,1fr) auto;min-height:0;min-width:0;width:auto;height:auto;align-items:stretch}
.td-shell:fullscreen .td-field canvas{width:100%;height:100%;min-height:0;aspect-ratio:auto;max-height:none}.td-shell:fullscreen .td-camera{padding:5px;gap:4px}
.td-shell:fullscreen .td-panel{max-height:none;height:100%;min-height:0;min-width:0;box-sizing:border-box;overflow:auto;overscroll-behavior:contain;padding:0 4px 12px 0}
.td-shell:fullscreen #tdMenu{overflow:auto;min-height:0}
@media(max-width:650px) and (orientation:portrait){.td-shell:fullscreen .td-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(150px,52%) minmax(0,1fr)}.td-shell:fullscreen .td-shop{grid-template-columns:repeat(4,1fr)}.td-shell:fullscreen .td-shop button{min-height:82px}.td-shell:fullscreen .td-camera span{font-size:8px}.td-shell:fullscreen .td-online summary{font-size:11px}}

.td-shell:fullscreen .td-field{height:100%;width:100%;align-self:stretch;justify-self:stretch;box-sizing:border-box}

/* Keep desktop shop drags in the placement interaction, without text selection. */
.td-shop button{user-select:none;-webkit-user-select:none;cursor:grab}.td-shop button:active{cursor:grabbing}

/* Give the neighbourhood the full page width and allow controls to fold away. */
.game-stage-wrap:has(.td-shell){width:calc(100% - 16px);max-width:none}
.td-shell{padding:12px}.td-field{max-width:none}
.td-camera #tdTogglePanel{width:auto;font-size:11px;padding:0 9px;flex-shrink:0}
.td-shell.td-map-wide .td-layout{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
.td-shell.td-map-wide .td-panel{display:none}
.td-shell.td-map-wide .td-field{position:relative;top:0;width:100%;max-width:none}
.td-shell.td-map-wide:not(:fullscreen) .td-field canvas{height:calc(100dvh - 160px);min-height:300px;aspect-ratio:auto}
.td-shell.td-map-wide:fullscreen .td-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
@media(max-width:650px){.td-camera:has(#tdPlace:not([hidden])){flex-wrap:wrap}.td-camera:has(#tdPlace:not([hidden]))>span{display:none}.td-camera #tdTogglePanel{font-size:10px;padding:0 5px}}

.td-audio-settings{position:absolute;z-index:4;right:8px;bottom:50px;width:min(300px,calc(100% - 16px));max-height:calc(100% - 60px);overflow:auto;box-sizing:border-box;padding:16px;background:#203744f5;border:1px solid #f1cf88;border-radius:14px;box-shadow:0 8px 28px #10203066;color:#fff0c4}
.td-audio-settings[hidden]{display:none}.td-audio-settings>div{display:flex;justify-content:space-between;align-items:center;gap:12px}.td-audio-settings button{background:#425d67;color:#fff0c4;border:1px solid #80928a;border-radius:6px;font-size:20px;cursor:pointer}.td-audio-switch{display:flex;align-items:center;gap:8px;margin:16px 0 10px;font-weight:700}.td-audio-switch input{accent-color:#ffd16e;width:18px;height:18px}.td-audio-volume{display:flex;justify-content:space-between;font-size:12px}.td-audio-settings input[type=range]{width:100%;accent-color:#ffd16e;margin:10px 0;height:24px}.td-audio-settings small{display:block;font-size:11px;line-height:1.5;color:#bcd3d1;margin-top:8px}

/* Wave announcements sweep across the field; the HUD stays the accessible source of truth. */
.td-banner{position:absolute;left:0;right:0;top:34%;z-index:1;display:grid;justify-items:center;gap:4px;padding:16px 12px;pointer-events:none;opacity:0;text-align:center;color:#fff6dc;background:linear-gradient(90deg,transparent,#1b2a3bd9 22%,#1b2a3bd9 78%,transparent);text-shadow:0 2px 0 #0d1722}
.td-banner small{font-size:11px;font-weight:900;letter-spacing:.34em;color:#ffd98a}
.td-banner strong{font-family:"Arial Black","Segoe UI Black",system-ui,sans-serif;font-size:clamp(20px,3.6vw,40px);line-height:1;letter-spacing:-.02em;text-transform:uppercase}
.td-banner[data-tone=boss] small,.td-banner[data-tone=lost] small{color:#ff9d8a}.td-banner[data-tone=won] small{color:#c9f754}.td-banner[data-tone=final] small{color:#ffb86a}
.td-banner.is-on{animation:td-banner 2.5s cubic-bezier(.2,.8,.2,1) both}
@keyframes td-banner{0%{opacity:0;transform:translateX(-7%) scaleY(.6)}12%{opacity:1;transform:none}80%{opacity:1;transform:none}100%{opacity:0;transform:translateX(5%)}}
@media(prefers-reduced-motion:reduce){.td-banner.is-on{animation:td-banner-still 2.5s linear both}}
html[data-motion=reduce] .td-banner.is-on{animation:td-banner-still 2.5s linear both}
@keyframes td-banner-still{0%,100%{opacity:0}12%,80%{opacity:1}}
@media(max-width:600px){.td-banner{padding:10px 8px}.td-banner small{font-size:9px;letter-spacing:.24em}}

/* End-of-level card over a lighter veil: the shattered crystal or the fireworks stay visible behind it. */
.td-field .td-overlay{background:#182e4870;backdrop-filter:blur(1.5px)}

/* ───────── 5.31 — interface 2026 ─────────
   Same controls, same ids, same places on phones; a new skin and a tighter desktop order.
   Ink surfaces, hairline borders, one lime accent for what starts a wave, gold only for money. */
.td-shell{--td-ink:#0e0c17;--td-raise:#17142299;--td-glass:rgba(255,255,255,.055);--td-glass-2:rgba(255,255,255,.09);--td-line:rgba(255,255,255,.1);--td-line-2:rgba(255,255,255,.2);--td-lime:#c9f754;--td-lime-ink:#141a05;--td-gold:#ffd166;--td-text:#f5f2ea;--td-soft:#aaa5bc;--td-display:"Arial Black","Segoe UI Black","Helvetica Neue",system-ui,sans-serif;
  padding:20px;background:radial-gradient(900px 420px at 0% 0%,#2a215033,transparent 70%),radial-gradient(700px 380px at 100% 0%,#c9f7540d,transparent 70%),var(--td-ink);border:1px solid var(--td-line);border-radius:28px;color:var(--td-text)}
.td-shell .td-top{margin-bottom:14px}
.td-shell .td-top h2{font-family:var(--td-display);font-size:clamp(22px,2.4vw,34px);letter-spacing:-.035em;text-transform:uppercase;margin:4px 0}
.td-shell .td-top .eyebrow{color:var(--td-soft);letter-spacing:.2em}
.td-shell .td-top .control-button,.td-shell .td-actions .control-button{border-radius:999px;border:1px solid var(--td-line-2);background:transparent;color:var(--td-text)}
.td-shell .td-top .control-button:hover,.td-shell .td-actions .control-button:hover:not(:disabled){border-color:var(--td-text);background:var(--td-glass)}
/* HUD: four glass counters and a hairline that fills as the assault runs out. */
.td-shell .td-hud{position:relative;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:12px;background:none;border:0;border-radius:0}
.td-shell .td-hud>div{display:flex;align-items:baseline;justify-content:space-between;gap:8px;padding:10px 16px;background:var(--td-glass);border:1px solid var(--td-line);border-radius:16px;min-width:0}
.td-shell .td-hud small{color:var(--td-soft);font-size:10px;font-weight:800;letter-spacing:.16em}
.td-shell .td-hud strong{font-family:var(--td-display);font-size:24px;letter-spacing:-.03em;color:var(--td-text);font-variant-numeric:tabular-nums;white-space:nowrap}
.td-shell .td-hud>div:nth-child(1) strong{color:#ff8fa3}.td-shell .td-hud>div:nth-child(2) strong{color:var(--td-gold)}.td-shell .td-hud>div:nth-child(3) strong{color:var(--td-lime)}
.td-shell .td-hud em{font-family:inherit;font-size:12px;color:var(--td-soft);font-weight:700}
.td-shell .td-hud-progress{position:absolute;left:14px;right:14px;bottom:-7px;height:3px;border-radius:3px;background:var(--td-line);overflow:hidden;pointer-events:none}
.td-shell .td-hud-progress::after{content:"";position:absolute;inset:0;transform-origin:left;transform:scaleX(var(--p,0));background:linear-gradient(90deg,var(--td-lime),#8cf0d1);border-radius:3px;transition:transform .9s linear}
/* Field: the diorama is the screen. */
.td-shell .td-field{border:0;border-radius:24px;background:#0b0a12;box-shadow:0 0 0 1px var(--td-line-2),0 30px 70px #0009}
.td-shell .td-camera{gap:6px;padding:8px 10px;background:#12101c;border-top:1px solid var(--td-line);color:var(--td-soft)}
.td-shell .td-camera span{font-size:9px;letter-spacing:.2em;color:var(--td-soft)}
.td-shell .td-camera button:not(.play-options-trigger){min-width:36px;width:auto;height:34px;padding:0 10px;border-radius:999px;border:1px solid var(--td-line-2);background:var(--td-glass);color:var(--td-text);font-size:15px}
.td-shell .td-camera button:not(.play-options-trigger):hover{border-color:var(--td-text)}
.td-shell .td-camera .play-options-trigger{border-radius:999px}
.td-shell .td-camera #tdPlace{background:var(--td-lime);color:var(--td-lime-ink);border-color:transparent;font-size:12px;font-weight:900}
.td-shell .td-scene-status{background:#12101ce6;border:1px solid var(--td-line-2);border-radius:999px;color:var(--td-text);letter-spacing:.06em}
.td-shell .td-audio-settings{background:#15121fee;border:1px solid var(--td-line-2);border-radius:18px;color:var(--td-text)}
/* Side panel: one title, then the wave button, then what you build with. */
.td-shell .td-panel small{color:var(--td-soft)}
.td-shell .td-panel p{color:var(--td-soft)}
.td-shell #tdLevel small{font-weight:800;letter-spacing:.16em;font-size:10px}
.td-shell .td-panel h3{font-family:var(--td-display);font-size:20px;letter-spacing:-.03em;text-transform:uppercase;line-height:1.05;margin:6px 0 8px}
.td-shell .td-difficulty-badge{display:inline-block;padding:4px 10px;border-radius:999px;border:1px solid var(--td-line-2);background:var(--td-glass);color:var(--td-text);font-size:11px;font-weight:800}
.td-shell .td-shop{gap:8px}
.td-shell .td-shop button{position:relative;background:var(--td-glass);border:1px solid var(--td-line);border-radius:16px;color:var(--td-text);transition:border-color .15s,background .15s,transform .15s}
.td-shell .td-shop button:hover{border-color:var(--td-line-2);background:var(--td-glass-2);transform:translateY(-2px)}
.td-shell .td-shop button[aria-pressed=true]{border-color:var(--td-lime);background:#c9f75414;box-shadow:0 0 0 1px var(--td-lime),0 10px 30px #c9f75422}
.td-shell .td-shop button>span{display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:#ffffff0f;font-size:21px;margin-bottom:8px}
.td-shell .td-shop strong{font-size:14px;letter-spacing:-.01em}
.td-shell .td-shop small{color:var(--td-soft)}
.td-shell .td-powers{padding:12px;background:var(--td-glass);border:1px solid var(--td-line);border-radius:16px}
.td-shell .td-powers>strong{color:var(--td-soft);font-size:10px;letter-spacing:.16em}
.td-shell .td-powers button{border-radius:12px;border:1px solid var(--td-line-2);background:#ffffff0a;color:var(--td-text);font-weight:800}
.td-shell .td-powers #tdMeteor:not(:disabled){border-color:#ff9f5a88;background:linear-gradient(120deg,#ff9f5a22,#ff6b5e14)}
.td-shell .td-powers #tdFreeze:not(:disabled){border-color:#8beaff88;background:linear-gradient(120deg,#8beaff22,#9a7bff14)}
.td-shell .td-powers button[aria-pressed=true]{background:var(--td-gold);color:#241a05;border-color:transparent}
.td-shell .td-target-label{color:var(--td-soft)}
.td-shell .td-target-label select,.td-shell .td-difficulty select,.td-shell .td-selection select{border-radius:12px;border:1px solid var(--td-line-2);background:#15121f;color:var(--td-text)}
.td-shell .td-selection{background:var(--td-glass);border:1px solid var(--td-line);border-radius:16px}
.td-shell .td-selection button{border-radius:999px;border:1px solid var(--td-line-2);background:transparent;color:var(--td-text);font-weight:800}
.td-shell .td-selection #tdUpgrade:not(:disabled){border-color:var(--td-lime);color:var(--td-lime)}
.td-shell .td-selection #tdSell:not(:disabled){border-color:#ff8fa388;color:#ffb3c0}
.td-shell .td-panel>.primary-button{border-radius:999px;background:var(--td-lime);color:var(--td-lime-ink);font-weight:900;letter-spacing:.01em;box-shadow:0 12px 34px #c9f75430;transition:transform .15s,box-shadow .15s}
.td-shell .td-panel>.primary-button:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 16px 40px #c9f75445}
.td-shell .td-panel>.primary-button:disabled{opacity:1;background:var(--td-glass);color:var(--td-text);border:1px solid var(--td-line-2);box-shadow:none}
.td-shell .td-panel summary{color:var(--td-text);font-weight:800}
.td-shell .td-panel details{border-top:1px solid var(--td-line);padding-top:12px;margin-top:14px}
.td-shell .td-field .td-overlay{background:#0e0c1785;backdrop-filter:blur(2px)}
@media(min-width:1101px){
 .td-shell .td-layout{grid-template-columns:minmax(0,1fr) 290px;gap:16px}
 .td-shell .td-panel{display:flex;flex-direction:column;gap:10px}
 .td-shell .td-panel>*{margin:0}
 .td-shell #tdLevel{order:1}.td-shell #tdWave{order:2}.td-shell .td-actions{order:3;margin:0}.td-shell .td-shop{order:4;margin:0}.td-shell .td-selection{order:5}.td-shell #tdMessage{order:6}.td-shell .td-powers{order:7;margin:0}.td-shell .td-forecast{order:8}.td-shell .td-target-label{order:9}.td-shell .td-panel details{order:10}
 .td-shell #tdLevel p{display:none}
 .td-shell .td-shop button{min-height:0;padding:10px}
 .td-shell .td-shop small{margin-top:3px}
 .td-shell .td-powers button{margin:6px 0}
 .td-shell .td-field{top:12px}
}
/* Campaign: a poster, then four worlds of cards. */
.td-shell .td-campaign-intro{position:relative;overflow:hidden;padding:clamp(18px,2.4vw,34px);border:1px solid var(--td-line);border-radius:24px;background:radial-gradient(520px 260px at 88% 10%,#c9f7541f,transparent 70%),linear-gradient(120deg,#1d1934,#141126)}
.td-shell .td-campaign-intro h3{font-family:var(--td-display);font-size:clamp(22px,3vw,44px);line-height:.95;letter-spacing:-.045em;text-transform:uppercase;margin:0 0 12px}
.td-shell .td-campaign-intro p,.td-shell .td-campaign-intro small{color:var(--td-soft)}
.td-shell .td-campaign-intro>b{padding:10px 16px;border-radius:999px;background:var(--td-lime);color:var(--td-lime-ink);font-family:var(--td-display);font-size:16px}
.td-shell .td-difficulty{background:var(--td-glass);border:1px solid var(--td-line);border-radius:18px;padding:14px 18px;margin-top:12px}
.td-shell .td-difficulty label{color:var(--td-soft);letter-spacing:.16em}
.td-shell .td-difficulty p{color:var(--td-soft)}
.td-shell .td-world{margin-top:26px}
.td-shell .td-world>h3{display:flex;align-items:center;gap:10px;font-family:var(--td-display);font-size:clamp(18px,2vw,26px);letter-spacing:-.035em;text-transform:uppercase}
.td-shell .td-world>h3>span{display:inline-grid;place-items:center;min-width:34px;height:26px;margin:0;padding:0 8px;border-radius:999px;background:var(--world);color:#141126;font-size:12px;letter-spacing:0}
.td-shell .td-levels{gap:10px}
.td-shell .td-levels button{position:relative;gap:6px;padding:0 0 12px;overflow:hidden;border:1px solid var(--td-line);border-radius:18px;background:var(--td-glass);color:var(--td-text);min-height:0;transition:transform .16s,border-color .16s,box-shadow .16s}
.td-shell .td-levels button:hover,.td-shell .td-levels button:focus-visible{background:var(--td-glass-2);border-color:var(--td-lime);transform:translateY(-4px);box-shadow:0 0 0 1px var(--td-lime),0 18px 36px #0008}
.td-shell .td-levels svg{border-radius:0;display:block}
.td-shell .td-levels svg rect{rx:0}
.td-shell .td-level-number{position:absolute;left:8px;top:8px;z-index:1;padding:3px 9px;border-radius:999px;background:#0e0c17d9;color:var(--td-text);font-family:var(--td-display);font-size:12px;letter-spacing:0}
.td-shell .td-levels strong{padding:4px 12px 0;font-size:14px;line-height:1.2;min-height:2.4em}
.td-shell .td-levels small{padding:0 12px;color:var(--td-soft)}
.td-shell .td-stars{padding:0 12px;color:var(--td-gold);letter-spacing:.12em;font-size:14px}
@media(prefers-reduced-motion:reduce){.td-shell .td-shop button,.td-shell .td-levels button,.td-shell .td-panel>.primary-button{transition:none}.td-shell .td-shop button:hover,.td-shell .td-levels button:hover,.td-shell .td-panel>.primary-button:hover:not(:disabled){transform:none}.td-shell .td-hud-progress::after{transition:none}}
@media(max-width:600px){.td-shell{padding:12px;border-radius:20px}.td-shell .td-hud{gap:5px}.td-shell .td-hud>div{flex-direction:column;align-items:flex-start;gap:0;padding:8px 9px;border-radius:12px}.td-shell .td-hud strong{font-size:18px}.td-shell .td-hud small{font-size:8px;letter-spacing:.08em}.td-shell .td-field{border-radius:18px}.td-shell .td-shop button>span{width:30px;height:30px;font-size:17px;margin-bottom:5px}.td-shell .td-shop strong{font-size:11px}}
/* During a battle the title is already in the page row: briefing, multiplayer and the level list share one slim line. */
.td-shell .mission-guide,.td-shell .td-online{background:var(--td-glass);border:1px solid var(--td-line);border-radius:14px;color:var(--td-text)}
.td-shell .mission-guide>summary,.td-shell .td-online>summary{font-size:13px;color:var(--td-text)}
@media(min-width:1101px){
 .td-shell:not(:fullscreen):has(#tdBattle:not([hidden])){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;column-gap:10px;row-gap:12px;align-items:start}
 .td-shell:not(:fullscreen):has(#tdBattle:not([hidden]))>.td-top{grid-column:3;grid-row:1;margin:0}
 .td-shell:not(:fullscreen):has(#tdBattle:not([hidden]))>.td-top>div:first-child{display:none}
 .td-shell:not(:fullscreen):has(#tdBattle:not([hidden]))>.mission-guide{grid-column:1;grid-row:1;margin:0}
 .td-shell:not(:fullscreen):has(#tdBattle:not([hidden]))>#tdRoom{grid-column:2;grid-row:1;margin:0}
 .td-shell:not(:fullscreen):has(#tdBattle:not([hidden]))>#tdRoom>.td-online{margin:0}
 .td-shell:not(:fullscreen):has(#tdBattle:not([hidden]))>#tdBattle{grid-column:1/-1}
}
/* Desktop: the field is sized on the height of the screen, so the whole battle fits without scrolling. */
@media(min-width:1101px) and (min-height:640px){
 .td-shell:not(:fullscreen) .td-layout{grid-template-columns:minmax(0,calc((100dvh - 282px) * 1.5)) minmax(290px,440px);justify-content:center}
 .td-shell:not(:fullscreen) .td-field{max-width:none}
}
/* Phones: during a battle the title goes too, and the wave button sits right under the towers. */
@media(max-width:1100px){
 .td-shell:not(:fullscreen):has(#tdBattle:not([hidden]))>.td-top>div:first-child{display:none}
 .td-shell:not(:fullscreen):has(#tdBattle:not([hidden]))>.td-top{justify-content:flex-end;margin-bottom:8px}
}
@media(max-width:600px){
 .td-shell .td-panel{display:flex;flex-direction:column;gap:10px}
 .td-shell .td-panel>*{margin:0}
 .td-shell #tdLevel{order:1}.td-shell .td-shop{order:2;margin:0}.td-shell #tdWave{order:3;margin:0}.td-shell .td-actions{order:4;margin:0}.td-shell .td-selection{order:5}.td-shell #tdMessage{order:6}.td-shell .td-powers{order:7;margin:0}.td-shell .td-forecast{order:8}.td-shell .td-target-label{order:9}.td-shell .td-panel details{order:10}
 .td-shell #tdLevel p{display:none}
}
@media(max-width:1100px){.td-shell .td-actions .control-button{min-height:44px;padding-inline:14px}}
