/* ---- Tower Wardens ---- */
/* The game's own page (Areas/Games/Views/TowerWardens), laid out the way Blast Crew's is: one scene that fills
   the page's content area, with the map drawn edge to edge and everything else lying over it on plates -
   the map's name top left, lives and gold top right, the towers down the left with the wave button under
   them, a column of round buttons down the right, and the tab bar at the foot. Maps, the Armoury and How to
   play open as panels over the scene, and the title screen is an overlay too. The title screen's own buttons
   and the tab bar are the shared gameShell.css. This stylesheet is only loaded on this page. */

/* The page gives the scene its whole content area: no padding round it, and no footer under it (the footer
   links are at the end of How to play). */
body #main-container .inner-container { max-width: none; min-height: 0; padding: 0 !important; }
#main-container > footer { display: none; }

#go-back, #go-to-top { display: none !important; }

/* Colours. What lies over the map is on pale plates by day and dark ones on the site's Dark theme. */
#twWrapper {
    position: relative;
    --tw-plate: rgba(255, 255, 255, 0.78); --tw-plate-solid: rgba(255, 255, 255, 0.95); --tw-plate-hover: #FFFFFF; --tw-plate-text: #23282C; --tw-plate-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
    --tw-card: #f6f1e4; --tw-ink: #33291c; --tw-soft: #7a6a52; --tw-line: #d9cdb3;
    --tw-chip: #fffaf0; --tw-chip-edge: #c9b88f;
    --tw-go: #d9482b; --tw-go-edge: #9c2d16; --tw-gold: #e0a800; --tw-life: #e5484d; --tw-glow: rgba(255, 255, 255, 0.55);
    /* The shared title screen and tab bar read these (gameShell.css, Tabletop). */
    --tt-wood: linear-gradient(160deg, #9A6A42 0%, #6E4628 55%, #8A5C38 100%);
    --tt-wood-hi: rgba(255, 220, 180, 0.35);
    --tt-felt: #1F3F2A; --tt-tray: #142C1C; --tt-felt-shade: 0.45; --tt-drop: 0.5;
    --tt-cream: #F4E9D8; --tt-cream-hover: #FBF3E6; --tt-cream-edge: #B99A74; --tt-cream-text: #3A2716; --tt-cream-soft: #6B5440;
    --tt-action: #D9482B; --tt-action-edge: #9C2D16;
}
body[data-theme="Dark"] #twWrapper {
    --tw-plate: rgba(16, 24, 36, 0.76); --tw-plate-solid: rgba(22, 32, 46, 0.95); --tw-plate-hover: #2A3A50; --tw-plate-text: #F2F5F7; --tw-plate-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
    --tw-card: #1d2530; --tw-ink: #e8edf3; --tw-soft: #9aa7b6; --tw-line: #33404f;
    --tw-chip: #283341; --tw-chip-edge: #141b24; --tw-glow: rgba(10, 20, 30, 0.55);
}
body[data-theme="Default"] #twWrapper {
    --tt-wood: linear-gradient(160deg, #DDB98E 0%, #BE8F5F 55%, #D3AA7B 100%);
    --tt-wood-hi: rgba(255, 240, 220, 0.6);
    --tt-felt: #E6F2DC; --tt-tray: #CFE3C0; --tt-felt-shade: 0.12; --tt-drop: 0.22;
}

/* ---- The scene ---- */
/* As tall as the window has room for (TowerWardens.js works that out and sets --tw-h; until it has, this
   allows for the site's header). --tw-top is the room the app version's header bar takes inside the scene,
   --tw-dock the room the tab bar takes at its foot. */
#twScene { position: relative; overflow: hidden; height: calc(100vh - 62px); height: var(--tw-h, calc(100dvh - 62px)); min-height: 320px; background: #84c463; color: var(--tw-plate-text); --tw-top: 0px; --tw-dock: 72px; }
.tw-stage, #twCanvas { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
#twCanvas { display: block; width: 100%; height: 100%; cursor: pointer; touch-action: none; }
.tw-stage.tw-hurt::after { content: ""; position: absolute; inset: 0; pointer-events: none; animation: twHurt .4s ease-out; }
@keyframes twHurt { 0% { box-shadow: inset 0 0 0 8px rgba(229, 72, 77, 0.95); } 100% { box-shadow: inset 0 0 0 0 rgba(229, 72, 77, 0); } }
#twScene > .tw-app-head { position: absolute; z-index: 7; top: 0; left: 0; right: 0; padding: 0 !important; pointer-events: none; }
    #twScene > .tw-app-head > * { pointer-events: auto; }
/* The standalone version has no header bar, as in Blast Crew: the account and the theme are in Settings,
   which works through the hidden bar (TowerWardens.js, Settings). */
#twWrapper header.gs-card-header { display: none !important; margin: 0; }

