:root{font-family:Arial,Helvetica,sans-serif;color:#3f413a;background:#e9e5dc;-webkit-font-smoothing:antialiased}
*{box-sizing:border-box}
body{margin:0}
#city-stage,#city-canvas{position:fixed;inset:0;width:100%;height:100%;overflow:hidden}
#city-canvas{display:block;outline-offset:-5px}
@media(pointer:fine){html[data-rolling-phase=running] #city-canvas{cursor:grab}html[data-rolling-phase=running] #city-canvas[data-camera-dragging=true]{cursor:grabbing}}
button{-webkit-tap-highlight-color:transparent;color:inherit;cursor:pointer;touch-action:manipulation}
button:focus-visible{outline:2px solid #964b36;outline-offset:4px}
.mode-button,.game-touch button{display:grid;place-items:center;width:44px;height:44px;border:1px solid #fff9ef;border-radius:50%;background:#f8f5ea;box-shadow:0 2px 0 #443d2b18;backdrop-filter:none}
.mode-button{position:fixed;top:max(20px,env(safe-area-inset-top));right:max(20px,env(safe-area-inset-right));z-index:10}
.mode-button:disabled{visibility:hidden}
.mode-button[hidden]{display:none}
.sound-button{top:max(76px,calc(env(safe-area-inset-top) + 56px))}
.sound-off,.sound-button[aria-pressed=true] .sound-on{display:none}
.sound-button[aria-pressed=true] .sound-off{display:block}
.mode-button:active{transform:scale(.97)}
button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.mode-button .play-icon{fill:currentColor;stroke:none}
.mode-button .exit-icon,.mode-button[aria-pressed=true] .play-icon{display:none}
.mode-button[aria-pressed=true] .exit-icon{display:block}
.game-leave{position:fixed;left:max(20px,env(safe-area-inset-left));bottom:max(20px,env(safe-area-inset-bottom));z-index:10;padding:11px 16px;border:1px solid #fff9ef;border-radius:24px;background:#f8f5ea;font:inherit;font-size:13px;box-shadow:0 2px 0 #443d2b18}
.game-leave[hidden]{display:none}
.game-map-markers{position:absolute;inset:0;z-index:3;pointer-events:none;overflow:hidden}
.game-map-markers[hidden]{display:none}
.game-map-player{position:absolute;left:0;top:0;color:var(--player-color);isolation:isolate}
.game-map-beam{position:absolute;bottom:0;left:-2px;width:4px;transform-origin:50% 100%;border-radius:3px;background:linear-gradient(to top,var(--player-color),#fff);box-shadow:0 0 5px 2px var(--player-color),0 0 17px 5px var(--player-color)}
.game-map-base{position:absolute;left:0;top:0;width:36px;height:12px;transform:translate(-50%,-50%);border:2px solid var(--player-color);border-radius:50%;background:transparent;box-shadow:0 0 8px 1px var(--player-color)}
.game-map-player[data-local=true] .game-map-base{width:40px;height:14px}
.game-map-label{position:absolute;left:0;top:0;white-space:nowrap;border:2px solid var(--player-color);border-radius:7px;background:#fffdf4;color:#27392f;padding:5px 9px;font-size:12px;font-weight:600;font-variant-numeric:tabular-nums;line-height:16px;box-shadow:0 2px 8px #16221830}
html[data-rolling-map=true] .pickup-counter,html[data-rolling-map=true] .game-progress{display:none}
.game-progress{position:fixed;top:max(22px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);display:grid;justify-items:center;gap:7px;z-index:3;pointer-events:none;color:#35443e;text-shadow:0 1px 5px #f8f5ea90}
.game-progress[hidden],.game-countdown[hidden]{display:none}
.game-diameter{font-size:27px;font-weight:600;line-height:1;font-variant-numeric:tabular-nums}
.game-progress progress{width:84px;height:3px;appearance:none;border:0;border-radius:2px;background:#35443e26;overflow:hidden}
.game-progress progress::-webkit-progress-bar{background:#35443e26}
.game-progress progress::-webkit-progress-value{background:#637660}
.game-progress progress::-moz-progress-bar{background:#637660}
.game-countdown{position:fixed;inset:0;display:grid;place-items:center;z-index:3;pointer-events:none;font-size:72px;font-weight:600;color:#fff9ef;text-shadow:0 2px 20px #15241e70}
.loading{position:fixed;inset:0;display:grid;place-items:center;background:#e9e5dc;z-index:4}
.loading[hidden]{display:none}
.loading-circle{width:64px;height:64px;border:3px solid #ffffff80;border-top-color:#526b43;border-radius:50%;animation:loading-spin 900ms linear infinite}
@keyframes loading-spin{to{transform:rotate(360deg)}}
.loading[data-error=true] .loading-circle{animation:none;border-color:#a34c3860;border-top-color:#a34c38}
.loading .loading-error{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);max-width:calc(100vw - 32px);width:360px;padding:12px 16px;background:#f8f5ea;color:#3f413a;border-radius:12px;text-align:center;pointer-events:auto;font-size:14px}
.loading-error p{margin:0 0 10px;line-height:1.4}
.loading-error button{padding:7px 12px;background:#637660;color:#fff;border:0;border-radius:6px;font:inherit}
.game-touch{display:none}
.pickup-counter{position:fixed;left:max(20px,env(safe-area-inset-left));top:max(20px,env(safe-area-inset-top));z-index:3;display:grid;gap:1px;width:max-content;min-width:88px;max-height:calc(100dvh - 120px);margin:0;padding:7px 9px;list-style:none;border:0;border-radius:0;background:transparent;color:#fff;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;overflow:auto;overscroll-behavior:contain;scrollbar-width:none;user-select:none}
.pickup-counter[hidden],html:not([data-rolling-phase=running]) .pickup-counter{display:none}
.pickup-counter::-webkit-scrollbar{display:none}
.pickup-counter li{display:grid;grid-template-columns:30px minmax(22px,auto);align-items:center;gap:9px;min-height:38px}
.pickup-counter svg{display:block;width:30px;height:30px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 1px 2px #0009)}
.pickup-counter span{font-size:14px;font-weight:600;line-height:1;font-variant-numeric:tabular-nums;text-align:right;text-shadow:0 1px 2px #0009}
html[data-city-night=true] body{background:#081222;color:#dce5f3}
html[data-city-night=true] .pickup-counter{background:transparent;color:#fff}
html[data-city-night=true] .game-progress progress::-webkit-progress-value{background:#b9caa7}
html[data-city-night=true] .game-progress progress::-moz-progress-bar{background:#b9caa7}
html[data-city-night=true] .mode-button,html[data-city-night=true] .game-touch button{background:#142338;color:#cddbed;border-color:#42516b}
@media(pointer:coarse){
 .game-leave{bottom:max(158px,calc(env(safe-area-inset-bottom) + 148px))}
 html[data-rolling-phase=running] .game-touch{display:flex;align-items:end;justify-content:space-between;position:fixed;bottom:max(26px,env(safe-area-inset-bottom));left:max(24px,env(safe-area-inset-left));right:max(24px,env(safe-area-inset-right));z-index:3;pointer-events:none}
 .game-touch button{touch-action:none;pointer-events:auto;user-select:none;-webkit-user-select:none}
 #game-stick{position:relative;width:116px;height:116px;background:#f8f5ea30;border-color:#f8f5ea90;backdrop-filter:none}
 .stick-knob{display:block;width:44px;height:44px;border:1px solid #fff9ef;border-radius:50%;background:#f8f5eac9;pointer-events:none;box-shadow:0 2px 8px #18291f20}
 .game-touch .game-jump{width:70px;height:70px;gap:0;padding:12px;align-content:center}
 .game-jump span{font-size:10px;line-height:1.4}
 .game-jump:active,.game-jump[data-pressed=true]{transform:scale(.96)}
 html[data-city-night=true] #game-stick{background:#14233850;border-color:#8495ac70}
 html[data-city-night=true] .stick-knob{background:#cddbedb0;border-color:#cddbed}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important}}

/* Room cards use the same warm paper, roof clay and forest ink as the city. */
.room-panel{--room-paper:#f4f0e6;--room-ink:#344438;--room-muted:#77796a;--room-line:#d8d7c8;--room-clay:#a44e38;--room-cream:#fff8e9;--room-ease:cubic-bezier(.23,1,.32,1);width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 48px);padding:18px;border:1px solid #50584166;border-radius:8px;background:var(--room-paper);color:var(--room-ink);box-shadow:5px 6px 0 #34443824,0 20px 70px #1d2c3226;overflow:auto;overscroll-behavior:contain;scrollbar-color:var(--room-line) transparent;scrollbar-width:thin;font-family:"Avenir Next","Trebuchet MS",Arial,sans-serif}
.room-panel::backdrop{background:#172b242c}
.room-player-name{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:12px;margin:0 0 16px;font-size:14px;color:var(--room-muted)}
.room-player-name input{box-sizing:border-box;width:100%;min-width:0;min-height:44px;padding:10px 12px;border:1px solid var(--room-line);border-radius:5px;background:#fff8e980;color:var(--room-ink);font:inherit;font-size:16px}
.room-player-name input:focus-visible{outline:2px solid var(--room-clay);outline-offset:2px}
.room-player-name input:disabled{opacity:.6}
#game-solo{background:transparent}
.room-directory{margin-top:18px;border-top:1px solid var(--room-line)}
.room-directory:has(#game-room-list:empty){margin-top:0;border:0}
#game-room-list{display:grid}
.room-row{display:grid;grid-template-columns:38px minmax(0,1fr) auto 16px;align-items:center;gap:12px;width:100%;min-height:86px;padding:14px 5px;border:0;border-bottom:1px solid var(--room-line);border-radius:0;background:transparent;text-align:left;font:inherit}
#game-room-list>[role=listitem]:last-child .room-row{border-bottom:0}
.room-emblem{display:grid;place-items:center;width:38px;height:38px;border:1px solid #6e796547;border-radius:50%;background:#e4e8d8;color:var(--room-ink)}
.room-emblem svg{width:25px;height:25px;stroke-width:1.35}
.room-detail{display:grid;gap:8px;min-width:0}
.room-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:Georgia,"Times New Roman",serif;font-size:21px;line-height:1.05;letter-spacing:-.5px}
.room-occupancy{display:flex;align-items:center;gap:8px}
.room-players,.room-time{font-size:10px;white-space:nowrap;font-variant-numeric:tabular-nums;letter-spacing:.15px}
.room-players{color:var(--room-muted)}
.room-slots{display:flex;gap:3px}
.room-slots i{width:4px;height:4px;border-radius:50%;background:var(--room-line)}
.room-slots i[data-filled=true]{background:#637660}
.room-time{display:flex;align-items:center;gap:4px;color:var(--room-muted)}
.room-time svg{width:12px;height:12px;stroke-width:1.5}
.room-row[data-phase=running] .room-time{color:#627454}
.room-arrow{width:16px;height:16px}.room-arrow svg{display:block;width:100%;height:100%}
.room-row[data-full=true]{opacity:.45}
.room-row:disabled{cursor:default}
.room-row[data-pending=true]{opacity:1}
.room-row,.room-action{position:relative}.room-row[data-pending=true] .room-arrow{visibility:hidden}.room-row[data-pending=true]:after,.room-action[data-pending=true]:after{content:"";position:absolute;right:16px;top:18px;width:14px;height:14px;border:1.5px solid currentColor;border-right-color:transparent;border-radius:50%;animation:room-wait 700ms linear infinite}.room-row[data-pending=true]:after{right:7px;top:calc(50% - 7px)}
.room-panel button{transition:transform 140ms var(--room-ease),background-color 140ms ease}
.room-panel button:not(:disabled):active{transform:scale(.98)}
.room-panel button:focus-visible{outline:2px solid var(--room-clay);outline-offset:3px;transition:none}
#game-host:focus-visible{outline-color:var(--room-ink)}
.room-row:focus-visible{outline-offset:-2px}
#game-room-status:empty{display:none}
#game-room-status{margin:14px 4px 2px;max-width:32em;font-size:12px;line-height:1.5;color:var(--room-muted)}
.lobby-panel{position:fixed;left:max(20px,env(safe-area-inset-left));top:max(20px,env(safe-area-inset-top));width:min(296px,calc(100vw - 100px));max-height:calc(100dvh - 40px);padding:14px;z-index:3}
.lobby-panel[hidden]{display:none}
#game-players{display:grid;gap:0;list-style:none;margin:0 0 12px;padding:0}
#game-players li{overflow-wrap:anywhere}
#game-players li{display:flex;align-items:center;gap:10px;min-height:48px;padding:10px 3px;border-bottom:1px solid var(--room-line);font-size:12px;line-height:1.4;font-weight:500}
#game-players li:before{content:"";width:23px;height:23px;flex:none;border:1px solid #657a6445;border-radius:50%;background:var(--player-color,#819077);box-shadow:inset -3px -3px 0 #2536291a}
#game-players li:after{content:"";margin-left:auto;width:6px;height:6px;flex:none;border:1px solid var(--room-muted);border-radius:50%}
#game-players li[data-ready=true]:after{background:#637660;border-color:#637660}
#game-begin{width:100%;min-height:50px;padding:13px 15px;background:var(--room-ink);border-color:var(--room-ink);color:var(--room-cream);flex-direction:row;align-items:center;gap:12px}
#game-begin span{font-size:22px}
#game-begin svg{width:21px;height:21px}
@keyframes room-wait{to{transform:rotate(360deg)}}
@media(hover:hover) and (pointer:fine){.room-row:not(:disabled):hover{background:#e7e8da}#game-host:not(:disabled):hover{background:#eceee1}#game-begin:not(:disabled):hover{background:#455942}}
html[data-city-night=true] .room-panel{--room-paper:#26362e;--room-ink:#e5e5d3;--room-muted:#b4baa7;--room-line:#485548;--room-clay:#b2694c;--room-cream:#fff8e9;border-color:#64705b;box-shadow:5px 6px 0 #08151044,0 20px 70px #07151130}
html[data-city-night=true] .room-emblem{background:#3b4a37;color:#dce4cb;border-color:#63725a}
html[data-city-night=true] #game-begin{background:#c3caaa;border-color:#c3caaa;color:#26362e}
@media(hover:hover) and (pointer:fine){html[data-city-night=true] .room-row:not(:disabled):hover,html[data-city-night=true] #game-solo:not(:disabled):hover{background:#354534}html[data-city-night=true] #game-begin:not(:disabled):hover{background:#d6dec0}}
@media(max-width:430px){.room-panel{padding:14px;max-height:calc(100dvh - 32px)}.room-action{min-height:48px}.room-row{grid-template-columns:32px minmax(0,1fr) auto 13px;gap:9px;min-height:80px}.room-emblem{width:32px;height:32px}.room-emblem svg{width:22px;height:22px}.room-name{font-size:20px}.room-slots{gap:2px}.room-occupancy{gap:6px}.room-time{font-size:9px}.room-arrow{width:13px;height:13px}.lobby-panel{padding:12px}.lobby-panel .room-action{min-height:48px}}
@media(prefers-reduced-motion:reduce){.room-panel button{transition:none}}

.loading{align-content:center}.arrival-skip{position:fixed;bottom:24px;right:24px;z-index:5;border:0;border-radius:50%;width:44px;height:44px;background:#f4f0e6;color:#4f584e;font-size:24px;cursor:pointer}.arrival-skip[hidden]{display:none}

.loading[data-preview=true]{background:transparent;pointer-events:none}

/* The defence desk keeps the street map open between the status and build controls. */
html[data-tower-defence=true] #game-toggle,html[data-tower-defence=true] #game-sound,html[data-tower-defence=true] #game-leave,html[data-tower-defence=true] .game-touch{display:none}
.td-hud,.td-defeat{--td-paper:#f7f3e8;--td-ink:#30473c;--td-muted:#737c6a;--td-line:#d5d8c7;--td-green:#647552;--td-dark:#30473c;--td-clay:#a4533d;--td-ease:cubic-bezier(.23,1,.32,1);font-family:"Avenir Next","Trebuchet MS",Arial,sans-serif;color:var(--td-ink);font-size:12px}
.td-hud{position:fixed;inset:0;z-index:11;pointer-events:none}
/* Keep controls above projected map labels, which are appended as units change. */
.td-dock,.td-readout,.td-paused,.td-hud>.td-detail{z-index:1}
.td-world-labels{position:absolute;inset:0;z-index:0;pointer-events:none}
.td-hud[hidden],.td-hud [hidden],.td-defeat [hidden]{display:none!important}
.td-enemy-directions{position:absolute;inset:0;overflow:hidden;pointer-events:none}
.td-enemy-direction{--td-marker-color:#fff;position:absolute;left:0;top:0;width:32px;height:32px;display:grid;place-items:center;border-radius:50%;background:var(--td-marker-color);pointer-events:none;transition:transform 400ms var(--td-ease)}
.td-enemy-direction[data-category=boss]{--td-marker-color:#ec8392}
.td-enemy-direction[data-category=air]{--td-marker-color:#79bfee}
.td-enemy-direction[data-category=arsonist]{--td-marker-color:#f0b363}
.td-enemy-direction[data-category=ghost]{--td-marker-color:#b799e2}
.td-enemy-direction img{position:relative;width:32px;height:32px;object-fit:contain;filter:drop-shadow(0 .8px .8px #1a2d365c)}
.td-enemy-direction i{position:absolute;inset:0;transform:rotate(var(--td-bearing));border-radius:50%;transition:transform 400ms var(--td-ease)}
.td-enemy-direction i::after{content:"";position:absolute;right:-4.8px;top:12px;width:7.2px;height:8px;background:var(--td-marker-color);clip-path:polygon(0 0,100% 50%,0 100%)}
.td-hud button,.td-defeat button{font-family:inherit;font-size:12px;transition:transform 140ms var(--td-ease),background-color 140ms ease,border-color 140ms ease}
.td-hud button:not(:disabled):active,.td-defeat button:not(:disabled):active{transform:scale(.97)}
.td-hud button:disabled{cursor:default}
.td-hud button:focus-visible,.td-defeat button:focus-visible{outline:2px solid var(--td-clay);outline-offset:3px;transition:none}
.td-paper{border:1px solid #69745660;border-radius:8px;background:var(--td-paper);box-shadow:3px 4px 0 #3444381c,0 8px 32px #15272017;pointer-events:auto}
.td-stat-label{display:flex;align-items:center;gap:4px;min-height:15px;font-size:10px;color:var(--td-muted);white-space:nowrap}
.td-stat-label svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}
.td-stats strong{display:block;margin-top:4px;font-size:24px;font-weight:500;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:-.8px}
.td-stats strong small{font-size:13px;color:var(--td-muted);letter-spacing:-.2px}
.td-health-stat strong{margin-top:5px;font-size:15px;letter-spacing:0}
.td-health-track{height:4px;margin-top:8px;overflow:hidden;border-radius:2px;background:#dce0d0}
.td-health-track i{display:block;width:100%;height:100%;transform-origin:left;background:#798b5f}
.td-health-track[data-low=true] i{background:var(--td-clay)}
.td-gold-stat{padding-left:13px;border-left:1px solid var(--td-line)}
.td-gold-stat strong{color:#937139}
.td-tool{display:grid;place-items:center;min-width:32px;min-height:32px;padding:5px;border:1px solid transparent;border-radius:4px;background:transparent;color:var(--td-ink)}
.td-tool svg{width:16px;height:16px;stroke-width:1.5}
.td-tool span{font-size:9px;line-height:1.2}
.td-tool strong{display:grid;place-items:center;font-size:13px;line-height:1;font-weight:500;font-variant-numeric:tabular-nums}
.td-tool[aria-pressed=true]{background:#e6ead8;border-color:#cbd3ba}
.td-paused{position:absolute;top:39%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;gap:6px;padding:10px 11px;white-space:nowrap;font-size:13px}
.td-paused>svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.5}
.td-paused button{display:grid;place-items:center;min-width:34px;min-height:34px;margin-left:4px;padding:6px;border:1px solid var(--td-line);border-radius:4px;background:#e4e8d8}
.td-paused button svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.5}
.td-towers{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.td-tower{display:flex;flex-direction:column;align-items:flex-start;min-width:0;min-height:112px;padding:9px 10px;border:1px solid var(--td-line);border-radius:5px;background:#efeee2;text-align:left;color:var(--td-ink)}
.td-tower-icon{display:block;height:27px}
.td-tower svg{width:28px;height:27px;stroke-width:1.3}
.td-tower>strong{font-size:12px;font-weight:600;line-height:1.3;overflow-wrap:anywhere}
.td-tower-target{margin-top:3px;color:var(--td-muted);font-size:9px;line-height:1.2}
.td-tower-cost{display:flex;align-items:center;gap:4px;margin-top:auto;font-size:12px;font-variant-numeric:tabular-nums}
.td-tower-cost svg{width:13px;height:13px;stroke-width:1.3}
.td-tower[aria-pressed=true]{border-color:#657851;background:#e2e8d4;box-shadow:inset 0 0 0 1px #657851}
.td-tower[data-affordable=false] .td-tower-cost{color:var(--td-clay)}
.td-tower[data-affordable=false] .td-tower-icon{opacity:.55}
.td-build-guide{display:flex;align-items:center;gap:10px;min-height:33px}
.td-build-guide p{max-width:30em;margin:0;font-size:11px;line-height:1.5;color:var(--td-muted)}
.td-build-guide strong{font-weight:500;color:var(--td-ink)}
.td-pad-symbol{width:22px;height:13px;flex:none;margin:0 5px;border:2px solid #94a565;border-radius:50%;background:#dfe6bc;box-shadow:0 0 0 3px #d8e4b744}
.td-map-help{margin:12px 0 0;padding-top:11px;border-top:1px solid var(--td-line);color:var(--td-muted);font-size:9px;line-height:1.4}
.td-touch-help{display:none}
@media(pointer:coarse){.td-mouse-help{display:none}.td-touch-help{display:inline}}
.td-wave-card{width:310px;max-width:100%;padding:16px}
.td-wave-card .td-section-heading{margin-bottom:11px}
.td-wave-kind{font-size:9px;color:var(--td-muted)}
.td-wave-kind[data-flying=true]{color:var(--td-clay)}
.td-wave-card>h2{margin:0;font-family:Georgia,"Times New Roman",serif;font-size:25px;line-height:1.13;font-weight:400;letter-spacing:-.65px;text-wrap:balance}
.td-wave-description{margin:9px 0 0;font-size:11px;line-height:1.5;color:var(--td-muted)}
.td-wave-facts{display:flex;justify-content:space-between;gap:9px;margin:14px 0 0;padding-top:10px;border-top:1px solid var(--td-line);font-size:10px;line-height:1.4;font-variant-numeric:tabular-nums;color:var(--td-muted)}
.td-message{margin:10px 0 0;font-size:11px;line-height:1.4;color:var(--td-ink)}
.td-start-wave{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:45px;width:100%;margin-top:14px;padding:12px 14px;border:1px solid var(--td-dark);border-radius:5px;background:var(--td-dark);color:#fff8e9;text-align:left;font:inherit;font-size:12px}
.td-start-wave svg{width:18px;height:18px;flex:none;stroke-width:1.5}
.td-start-wave:disabled{background:#e5e8d9;border-color:var(--td-line);color:var(--td-muted)}
.td-start-wave:disabled svg{display:none}
.td-campaign{margin:10px 0 0;font-size:9px;line-height:1.4;text-align:center;color:var(--td-muted)}
.td-defeat.td-paper{box-sizing:border-box;width:min(420px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:24px;border-radius:24px;overflow:auto;overscroll-behavior:contain;text-align:center;box-shadow:0 24px 80px #10271e40,inset 0 1px 0 #ffffff80}
.td-defeat::backdrop{background:#142a256b}
.td-defeat .td-defeat-mark{display:grid;place-items:center;width:140px;height:100px;margin:0 auto 10px;border:0;background:radial-gradient(ellipse,#dfe9d7aa,transparent 70%)}
.td-defeat-mark img{display:block;width:116px;height:96px;object-fit:contain;filter:drop-shadow(0 7px 5px #30473c22)}
.td-defeat h2{margin:0;font-family:Georgia,"Times New Roman",serif;font-weight:400;font-size:36px;line-height:1.1;letter-spacing:-1px;text-wrap:balance}
.td-defeat h2:focus{outline:none}
.td-defeat-close{position:absolute;top:8px;right:8px;display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--td-muted)}
.td-defeat-close svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round}
.td-defeat .td-start-wave{min-height:48px;margin-top:20px;border-radius:12px;padding:12px 16px;font-size:14px;font-weight:600}
.td-defeat .td-start-wave svg{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round}
@media(hover:hover) and (pointer:fine){.td-defeat-close:hover{background:var(--game-glass-hover)}.td-defeat .td-start-wave:hover{background:#3c584a}}
@media(prefers-reduced-motion:no-preference){
 .td-defeat[open]{opacity:1;transform:translateY(0) scale(1);transition:opacity 220ms var(--td-ease),transform 220ms var(--td-ease)}
 @starting-style{.td-defeat[open]{opacity:0;transform:translateY(8px) scale(.97)}}
}
.td-return{min-height:44px;margin:8px 0 0;padding:10px 14px;border:0;border-radius:5px;background:transparent;color:var(--td-muted)}
@media(hover:hover) and (pointer:fine){
 .td-tool:not(:disabled):hover,.td-sell:not(:disabled):hover,.td-return:hover{background:#e8ebdd}
 .td-tower:not(:disabled):hover{background:#e4e8d7;border-color:#a3af8c}
 .td-tower[aria-pressed=true]:hover{background:#dbe4c8;border-color:#657851}
 .td-start-wave:not(:disabled):hover{background:#445b46;border-color:#445b46}
 .td-upgrade:not(:disabled):hover,.td-paused button:hover{background:#d6e0c2}
}
@media(max-width:900px){.td-command{width:370px;padding:14px 16px}.td-stats{gap:13px;grid-template-columns:67px 1fr 65px}.td-gold-stat{padding-left:13px}.td-build{width:460px}.td-wave-card{width:280px}.td-bottom{gap:12px}.td-tool{min-width:48px;padding-inline:6px}.td-tool span{font-size:8px}}
@media(max-width:720px){
 .td-command{top:max(10px,env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));width:auto;padding:11px 13px}
 .td-heading{gap:8px}.td-cathedral-mark{width:32px;height:30px;padding-right:7px}.td-cathedral-mark svg{width:25px;height:24px}.td-heading h1{font-size:23px}.td-heading .td-eyebrow{font-size:8px;letter-spacing:1px}.td-phase{font-size:9px;padding:4px 6px}
 .td-stats{grid-template-columns:64px 1fr 64px;gap:13px;margin-top:10px;padding-top:9px}.td-stats strong{font-size:21px}.td-stat-label{font-size:9px;min-height:12px}.td-health-stat strong{font-size:13px}.td-health-track{margin-top:6px}.td-stats strong small{font-size:12px}.td-gold-stat{padding-left:12px}
 .td-tools{top:max(135px,calc(env(safe-area-inset-top) + 125px));right:max(10px,env(safe-area-inset-right));padding:3px;gap:1px}.td-tool{min-width:44px;min-height:44px;padding:8px}.td-tool span{display:none}.td-tool svg{width:20px;height:20px}.td-tool strong{font-size:16px}.td-leave{margin-left:1px}
 .td-bottom{left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));bottom:max(10px,env(safe-area-inset-bottom));display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;gap:7px;max-height:calc(100dvh - 205px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none;border-radius:8px}
 .td-bottom::-webkit-scrollbar{display:none}
 .td-build,.td-wave-card{width:100%;padding:11px 12px;flex-shrink:0;box-shadow:none}
 .td-section-heading{margin-bottom:8px}.td-section-heading h2{font-size:11px}.td-key-hint{display:none}.td-towers{gap:7px}.td-tower{min-height:95px;padding:7px 9px}.td-tower-top{margin-bottom:5px}.td-tower-icon{height:23px}.td-tower-icon svg{height:23px;width:25px}.td-tower kbd{display:none}.td-tower>strong{font-size:11px}.td-tower-target{font-size:8px}.td-tower-cost{margin-top:6px;font-size:11px}.td-tower-cost svg{width:12px;height:12px}
 .td-selection{margin-top:9px}.td-build-guide{min-height:29px;gap:7px}.td-build-guide p{font-size:10px}.td-pad-symbol{width:19px;height:12px;margin-inline:3px}.td-map-help{margin-top:8px;padding-top:7px;font-size:8px}.td-selected-actions button{min-height:36px}.td-selected-tower>p{font-size:9px;margin-bottom:7px}
 .td-wave-card{order:-1;display:grid;grid-template-columns:minmax(0,1fr) minmax(125px,40%);align-items:center;gap:5px 12px}.td-wave-card .td-section-heading{grid-column:1;margin:0;justify-content:flex-start;gap:7px}.td-wave-card .td-eyebrow{font-size:8px;letter-spacing:.8px}.td-wave-kind{font-size:8px}.td-wave-card>h2{grid-column:1;font-size:20px;line-height:1.1}.td-wave-description{display:none}.td-wave-facts{grid-column:1;justify-content:flex-start;flex-wrap:wrap;gap:3px 9px;margin:0;padding:0;border:0;font-size:8px}.td-wave-card .td-start-wave{grid-column:2;grid-row:1/span 3;align-self:stretch;justify-content:center;min-height:52px;margin:0;padding:10px;font-size:11px;text-align:center;gap:6px}.td-wave-card .td-start-wave svg{width:15px;height:15px}.td-wave-card .td-message{grid-column:1/-1;margin:3px 0 0;font-size:10px;line-height:1.35}.td-campaign{display:none}
 .td-paused{top:34%;gap:7px;padding:10px;font-size:11px}.td-paused button{margin-left:2px;min-height:36px;font-size:10px}
}
@media(max-height:610px) and (min-width:721px){.td-command{padding:10px 13px}.td-heading h1{font-size:25px}.td-stats{margin-top:10px;padding-top:9px}.td-build,.td-wave-card{padding:12px}.td-tower{min-height:95px;padding:7px 9px}.td-tower-top{margin-bottom:3px}.td-tower-icon,.td-tower-icon svg{height:22px}.td-tower-cost{margin-top:6px}.td-map-help{margin-top:8px;padding-top:8px}.td-selection{margin-top:8px}.td-wave-description{font-size:10px}.td-wave-card>h2{font-size:23px}.td-wave-facts{margin-top:9px;padding-top:8px}.td-message{margin-top:8px;font-size:10px}.td-start-wave{margin-top:10px;min-height:40px}.td-campaign{margin-top:7px}.td-bottom{bottom:12px}}
@media(max-height:590px) and (max-width:720px){.td-bottom{max-height:48dvh}.td-paused{top:43%}.td-build-guide{min-height:24px}.td-build-guide p{font-size:9px}.td-map-help{margin-top:6px;padding-top:5px}.td-tower{min-height:86px}.td-tower-icon,.td-tower-icon svg{height:20px}.td-selection{margin-top:7px}}
@media(max-height:590px) and (min-width:550px) and (max-width:720px) and (orientation:landscape){.td-command{right:210px;min-width:285px}.td-heading h1{font-size:21px}.td-tools{top:10px}}
@media(prefers-reduced-motion:reduce){.td-hud button,.td-defeat button,.td-enemy-direction,.td-enemy-direction i{transition:none}}

/* Auto-fit so the row fills whether or not Ideon has unlocked a fifth tower. */
.td-towers{grid-template-columns:repeat(auto-fit,minmax(98px,1fr))}
@media(max-width:720px){.td-tower{padding-inline:6px}.td-tower>strong{font-size:10px}}

/* The detail panel only appears when a building on the map is clicked. */
.td-detail{width:236px;padding:12px 13px 13px;border:1px solid #69745660;border-radius:8px;background:var(--td-paper);box-shadow:3px 4px 0 #3444381c,0 8px 32px #15272017;pointer-events:auto}
.td-detail-head{display:flex;align-items:center;gap:8px}
.td-detail-icon{display:grid;place-items:center;flex:none;color:var(--td-muted)}
.td-detail-icon svg{width:20px;height:19px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}
.td-detail-head>strong{flex:1;min-width:0;font-size:12px;font-weight:600;line-height:1.3;overflow-wrap:anywhere}
.td-detail-close{display:grid;place-items:center;flex:none;width:22px;height:22px;padding:0;border:0;border-radius:4px;background:transparent;color:var(--td-muted)}
.td-detail-close svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.6}
.td-detail-effect{margin:7px 0 0;font-size:10px;line-height:1.45;color:var(--td-muted)}
.td-detail-bar{height:4px;margin-top:9px;overflow:hidden;border-radius:2px;background:#dce0d0}
.td-detail-bar i{display:block;width:100%;height:100%;transform-origin:left;background:#798b5f;transition:transform 220ms var(--td-ease)}
.td-detail-bar[data-low=true] i{background:var(--td-clay)}
.td-detail-buy{width:100%;min-height:32px;margin-top:10px;padding:7px 9px;border:1px solid var(--td-line);border-radius:5px;background:#e9eddc;color:var(--td-ink);font-size:11px;font-variant-numeric:tabular-nums}
.td-detail-buy[data-action="invest"]{text-align:left}
.td-detail-buy [data-ref="detailAction"]{display:flex;align-items:center;gap:8px}
.td-detail-buy [data-ref="detailAction"]>.td-money{flex:none;margin-left:auto}
.td-detail-buy:disabled{opacity:.55}
.td-hud [data-action="invest"]:disabled{pointer-events:none}
@media (max-width:760px){
 .td-command{width:min(268px,calc(100vw - 40px))}
 .td-bottom{flex-direction:column;align-items:stretch}
 .td-detail{width:auto}
}

/* Still used by the lobby's Start button. */
.room-action{display:flex;align-items:center;justify-content:center;gap:10px;min-height:52px;padding:13px 16px;border:1px solid var(--room-line);border-radius:5px;background:#e9e8da;color:var(--room-ink);font:inherit}
.room-action svg{width:20px;height:20px;stroke-width:1.5}
.room-action span{font-family:Georgia,"Times New Roman",serif;font-size:20px;line-height:1.05;letter-spacing:-.5px}
.room-action:disabled:not([data-pending=true]){opacity:.45;cursor:default}
/* Each picker column carries its game's action and leaderboard. */
#game-panel{--room-ink:#344438;--room-muted:#526258;--room-line:#405c4533;box-sizing:border-box;width:min(1040px,calc(100vw - 32px))}
.room-games{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.room-game-column{min-width:0;border:1px solid var(--room-line);border-radius:10px;background:var(--game-glass-control)}
a.room-game{text-decoration:none}
.room-game[hidden]{display:none}
.room-game{position:relative;display:grid;grid-template-columns:48px minmax(0,1fr);grid-template-areas:"mark title" "mark score";align-content:center;align-items:center;gap:4px 10px;box-sizing:border-box;width:100%;min-height:88px;padding:12px;border:1px solid transparent;border-radius:9px;color:#30473c;text-align:left}
.room-game-column .room-game{background:transparent;border-color:transparent}
.room-game-mark{grid-area:mark;position:relative;display:grid;place-items:center;flex:none;width:48px;height:38px;color:#647552}
.room-game-mark img{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:block;width:52px;height:52px;object-fit:contain;user-select:none;pointer-events:none}
.room-game-mark svg{width:32px;height:32px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.room-game>strong{grid-area:title;flex:1;min-width:0;font-family:Georgia,"Times New Roman",serif;font-size:21px;font-weight:400;line-height:1.1;letter-spacing:-.4px}
.room-game-score{grid-area:score;flex:none;font-size:13px;font-variant-numeric:tabular-nums;color:#937139}
.room-game-score:empty{display:none}
.room-game[data-pending=true] .room-game-mark img{visibility:hidden}
.room-game[data-pending=true] .room-game-mark::after{content:"";width:20px;height:20px;box-sizing:border-box;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:room-wait 700ms linear infinite}
.room-game:disabled:not([data-pending=true]){opacity:.55}
.room-together{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:40px;margin-top:9px;padding:9px 12px;border:1px solid #d5d8c7;border-radius:7px;background:transparent;color:#737c6a;font-size:12px}
.room-together[hidden]{display:none}
.room-together svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
@media(hover:hover) and (pointer:fine){
 .room-game:not(:disabled):hover{background:#e9eddc;border-color:#b9c4a4}
 .room-together:not(:disabled):hover{background:#eceee1}
}

/* Build controls stay low; status remains visible at the top left. */
.td-dock{position:absolute;bottom:max(14px,env(safe-area-inset-bottom));left:max(14px,env(safe-area-inset-left));display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:max-content;max-width:calc(100vw - 28px);pointer-events:none}
.td-bar{display:grid;grid-template-columns:1fr;align-items:center;gap:6px;width:max-content;max-width:100%;padding:8px 9px}
.td-readout{position:absolute;top:max(14px,env(safe-area-inset-top));left:max(14px,env(safe-area-inset-left));display:flex;align-items:center;gap:14px;min-width:0;max-width:calc(100vw - 28px);box-sizing:border-box;padding:6px 10px;pointer-events:auto}
.td-stat{min-width:0}
.td-stat .td-stat-label{display:flex;align-items:center;gap:3px;font-size:8px;line-height:1.2;color:var(--td-muted);white-space:nowrap}
.td-stat .td-stat-label svg{width:11px;height:11px;fill:none;stroke:currentColor;stroke-width:1.35;stroke-linecap:round;stroke-linejoin:round}
.td-stat strong{display:block;margin-top:1px;font-size:16px;font-weight:500;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:-.5px}
.td-stat strong small{font-size:11px;color:var(--td-muted)}
.td-wave-stat{display:flex;align-items:center;gap:5px}
.td-wave-stat strong{white-space:nowrap}
.td-wave-art{display:block;width:32px;height:32px;object-fit:contain}
.td-health-track{height:3px;margin-top:4px;overflow:hidden;border-radius:2px;background:#dce0d0}
.td-gold-stat{display:flex;align-items:center;gap:5px;padding-left:0;border-left:0}
.td-gold-art{display:block;width:36px;height:36px;object-fit:contain}
.td-gold-stat strong{color:#937139}
.td-controls{display:flex;align-items:center;gap:2px;padding-left:8px;border-left:1px solid var(--td-line)}
.td-controls .td-tool{min-width:36px;min-height:40px}
.td-speed strong{font-size:16px}
.td-income-marker,.td-income-total{position:absolute;top:0;left:0;pointer-events:none;color:#ffe18a;font-size:17.6px;font-weight:700;line-height:1;text-shadow:0 1px 3px #45300c,0 0 2px #45300c}
.td-healing-marker{color:#8ff0b0;text-shadow:0 1px 3px #163e28,0 0 2px #163e28}
.td-income-total{font-size:12px;font-weight:600;white-space:nowrap;font-variant-numeric:tabular-nums}
.td-health-marker{position:absolute;top:0;left:0;display:flex;align-items:center;gap:6px;padding:0;border:0;border-radius:0;background:none;box-shadow:none;pointer-events:none;white-space:nowrap;transition:opacity 250ms ease-out}
.td-health-marker .td-health-track{width:64px;height:5px;margin:0;background:#30473c55;outline:1px solid #fff;outline-offset:0}
.td-health-marker strong{font-size:12px;font-weight:600;font-variant-numeric:tabular-nums;color:#111;-webkit-text-stroke:1px #fff;paint-order:stroke fill;text-shadow:none}
.td-health-marker[data-kind=boss] strong{display:none}
@media(prefers-reduced-motion:reduce){.td-health-marker{transition:none}}
.td-hidden{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
/* A tower is its name, what it reaches and its price. Nothing else. */
.td-towers{display:grid;grid-row:1;grid-column:1;grid-template-columns:repeat(3,72px);gap:5px}
.td-tower{display:flex;flex-direction:column;align-items:flex-start;gap:0;min-width:0;min-height:52px;padding:5px 6px;border:1px solid var(--td-line);border-radius:4px;background:#efeee2;text-align:left;color:var(--td-ink)}
.td-tower-icon{display:block;height:17px}
.td-tower svg{width:18px;height:17px;stroke-width:1.35}
.td-tower>strong{font-size:9.5px;font-weight:600;line-height:1.15;letter-spacing:-.1px;overflow-wrap:normal;hyphens:none}
.td-tower-target{font-size:7.5px;line-height:1.2;color:var(--td-muted)}
.td-tower-cost{display:flex;align-items:center;gap:2px;margin-top:auto;font-size:10px;font-variant-numeric:tabular-nums}
.td-tower-cost svg{width:9px;height:9px;stroke-width:1.4}
.td-detail{width:226px;max-width:100%;padding:10px 11px 11px}
@media (max-width:760px){
 .td-dock{gap:7px}
 .td-dock{bottom:max(10px,env(safe-area-inset-bottom));left:max(10px,env(safe-area-inset-left));max-width:calc(100vw - 20px)}
 .td-readout{top:max(10px,env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));max-width:calc(100vw - 20px);gap:12px}
 .td-controls .td-tool{min-width:40px;min-height:44px}
 .td-towers{grid-template-columns:repeat(3,66px)}
 .td-detail{width:100%}
}

/* A compact podium with illustrated medals and no row dividers. */
.td-defeat-board{display:grid;gap:5px;margin:12px 0 0;padding:0;list-style:none;text-align:left;font-variant-numeric:tabular-nums}
.td-defeat-board:empty{display:none}
.td-defeat-board li{display:flex;align-items:center;gap:12px;min-height:38px;padding:3px 14px 3px 8px;border-radius:12px;font-size:14px;color:var(--td-ink)}
.td-defeat-board li[data-medal=gold]{background:linear-gradient(100deg,#f3dc9670,#f3dc9620)}
.td-defeat-board li[data-medal=silver]{background:linear-gradient(100deg,#eef2f670,#eef2f620)}
.td-defeat-board li[data-medal=bronze]{background:linear-gradient(100deg,#dab49b50,#dab49b15)}
.td-defeat-rank{display:grid;place-items:center;width:40px;flex:none;font-size:12px;color:var(--td-muted)}
.td-defeat-rank img{display:block;width:40px;height:44px;object-fit:contain}
.td-defeat-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.td-defeat-score{flex:none;font-size:16px;font-weight:600}
.td-defeat-form{display:grid;gap:7px;margin-top:24px;text-align:left}
.td-defeat-name-entry{display:flex;gap:8px}
.td-defeat-name-entry input{flex:1;width:0;min-width:0;min-height:44px;padding:10px 12px;border:1px solid var(--td-line);border-radius:10px;background:#fffdf5;color:var(--td-ink);font:inherit;font-size:16px}
.td-defeat-name-entry input:focus-visible{outline:2px solid var(--td-clay);outline-offset:2px}
.td-defeat-name-entry button{flex:0 0 auto;min-height:44px;padding:9px 12px;border:1px solid var(--td-green);border-radius:10px;background:var(--td-green);color:#fffdf5}
.td-defeat-name-entry input:disabled,.td-defeat-name-entry button:disabled{opacity:.65;cursor:default}
.td-defeat-save-status{min-height:16px;margin:0;font-size:11px;line-height:1.4;color:var(--td-muted)}
.td-defeat-save-status:empty{display:none}
.td-defeat-board-title{margin:24px 0 0;font-size:13px;font-weight:600;line-height:1.4}

/* Illustrated defence roster, with the selected tower's ability and next rank. */
.td-bar{width:840px;box-sizing:border-box;padding:0;border:0;background:none;box-shadow:none;pointer-events:none}
.td-towers{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:minmax(100px,1fr);width:100%;min-width:0;max-height:none;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;overscroll-behavior-x:contain;touch-action:pan-x;pointer-events:auto;-webkit-overflow-scrolling:touch;-webkit-user-select:none;user-select:none;padding:24px 0 3px}
.td-tower{position:relative;overflow:visible;min-height:111px;padding:0 6px 4px;gap:1px;pointer-events:auto;touch-action:pan-x}
/* Locked cards and card artwork pass gestures to the native scroll surface. */
.td-tower:disabled,.td-tower>*{pointer-events:none}
.td-tower-requirement{position:absolute;top:-22px;right:-1px;z-index:2;box-sizing:border-box;max-width:calc(100% - 8px);padding:4px 6px;border:1px solid #609a6555;border-radius:5px;background:#c3e8bb;color:#285c39;box-shadow:0 2px 4px #21452b14;font-size:10px;font-weight:700;line-height:1.1;white-space:nowrap;pointer-events:none}
.td-tower .td-tower-art{display:block;align-self:center;flex:0 0 56px;width:100%;height:56px;margin-top:24px;pointer-events:none}
.td-tower>strong{font-size:12px;line-height:1.25}
.td-tower-target{max-width:100%;margin-top:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:11px;line-height:1.2;color:#59664f}
.td-tower-cost{position:absolute;z-index:1;top:4px;left:5px;display:flex;align-items:center;gap:3px;margin:0;font-size:12px;line-height:20px;font-weight:500}
.td-tower-cost img{display:block;width:20px;height:20px;object-fit:contain}
.td-tower[aria-pressed=true]{border-color:#60794c;background:#e5e9d7;box-shadow:inset 0 0 0 1px #60794c}
.td-tower[data-locked=true],.td-tower[data-affordable=false],.td-building-row[data-affordable=false]{opacity:.6}
.td-tower[hidden]{display:none}
.td-detail{position:absolute;left:calc(100% + 10px);bottom:0;width:256px;box-sizing:border-box;max-height:calc(100vh - 40px);overflow:auto}
.td-detail-art{display:block;width:100%;height:150px;object-fit:contain;margin-bottom:7px}
.td-detail-stats,.td-detail-next{font-size:11px;line-height:1.55;margin:9px 0 0;color:var(--td-ink)}
.td-detail-next{padding-top:8px;border-top:1px solid var(--td-line);color:var(--td-muted)}
.td-detail-sell{float:right;border:0;background:transparent;color:var(--td-clay);padding:10px 0 0;font-size:10px}
.td-detail-buy{clear:both}
.td-money{display:inline-flex;align-items:center;gap:3px;vertical-align:middle;white-space:nowrap;font-variant-numeric:tabular-nums}
.td-money img{flex:none;width:14px;height:16px;object-fit:contain}
.td-smash{position:relative;display:flex;align-items:center;gap:6px;min-height:44px;padding:10px 14px;overflow:hidden;pointer-events:auto;border:1px solid #b99a5c;border-radius:9px;color:#554121;background:#f1e6c9;font:inherit;font-size:12px;text-align:left;touch-action:manipulation}
.td-smash>*{position:relative}.td-smash>strong{flex:1;min-width:0}.td-smash>[data-ref="smashCost"]{flex:none;margin-left:auto;text-align:right}.td-smash:disabled{opacity:.55;cursor:default}.td-smash[hidden]{display:none}
.td-smash .td-smash-cooldown{position:absolute;inset:0;background:#929892;transform:translateX(100%);pointer-events:none}
.td-smash[data-cooling="true"]:disabled{opacity:1}
.td-smash:focus-visible{outline:2px solid #876530;outline-offset:3px}
@media(hover:hover){.td-smash:not(:disabled):hover{background:#f8eccb;border-color:#876530}}
.td-tower:focus-visible,.td-detail button:focus-visible{outline:2px solid #526b43;outline-offset:2px}
@media(max-width:760px){
 .td-bar{width:min(840px,calc(100vw - 20px))}
 .td-detail{left:0;bottom:calc(100% + 8px);width:100%;max-height:34vh}
 .td-detail-art{width:80px;height:80px;float:left;margin:0 10px 4px 0}
 .td-detail-stats,.td-detail-next{font-size:10px}
 .td-tower{min-height:111px}
}
@media(max-height:650px){.td-detail-art{height:80px}.td-detail{max-height:40vh}}

.td-upgrade-branches .td-detail-buy{text-align:left}.td-upgrade-branches strong,.td-upgrade-branches span{display:block}.td-upgrade-branches span{margin-top:4px;font-size:10px;line-height:1.45}

/* Building investments stay inside the roster; no secondary tower popup. */
.td-bar>.td-detail{position:static;grid-column:1/-1;width:100%;max-height:160px;overflow:auto;margin-top:8px;padding:10px 0 0;border:0;border-top:1px solid var(--td-line);border-radius:0;box-shadow:none;background:transparent}

/* Compact building card, projected above its roof instead of docked to the roster. */
.td-hud>.td-detail{position:fixed;left:0;top:0;bottom:auto;width:208px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:10px;overflow:visible;margin:0;border:1px solid #69745638;border-radius:12px;background:var(--td-building-paper,var(--td-paper));box-shadow:0 4px 14px #182a2424;isolation:isolate;visibility:hidden}
.td-hud>.td-detail::after{content:"";position:absolute;left:var(--td-detail-arrow,50%);bottom:-5px;width:8px;height:8px;background:var(--td-building-paper,var(--td-paper));border-right:1px solid #69745638;border-bottom:1px solid #69745638;transform:translateX(-50%) rotate(45deg)}
.td-hud>.td-detail .td-detail-head{gap:7px;align-items:center}
.td-hud>.td-detail .td-detail-art{flex:none;float:none;width:54px;height:54px;margin:0;object-fit:contain;border-radius:6px}
.td-hud>.td-detail .td-detail-head>strong{font-size:11px;line-height:1.35}
.td-hud>.td-detail .td-detail-close{align-self:flex-start;width:20px;height:20px}
.td-hud>.td-detail .td-detail-effect{margin-top:7px;font-size:10px;line-height:1.45}
.td-hud>.td-detail .td-detail-buy{min-height:28px;margin-top:8px;padding:5px 8px;font-size:11px;border-radius:7px}
.td-hud>.td-vehicle-detail{width:112px;padding:6px}.td-hud>.td-vehicle-detail .td-detail-buy{margin-top:0}
.td-hud>.td-vehicle-detail .td-detail-buy[aria-pressed="true"]{background:#426855;color:#fff;border-color:#426855}

/* Shared glass surfaces. Blur only floating surfaces, never the full-screen
   overlay or nested controls, to bound compositing work over the live city. */
:root{--game-glass:rgba(245,249,247,.72);--game-glass-border:rgba(255,255,255,.65);--game-glass-shadow:0 4px 20px #172d2420,inset 0 1px 0 #ffffff55;--game-glass-filter:blur(10px);--game-glass-control:rgba(255,255,255,.28);--game-glass-hover:rgba(255,255,255,.48);--game-glass-selected:rgba(212,231,209,.78)}
.room-panel,.td-paper,.td-tower,.td-hud>.td-detail,.mode-button,.game-touch button,.game-leave,.arrival-skip,.loading .loading-error,.game-map-label{
 background:var(--game-glass);border-color:var(--game-glass-border);box-shadow:var(--game-glass-shadow);-webkit-backdrop-filter:var(--game-glass-filter);backdrop-filter:var(--game-glass-filter)
}
.td-hud>.td-detail::after{background:var(--game-glass);border-color:var(--game-glass-border)}
.room-panel{--room-muted:#526258;--room-line:#405c4533}
.td-hud,.td-defeat{--td-muted:#526258;--td-line:#405c4533}
.td-tower-target{color:#526258}
.room-game,.room-action,.room-emblem,.room-player-name input,.td-defeat-name-entry input,.td-defeat-mark,.td-detail-buy,.td-paused button{background:var(--game-glass-control);border-color:#405c4533}
.td-tower[aria-pressed=true],.td-tool[aria-pressed=true]{background:var(--game-glass-selected);border-color:#60794c;box-shadow:inset 0 0 0 1px #60794c}
.td-tower[aria-pressed=true],.td-tower[aria-pressed=true]:hover{border-color:#fff;box-shadow:inset 0 0 0 2px #fff}
@media(hover:hover) and (pointer:fine){
 .room-game:not(:disabled):hover,.room-row:not(:disabled):hover,.room-together:not(:disabled):hover,#game-host:not(:disabled):hover,.td-tower:not(:disabled):hover,.td-tool:not(:disabled):hover,.td-detail-buy:not(:disabled):hover,.td-return:hover{background:var(--game-glass-hover)}
 .td-tower[aria-pressed=true]:hover{background:var(--game-glass-selected)}
}
html[data-city-night=true] .mode-button,html[data-city-night=true] .game-touch button{background:rgba(20,35,56,.72);border-color:#ffffff40}
/* Keep a readable surface when blur is unavailable or transparency is reduced. */
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){:root{--game-glass:rgba(245,249,247,.94)}}
@media(prefers-reduced-transparency:reduce){:root{--game-glass:#f5f9f7;--game-glass-filter:none;--game-glass-control:#ffffff;--game-glass-selected:#d4e7d1}}

/* The initial play action occupies the same center as the loading circle.
   In-game map controls retain their corner position. */
#game-toggle[aria-haspopup=dialog]{top:50%;left:50%;right:auto;width:64px;height:64px;transform:translate(-50%,-50%)}
#game-toggle[aria-haspopup=dialog]:active{transform:translate(-50%,-50%) scale(.97)}
#game-toggle[aria-haspopup=dialog] .play-icon{width:30px;height:30px}
@media(min-width:601px) and (max-width:980px){.room-games{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){
 #game-panel{padding:12px;width:min(560px,calc(100vw - 24px))}
 .room-games{grid-template-columns:minmax(0,1fr);gap:10px}
 .room-game{grid-template-columns:minmax(0,1fr);grid-template-areas:"mark" "title" "score";align-content:start;min-height:154px;padding:12px 10px;gap:8px 0}
 .room-game-mark{width:52px;height:52px}
 .room-game>strong{font-size:20px;line-height:1.15;min-height:46px;text-wrap:balance}
 .room-game-score{font-size:11px}
}

.td-announcement{position:fixed;top:18px;left:50%;width:max-content;max-width:min(540px,calc(100vw - 32px));padding:14px 20px;border-radius:12px;text-align:center;font-size:16px;line-height:1.45;pointer-events:none;opacity:0;transform:translate(-50%,calc(-100% - 24px));transition:transform .35s cubic-bezier(.2,.8,.2,1),opacity .25s;z-index:4}
.td-announcement[data-visible="true"]{opacity:1;transform:translate(-50%,0)}
@media(max-width:1000px){.td-announcement{top:78px;font-size:14px}.td-announcement:not([data-visible="true"]){transform:translate(-50%,calc(-100% - 84px))}}
@media(prefers-reduced-motion:reduce){.td-announcement{transition:none}}

/* All building purchases stay visible; short viewports use columns, never scrolling. */
.td-buildings{position:fixed;top:max(14px,env(safe-area-inset-top));right:max(14px,env(safe-area-inset-right));width:312px;max-width:calc(100vw - 20px);z-index:2;overflow:clip;border-radius:14px;background:var(--game-glass);-webkit-backdrop-filter:var(--game-glass-filter);backdrop-filter:var(--game-glass-filter)}
.td-buildings summary{position:relative;display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:44px;padding:12px 14px 12px 38px;cursor:pointer;list-style:none;font-size:13px;font-weight:600;user-select:none}
.td-buildings summary>svg{position:absolute;left:14px;top:50%;width:16px;height:16px;transform:translateY(-50%);fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.td-buildings summary::-webkit-details-marker{display:none}
.td-buildings summary span{display:flex;align-items:center;justify-content:center;width:20px;height:20px;flex:none;border-radius:6px;background:#30473c08}
.td-buildings summary span svg{display:block;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.td-buildings[open] summary{border-bottom:1px solid #30473c12}
.td-buildings[open] summary span{transform:rotate(180deg)}
.td-buildings summary:focus-visible{outline:2px solid var(--td-clay);outline-offset:-4px;border-radius:10px}
.td-building-list{display:grid;grid-template-columns:minmax(0,1fr);max-height:none;overflow:clip;padding:4px 8px 8px}
.td-building-row{display:grid;grid-template-columns:32px minmax(0,1fr) 64px;align-items:center;gap:8px;min-width:0;min-height:42px;padding:4px 6px;border-bottom:1px solid #30473c0c}
.td-building-row:last-child{border-bottom:0}
.td-building-icon,.td-building-icon img,.td-building-icon svg{display:block;width:32px;height:32px;object-fit:contain}
.td-building-icon svg{fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.td-building-name{min-width:0;font-size:12px;font-weight:500;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.td-building-row button{display:flex;align-items:center;justify-content:center;gap:4px;width:100%;min-width:0;min-height:32px;padding:4px 7px;border:1px solid #30473c22;border-radius:8px;background:var(--game-glass-control);color:var(--td-ink);font-variant-numeric:tabular-nums;white-space:nowrap;cursor:pointer;touch-action:manipulation}
.td-building-row button img{object-fit:contain;flex:none}
.td-building-row button:disabled{opacity:.6}
.td-building-row[data-affordable=false]{opacity:1;color:#667164}
.td-building-row[data-affordable=false] .td-building-icon{opacity:.7}
.td-building-row[data-affordable=false] button:disabled{opacity:1;color:var(--td-clay);background:#ffffff18;border-color:#30473c12}
@media(hover:hover) and (pointer:fine){.td-building-row button:not(:disabled):hover,.td-buildings summary:hover{background:var(--game-glass-hover)}}
.td-building-row[data-queued=true]{opacity:1}
.td-hud button[data-action=invest][data-queued=true]{background:#f4dfa0;border-color:#d2af58;color:#624d21;opacity:1}
@media(max-width:700px){
 .td-buildings{top:max(76px,env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right))}
 .td-building-row{min-height:44px;padding-top:2px;padding-bottom:2px}
 .td-building-row button{min-height:40px}
}
@media(max-height:720px) and (min-width:540px){
 .td-buildings[open]{width:600px;--td-building-row-height:clamp(28px,calc((100dvh - 152px - env(safe-area-inset-bottom))/6),42px)}
 .td-building-list{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:12px}
}
@media(max-height:720px) and (min-width:701px) and (max-width:1000px){.td-buildings[open]{top:76px}}
@media(max-height:700px) and (max-width:539px){
 .td-buildings[open]{width:calc(100vw - 20px);--td-building-row-height:clamp(28px,calc((100dvh - 152px - env(safe-area-inset-bottom))/12),44px)}
}
@media(max-height:720px) and (min-width:540px),(max-height:700px) and (max-width:539px){
 .td-building-row{height:var(--td-building-row-height);min-height:0;padding-top:2px;padding-bottom:2px}
 .td-building-icon,.td-building-icon img,.td-building-icon svg{width:min(28px,calc(var(--td-building-row-height) - 5px));height:min(28px,calc(var(--td-building-row-height) - 5px))}
 .td-building-row button{height:calc(var(--td-building-row-height) - 5px);min-height:0;padding-top:2px;padding-bottom:2px}
}

/* Each game's records belong to its menu column, with no floating board. */
.room-board-mode{display:flex;gap:3px;margin:0 12px 10px;padding:3px;border-radius:7px;background:#405c450b}
.room-board-mode button{flex:1;min-width:0;padding:6px 4px;border:0;border-radius:5px;background:transparent;color:var(--room-muted);font:inherit;font-size:11px;line-height:1.3}
.room-board-mode button[aria-pressed=true]{background:var(--game-glass-control);color:var(--room-ink);box-shadow:0 1px 3px #30473c20}
.room-leaderboard{margin:0;padding:0 12px 12px;list-style:none;font-size:13px;line-height:1.4;font-variant-numeric:tabular-nums}
.room-leaderboard:empty{display:none}
.room-leaderboard li{display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:center;gap:6px;min-height:30px}
.room-leaderboard-rank{display:grid;place-items:center;color:var(--room-muted);font-size:11px}
.room-leaderboard-rank img{display:block;width:28px;height:30px;object-fit:contain}
.room-leaderboard-name{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.room-leaderboard li strong{font-size:13px;font-weight:600}
.room-leaderboard-empty{margin:8px 12px 20px;color:var(--room-muted);font-size:12px}
@media(max-width:600px){.room-leaderboard{padding:0 10px 10px;font-size:12px}.room-leaderboard li{grid-template-columns:24px minmax(0,1fr) auto;gap:4px}.room-leaderboard-rank img{width:24px;height:26px}.room-leaderboard li strong{font-size:12px}.room-leaderboard-empty{margin:8px 10px 16px}}

/* The forecast expands the same glass status panel, at the header width. */
.td-readout{flex-direction:column;align-items:stretch;gap:0;padding:0;width:max-content;overflow:hidden;background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none}
.td-readout-header,.td-wave-list li{background:var(--game-glass);-webkit-backdrop-filter:var(--game-glass-filter);backdrop-filter:var(--game-glass-filter);transition:background-color 160ms ease-out}
.td-readout-header{display:flex;align-items:center;gap:14px;padding:6px 10px}
.td-readout:not(:has(.td-wave-preview[open])) .td-wave-panel{display:none}
.td-readout:has(.td-wave-preview[open]){z-index:3}
.td-wave-preview summary{cursor:pointer;list-style:none;user-select:none;min-height:40px}
.td-wave-preview summary::-webkit-details-marker{display:none}
.td-wave-preview summary:focus-visible{outline:2px solid var(--td-clay);outline-offset:3px;border-radius:6px}
.td-wave-panel{width:0;min-width:100%;box-sizing:border-box;border-top:1px solid var(--td-line)}
.td-wave-list{list-style:none;margin:0;padding:0;max-height:min(570px,calc(100dvh - 240px));overflow-y:auto;overscroll-behavior:contain}
.td-wave-list li{display:flex;gap:8px;align-items:center;padding:6px 12px;border-bottom:1px solid var(--td-line);font-size:12px;line-height:1.5}
.td-wave-list li:last-child{border-bottom:0}
.td-wave-list li strong{min-width:22px;font-variant-numeric:tabular-nums;font-weight:600}
.td-wave-units{display:flex;flex-wrap:wrap;gap:3px;min-width:0}
.td-wave-unit{display:block;flex:none;width:36px;height:36px;object-fit:contain}
.td-wave-label{white-space:nowrap;color:var(--td-ink)}

.td-health-marker[data-kind="boss"] .td-health-track{width:84px;height:7px}

.td-wave-list .td-wave-current{background:rgba(224,230,217,.72);font-weight:700}
.td-wave-list .td-wave-current strong,.td-wave-list .td-wave-current span{color:#254b35;font-weight:700}
.td-wave-status{margin-left:auto;font-size:10px;line-height:1.5}
@media(hover:hover) and (pointer:fine){
 .td-readout:hover .td-readout-header,.td-readout:hover .td-wave-list li{background:rgba(245,249,247,.94)}
 .td-readout:hover .td-wave-list .td-wave-current{background:rgba(224,230,217,.96)}
}
@media(prefers-reduced-motion:reduce){.td-readout-header,.td-wave-list li{transition:none}}
@media(max-width:700px){.td-readout-header{gap:12px}}

/* Inspect a live enemy without covering the tower roster. */
.td-enemy-info{position:absolute;right:max(14px,env(safe-area-inset-right));bottom:max(14px,env(safe-area-inset-bottom));z-index:2;width:272px;max-width:calc(100vw - 28px);box-sizing:border-box;padding:14px;border-radius:12px;max-height:calc(100dvh - 96px);overflow:auto}
.td-enemy-heading{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.td-enemy-heading>img{flex:none;width:64px;height:64px;object-fit:contain}
.td-enemy-heading h2{margin:0;font-size:17px;line-height:1.2;font-weight:650}
.td-enemy-heading p{margin:5px 0 0;font-size:11px;line-height:1.4;color:var(--td-muted)}
.td-enemy-health-label{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:5px;font-size:11px;font-variant-numeric:tabular-nums}
.td-enemy-health-label strong{font-size:14px}
.td-enemy-health{height:7px;overflow:hidden;border:1px solid #fff;border-radius:4px;background:#30473c25}
.td-enemy-health i{display:block;height:100%;background:#608463;transform-origin:left}
.td-enemy-health[data-low=true] i{background:#b76450}
.td-enemy-stats{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:12px 0 0}
.td-enemy-stats>div{display:flex;align-items:center;justify-content:space-between;gap:8px}
.td-enemy-stats dt{font-size:11px;color:var(--td-muted)}
.td-enemy-stats dd{margin:0;font-size:13px;font-weight:600;font-variant-numeric:tabular-nums}
.td-enemy-traits{display:grid;gap:5px;list-style:none;margin:12px 0 0;padding:0;font-size:11px;line-height:1.45}
.td-enemy-status{margin:10px 0 0;padding-top:8px;border-top:1px solid var(--td-line);font-size:11px;font-weight:600;color:var(--td-clay)}
@media(max-width:1080px){.td-enemy-info{right:max(10px,env(safe-area-inset-right));bottom:calc(142px + env(safe-area-inset-bottom));width:260px;max-height:calc(100dvh - 228px)}}

.room-player-name input.name-required {background:#fff2b8}