/* Top left, the map; top right, what the player has. */
#twTopBar { position: absolute; z-index: 2; top: calc(var(--tw-top) + 10px); left: 10px; right: 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; pointer-events: none; }
.tw-title { display: flex; align-items: center; gap: 9px; min-width: 0; margin: 0; padding: 5px 14px 5px 5px; border-radius: 16px; font-family: Fredoka, "Open Sans", sans-serif; font-size: 18px; font-weight: 600; line-height: 1.1; color: var(--tw-plate-text); background: var(--tw-plate); box-shadow: var(--tw-plate-shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.tw-level-badge { display: inline-flex; flex: none; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 6px; box-sizing: border-box; border-radius: 12px; background: var(--tw-go); color: #fff; font-size: 18px; box-shadow: 0 3px 0 var(--tw-go-edge); }
.tw-title-text { display: flex; flex-direction: column; min-width: 0; }
    .tw-title-text > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tw-title-era { font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.7; }
.tw-hud { display: flex; flex: none; gap: 2px; padding: 4px 6px; border-radius: 999px; background: var(--tw-plate); box-shadow: var(--tw-plate-shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.tw-stat { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px 5px 7px; font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 700; }
    .tw-stat i { width: 17px; height: 17px; }
.tw-stat-lives i { background: var(--tw-life); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-8-5.2-8-11a4.6 4.6 0 0 1 8-3 4.6 4.6 0 0 1 8 3c0 5.8-8 11-8 11z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-8-5.2-8-11a4.6 4.6 0 0 1 8-3 4.6 4.6 0 0 1 8 3c0 5.8-8 11-8 11z'/%3E%3C/svg%3E") center / contain no-repeat; }
.tw-stat-gold i { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe680, var(--tw-gold)); box-shadow: inset 0 0 0 1.5px #a67c00; }
.tw-stat-gem { position: relative; }
    .tw-stat-gem i { background: var(--tw-gem-pic) center / contain no-repeat; }
    .tw-stat-gem.tw-gem-got i { animation: twGemGot .5s ease-out; }
.tw-gem-pop { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); font-size: 14px; color: #0b6f8f; text-shadow: 0 0 4px #fff, 0 0 2px #fff; pointer-events: none; animation: twGemPop 1.4s ease-out both; }
    body[data-theme="Dark"] .tw-gem-pop { color: #8fe6ff; text-shadow: 0 0 4px #000; }
@keyframes twGemPop { 0% { opacity: 0; transform: translate(-50%, 14px); } 20% { opacity: 1; transform: translate(-50%, 2px); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -8px); } }
@keyframes twGemGot { 0% { transform: scale(1); } 40% { transform: scale(1.5) rotate(-10deg); } 100% { transform: scale(1); } }
.tw-gem { display: inline-block; width: 15px; height: 14px; margin-right: 5px; vertical-align: -2px; background: var(--tw-gem-pic) center / contain no-repeat; }
@media (prefers-reduced-motion: reduce) { .tw-stat-gem.tw-gem-got i { animation: none; } }
.tw-stat-wave i { background: currentColor; opacity: 0.75; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h2v18H5zM8 4h11l-3 4 3 4H8z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h2v18H5zM8 4h11l-3 4 3 4H8z'/%3E%3C/svg%3E") center / contain no-repeat; }

/* The hint line, between the two. */
.tw-hint { position: absolute; z-index: 2; top: calc(var(--tw-top) + 14px); left: 50%; transform: translateX(-50%); box-sizing: border-box; width: max-content; max-width: min(470px, calc(100% - 620px)); padding: 7px 15px; border-radius: 14px; font-size: 13px; line-height: 1.4; text-align: center; pointer-events: none; color: var(--tw-plate-text); background: var(--tw-plate); box-shadow: var(--tw-plate-shadow); }

/* ---- The left-hand column: the towers, then the wave button ---- */
.tw-left { position: absolute; z-index: 2; top: calc(var(--tw-top) + 74px); left: 10px; display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 186px; pointer-events: none; }
    .tw-left > * { pointer-events: auto; }
.tw-tray { padding: 6px; border-radius: 18px; background: var(--tw-plate); box-shadow: var(--tw-plate-shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.tw-towers { display: flex; flex-direction: column; gap: 4px; }
.tw-tower-btn { display: flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer; padding: 4px 9px 4px 5px; font-family: inherit; text-align: left; color: var(--tw-plate-text); border: 2px solid transparent; border-radius: 13px; background: transparent; -webkit-tap-highlight-color: transparent; transition: background-color .15s ease-in-out; }
    .tw-tower-btn .tw-tower-pic { flex: none; width: 36px; height: 36px; }
    .tw-tower-btn:hover { background: rgba(127, 127, 127, 0.2); }
    .tw-tower-btn.tw-on { border-color: var(--tw-go); background: var(--tw-plate-solid); }
    .tw-tower-btn.tw-poor { opacity: 0.5; }
    .tw-tower-btn:active { transform: scale(0.97); }
.tw-tower-name { flex: 1 1 auto; min-width: 0; font-family: Fredoka, "Open Sans", sans-serif; font-size: 15px; font-weight: 600; }
.tw-cost { display: inline-flex; flex: none; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
    .tw-cost::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe680, var(--tw-gold)); box-shadow: inset 0 0 0 1px #a67c00; }
    /* The Armoury's price is in diamonds. */
    .tw-cost-coin::before { width: 13px; height: 12px; border-radius: 0; box-shadow: none; background: var(--tw-gem-pic) center / contain no-repeat; }
/* The tower that's been tapped takes the tray's place. */
.tw-selected { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 4px; user-select: none; }
.tw-sel-name { font-family: Fredoka, "Open Sans", sans-serif; font-size: 16px; font-weight: 600; }
    .tw-sel-name b { display: block; font-weight: 400; font-size: 12px; opacity: 0.75; }
.tw-sel-max { font-size: 12.5px; opacity: 0.75; }
/* What the tapped tower does: a bar for each thing, filled to where it is now, with the step an upgrade would
   add shown in gold behind it and as a number beside it. */
.tw-sel-stats { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.tw-stat-row { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 6px; }
.tw-stat-name { opacity: 0.8; }
.tw-stat-bar { position: relative; height: 7px; border-radius: 4px; background: rgba(127, 127, 127, 0.28); overflow: hidden; }
    .tw-stat-bar i { position: absolute; z-index: 1; top: 0; bottom: 0; left: 0; border-radius: 4px; background: var(--tw-go); }
    .tw-stat-bar i.tw-stat-next { z-index: 0; background: var(--tw-gold); }
    .tw-stat-bar i.tw-stat-hp { background: #3fae5a; }
.tw-stat-num { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
    .tw-stat-num em { font-style: normal; color: #b88600; }
    body[data-theme="Dark"] .tw-stat-num em { color: #ffd23f; }
.tw-selected .tw-btn { justify-content: space-between; padding: 7px 11px; font-size: 14px; }
.tw-selected .tw-btn-up { background: var(--tw-go); color: #fff; box-shadow: 0 3px 0 var(--tw-go-edge); }
.tw-selected .tw-btn-x { justify-content: center; padding: 3px 0; font-size: 13px; }
#twButtons { display: flex; }
.tw-wave-btn { flex: 1 1 auto; min-height: 44px; padding: 8px 10px; border-radius: 22px; font-size: 14.5px; line-height: 1.15; font-variant-numeric: tabular-nums; border: 2px solid rgba(255, 255, 255, 0.75); box-shadow: var(--tw-plate-shadow); }
    .tw-wave-btn:disabled { opacity: 0.7; }
    .tw-wave-btn.tw-ready { animation: twReady 1.6s ease-in-out infinite; }
@keyframes twReady { 50% { filter: brightness(1.18); } }

/* ---- The right-hand column: round buttons ---- */
/* Where the window is too short for one column they wrap into a second, to its left. The column itself lets
   taps through to the map; only its buttons take them. */
.tw-side { position: absolute; z-index: 2; top: calc(var(--tw-top) + 74px); right: 10px; bottom: calc(var(--tw-dock) + 10px); display: flex; flex-direction: column; flex-wrap: wrap-reverse; align-content: flex-start; gap: 7px; pointer-events: none; }
    .tw-side button { position: relative; pointer-events: auto; cursor: pointer; width: 40px; height: 40px; margin: 0; padding: 0; font-family: Fredoka, "Open Sans", sans-serif; font-size: 12.5px; font-weight: 700; border: 0; border-radius: 50%; color: var(--tw-plate-text); background: var(--tw-plate); box-shadow: var(--tw-plate-shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: transform .12s ease-in-out, background-color .2s ease-in-out; -webkit-tap-highlight-color: transparent; }
    .tw-side button:hover { background: var(--tw-plate-hover); }
    .tw-side button:active { transform: scale(0.94); }
    .tw-side button.tw-on { color: #fff; background: var(--tw-go); }
    .tw-side button.tw-off { opacity: 0.55; }
    .tw-side .tw-side-tool { margin-top: 8px; }
    .tw-side .tw-ico::before { content: ""; position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; background: var(--tw-pic) center / contain no-repeat; }
.tw-ico-armoury { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke-linejoin='round'%3E%3Cpath d='M12 2.5 4 5.500v6c0 5 3.4 8.3 8 10 4.6-1.7 8-5 8-10v-6z' fill='%23F2C230' stroke='%237A5A00' stroke-width='1.6'/%3E%3Cpath d='M12 5v14.500c3.5-1.5 5.8-4 5.8-8V7z' fill='%23E0A800'/%3E%3Cpath d='M8.5 12l2.5 2.5 4.5-5' fill='none' stroke='%23FFF' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.tw-ico-help { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='%232F7FE0' stroke='%23134A94' stroke-width='1.6'/%3E%3Cpath d='M9.3 9.300a2.8 2.8 0 1 1 4.2 2.400c-.9.6-1.5 1.1-1.5 2.3' fill='none' stroke='%23FFF' stroke-width='2.2' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='17.3' r='1.3' fill='%23FFF'/%3E%3C/svg%3E"); }
.tw-ico-settings { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.3 2.5h3.4l.5 2.6 1.9.8 2.2-1.5 2.4 2.4-1.5 2.2.8 1.9 2.6.5v3.400l-2.6.5-.8 1.9 1.5 2.2-2.4 2.4-2.2-1.5-1.9.8-.5 2.600h-3.400l-.5-2.6-1.9-.8-2.2 1.5-2.4-2.4 1.5-2.2-.8-1.9-2.6-.5v-3.400l2.6-.5.8-1.9-1.5-2.2 2.4-2.4 2.2 1.5 1.9-.8z' fill='%238E99A8' stroke='%233F4A59' stroke-width='1.3' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='12' r='3.3' fill='%23F4F6F8' stroke='%233F4A59' stroke-width='1.3'/%3E%3C/svg%3E"); }
.tw-ico-sound { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9.500v5h3.500L12 18V6L7.5 9.500z' fill='%2326A69A' stroke='%230E5A52' stroke-width='1.6'/%3E%3Cpath d='M15.5 9a4 4 0 0 1 0 6M18 6.500a7.5 7.5 0 0 1 0 11' fill='none' stroke='%230E5A52' stroke-width='2'/%3E%3C/svg%3E"); }
.tw-ico-restart { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12a7 7 0 1 0 2.3-5.200M4.5 3.500v4h4' stroke='%238A3A12' stroke-width='4.6'/%3E%3Cpath d='M5 12a7 7 0 1 0 2.3-5.200M4.5 3.500v4h4' stroke='%23F28A3C' stroke-width='2.4'/%3E%3C/svg%3E"); }
.tw-ico-zoom { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5' fill='%23CFE9FF' stroke='%231F5FA8' stroke-width='2'/%3E%3Cpath d='M15.5 15.5 21 21' stroke='%231F5FA8' stroke-width='3'/%3E%3Cpath d='M7.5 10.5h6M10.5 7.5v6' stroke='%231F5FA8' stroke-width='1.8'/%3E%3C/svg%3E"); }
.tw-ico-zoomout { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5' fill='%23CFE9FF' stroke='%231F5FA8' stroke-width='2'/%3E%3Cpath d='M15.5 15.5 21 21' stroke='%231F5FA8' stroke-width='3'/%3E%3Cpath d='M7.5 10.5h6' stroke='%231F5FA8' stroke-width='1.8'/%3E%3C/svg%3E"); }
.tw-ico-pause { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='5' y='4.500' width='5' height='15' rx='1.500' fill='%237C5CE0' stroke='%233A2496' stroke-width='1.5'/%3E%3Crect x='14' y='4.500' width='5' height='15' rx='1.500' fill='%237C5CE0' stroke='%233A2496' stroke-width='1.5'/%3E%3C/svg%3E"); }
.tw-side button:focus-visible, .tw-btn:focus-visible, .tw-tower-btn:focus-visible, button.tw-level:focus-visible { outline: 2px solid #864cff; outline-offset: 2px; }

/* ---- Buttons ---- */
.tw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; padding: 8px 14px; font-family: Fredoka, "Open Sans", sans-serif; font-size: 15px; font-weight: 600; color: var(--tw-ink); border: 0; border-radius: 11px; background: var(--tw-chip); box-shadow: 0 3px 0 var(--tw-chip-edge); }
    .tw-btn:active { transform: translateY(2px); }
    .tw-btn:disabled { cursor: default; }
.tw-btn-go { background: var(--tw-go); color: #fff; box-shadow: 0 3px 0 var(--tw-go-edge); }
.tw-btn-x { padding: 4px 11px; font-size: 20px; line-height: 1; }
.tw-btn.tw-poor { opacity: 0.55; }

/* ---- The tutorial card, and the glow on what it's talking about ---- */
.tw-coach { position: absolute; z-index: 3; top: calc(var(--tw-top) + 12px); left: 50%; transform: translateX(-50%); width: min(430px, calc(100% - 620px)); min-width: 300px; box-sizing: border-box; padding: 10px 14px; border-radius: 14px; background: var(--tw-card); color: var(--tw-ink); border: 2px solid var(--tw-gold); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35); font-size: 14px; line-height: 1.35; text-align: left; }
.tw-coach-text { margin: 0; }
.tw-coach-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; min-height: 22px; }
.tw-coach-dots { display: flex; gap: 4px; margin-right: auto; }
    .tw-coach-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--tw-line); }
    .tw-coach-dots i.tw-on { width: 16px; border-radius: 4px; background: var(--tw-go); }
.tw-coach-skip { cursor: pointer; padding: 4px 6px; font-family: inherit; font-size: 13px; color: var(--tw-soft); border: 0; background: transparent; text-decoration: underline; }
.tw-coach .tw-btn { padding: 5px 14px; font-size: 14px; }
.tw-coach-target { position: relative; z-index: 1; animation: twCoachTarget 1.1s ease-in-out infinite; }
@keyframes twCoachTarget { 0%, 100% { box-shadow: 0 0 0 3px var(--tw-gold); } 50% { box-shadow: 0 0 0 8px rgba(224, 168, 0, 0.35); } }

/* ---- The result card, over the map ---- */
.tw-result { position: absolute; z-index: 4; inset: 0; display: flex; align-items: center; justify-content: center; padding: calc(var(--tw-top) + 12px) 12px calc(var(--tw-dock) + 12px); box-sizing: border-box; background: rgba(12, 16, 22, 0.5); line-height: 1.4; }
.tw-result-card { width: 100%; max-width: 420px; max-height: 100%; overflow-y: auto; box-sizing: border-box; padding: 16px 18px; border-radius: 16px; background: var(--tw-card); color: var(--tw-ink); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4); text-align: center; }
    .tw-result-card h2, .tw-panel-head h2 { margin: 0; font-family: Fredoka, "Open Sans", sans-serif; font-size: 22px; font-weight: 600; color: var(--tw-ink); text-wrap: balance; }
.tw-score { margin: 4px 0 2px; font-family: Fredoka, "Open Sans", sans-serif; font-size: 17px; color: var(--tw-soft); }
    .tw-score b { display: block; font-size: 54px; line-height: 1; color: var(--tw-go); font-variant-numeric: tabular-nums; }
.tw-result-line, .tw-result-coins { margin: 6px 0 0; font-size: 14px; }
.tw-result-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.tw-stars { color: #f2b01e; font-size: 30px; letter-spacing: 2px; }
    .tw-stars i { font-style: normal; color: var(--tw-line); }

/* ---- Panels over the scene: Maps, the Armoury, How to play ---- */
.tw-panel { position: absolute; z-index: 5; inset: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; box-sizing: border-box; padding: calc(var(--tw-top) + 14px) 12px calc(var(--tw-dock) + 26px) 12px; background: rgba(20, 28, 36, 0.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); line-height: 1.4; animation: twPanelIn .2s ease-out; }
@keyframes twPanelIn { from { opacity: 0; } to { opacity: 1; } }
.tw-panel-card { box-sizing: border-box; max-width: 760px; margin: 0 auto; padding: 16px 18px; border-radius: 18px; background: var(--tw-card); color: var(--tw-ink); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4); text-align: left; }
.tw-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.tw-panel-body { font-size: 14px; }
    .tw-panel-body h3 { margin: 12px 0 4px; font-size: 15px; color: var(--tw-ink); }
    .tw-panel-body p { margin: 0 0 8px; }
    .tw-panel-body ul { margin: 0 0 8px; padding-left: 18px; }
/* Under the title screen and under an open panel, only the map itself shows. */
#twWrapper.gs-title-open .tw-stage > :not(canvas), #twWrapper.tw-panel-open .tw-stage > :not(canvas), #twWrapper.gs-title-open .tw-panel { display: none !important; }

/* Maps: in eras, a heading for each and a stripe of the era's colour on its maps */
.tw-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tw-level-no { font-family: Fredoka, "Open Sans", sans-serif; font-size: 17px; font-weight: 600; }
button.tw-level { display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer; padding: 8px 6px; font-family: inherit; font-size: 13px; color: var(--tw-ink); border: 2px solid transparent; border-radius: 12px; background: var(--tw-chip); box-shadow: 0 3px 0 var(--tw-chip-edge); }
    button.tw-level .tw-stars { font-size: 17px; letter-spacing: 1px; }
    button.tw-level.tw-locked { cursor: default; opacity: 0.5; }
.tw-level-two { padding: 1px 8px; font-size: 11px; font-weight: 700; border-radius: 9px; color: #5a3a00; background: #ffd23f; }
.tw-level-saved { margin-top: 2px; padding: 1px 8px; font-size: 11.5px; font-weight: 700; border-radius: 9px; color: #fff; background: #2f7fe0; font-variant-numeric: tabular-nums; }
.tw-level-lock, .tw-level-best { font-size: 12px; color: var(--tw-soft); font-variant-numeric: tabular-nums; }
.tw-era { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 12px 0 6px !important; font-family: Fredoka, "Open Sans", sans-serif; font-size: 16px; }
    .tw-era span { font-family: inherit; font-size: 12px; font-weight: 400; color: var(--tw-soft); }
    .tw-era::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--tw-era, #84c463); }
[data-era="kingdom"] { --tw-era: #84c463; } [data-era="frontier"] { --tw-era: #d9a65a; } [data-era="city"] { --tw-era: #7d858f; } [data-era="future"] { --tw-era: #39e6ff; }
button.tw-level[data-era] { border-top: 4px solid var(--tw-era); }
    button.tw-level.tw-current[data-era] { border-color: var(--tw-go); border-top-color: var(--tw-era); }
/* The Armoury */
.tw-armoury { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.tw-perk { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; border-radius: 12px; background: var(--tw-chip); box-shadow: 0 3px 0 var(--tw-chip-edge); }
.tw-perk-name { font-family: Fredoka, "Open Sans", sans-serif; font-size: 16px; font-weight: 600; }
.tw-perk-lv { font-family: inherit; font-size: 12px; font-weight: 400; color: var(--tw-soft); font-variant-numeric: tabular-nums; }
.tw-perk-text { flex: 1; font-size: 13px; }
.tw-armoury-note, .tw-reset { margin-top: 10px !important; font-size: 12px; color: var(--tw-soft); }
.tw-panel-body .custom-footer { margin-top: 14px; font-size: 12px; text-align: center; }

/* Settings */
.tw-set h3:first-child { margin-top: 2px; }
.tw-set-sub { margin: 0 !important; font-size: 12.5px; color: var(--tw-soft); }
.tw-set-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
    .tw-set-row .tw-btn { padding: 7px 16px; font-size: 14px; text-decoration: none; }
    .tw-set-row .tw-btn.tw-set-off { opacity: 0.7; }
.tw-set-pic { flex: none; width: 46px; height: 46px; border-radius: 50%; object-fit: cover; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
.tw-set-who { display: flex; flex-direction: column; gap: 2px; flex: 1 1 180px; min-width: 0; font-size: 13px; line-height: 1.4; }
    .tw-set-who strong { font-family: Fredoka, "Open Sans", sans-serif; font-size: 17px; font-weight: 600; }
    .tw-set-who span { color: var(--tw-soft); }
.tw-choice { cursor: pointer; padding: 6px 16px; font-family: inherit; font-size: 13px; font-weight: 700; line-height: 18px; border-radius: 16px; border: 1.5px solid var(--tw-line); color: var(--tw-ink); background: transparent; }
    .tw-choice.tw-choice-on { color: #fff; border-color: var(--tw-go); background: var(--tw-go); }
    .tw-choice:focus-visible, .tw-link:focus-visible { outline: 2px solid #864cff; outline-offset: 2px; }
.tw-reset-ask { flex: 1 1 100%; padding: 12px 14px; border-radius: 12px; background: rgba(217, 72, 43, 0.1); box-shadow: inset 0 0 0 1px rgba(217, 72, 43, 0.35); }
    .tw-reset-ask[hidden] { display: none; }
    .tw-reset-ask p { margin: 0 0 10px 0; font-size: 13.5px; line-height: 1.5; }
    .tw-reset-ask .tw-btn { margin: 0 3px 3px 0; }
.tw-set-row .tw-btn[hidden] { display: none; }
.tw-link { display: inline-flex; align-items: center; padding: 6px 12px; font-size: 13px; text-decoration: none; border-radius: 15px; color: var(--tw-ink); background: rgba(127, 127, 127, 0.16); }
    .tw-link:hover { background: rgba(127, 127, 127, 0.28); }

/* ---- The title screen: the logo and the menu over the map, with a soft light behind them and no card ---- */
#twWrapper.gs-title-open #gsTitleScreen { position: absolute; z-index: 8; top: 0; left: 0; right: 0; display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; box-sizing: border-box; height: calc(100vh - 62px); height: var(--tw-h, calc(100dvh - 62px)); min-height: 320px; background: radial-gradient(ellipse 62% 72% at 50% 46%, var(--tw-glow), transparent 74%); }
#twWrapper #gsTitleScreen::before { display: none; }
#twWrapper #gsTitleScreen .gs-title-inner { width: 100%; margin: auto; box-sizing: border-box; }
#twWrapper #gsTitleScreen .gs-title-logo { width: min(100%, 400px); filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35)); }
#twWrapper #gsTitleScreen .gs-title-tagline, #twWrapper #gsTitleScreen .gs-title-best { padding: 6px 15px; font-weight: 600; border-radius: 14px; opacity: 1; color: var(--tw-plate-text); background: var(--tw-plate); box-shadow: var(--tw-plate-shadow); }
#twWrapper #gsTitleScreen .gs-title-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
    #twWrapper #gsTitleScreen .gs-title-option { opacity: 1; color: var(--tw-plate-text); background: var(--tw-plate); box-shadow: var(--tw-plate-shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
        #twWrapper #gsTitleScreen .gs-title-option:hover { background: var(--tw-plate-hover); }

/* ---- The tab bar and its bubble ---- */
#twWrapper #twModeHolder.gs-mode-holder { position: absolute; z-index: 6; left: 8px; right: 8px; bottom: 8px; max-width: 520px; margin: 0 auto !important; }
    #twWrapper.gs-title-open #twModeHolder.gs-mode-holder { display: none !important; }
#twWrapper #gsDock .gs-dock-menu::before { width: 26px; height: 26px; background-color: transparent; background-image: url(../../Assets/Games/Images/TowerWardens/menu.svg); background-position: center; background-size: contain; background-repeat: no-repeat; -webkit-mask: none; mask: none; }
#gsDockBubble[data-mode="play"] { background: linear-gradient(135deg, #EC5A45, #C2331F); box-shadow: 0 6px 16px rgba(216, 64, 47, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
#gsDockBubble[data-mode="maps"] { background: linear-gradient(135deg, #4FB06B, #1F8A4C); box-shadow: 0 6px 16px rgba(31, 138, 76, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
#gsDockBubble[data-mode="armoury"] { background: linear-gradient(135deg, #F2A93A, #D9741F); box-shadow: 0 6px 16px rgba(232, 140, 40, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
#gsDock .gs-dock-tab span { white-space: nowrap; }

/* ---- Narrower screens ---- */
/* Where the floating tab bar would run into the map's foot, the scene leaves room for it. */
/* Not wide enough for the hint between the plates: it and the tutorial card go under them. */
@media screen and (max-width: 1100px) {
    .tw-hint { top: calc(var(--tw-top) + 66px); max-width: min(470px, calc(100% - 420px)); }
    .tw-coach { top: calc(var(--tw-top) + 66px); width: min(430px, calc(100% - 420px)); }
}
@media screen and (max-width: 775px) {
    #twScene { --tw-dock: 62px; }
    body[data-mode="spa"] #twScene { --tw-dock: 0px; }
}
/* Phones, and a phone on its side: the towers in a row along the foot of the scene above the tabs, and the
   wave button top left under the map's name - where Blast Crew keeps its Detonate. */
@media screen and (max-width: 560px), screen and (max-height: 520px) {
    #twTopBar { top: calc(var(--tw-top) + 8px); left: 8px; right: 8px; }
    .tw-title { font-size: 15px; padding: 4px 11px 4px 4px; }
    .tw-level-badge { min-width: 32px; height: 32px; font-size: 16px; border-radius: 10px; }
    .tw-stat { padding: 4px 6px 4px 5px; font-size: 14px; gap: 4px; }
    .tw-left { display: contents; }
    #twButtons { position: absolute; z-index: 2; top: calc(var(--tw-top) + 58px); left: 8px; }
        .tw-wave-btn { min-height: 40px; padding: 6px 16px; }
    .tw-tray { position: absolute; z-index: 2; left: 6px; right: 6px; bottom: calc(var(--tw-dock) + 8px); width: -moz-fit-content; width: fit-content; max-width: calc(100% - 12px); margin: 0 auto; padding: 4px; border-radius: 18px; }
    .tw-towers { flex-direction: row; gap: 2px; }
    .tw-tower-btn { flex-direction: column; gap: 0; padding: 3px 7px; }
        .tw-tower-btn .tw-tower-pic { width: 32px; height: 32px; }
    .tw-tower-name { font-size: 12px; }
    .tw-cost { font-size: 12px; }
    .tw-selected { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; }
        .tw-sel-stats { flex: 1 1 150px; min-width: 150px; }
        .tw-sel-name b { display: inline; margin-left: 4px; }
        .tw-selected .tw-btn-x { padding: 5px 11px; }
    .tw-side { top: calc(var(--tw-top) + 106px); left: 8px; right: 8px; bottom: auto; flex-direction: row; flex-wrap: wrap; gap: 5px 4px; }
        .tw-side button { width: 35px; height: 35px; }
        .tw-side .tw-side-tool { margin-top: 0; margin-left: 4px; }
    .tw-hint { top: calc(var(--tw-top) + 150px); left: 8px; max-width: calc(100% - 16px); padding: 6px 12px; transform: none; font-size: 12.5px; text-align: left; }
    .tw-coach { top: calc(var(--tw-top) + 150px); left: 8px; width: auto; min-width: 0; max-width: calc(100% - 16px); padding: 7px 10px; transform: none; font-size: 12.5px; }
    .tw-coach-foot { margin-top: 4px; }
    .tw-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tw-panel-card { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .tw-stage.tw-hurt::after, .tw-wave-btn.tw-ready, .tw-panel { animation: none; }
    .tw-coach-target { animation: none; box-shadow: 0 0 0 3px var(--tw-gold); }
    .tw-side button, .tw-tower-btn { transition: none; }
}

/* ---- A picture for every button ----
   Like Blast Crew's: each button, option and link carries a small drawing of its own, in colour. An element
   with .tw-ico shows the drawing its .tw-ico-(name) class names (--tw-pic) before its words; the round
   buttons at the side (above) show it alone. Drawings that sit on a red button are white. */
.tw-ico-turn { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 9.500l6 3-6 3-6-3z' fill='%238FD27A' stroke='%232E6B24' stroke-width='1.4' stroke-linejoin='round'/%3E%3Cpath d='M6 12.500v3.500l6 3 6-3v-3.500l-6 3z' fill='%235FAE4E' stroke='%232E6B24' stroke-width='1.4' stroke-linejoin='round'/%3E%3Cpath d='M4 8.500A9 9 0 0 1 19 5M20 1.800V6h-4.200' fill='none' stroke='%23134A94' stroke-width='4.200' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M4 8.500A9 9 0 0 1 19 5M20 1.800V6h-4.200' fill='none' stroke='%235AA8F5' stroke-width='2.100' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.tw-ico-wrench { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.500 3a5.500 5.500 0 0 0-5.200 7.300L3.600 16a2.200 2.200 0 0 0 0 3.100l1.300 1.300a2.200 2.200 0 0 0 3.100 0l5.700-5.700A5.500 5.500 0 0 0 20.800 8l-3.300 3.300-3.200-.800-.800-3.200L16.800 4a5.500 5.500 0 0 0-2.300-1z' fill='%238FC7F5' stroke='%23134A94' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.tw-ico-maps { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6.500l6-2.500 6 2.500 6-2.500v13.500l-6 2.500-6-2.500-6 2.500z' fill='%238FD27A' stroke='%232E6B24' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M9 4v13.500M15 6.500V20' stroke='%232E6B24' stroke-width='1.3'/%3E%3Cpath d='M5.500 14.500c1.500-2.500 3 0 4.500-2s2.500-2.500 4.500-1.500 2.500 1.500 4-1' fill='none' stroke='%23B5651D' stroke-width='1.7' stroke-linecap='round' stroke-dasharray='1.600 2.200'/%3E%3C/svg%3E"); }
.tw-ico-sound.tw-off, .tw-ico-sound.tw-set-off, .tw-ico-sound[aria-pressed="false"] { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9.500v5h3.500L12 18V6L7.500 9.500z' fill='%23A5AEB8' stroke='%235B646D' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M16 9.500l5 5M21 9.500l-5 5' fill='none' stroke='%23D8402F' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.tw-ico-wipes { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='2.500' y='5' width='11' height='14' rx='2' fill='%23C9B8F7' stroke='%234B2FA0' stroke-width='1.5'/%3E%3Crect x='10.500' y='5' width='11' height='14' rx='2' fill='%237C5CE0' stroke='%234B2FA0' stroke-width='1.5'/%3E%3Cpath d='M13.500 12h5m-2-2.200 2.200 2.200-2.200 2.200' fill='none' stroke='%23FFF' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.tw-ico-wrench.tw-set-off::before { filter: grayscale(1); opacity: 0.6; }
.tw-ico-wipes.tw-set-off { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='2.500' y='5' width='11' height='14' rx='2' fill='%23D5DAE0' stroke='%235B646D' stroke-width='1.5'/%3E%3Crect x='10.500' y='5' width='11' height='14' rx='2' fill='%23A5AEB8' stroke='%235B646D' stroke-width='1.5'/%3E%3Cpath d='M4 20.500L20 3.500' stroke='%23D8402F' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.tw-ico-trash { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 7.500h12l-1 12.200a1.500 1.500 0 0 1-1.500 1.300h-7A1.500 1.500 0 0 1 7 19.700z' fill='%23E8503E' stroke='%238A1F14' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M4 7.500h16M9.500 7.500V4.500h5v3' fill='none' stroke='%238A1F14' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M10 11v6.500M14 11v6.500' stroke='%23FFF' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
.tw-btn-go.tw-ico-trash { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 7.500h12l-1 12.200a1.500 1.500 0 0 1-1.500 1.300h-7A1.500 1.500 0 0 1 7 19.700z' fill='%23FFF' stroke='%235A1408' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M4 7.500h16M9.500 7.500V4.500h5v3' fill='none' stroke='%235A1408' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M10 11v6.500M14 11v6.500' stroke='%23D9482B' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
.tw-ico-back { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 12H6m5-5.500L5.500 12l5.500 5.500' fill='none' stroke='%23134A94' stroke-width='4.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M19 12H6m5-5.500L5.500 12l5.500 5.500' fill='none' stroke='%235AA8F5' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.tw-ico-device { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='4.500' width='18' height='12' rx='2' fill='%238FC7F5' stroke='%231F5FA8' stroke-width='1.6'/%3E%3Cpath d='M8.500 20h7M12 16.500V20' stroke='%231F5FA8' stroke-width='1.9' stroke-linecap='round'/%3E%3C/svg%3E"); }
.tw-ico-sun { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.500v2.500M12 19v2.500M2.500 12H5M19 12h2.500M5.300 5.300l1.800 1.800M16.900 16.900l1.800 1.800M5.300 18.700l1.800-1.800M16.900 7.100l1.800-1.800' stroke='%23B36B00' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='12' r='4.500' fill='%23FFC93C' stroke='%23B36B00' stroke-width='1.6'/%3E%3C/svg%3E"); }
.tw-ico-moon { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 14.500A8.500 8.500 0 0 1 9.500 4a8.500 8.500 0 1 0 10.500 10.500z' fill='%239AA6F0' stroke='%232F3A8F' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.tw-ico-person { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4.500 20.500c.500-4.500 3.500-6.500 7.500-6.500s7 2 7.500 6.500z' fill='%233F8FD8' stroke='%231F5E9C' stroke-width='1.6' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='8' r='4' fill='%23F2C9A0' stroke='%237A4A1E' stroke-width='1.6'/%3E%3C/svg%3E"); }
.tw-ico-signout { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 4H5.500A1.500 1.500 0 0 0 4 5.500v13A1.500 1.500 0 0 0 5.500 20H10' fill='none' stroke='%235B646D' stroke-width='2.2' stroke-linecap='round'/%3E%3Cpath d='M10 12h10m-4-4.500 4.500 4.500-4.500 4.500' fill='none' stroke='%238A3A12' stroke-width='4.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M10 12h10m-4-4.500 4.500 4.500-4.500 4.500' fill='none' stroke='%23F28A3C' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.tw-ico-pause.tw-on { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4.500v15l12.500-7.500z' fill='%233DBB5E' stroke='%2317692C' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.tw-ico-auto { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 11a7 7 0 0 1 12.200-4M19 13a7 7 0 0 1-12.200 4M17.500 2.500V7H13M6.500 21.500V17H11' fill='none' stroke='%2317692C' stroke-width='4.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5 11a7 7 0 0 1 12.200-4M19 13a7 7 0 0 1-12.200 4M17.500 2.500V7H13M6.500 21.500V17H11' fill='none' stroke='%235FD47C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M10.300 9.200v5.600l4.600-2.800z' fill='%235FD47C' stroke='%2317692C' stroke-width='1.1' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.tw-ico-speed { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6v12l8.500-6zM12.500 6v12L21 12z' fill='%23F5A623' stroke='%238A4B00' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.tw-ico-swords { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg transform='rotate(-45 12 12)'%3E%3Cpath d='M12 .8l2.100 3.400V15.200h-4.200V4.200z' fill='%23FFF' stroke='%235A1408' stroke-width='1.300' stroke-linejoin='round'/%3E%3Cpath d='M12 4.500V14' stroke='%23B9C4D0' stroke-width='1'/%3E%3Crect x='7' y='14.800' width='10' height='2.600' rx='1.300' fill='%23FFD23F' stroke='%235A1408' stroke-width='1.200'/%3E%3Crect x='10.900' y='17.400' width='2.200' height='3.400' fill='%23A8642A' stroke='%235A1408' stroke-width='1.100'/%3E%3Ccircle cx='12' cy='21.900' r='1.600' fill='%23FFD23F' stroke='%235A1408' stroke-width='1.100'/%3E%3C/g%3E%3Cg transform='rotate(45 12 12)'%3E%3Cpath d='M12 .8l2.100 3.400V15.200h-4.200V4.200z' fill='%23FFF' stroke='%235A1408' stroke-width='1.300' stroke-linejoin='round'/%3E%3Cpath d='M12 4.500V14' stroke='%23B9C4D0' stroke-width='1'/%3E%3Crect x='7' y='14.800' width='10' height='2.600' rx='1.300' fill='%23FFD23F' stroke='%235A1408' stroke-width='1.200'/%3E%3Crect x='10.900' y='17.400' width='2.200' height='3.400' fill='%23A8642A' stroke='%235A1408' stroke-width='1.100'/%3E%3Ccircle cx='12' cy='21.900' r='1.600' fill='%23FFD23F' stroke='%235A1408' stroke-width='1.100'/%3E%3C/g%3E%3C/svg%3E"); }
.tw-ico-up { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 19.500V6m-5.500 5L12 5.500l5.500 5.500' fill='none' stroke='%235A1408' stroke-width='4.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M12 19.500V6m-5.500 5L12 5.500l5.500 5.500' fill='none' stroke='%23FFF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.tw-ico-next { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h13m-5-5.500 5.500 5.500-5.500 5.500' fill='none' stroke='%235A1408' stroke-width='4.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5 12h13m-5-5.500 5.500 5.500-5.500 5.500' fill='none' stroke='%23FFF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.tw-ico-check { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.500l4.500 4.500L19 7.500' fill='none' stroke='%235A1408' stroke-width='4.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5 12.500l4.500 4.500L19 7.500' fill='none' stroke='%23FFF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.tw-ico-again { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12a7 7 0 1 0 2.300-5.200M4.500 3.500v4h4' fill='none' stroke='%235A1408' stroke-width='4.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5 12a7 7 0 1 0 2.300-5.200M4.500 3.500v4h4' fill='none' stroke='%23FFF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.tw-ico-tag { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.500 4.500h8l9 9-7.500 7.500-9.500-9.500z' fill='%23F2C230' stroke='%237A5A00' stroke-width='1.6' stroke-linejoin='round'/%3E%3Ccircle cx='8' cy='9' r='1.700' fill='%23FFF' stroke='%237A5A00' stroke-width='1.2'/%3E%3C/svg%3E"); }
.tw-ico-coins { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 13v3.500c0 1.900 3.100 3.500 7 3.500s7-1.600 7-3.500V13z' fill='%23E0A800' stroke='%237A5A00' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M5 9v4c0 1.900 3.100 3.500 7 3.500s7-1.600 7-3.500V9z' fill='%23F2C230' stroke='%237A5A00' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cellipse cx='12' cy='8.500' rx='7' ry='3.500' fill='%23FFE07A' stroke='%237A5A00' stroke-width='1.5'/%3E%3C/svg%3E"); }
.tw-ico-sword { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.500 3.500l-1 5-8.500 8.500-3.500-3.500L16 5z' fill='%23D8E2EC' stroke='%233F4A59' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M5.500 11.500l7 7' stroke='%237A5A00' stroke-width='2.8' stroke-linecap='round'/%3E%3Cpath d='M7.500 16.500l-3.500 3.500' stroke='%238A4B1E' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E"); }
.tw-ico-heart { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.500C5 15.500 3 12 3 8.800A4.600 4.600 0 0 1 12 7a4.600 4.600 0 0 1 9 1.800c0 3.200-2 6.700-9 11.700z' fill='%23E5484D' stroke='%238A1F23' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.tw-btn.tw-ico::before, .tw-choice.tw-ico::before, .tw-link::before, #twWrapper .gs-title-option.tw-ico::before, .tw-panel-head h2.tw-ico::before, .tw-perk-name.tw-ico::before { content: ""; flex: none; width: 18px; height: 18px; background: var(--tw-pic) center / contain no-repeat; transition: transform .2s ease; }
.tw-btn.tw-ico:hover:not(:disabled)::before, .tw-choice.tw-ico:hover::before, .tw-link:hover::before, #twWrapper .gs-title-option.tw-ico:hover::before, .tw-side .tw-ico:hover::before { transform: scale(1.12); }
#twWrapper .gs-title-option.tw-ico, .tw-choice.tw-ico { display: inline-flex; align-items: center; gap: 6px; }
.tw-choice.tw-ico { padding-left: 11px; }
    /* On the chosen one, which is red, the drawing sits on a white disc so it still reads. */
    .tw-choice.tw-ico.tw-choice-on::before { border-radius: 50%; background-color: #fff; box-shadow: 0 0 0 2px #fff; }
/* A switch that is off says so with its drawing, so it needn't fade as well. */
.tw-set-row .tw-btn.tw-ico.tw-set-off { opacity: 1; }
.tw-set-row .tw-btn.tw-ico::before { width: 20px; height: 20px; }
.tw-btn.tw-ico-next { flex-direction: row-reverse; }
    .tw-btn.tw-ico-next:hover::before { transform: translateX(3px); }
.tw-panel-head h2.tw-ico { display: flex; align-items: center; gap: 8px; margin-right: auto; }
    .tw-panel-head h2.tw-ico::before { width: 26px; height: 26px; }
.tw-perk-name.tw-ico { display: flex; align-items: center; gap: 6px; align-self: stretch; }
    .tw-perk-name.tw-ico::before { width: 24px; height: 24px; }
    .tw-perk-name.tw-ico .tw-perk-lv { margin-left: auto; }
/* The wave button: crossed swords, a little bigger. */
.tw-wave-btn.tw-ico::before { width: 28px; height: 28px; margin: -4px 0; }
/* A tapped tower's buttons: the drawing and the word to the left, the price to the right. */
.tw-selected .tw-btn.tw-ico { justify-content: flex-start; }
    .tw-selected .tw-btn.tw-ico .tw-cost { margin-left: auto; }
.tw-selected .tw-btn.tw-btn-x { justify-content: center; }
/* The links at the foot of Settings - the same pictures the other games use for them. */
.tw-link { gap: 5px; }
    .tw-link::before { background-position: center; background-size: contain; background-repeat: no-repeat; }
    .tw-link-list::before { background-image: url(../../Assets/Games/Logos/GamesApp.png); }
    .tw-link-version[data-type="browser"]::before { background-image: url(../../Assets/icons/desktopview.png); }
    .tw-link-version[data-type="app"]::before { background-image: url(../../Assets/icons/appview.png); }
/* The round buttons. One that is switched on keeps its drawing and takes a ring, where it used to fill with
   colour; Auto switched off goes grey; sound switched off shows the crossed-out speaker at full strength. */
.tw-side button.tw-ico.tw-on { color: var(--tw-plate-text); background: var(--tw-plate-solid); box-shadow: 0 0 0 3px var(--tw-go), var(--tw-plate-shadow); }
.tw-side button.tw-ico-sound.tw-off { opacity: 1; }
.tw-side .tw-ico-auto:not(.tw-on)::before { filter: grayscale(1); opacity: 0.55; }
/* Speed: the drawing above, how fast below. */
.tw-side button.tw-ico-speed { padding-top: 17px; font-size: 11px; line-height: 12px; }
    .tw-side .tw-ico-speed::before { top: 6px; width: 16px; height: 13px; margin: 0 0 0 -8px; }
@media screen and (max-width: 560px), screen and (max-height: 520px) {
    .tw-side button.tw-ico-speed { padding-top: 14px; font-size: 10px; line-height: 11px; }
        .tw-side .tw-ico-speed::before { top: 3px; }
    /* Eleven in a row on a phone. */
    .tw-side { gap: 5px 3px; }
        .tw-side button { width: 30px; height: 30px; }
        .tw-side .tw-side-tool { margin-left: 3px; }
    .tw-side .tw-ico::before { width: 19px; height: 19px; margin: -9.5px 0 0 -9.5px; }
        .tw-side .tw-ico-speed::before { width: 15px; height: 12px; margin: 0 0 0 -7.5px; }
}
@media (prefers-reduced-motion: reduce) {
    .tw-btn.tw-ico::before, .tw-choice.tw-ico::before, .tw-link::before, #twWrapper .gs-title-option.tw-ico::before { transition: none; }
    .tw-btn.tw-ico:hover:not(:disabled)::before, .tw-choice.tw-ico:hover::before, .tw-link:hover::before, #twWrapper .gs-title-option.tw-ico:hover::before, .tw-side .tw-ico:hover::before, .tw-btn.tw-ico-next:hover::before { transform: none; }
}

/* A hint fades once it has been up long enough to read (TowerWardens.js, HINT_FOR). */
.tw-hint { transition: opacity .5s ease, visibility 0s linear 0s; }
    .tw-hint.tw-hint-gone { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .5s ease, visibility 0s linear .5s; }
@media (prefers-reduced-motion: reduce) { .tw-hint, .tw-hint.tw-hint-gone { transition: none; } }

/* ---- The wipe ----
   The shell's screen-covering wipe, as a volley (TowerWardens.js, The wipe): every cell is a shot that flies
   in from off the left of the screen to its place, the ground darkens behind them, and they all fly on out
   to the right. --lift, --tilt and --t are each shot's own. */
#gsTitleWipe.gs-wipe-volley { gap: 0; padding: 0; }
    #gsTitleWipe.gs-wipe-volley::before { background: radial-gradient(ellipse at 50% 50%, var(--tw-wipe-a, #2c4f2a) 0%, var(--tw-wipe-b, #182b17) 100%); }
.gs-wipe-volley .gs-wipe-cell { overflow: visible; border-radius: 0; background: transparent; transform: translateX(-130vw); animation: twVolleyIn var(--t, .3s) cubic-bezier(.15, .7, .3, 1) var(--d) both; }
    .gs-wipe-volley .gs-wipe-cell svg { flex: none; width: 96%; height: auto; overflow: visible; transform: translate(var(--shift, 0), var(--lift, 0)) rotate(var(--tilt, 0deg)) scale(var(--size, 1)); filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.4)); }
    .gs-wipe-volley .gs-wipe-cell.tw-volley-big svg { width: 118%; }
    #gsTitleWipe.gs-wipe-out.gs-wipe-volley .gs-wipe-cell { animation: twVolleyOut var(--t, .3s) cubic-bezier(.6, 0, .9, .4) var(--d) both; }
@keyframes twVolleyIn { from { transform: translateX(-130vw); } to { transform: translateX(0); } }
@keyframes twVolleyOut { from { transform: translateX(0); } to { transform: translateX(130vw); } }
#gsTitleWipe.gs-wipe-volley .gs-wipe-label { color: #3a2716; background: #fff6dc; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45), 0 0 0 5px #23282c, 0 0 0 10px #d9482b; }

/* The diamond: the Armoury's money, wherever it is shown. On the body, since the title screen and the panels
   are not all inside the scene. */
body { --tw-gem-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M6 1.500h12l5 6.500-11 12.500L1 8z' fill='%2339c6f0' stroke='%230b5f80' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M6 1.500L9 8l3-6.500L15 8l3-6.500M1 8h22M9 8l3 12.500L15 8' fill='none' stroke='%230b5f80' stroke-width='1' stroke-linejoin='round'/%3E%3Cpath d='M6 1.500L9 8H1z' fill='%23b8f0ff'/%3E%3Cpath d='M9 8l3-6.500L15 8z' fill='%237fe0fa'/%3E%3C/svg%3E"); }

/* ---- The round buttons, a size up ----
   44px in the column on a wide screen (40 again where the window is too short for eleven of them), and 37px
   in the row on a phone - where the two zoom buttons give up their places, a pinch doing the same job, so
   the row still fits on one line. */
@media screen and (min-width: 561px) and (min-height: 761px) {
    .tw-side { gap: 6px; }
        .tw-side button { width: 44px; height: 44px; }
        .tw-side .tw-ico::before { width: 25px; height: 25px; margin: -12.5px 0 0 -12.5px; }
    .tw-side button.tw-ico-speed { padding-top: 20px; font-size: 12px; }
        .tw-side .tw-ico-speed::before { top: 7px; width: 18px; height: 15px; margin: 0 0 0 -9px; }
}
@media screen and (max-width: 560px), screen and (max-height: 520px) {
    .tw-side button { width: 37px; height: 37px; }
    .tw-side .tw-ico::before { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
    .tw-side button.tw-ico-speed { padding-top: 17px; font-size: 10.5px; line-height: 12px; }
        .tw-side .tw-ico-speed::before { top: 5px; width: 16px; height: 13px; margin: 0 0 0 -8px; }
}
@media screen and (max-width: 560px) {
    #twZoomInBtn, #twZoomOutBtn { display: none; }
}
@media screen and (max-width: 380px) {
    .tw-side button { width: 34px; height: 34px; }
    .tw-side .tw-ico::before { width: 20px; height: 20px; margin: -10px 0 0 -10px; }
    .tw-side button.tw-ico-speed { padding-top: 15px; }
        .tw-side .tw-ico-speed::before { top: 4px; width: 16px; height: 13px; margin: 0 0 0 -8px; }
}

/* ---- The round buttons on a phone: a column down the right, as on a wide screen ----
   Under the lives and gold, down to just above the towers. Where the scene is too short for all of them in
   one column (a small phone, or one on its side) they wrap into a second, to its left. The hint and the
   tutorial card move up into the room the row used to take, and stop short of the column. (A phone on its
   side gets the same column - see the end of this file.) */
@media screen and (max-width: 560px) {
    .tw-side { top: calc(var(--tw-top) + 58px); left: auto; right: 8px; bottom: calc(var(--tw-dock) + 98px); flex-direction: column; flex-wrap: wrap-reverse; align-content: flex-start; gap: 5px; }
        .tw-side .tw-side-tool { margin-left: 0; margin-top: 4px; }
    .tw-hint, .tw-coach { top: calc(var(--tw-top) + 106px); max-width: calc(100% - 64px); }
}

/* Selling a tower asks first (TowerWardens.js, sellAsk). */
.tw-sell-ask { padding: 6px 8px; font-size: 13px; font-weight: 700; line-height: 1.35; border-radius: 9px; background: rgba(217, 72, 43, 0.12); box-shadow: inset 0 0 0 1px rgba(217, 72, 43, 0.35); }
    .tw-sell-ask .tw-cost { vertical-align: -1px; }

/* ---- How to play: pictures of each era's towers and raiders ---- */
.tw-help-pics { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 12px; }
.tw-help-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 6px; padding: 6px 8px; border-radius: 12px; background: var(--tw-chip); box-shadow: inset 4px 0 0 var(--tw-era, #84c463); }
.tw-help-era { flex: 0 0 82px; align-self: center; font-family: Fredoka, "Open Sans", sans-serif; font-size: 14px; font-weight: 600; }
.tw-help-card { display: inline-flex; flex-direction: column; align-items: center; width: 68px; font-size: 11.5px; line-height: 1.2; text-align: center; color: var(--tw-soft); }
    .tw-help-card canvas { display: block; }
@media screen and (max-width: 560px) {
    .tw-help-era { flex-basis: 100%; }
    .tw-help-card { width: 58px; }
}

/* ---- The towers' tray on a phone: the full width of the screen, its buttons (up to eight) sharing it ---- */
@media screen and (max-width: 560px) {
    .tw-tray { left: 8px; right: 8px; width: auto; max-width: none; margin: 0; }
    /* Two rows of four: eight names don't fit side by side. Each button has its picture beside its name and price. */
    .tw-towers { flex-wrap: wrap; justify-content: flex-start; gap: 2px 0; }
        .tw-tower-btn { flex: 0 0 25%; min-width: 0; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; padding: 3px 2px; column-gap: 3px; }
            .tw-tower-btn .tw-tower-pic { width: 26px; height: 26px; }
    .tw-tower-name { flex: 1 1 0; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .tw-towers .tw-cost { flex: 0 0 100%; font-size: 12px; margin-left: 29px; margin-top: -7px; }
}

/* ---- Tower health: the heart button's count, and the list it opens ---- */
.tw-ico-health { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.500C5 15.500 3 12 3 8.800A4.600 4.600 0 0 1 12 7a4.600 4.600 0 0 1 9 1.800c0 3.200-2 6.700-9 11.700z' fill='%233FAE5A' stroke='%2317692C' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M12 8.300v6.400M8.800 11.500h6.400' stroke='%23FFF' stroke-width='2.300' stroke-linecap='round'/%3E%3C/svg%3E"); }
.tw-side .tw-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box; border-radius: 9px; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; color: #fff; background: #d98a1f; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); pointer-events: none; }
    .tw-side .tw-badge:empty { display: none; }
    .tw-side .tw-warn .tw-badge { background: #e5484d; animation: twReady 1.2s ease-in-out infinite; }
.tw-health { position: absolute; z-index: 3; top: calc(var(--tw-top) + 74px); right: 66px; display: flex; flex-direction: column; gap: 6px; width: 250px; max-height: calc(100% - var(--tw-top) - 190px); padding: 10px; box-sizing: border-box; border-radius: 18px; color: var(--tw-plate-text); background: var(--tw-plate-solid); box-shadow: var(--tw-plate-shadow); font-family: Fredoka, "Open Sans", sans-serif; user-select: none; }
.tw-health-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .tw-health-head b { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600; }
        .tw-health-head b::before { content: ""; flex: none; width: 20px; height: 20px; background: var(--tw-pic) center / contain no-repeat; }
    .tw-health-head .tw-btn-x { padding: 0 9px; font-size: 19px; line-height: 26px; }
.tw-health-all { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; font-size: 14px; }
    .tw-health-all .tw-stat-bar { height: 11px; border-radius: 6px; }
.tw-health-sum { font-size: 13px; opacity: 0.8; }
.tw-health .tw-btn-fix { justify-content: flex-start; padding: 7px 11px; font-size: 14px; }
    .tw-health .tw-btn-fix .tw-cost { margin-left: auto; }
    .tw-health .tw-btn.tw-poor { opacity: 0.6; }
.tw-health-list { display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -4px; padding: 0 4px; }
.tw-health-row { display: grid; grid-template-columns: 92px 1fr 58px; align-items: center; gap: 7px; flex: none; cursor: pointer; padding: 6px 6px; font-family: inherit; font-size: 13.5px; font-weight: 600; text-align: left; color: inherit; border: 2px solid transparent; border-radius: 10px; background: transparent; -webkit-tap-highlight-color: transparent; }
    .tw-health-row:hover { background: rgba(127, 127, 127, 0.18); }
    .tw-health-row.tw-on { border-color: var(--tw-go); }
    .tw-health-row:focus-visible { outline: 2px solid #864cff; outline-offset: 1px; }
    .tw-health-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
        .tw-health-name i { font-style: normal; font-weight: 500; opacity: 0.65; }
    .tw-health-num { font-size: 12.5px; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.tw-stat-bar i.tw-stat-hp.tw-mid { background: #e0a020; }
.tw-stat-bar i.tw-stat-hp.tw-low { background: #e5484d; }
/* The tools group now starts at the heart, so the gap that was over Start again sits over it instead. */
@media screen and (max-width: 560px) {
    .tw-health { top: calc(var(--tw-top) + 104px); left: 8px; right: 54px; width: auto; max-height: 42%; }
    .tw-side .tw-badge { top: -4px; right: -4px; min-width: 16px; height: 16px; font-size: 10px; line-height: 16px; }
}
@media (prefers-reduced-motion: reduce) { .tw-side .tw-warn .tw-badge { animation: none; } }

/* ---- The round buttons on a short, wide screen (a phone on its side): down the right as well ----
   In a row under the wave button they covered the board. Here they run from under the lives and gold down
   to the tab bar, beside the towers tray, in as many columns as it takes, each new one to the left. */
@media screen and (min-width: 561px) and (max-height: 520px) {
    .tw-side { top: calc(var(--tw-top) + 54px); left: auto; right: 8px; bottom: calc(var(--tw-dock) + 8px); flex-direction: column; flex-wrap: wrap-reverse; align-content: flex-start; gap: 5px; }
        .tw-side .tw-side-tool { margin-left: 0; margin-top: 0; }
    .tw-hint, .tw-coach { top: calc(var(--tw-top) + 106px); max-width: calc(100% - 150px); }
}
/* Where the buttons have wrapped into a second column, the tower health pane opens clear of both. */
@media screen and (min-width: 561px) and (max-height: 730px) { .tw-health { right: 112px; } }
@media screen and (min-width: 561px) and (max-height: 520px) { .tw-health { top: calc(var(--tw-top) + 54px); right: 100px; max-height: calc(100% - var(--tw-top) - var(--tw-dock) - 70px); } }

/* ---- The map list's pictures ----
   A small view of each map at the head of its tile (TowerWardens.js, paintMap). A map not yet open is shown
   faded and grey. */
button.tw-level { overflow: hidden; padding-top: 0; }
.tw-level-pic { display: block; align-self: stretch; width: calc(100% + 12px); height: auto; aspect-ratio: 320 / 176; margin: 0 -6px 6px; background: rgba(127, 127, 127, 0.25); }
button.tw-level.tw-locked .tw-level-pic { filter: grayscale(0.85); opacity: 0.55; }

/* ---- The leaderboard ----
   A panel like the Maps list's: the maps to choose from along the top, an era to a row, then the chosen map's
   board - a place, a picture, a name and the best wave. The asker's own row is picked out. */
.tw-ico-trophy { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4h10v5a5 5 0 0 1-10 0z' fill='%23F2C230' stroke='%237A5A00' stroke-width='1.500' stroke-linejoin='round'/%3E%3Cpath d='M7 6H4a3 3 0 0 0 3.500 4M17 6h3a3 3 0 0 1-3.500 4' fill='none' stroke='%237A5A00' stroke-width='1.500' stroke-linecap='round'/%3E%3Cpath d='M12 14v3M8.500 20.500h7l-1-3.500h-5z' fill='%23C98F1A' stroke='%237A5A00' stroke-width='1.500' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E"); }
.tw-board-link { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.tw-board-maps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 6px; }
    .tw-board-era { flex: 0 0 92px; font-family: Fredoka, "Open Sans", sans-serif; font-size: 14px; font-weight: 600; color: var(--tw-ink); }
    .tw-board-maps .tw-choice { padding: 4px 12px; font-size: 12.5px; }
.tw-board { margin-top: 12px; }
.tw-board-note { margin: 0 0 8px; font-size: 13.5px; color: var(--tw-soft); }
    .tw-board-note b { color: var(--tw-ink); }
.tw-board-none { margin: 14px 0; text-align: center; font-size: 14px; color: var(--tw-soft); }
.tw-board-list { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.tw-board-row { display: grid; grid-template-columns: 34px 30px 1fr auto; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; font-size: 14px; color: var(--tw-ink); background: var(--tw-chip); }
    .tw-board-rank { font-family: Fredoka, "Open Sans", sans-serif; font-size: 15px; font-weight: 600; text-align: center; color: var(--tw-soft); }
    .tw-board-top1 .tw-board-rank { color: #c98f1a; } .tw-board-top2 .tw-board-rank { color: #8e99a8; } .tw-board-top3 .tw-board-rank { color: #b0703a; }
    .tw-board-pic { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: rgba(127, 127, 127, 0.3); }
    .tw-board-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
        .tw-board-name i { margin-left: 4px; padding: 1px 7px; border-radius: 9px; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: var(--tw-go); }
    .tw-board-wave { font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--tw-soft); }
        .tw-board-wave b { font-family: Fredoka, "Open Sans", sans-serif; font-size: 17px; font-weight: 600; color: var(--tw-ink); }
.tw-board-row.tw-board-you { box-shadow: inset 0 0 0 2px var(--tw-go); }
@media screen and (max-width: 560px) { .tw-board-era { flex-basis: 100%; } }

/* ---- Getting about, without a tab bar (2026-11-23) ----
   The dock is gone, and with it the room kept for it at the foot of the scene. In its place, at the top: a
   Menu button, the map's name (a button: the list of maps) and the diamonds (a button: the Armoury). The
   menu itself is a panel like the others, of big buttons. */
#twWrapper #twScene, body[data-mode="spa"] #twWrapper #twScene { --tw-dock: 0px; }
.tw-top-left { display: flex; align-items: center; gap: 8px; min-width: 0; pointer-events: none; }
    .tw-top-left > * { pointer-events: auto; }
.tw-nav-btn { position: relative; flex: none; cursor: pointer; width: 48px; height: 48px; margin: 0; padding: 0; border: 0; border-radius: 16px; color: var(--tw-plate-text); background: var(--tw-plate); box-shadow: var(--tw-plate-shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background .15s ease, transform .1s ease; }
    .tw-nav-btn:hover { background: var(--tw-plate-hover); }
    .tw-nav-btn:active { transform: scale(0.94); }
    .tw-nav-btn.tw-ico::before { content: ""; position: absolute; top: 50%; left: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; background: var(--tw-pic) center / contain no-repeat; }
.tw-ico-menu { --tw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='4.2' width='18' height='3.6' rx='1.8' fill='%23E5484D' stroke='%237A1F22' stroke-width='1.2'/%3E%3Crect x='3' y='10.2' width='18' height='3.6' rx='1.8' fill='%23F2C230' stroke='%237A5A00' stroke-width='1.2'/%3E%3Crect x='3' y='16.2' width='18' height='3.6' rx='1.8' fill='%234FB06B' stroke='%231F5A30' stroke-width='1.2'/%3E%3C/svg%3E"); }
.tw-title { padding: 0; pointer-events: auto; }
.tw-title-btn { display: flex; align-items: center; gap: 9px; min-width: 0; max-width: 100%; cursor: pointer; margin: 0; padding: 5px 12px 5px 5px; border: 0; border-radius: 16px; font: inherit; line-height: 1.1; text-align: left; color: inherit; background: none; transition: background .15s ease; }
    .tw-title-btn:hover { background: var(--tw-plate-hover); }
    .tw-title-btn::after { content: ""; flex: none; width: 9px; height: 9px; margin: -4px 2px 0 1px; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; border-radius: 1px; opacity: 0.55; transform: rotate(45deg); }
button.tw-stat-gem { cursor: pointer; margin: 0; border: 0; border-radius: 999px; font-family: inherit; color: inherit; background: rgba(127, 127, 127, 0.16); transition: background .15s ease; }
    button.tw-stat-gem:hover { background: rgba(127, 127, 127, 0.32); }
.tw-nav-btn:focus-visible, .tw-title-btn:focus-visible, button.tw-stat-gem:focus-visible, .tw-menu-item:focus-visible { outline: 2px solid #864cff; outline-offset: 2px; }
.tw-menu { display: flex; flex-wrap: wrap; gap: 10px; }
.tw-menu-item { position: relative; flex: 1 1 240px; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 64px; cursor: pointer; margin: 0; padding: 10px 14px 10px 62px; box-sizing: border-box; border: 2px solid transparent; border-radius: 16px; font-family: inherit; text-align: left; color: var(--tw-plate-text); background: rgba(127, 127, 127, 0.13); transition: background .15s ease, transform .1s ease; }
    .tw-menu-item:hover { background: rgba(127, 127, 127, 0.24); }
    .tw-menu-item:active { transform: scale(0.98); }
    .tw-menu-item b { font-family: Fredoka, "Open Sans", sans-serif; font-size: 17px; font-weight: 600; }
    .tw-menu-item span { font-size: 12.5px; opacity: 0.75; }
    .tw-menu-item.tw-ico::before { content: ""; position: absolute; top: 50%; left: 16px; width: 32px; height: 32px; margin-top: -16px; background: var(--tw-pic) center / contain no-repeat; }
    .tw-menu-item.tw-menu-go { flex-basis: 100%; color: #fff; background: var(--tw-go); box-shadow: 0 4px 0 var(--tw-go-edge); }
        .tw-menu-item.tw-menu-go:hover { background: var(--tw-go); filter: brightness(1.07); }
        .tw-menu-item.tw-menu-go span { opacity: 0.9; }
    .tw-menu-item.tw-menu-off::before { filter: grayscale(1); opacity: 0.6; }
@media screen and (max-width: 775px) {
    .tw-top-left { gap: 6px; }
    .tw-nav-btn { width: 40px; height: 40px; border-radius: 13px; }
    .tw-title-btn { padding: 4px 9px 4px 4px; gap: 7px; }
        .tw-title-btn::after { width: 7px; height: 7px; }
}
@media screen and (max-width: 560px) {
    /* A phone has no room for the name beside the numbers: the badge alone stands for the map there. */
    .tw-title-text { display: none; }
    .tw-title-btn { padding: 4px 8px 4px 4px; }
    .tw-menu-item { flex-basis: 100%; min-height: 56px; }
}
@media (prefers-reduced-motion: reduce) { .tw-nav-btn, .tw-title-btn, .tw-menu-item { transition: none; } }

/* ---- The towers to build, as cards (2026-11-23) ----
   Two across on a wide screen, four across on a phone, one row where the screen is short. Each card is washed
   in its tower's colour (--tw-mark, set on the button) with a band of it along the top: the picture, the
   name, a word for what it is for, the price. Under them, a strip about the one pointed at or picked. */
#twTowers { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#twTowers .tw-tower-btn { position: relative; display: flex; flex: none; flex-direction: column; flex-wrap: nowrap; align-items: center; justify-content: flex-start; gap: 0; min-width: 0; overflow: hidden; padding: 8px 4px 6px; border: 2px solid transparent; border-radius: 14px; text-align: center; background: rgba(127, 127, 127, 0.13); background: linear-gradient(180deg, color-mix(in srgb, var(--tw-mark) 30%, transparent), color-mix(in srgb, var(--tw-mark) 7%, transparent) 70%); box-shadow: inset 0 4px 0 var(--tw-mark); transition: transform .12s ease, box-shadow .15s ease, background .15s ease; }
    #twTowers .tw-tower-btn:hover { transform: translateY(-2px); box-shadow: inset 0 4px 0 var(--tw-mark), 0 5px 12px rgba(0, 0, 0, 0.18); }
    #twTowers .tw-tower-btn:active { transform: scale(0.97); }
    #twTowers .tw-tower-btn.tw-on { border-color: var(--tw-mark); background: var(--tw-plate-solid); box-shadow: inset 0 4px 0 var(--tw-mark), 0 0 0 3px color-mix(in srgb, var(--tw-mark) 45%, transparent), 0 5px 12px rgba(0, 0, 0, 0.2); }
    #twTowers .tw-tower-btn.tw-poor { opacity: 1; }
        #twTowers .tw-tower-btn.tw-poor .tw-tower-pic { filter: grayscale(0.85); opacity: 0.6; }
        #twTowers .tw-tower-btn.tw-poor .tw-tower-name, #twTowers .tw-tower-btn.tw-poor .tw-tower-role { opacity: 0.55; }
        #twTowers .tw-tower-btn.tw-poor .tw-cost { color: #c8382c; }
    #twTowers .tw-tower-btn .tw-tower-pic { width: 50px; height: 50px; margin: -2px 0 -3px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.22)); }
    #twTowers .tw-tower-name { flex: none; max-width: 100%; overflow: hidden; font-size: 13.5px; line-height: 1.15; white-space: nowrap; text-overflow: ellipsis; }
    #twTowers .tw-tower-role { font-size: 9.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; opacity: 0.62; }
    #twTowers .tw-cost { flex: none; margin: 4px 0 0; padding: 1px 9px 1px 6px; border-radius: 999px; font-size: 12.5px; background: rgba(127, 127, 127, 0.2); }
    #twTowers .tw-tower-key { position: absolute; top: 7px; left: 6px; min-width: 15px; height: 15px; box-sizing: border-box; padding: 0 3px; border-radius: 5px; font-size: 10px; font-weight: 700; line-height: 15px; color: var(--tw-plate-text); background: rgba(127, 127, 127, 0.22); opacity: 0.75; }
.tw-tower-info { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; padding: 7px 9px 8px; border-left: 4px solid var(--tw-mark); border-radius: 10px; font-size: 12px; line-height: 1.3; background: rgba(127, 127, 127, 0.13); }
    .tw-tower-info-name { font-family: Fredoka, "Open Sans", sans-serif; font-size: 14px; font-weight: 600; }
    .tw-tower-info-text { opacity: 0.85; }
    .tw-tower-info-stats { margin-top: 2px; font-size: 11.5px; font-variant-numeric: tabular-nums; opacity: 0.9; }
@media (hover: none) { #twTowers .tw-tower-key { display: none; } }
@media screen and (max-width: 560px), screen and (max-height: 520px) {
    /* One row along the foot of a short screen: narrower cards, no word under the name, no key. */
    #twTowers { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 4px; }
    #twTowers .tw-tower-btn { flex: 0 0 62px; padding: 6px 2px 4px; border-radius: 12px; }
        #twTowers .tw-tower-btn .tw-tower-pic { width: 36px; height: 36px; margin: -1px 0 -2px; }
    #twTowers .tw-tower-name { font-size: 11.5px; }
    #twTowers .tw-tower-role, #twTowers .tw-tower-key { display: none; }
    #twTowers .tw-cost { margin: 2px 0 0; padding: 0 7px 0 5px; font-size: 11.5px; }
    .tw-tower-info { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 7px; margin-top: 4px; padding: 4px 8px; font-size: 11.5px; }
        .tw-tower-info-name { font-size: 12.5px; }
        .tw-tower-info-stats { flex-basis: 100%; margin-top: 0; }
}
@media screen and (max-width: 560px) {
    /* A phone: all of them in ONE row, sharing the width - a picture in its colour and a price, no name (the
       strip names the one picked, and so does the hint). The tray is then about a third the height it was. */
    #twTowers { gap: 3px; }
    #twTowers .tw-tower-btn { flex: 1 1 0; padding: 5px 0 3px; border-radius: 11px; box-shadow: inset 0 3px 0 var(--tw-mark); }
        #twTowers .tw-tower-btn.tw-on { box-shadow: inset 0 3px 0 var(--tw-mark), 0 0 0 2px color-mix(in srgb, var(--tw-mark) 45%, transparent); }
        #twTowers .tw-tower-btn .tw-tower-pic { width: 32px; height: 32px; margin: 0 0 -1px; }
    #twTowers .tw-tower-name { display: none; }
    #twTowers .tw-cost { margin: 0; padding: 0; gap: 2px; font-size: 11px; background: none; }
        #twTowers .tw-cost::before { width: 8px; height: 8px; }
    .tw-tower-info { display: block; overflow: hidden; margin-top: 3px; padding: 3px 8px; border-left-width: 3px; font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
        .tw-tower-info-name { margin-right: 7px; font-size: 12px; }
        .tw-tower-info-text { display: none; }
        .tw-tower-info-stats { display: inline; }
}
@media screen and (min-width: 561px) and (min-height: 521px) and (max-height: 760px) {
    /* A wide screen that isn't tall (a small laptop, a tablet on its side): the same two columns, each card lower. */
    #twTowers { gap: 4px; }
    #twTowers .tw-tower-btn { padding: 6px 4px 4px; }
        #twTowers .tw-tower-btn .tw-tower-pic { width: 36px; height: 36px; margin: -2px 0 -2px; }
    #twTowers .tw-tower-role { display: none; }
    #twTowers .tw-cost { margin-top: 2px; }
    .tw-tower-info-text { display: none; }
}
@media (prefers-reduced-motion: reduce) { #twTowers .tw-tower-btn { transition: none; } #twTowers .tw-tower-btn:hover { transform: none; } }

/* ---- The wave button is never off the screen (2026-11-23) ----
   In the left-hand column it used to come under the towers, so a window not tall enough for the cards pushed
   it out of sight. It is now at the head of the column, as it is on a phone, and the column stops at the foot
   of the scene: if the cards don't fit, the tray scrolls and the button stays where it is. */
@media screen and (min-width: 561px) and (min-height: 521px) {
    .tw-left { bottom: 10px; }
    #twButtons { order: -1; flex: none; }
    .tw-tray { flex: 0 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}

/* ---- The strip under the cards keeps its room (2026-11-23) ----
   It is always there in the left-hand column, at one height whatever it says, and outside the part that
   scrolls: only the cards scroll. So nothing moves when the pointer goes from card to card. */
.tw-tower-info-idle { border-left-color: rgba(127, 127, 127, 0.4); }
    .tw-tower-info-idle .tw-tower-info-text { opacity: 0.7; }
@media screen and (min-width: 561px) and (min-height: 521px) {
    .tw-tray { display: flex; flex-direction: column; overflow: hidden; }
    #twTowers { flex: 0 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 3px 1px 1px; margin: -3px -1px -1px; }
    .tw-selected { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
    .tw-tower-info { flex: none; box-sizing: border-box; height: 104px; overflow: hidden; }
        .tw-tower-info-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
        .tw-tower-info-stats { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media screen and (min-width: 561px) and (min-height: 521px) and (max-height: 760px) {
    .tw-tower-info { height: 50px; }
        .tw-tower-info-idle .tw-tower-info-text { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; font-size: 11px; }
}
@media screen and (max-width: 560px), screen and (max-height: 520px) { .tw-tower-info-idle { display: none !important; } }

/* On a phone, and wherever the tray lies along the foot of the scene, the strip floats just above the tray
   instead of sitting in it: it takes no room, so the cards stay put when it comes and goes. */
@media screen and (max-width: 560px), screen and (max-height: 520px) {
    .tw-tower-info { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); margin: 0; background: var(--tw-plate-solid); box-shadow: var(--tw-plate-shadow); pointer-events: none; }
}

/* The strip's numbers are never cut short: they run on to a second line when there are four of them (Frost,
   the long shot, poison), and the strip is tall enough for that. On a short screen it says the name and the
   numbers only - what the tower does is in its tooltip. */
@media screen and (min-width: 561px) and (min-height: 521px) {
    .tw-tower-info { height: 122px; }
        .tw-tower-info-stats { white-space: normal; overflow: visible; text-overflow: clip; }
}
@media screen and (min-width: 561px) and (min-height: 521px) and (max-height: 760px) {
    .tw-tower-info { height: 68px; }
        .tw-tower-info:not(.tw-tower-info-idle) .tw-tower-info-text { display: none; }
        .tw-tower-info-idle .tw-tower-info-text { -webkit-line-clamp: 3; line-clamp: 3; }
}

/* When the cards don't all fit they scroll at their full height - the rows are not squeezed to fit. */
@media screen and (min-width: 561px) and (min-height: 521px) { #twTowers { grid-auto-rows: max-content; align-content: start; } }

/* ---- The tray made small (2026-11-23) ----
   A tab at the head of the tray (.tw-tray-tab) folds the cards down to their pictures - four across in the
   column, one thin row on a phone - with no names, prices or strip, and opens them out again. The cards are
   still buttons while they are small. */
.tw-tray-tab { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 6px; width: 100%; cursor: pointer; margin: 0 0 5px; padding: 2px 6px 2px 8px; box-sizing: border-box; border: 0; border-radius: 9px; font-family: Fredoka, "Open Sans", sans-serif; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tw-plate-text); background: none; opacity: 0.75; transition: background .15s ease, opacity .15s ease; }
    .tw-tray-tab:hover { opacity: 1; background: rgba(127, 127, 127, 0.18); }
    .tw-tray-tab:focus-visible { outline: 2px solid #864cff; outline-offset: 2px; }
    .tw-tray-tab i { flex: none; width: 8px; height: 8px; margin: -4px 3px 0 0; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; border-radius: 1px; transform: rotate(45deg); transition: transform .2s ease; }
    .tw-tray-mini .tw-tray-tab { margin-bottom: 4px; }
        .tw-tray-mini .tw-tray-tab i { margin-top: 4px; transform: rotate(-135deg); }
.tw-tray-mini #twTowers { grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tw-tray-mini #twTowers .tw-tower-btn { padding: 5px 0 2px; border-radius: 10px; box-shadow: inset 0 3px 0 var(--tw-mark); }
    .tw-tray-mini #twTowers .tw-tower-btn.tw-on { box-shadow: inset 0 3px 0 var(--tw-mark), 0 0 0 2px color-mix(in srgb, var(--tw-mark) 45%, transparent); }
    .tw-tray-mini #twTowers .tw-tower-btn .tw-tower-pic { width: 30px; height: 30px; margin: 0; }
.tw-tray-mini #twTowers .tw-tower-name, .tw-tray-mini #twTowers .tw-tower-role, .tw-tray-mini #twTowers .tw-cost, .tw-tray-mini #twTowers .tw-tower-key { display: none; }
#twTray.tw-tray-mini .tw-tower-info { display: none !important; }
@media screen and (max-width: 560px), screen and (max-height: 520px) {
    /* Along the foot of the scene the tab is a small handle standing on the top left corner of the tray. */
    .tw-tray-tab { position: absolute; left: 10px; bottom: 100%; width: auto; margin: 0; padding: 3px 9px 2px 10px; border-radius: 10px 10px 0 0; font-size: 11px; opacity: 1; background: var(--tw-plate-solid); box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.12); }
        .tw-tray-tab:hover { background: var(--tw-plate-solid); }
        .tw-tray-mini .tw-tray-tab { margin: 0; }
    .tw-tower-info { left: 96px; }
    .tw-tray-mini #twTowers { display: flex; gap: 3px; }
    .tw-tray-mini #twTowers .tw-tower-btn { flex: 1 1 0; padding: 4px 0 4px; }
        .tw-tray-mini #twTowers .tw-tower-btn .tw-tower-pic { width: 26px; height: 26px; }
}
@media screen and (max-height: 520px) and (min-width: 561px) { .tw-tray-mini #twTowers .tw-tower-btn { flex: 0 0 40px; } }
@media (prefers-reduced-motion: reduce) { .tw-tray-tab, .tw-tray-tab i { transition: none; } }
