/* ---- Bridge Works ---- */
/* The game's own page (Areas/Games/Views/BridgeWorks), 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. */
#bwWrapper {
    position: relative;
    --bw-plate: rgba(255, 255, 255, 0.78); --bw-plate-solid: rgba(255, 255, 255, 0.95); --bw-plate-hover: #FFFFFF; --bw-plate-text: #23282C; --bw-plate-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
    --bw-card: #f6f1e4; --bw-ink: #33291c; --bw-soft: #7a6a52; --bw-line: #d9cdb3;
    --bw-chip: #fffaf0; --bw-chip-edge: #c9b88f;
    --bw-go: #d9482b; --bw-go-edge: #9c2d16; --bw-gold: #e0a800; --bw-life: #e5484d; --bw-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"] #bwWrapper {
    --bw-plate: rgba(16, 24, 36, 0.76); --bw-plate-solid: rgba(22, 32, 46, 0.95); --bw-plate-hover: #2A3A50; --bw-plate-text: #F2F5F7; --bw-plate-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
    --bw-card: #1d2530; --bw-ink: #e8edf3; --bw-soft: #9aa7b6; --bw-line: #33404f;
    --bw-chip: #283341; --bw-chip-edge: #141b24; --bw-glow: rgba(10, 20, 30, 0.55);
}
body[data-theme="Default"] #bwWrapper {
    --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 (BridgeWorks.js works that out and sets --bw-h; until it has, this
   allows for the site's header). --bw-top is the room the app version's header bar takes inside the scene,
   --bw-dock the room the tab bar takes at its foot. */
#bwScene { position: relative; overflow: hidden; height: calc(100vh - 62px); height: var(--bw-h, calc(100dvh - 62px)); min-height: 320px; background: #84c463; color: var(--bw-plate-text); --bw-top: 0px; --bw-dock: 72px; }
.bw-stage, #bwCanvas { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
#bwCanvas { display: block; width: 100%; height: 100%; cursor: pointer; touch-action: none; }
.bw-stage.bw-hurt::after { content: ""; position: absolute; inset: 0; pointer-events: none; animation: bwHurt .4s ease-out; }
@keyframes bwHurt { 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); } }
#bwScene > .bw-app-head { position: absolute; z-index: 7; top: 0; left: 0; right: 0; padding: 0 !important; pointer-events: none; }
    #bwScene > .bw-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 (BridgeWorks.js, Settings). */
#bwWrapper header.gs-card-header { display: none !important; margin: 0; }

/* Top left, the map; top right, what the player has. */
#bwTopBar { position: absolute; z-index: 2; top: calc(var(--bw-top) + 10px); left: 10px; right: 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; pointer-events: none; }
.bw-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(--bw-plate-text); background: var(--bw-plate); box-shadow: var(--bw-plate-shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.bw-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(--bw-go); color: #fff; font-size: 18px; box-shadow: 0 3px 0 var(--bw-go-edge); }
.bw-title-text { display: flex; flex-direction: column; min-width: 0; }
    .bw-title-text > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bw-title-era { font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.7; }
.bw-hud { display: flex; flex: none; gap: 2px; padding: 4px 6px; border-radius: 999px; background: var(--bw-plate); box-shadow: var(--bw-plate-shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.bw-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; }
    .bw-stat i { width: 17px; height: 17px; }
.bw-stat-lives i { background: var(--bw-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; }
.bw-stat-gold i { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe680, var(--bw-gold)); box-shadow: inset 0 0 0 1.5px #a67c00; }
.bw-stat-gem { position: relative; }
    .bw-stat-gem i { background: var(--bw-gem-pic) center / contain no-repeat; }
    .bw-stat-gem.bw-gem-got i { animation: bwGemGot .5s ease-out; }
.bw-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: bwGemPop 1.4s ease-out both; }
    body[data-theme="Dark"] .bw-gem-pop { color: #8fe6ff; text-shadow: 0 0 4px #000; }
@keyframes bwGemPop { 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 bwGemGot { 0% { transform: scale(1); } 40% { transform: scale(1.5) rotate(-10deg); } 100% { transform: scale(1); } }
.bw-gem { display: inline-block; width: 15px; height: 14px; margin-right: 5px; vertical-align: -2px; background: var(--bw-gem-pic) center / contain no-repeat; }
@media (prefers-reduced-motion: reduce) { .bw-stat-gem.bw-gem-got i { animation: none; } }
.bw-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. */
.bw-hint { position: absolute; z-index: 2; top: calc(var(--bw-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(--bw-plate-text); background: var(--bw-plate); box-shadow: var(--bw-plate-shadow); }

/* ---- The left-hand column: the towers, then the wave button ---- */
.bw-left { position: absolute; z-index: 2; top: calc(var(--bw-top) + 74px); left: 10px; display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 186px; pointer-events: none; }
    .bw-left > * { pointer-events: auto; }
.bw-tray { padding: 6px; border-radius: 18px; background: var(--bw-plate); box-shadow: var(--bw-plate-shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.bw-towers { display: flex; flex-direction: column; gap: 4px; }
.bw-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(--bw-plate-text); border: 2px solid transparent; border-radius: 13px; background: transparent; -webkit-tap-highlight-color: transparent; transition: background-color .15s ease-in-out; }
    .bw-tower-btn .bw-tower-pic { flex: none; width: 36px; height: 36px; }
    .bw-tower-btn:hover { background: rgba(127, 127, 127, 0.2); }
    .bw-tower-btn.bw-on { border-color: var(--bw-go); background: var(--bw-plate-solid); }
    .bw-tower-btn.bw-poor { opacity: 0.5; }
    .bw-tower-btn:active { transform: scale(0.97); }
.bw-tower-name { flex: 1 1 auto; min-width: 0; font-family: Fredoka, "Open Sans", sans-serif; font-size: 15px; font-weight: 600; }
.bw-cost { display: inline-flex; flex: none; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
    .bw-cost::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe680, var(--bw-gold)); box-shadow: inset 0 0 0 1px #a67c00; }
    /* The Armoury's price is in diamonds. */
    .bw-cost-coin::before { width: 13px; height: 12px; border-radius: 0; box-shadow: none; background: var(--bw-gem-pic) center / contain no-repeat; }
/* The tower that's been tapped takes the tray's place. */
.bw-selected { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 4px; user-select: none; }
.bw-sel-name { font-family: Fredoka, "Open Sans", sans-serif; font-size: 16px; font-weight: 600; }
    .bw-sel-name b { display: block; font-weight: 400; font-size: 12px; opacity: 0.75; }
.bw-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. */
.bw-sel-stats { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.bw-stat-row { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 6px; }
.bw-stat-name { opacity: 0.8; }
.bw-stat-bar { position: relative; height: 7px; border-radius: 4px; background: rgba(127, 127, 127, 0.28); overflow: hidden; }
    .bw-stat-bar i { position: absolute; z-index: 1; top: 0; bottom: 0; left: 0; border-radius: 4px; background: var(--bw-go); }
    .bw-stat-bar i.bw-stat-next { z-index: 0; background: var(--bw-gold); }
    .bw-stat-bar i.bw-stat-hp { background: #3fae5a; }
.bw-stat-num { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
    .bw-stat-num em { font-style: normal; color: #b88600; }
    body[data-theme="Dark"] .bw-stat-num em { color: #ffd23f; }
.bw-selected .bw-btn { justify-content: space-between; padding: 7px 11px; font-size: 14px; }
.bw-selected .bw-btn-up { background: var(--bw-go); color: #fff; box-shadow: 0 3px 0 var(--bw-go-edge); }
.bw-selected .bw-btn-x { justify-content: center; padding: 3px 0; font-size: 13px; }
#bwButtons { display: flex; flex-wrap: wrap; gap: 7px; }
/* The sandbox's "Edit crossing": under Test bridge, and only in the sandbox. */
#bwButtons .bw-sb-edit { display: none; flex: 1 1 100%; min-height: 38px; border-radius: 19px; font-size: 14px; color: var(--bw-plate-text); background: var(--bw-plate); box-shadow: var(--bw-plate-shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
    #bwButtons .bw-sb-edit:hover { background: var(--bw-plate-hover); }
#bwWrapper.bw-sandbox #bwButtons .bw-sb-edit { display: inline-flex; }
.bw-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(--bw-plate-shadow); }
    .bw-wave-btn:disabled { opacity: 0.7; }
    .bw-wave-btn.bw-ready { animation: bwReady 1.6s ease-in-out infinite; }
@keyframes bwReady { 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. */
.bw-side { position: absolute; z-index: 2; top: calc(var(--bw-top) + 74px); right: 10px; bottom: calc(var(--bw-dock) + 10px); display: flex; flex-direction: column; flex-wrap: wrap-reverse; align-content: flex-start; gap: 7px; pointer-events: none; }
    .bw-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(--bw-plate-text); background: var(--bw-plate); box-shadow: var(--bw-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; }
    .bw-side button:hover { background: var(--bw-plate-hover); }
    .bw-side button:active { transform: scale(0.94); }
    .bw-side button.bw-on { color: #fff; background: var(--bw-go); }
    .bw-side button.bw-off { opacity: 0.55; }
    .bw-side .bw-side-tool { margin-top: 8px; }
    .bw-side .bw-ico::before { content: ""; position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; background: var(--bw-pic) center / contain no-repeat; }
.bw-ico-armoury { --bw-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"); }
.bw-ico-help { --bw-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"); }
.bw-ico-settings { --bw-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"); }
.bw-ico-sound { --bw-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"); }
.bw-ico-restart { --bw-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"); }
.bw-ico-zoom { --bw-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"); }
.bw-ico-zoomout { --bw-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"); }
.bw-ico-pause { --bw-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"); }
.bw-side button:focus-visible, .bw-btn:focus-visible, .bw-tower-btn:focus-visible, button.bw-level:focus-visible { outline: 2px solid #864cff; outline-offset: 2px; }

/* ---- Buttons ---- */
.bw-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(--bw-ink); border: 0; border-radius: 11px; background: var(--bw-chip); box-shadow: 0 3px 0 var(--bw-chip-edge); }
    .bw-btn:active { transform: translateY(2px); }
    .bw-btn:disabled { cursor: default; }
.bw-btn-go { background: var(--bw-go); color: #fff; box-shadow: 0 3px 0 var(--bw-go-edge); }
.bw-btn-x { padding: 4px 11px; font-size: 20px; line-height: 1; }
.bw-btn.bw-poor { opacity: 0.55; }

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

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

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

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

/* Settings */
.bw-set h3:first-child { margin-top: 2px; }
.bw-set-sub { margin: 0 !important; font-size: 12.5px; color: var(--bw-soft); }
.bw-set-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
    .bw-set-row .bw-btn { padding: 7px 16px; font-size: 14px; text-decoration: none; }
    .bw-set-row .bw-btn.bw-set-off { opacity: 0.7; }
.bw-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); }
.bw-set-who { display: flex; flex-direction: column; gap: 2px; flex: 1 1 180px; min-width: 0; font-size: 13px; line-height: 1.4; }
    .bw-set-who strong { font-family: Fredoka, "Open Sans", sans-serif; font-size: 17px; font-weight: 600; }
    .bw-set-who span { color: var(--bw-soft); }
.bw-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(--bw-line); color: var(--bw-ink); background: transparent; }
    .bw-choice.bw-choice-on { color: #fff; border-color: var(--bw-go); background: var(--bw-go); }
    .bw-choice:focus-visible, .bw-link:focus-visible { outline: 2px solid #864cff; outline-offset: 2px; }
.bw-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); }
    .bw-reset-ask[hidden] { display: none; }
    .bw-reset-ask p { margin: 0 0 10px 0; font-size: 13.5px; line-height: 1.5; }
    .bw-reset-ask .bw-btn { margin: 0 3px 3px 0; }
.bw-set-row .bw-btn[hidden] { display: none; }
.bw-link { display: inline-flex; align-items: center; padding: 6px 12px; font-size: 13px; text-decoration: none; border-radius: 15px; color: var(--bw-ink); background: rgba(127, 127, 127, 0.16); }
    .bw-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 ---- */
#bwWrapper.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(--bw-h, calc(100dvh - 62px)); min-height: 320px; background: radial-gradient(ellipse 62% 72% at 50% 46%, var(--bw-glow), transparent 74%); }
#bwWrapper #gsTitleScreen::before { display: none; }
#bwWrapper #gsTitleScreen .gs-title-inner { width: 100%; margin: auto; box-sizing: border-box; }
#bwWrapper #gsTitleScreen .gs-title-logo { width: min(100%, 400px); filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35)); }
#bwWrapper #gsTitleScreen .gs-title-tagline, #bwWrapper #gsTitleScreen .gs-title-best { padding: 6px 15px; font-weight: 600; border-radius: 14px; opacity: 1; color: var(--bw-plate-text); background: var(--bw-plate); box-shadow: var(--bw-plate-shadow); }
#bwWrapper #gsTitleScreen .gs-title-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
    #bwWrapper #gsTitleScreen .gs-title-option { opacity: 1; color: var(--bw-plate-text); background: var(--bw-plate); box-shadow: var(--bw-plate-shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
        #bwWrapper #gsTitleScreen .gs-title-option:hover { background: var(--bw-plate-hover); }

/* ---- The tab bar and its bubble ---- */
#bwWrapper #bwModeHolder.gs-mode-holder { position: absolute; z-index: 6; left: 8px; right: 8px; bottom: 8px; max-width: 520px; margin: 0 auto !important; }
    #bwWrapper.gs-title-open #bwModeHolder.gs-mode-holder { display: none !important; }
#bwWrapper #gsDock .gs-dock-menu::before { width: 26px; height: 26px; background-color: transparent; background-image: url(../../Assets/Games/Images/BridgeWorks/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) {
    .bw-hint { top: calc(var(--bw-top) + 66px); max-width: min(470px, calc(100% - 420px)); }
    .bw-coach { top: calc(var(--bw-top) + 66px); width: min(430px, calc(100% - 420px)); }
}
@media screen and (max-width: 775px) {
    #bwScene { --bw-dock: 62px; }
    body[data-mode="spa"] #bwScene { --bw-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) {
    #bwTopBar { top: calc(var(--bw-top) + 8px); left: 8px; right: 8px; }
    .bw-title { font-size: 15px; padding: 4px 11px 4px 4px; }
    .bw-level-badge { min-width: 32px; height: 32px; font-size: 16px; border-radius: 10px; }
    .bw-stat { padding: 4px 6px 4px 5px; font-size: 14px; gap: 4px; }
    .bw-left { display: contents; }
    #bwButtons { position: absolute; z-index: 2; top: calc(var(--bw-top) + 58px); left: 8px; flex-wrap: nowrap; }
    /* Beside Test bridge here, where there is no room under it. */
    #bwButtons .bw-sb-edit { flex: none; min-height: 44px; border-radius: 22px; padding: 8px 12px; }
        .bw-wave-btn { min-height: 40px; padding: 6px 16px; }
    .bw-tray { position: absolute; z-index: 2; left: 6px; right: 6px; bottom: calc(var(--bw-dock) + 8px); width: -moz-fit-content; width: fit-content; max-width: calc(100% - 12px); margin: 0 auto; padding: 4px; border-radius: 18px; }
    .bw-towers { flex-direction: row; gap: 2px; }
    .bw-tower-btn { flex-direction: column; gap: 0; padding: 3px 7px; }
        .bw-tower-btn .bw-tower-pic { width: 32px; height: 32px; }
    .bw-tower-name { font-size: 12px; }
    .bw-cost { font-size: 12px; }
    .bw-selected { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; }
        .bw-sel-stats { flex: 1 1 150px; min-width: 150px; }
        .bw-sel-name b { display: inline; margin-left: 4px; }
        .bw-selected .bw-btn-x { padding: 5px 11px; }
    .bw-side { top: calc(var(--bw-top) + 106px); left: 8px; right: 8px; bottom: auto; flex-direction: row; flex-wrap: wrap; gap: 5px 4px; }
        .bw-side button { width: 35px; height: 35px; }
        .bw-side .bw-side-tool { margin-top: 0; margin-left: 4px; }
    .bw-hint { top: calc(var(--bw-top) + 150px); left: 8px; max-width: calc(100% - 16px); padding: 6px 12px; transform: none; font-size: 12.5px; text-align: left; }
    .bw-coach { top: calc(var(--bw-top) + 150px); left: 8px; width: auto; min-width: 0; max-width: calc(100% - 16px); padding: 7px 10px; transform: none; font-size: 12.5px; }
    .bw-coach-foot { margin-top: 4px; }
    .bw-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bw-panel-card { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .bw-stage.bw-hurt::after, .bw-wave-btn.bw-ready, .bw-panel { animation: none; }
    .bw-coach-target { animation: none; box-shadow: 0 0 0 3px var(--bw-gold); }
    .bw-side button, .bw-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 .bw-ico shows the drawing its .bw-ico-(name) class names (--bw-pic) before its words; the round
   buttons at the side (above) show it alone. Drawings that sit on a red button are white. */
.bw-ico-turn { --bw-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"); }
.bw-ico-wrench { --bw-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"); }
.bw-ico-maps { --bw-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"); }
.bw-ico-sound.bw-off, .bw-ico-sound.bw-set-off, .bw-ico-sound[aria-pressed="false"] { --bw-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"); }
.bw-ico-wipes { --bw-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"); }
.bw-ico-wrench.bw-set-off::before { filter: grayscale(1); opacity: 0.6; }
.bw-ico-wipes.bw-set-off { --bw-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"); }
.bw-ico-trash { --bw-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"); }
.bw-btn-go.bw-ico-trash { --bw-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"); }
.bw-ico-back { --bw-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"); }
.bw-ico-device { --bw-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"); }
.bw-ico-sun { --bw-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"); }
.bw-ico-moon { --bw-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"); }
.bw-ico-person { --bw-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"); }
.bw-ico-signout { --bw-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"); }
.bw-ico-pause.bw-on { --bw-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"); }
.bw-ico-auto { --bw-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"); }
.bw-ico-speed { --bw-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"); }
.bw-ico-swords { --bw-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"); }
.bw-ico-up { --bw-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"); }
.bw-ico-next { --bw-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"); }
.bw-ico-check { --bw-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"); }
.bw-ico-again { --bw-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"); }
.bw-ico-tag { --bw-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"); }
.bw-ico-coins { --bw-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"); }
.bw-ico-sword { --bw-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"); }
.bw-ico-heart { --bw-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"); }
.bw-btn.bw-ico::before, .bw-choice.bw-ico::before, .bw-link::before, #bwWrapper .gs-title-option.bw-ico::before, .bw-panel-head h2.bw-ico::before, .bw-perk-name.bw-ico::before { content: ""; flex: none; width: 18px; height: 18px; background: var(--bw-pic) center / contain no-repeat; transition: transform .2s ease; }
.bw-btn.bw-ico:hover:not(:disabled)::before, .bw-choice.bw-ico:hover::before, .bw-link:hover::before, #bwWrapper .gs-title-option.bw-ico:hover::before, .bw-side .bw-ico:hover::before { transform: scale(1.12); }
#bwWrapper .gs-title-option.bw-ico, .bw-choice.bw-ico { display: inline-flex; align-items: center; gap: 6px; }
.bw-choice.bw-ico { padding-left: 11px; }
    /* On the chosen one, which is red, the drawing sits on a white disc so it still reads. */
    .bw-choice.bw-ico.bw-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. */
.bw-set-row .bw-btn.bw-ico.bw-set-off { opacity: 1; }
.bw-set-row .bw-btn.bw-ico::before { width: 20px; height: 20px; }
.bw-btn.bw-ico-next { flex-direction: row-reverse; }
    .bw-btn.bw-ico-next:hover::before { transform: translateX(3px); }
.bw-panel-head h2.bw-ico { display: flex; align-items: center; gap: 8px; margin-right: auto; }
    .bw-panel-head h2.bw-ico::before { width: 26px; height: 26px; }
.bw-perk-name.bw-ico { display: flex; align-items: center; gap: 6px; align-self: stretch; }
    .bw-perk-name.bw-ico::before { width: 24px; height: 24px; }
    .bw-perk-name.bw-ico .bw-perk-lv { margin-left: auto; }
/* The wave button: crossed swords, a little bigger. */
.bw-wave-btn.bw-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. */
.bw-selected .bw-btn.bw-ico { justify-content: flex-start; }
    .bw-selected .bw-btn.bw-ico .bw-cost { margin-left: auto; }
.bw-selected .bw-btn.bw-btn-x { justify-content: center; }
/* The links at the foot of Settings - the same pictures the other games use for them. */
.bw-link { gap: 5px; }
    .bw-link::before { background-position: center; background-size: contain; background-repeat: no-repeat; }
    .bw-link-list::before { background-image: url(../../Assets/Games/Logos/GamesApp.png); }
    .bw-link-version[data-type="browser"]::before { background-image: url(../../Assets/icons/desktopview.png); }
    .bw-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. */
.bw-side button.bw-ico.bw-on { color: var(--bw-plate-text); background: var(--bw-plate-solid); box-shadow: 0 0 0 3px var(--bw-go), var(--bw-plate-shadow); }
.bw-side button.bw-ico-sound.bw-off { opacity: 1; }
.bw-side .bw-ico-auto:not(.bw-on)::before { filter: grayscale(1); opacity: 0.55; }
/* Speed: the drawing above, how fast below. */
.bw-side button.bw-ico-speed { padding-top: 17px; font-size: 11px; line-height: 12px; }
    .bw-side .bw-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) {
    .bw-side button.bw-ico-speed { padding-top: 14px; font-size: 10px; line-height: 11px; }
        .bw-side .bw-ico-speed::before { top: 3px; }
    /* Eleven in a row on a phone. */
    .bw-side { gap: 5px 3px; }
        .bw-side button { width: 30px; height: 30px; }
        .bw-side .bw-side-tool { margin-left: 3px; }
    .bw-side .bw-ico::before { width: 19px; height: 19px; margin: -9.5px 0 0 -9.5px; }
        .bw-side .bw-ico-speed::before { width: 15px; height: 12px; margin: 0 0 0 -7.5px; }
}
@media (prefers-reduced-motion: reduce) {
    .bw-btn.bw-ico::before, .bw-choice.bw-ico::before, .bw-link::before, #bwWrapper .gs-title-option.bw-ico::before { transition: none; }
    .bw-btn.bw-ico:hover:not(:disabled)::before, .bw-choice.bw-ico:hover::before, .bw-link:hover::before, #bwWrapper .gs-title-option.bw-ico:hover::before, .bw-side .bw-ico:hover::before, .bw-btn.bw-ico-next:hover::before { transform: none; }
}

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

/* ---- The wipe ----
   The shell's screen-covering wipe (gameShell.js; it is asked for its "fruit" order, which fills from the
   bottom row up), as a truss going up: every cell is one bay of lattice (BridgeWorks.js, bayFill) that drops
   from above the screen, a little askew, and settles square; the sky darkens behind them; and at the end
   the whole of it falls away. The style's name is Fruit Frenzy's, whose rules are in gameShell.css; these
   are written to outrank them (this stylesheet is only loaded on this page). */
html body #gsTitleWipe.gs-wipe-fruit { gap: 0; padding: 0; }
    html body #gsTitleWipe.gs-wipe-fruit::before { background: linear-gradient(180deg, #3d5f86 0%, #1c2733 100%); }
html body #gsTitleWipe.gs-wipe-fruit .gs-wipe-cell { overflow: visible; border-radius: 0; background: transparent; font-size: 0; text-shadow: none; transform: translateY(-120vh) rotate(var(--tilt, -6deg)); animation: bwBayIn .36s cubic-bezier(.25, .8, .35, 1) var(--d) both; }
    html body #gsTitleWipe.gs-wipe-fruit .gs-wipe-cell svg { flex: none; width: 108%; height: 108%; overflow: visible; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.45)); }
    html body #gsTitleWipe.gs-wipe-out.gs-wipe-fruit .gs-wipe-cell { animation: bwBayOut .36s cubic-bezier(.55, 0, .9, .45) var(--d) both; }
@keyframes bwBayIn { 0% { transform: translateY(-120vh) rotate(var(--tilt, -6deg)); } 72% { transform: translateY(4%) rotate(calc(var(--tilt, -6deg) * -0.12)); } 100% { transform: none; } }
@keyframes bwBayOut { 0% { transform: none; opacity: 1; } 100% { transform: translateY(125vh) rotate(calc(var(--tilt, -6deg) * 2)); opacity: 1; } }
/* What is being gone to, on a sign bolted over the lattice. */
html body #gsTitleWipe.gs-wipe-fruit .gs-wipe-label { border-radius: 8px; color: #FFFFFF; background: #2F6FB0; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 0 4px #EEF2F5, 0 0 0 9px #1F2A36; }
@media (prefers-reduced-motion: reduce) { html body #gsTitleWipe.gs-wipe-fruit .gs-wipe-cell, html body #gsTitleWipe.gs-wipe-out.gs-wipe-fruit .gs-wipe-cell { animation-duration: .01s; } }

/* 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 { --bw-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) {
    .bw-side { gap: 6px; }
        .bw-side button { width: 44px; height: 44px; }
        .bw-side .bw-ico::before { width: 25px; height: 25px; margin: -12.5px 0 0 -12.5px; }
    .bw-side button.bw-ico-speed { padding-top: 20px; font-size: 12px; }
        .bw-side .bw-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) {
    .bw-side button { width: 37px; height: 37px; }
    .bw-side .bw-ico::before { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
    .bw-side button.bw-ico-speed { padding-top: 17px; font-size: 10.5px; line-height: 12px; }
        .bw-side .bw-ico-speed::before { top: 5px; width: 16px; height: 13px; margin: 0 0 0 -8px; }
}
@media screen and (max-width: 560px) {
    #bwZoomInBtn, #bwZoomOutBtn { display: none; }
}
@media screen and (max-width: 380px) {
    .bw-side button { width: 34px; height: 34px; }
    .bw-side .bw-ico::before { width: 20px; height: 20px; margin: -10px 0 0 -10px; }
    .bw-side button.bw-ico-speed { padding-top: 15px; }
        .bw-side .bw-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) {
    .bw-side { top: calc(var(--bw-top) + 58px); left: auto; right: 8px; bottom: calc(var(--bw-dock) + 98px); flex-direction: column; flex-wrap: wrap-reverse; align-content: flex-start; gap: 5px; }
        .bw-side .bw-side-tool { margin-left: 0; margin-top: 4px; }
    .bw-hint, .bw-coach { top: calc(var(--bw-top) + 106px); max-width: calc(100% - 64px); }
}

/* Selling a tower asks first (BridgeWorks.js, sellAsk). */
.bw-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); }
    .bw-sell-ask .bw-cost { vertical-align: -1px; }

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

/* ---- The towers' tray on a phone: the full width of the screen, its five buttons sharing it ---- */
@media screen and (max-width: 560px) {
    .bw-tray { left: 8px; right: 8px; width: auto; max-width: none; margin: 0; }
    .bw-towers { justify-content: space-between; }
        .bw-tower-btn { flex: 1 1 0; min-width: 0; padding: 5px 4px; }
            .bw-tower-btn .bw-tower-pic { width: 38px; height: 38px; }
    .bw-tower-name { font-size: 13px; }
    .bw-cost { font-size: 13px; }
}

/* ---- Tower health: the heart button's count, and the list it opens ---- */
.bw-ico-health { --bw-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"); }
.bw-side .bw-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; }
    .bw-side .bw-badge:empty { display: none; }
    .bw-side .bw-warn .bw-badge { background: #e5484d; animation: bwReady 1.2s ease-in-out infinite; }
.bw-health { position: absolute; z-index: 3; top: calc(var(--bw-top) + 74px); right: 66px; display: flex; flex-direction: column; gap: 6px; width: 250px; max-height: calc(100% - var(--bw-top) - 190px); padding: 10px; box-sizing: border-box; border-radius: 18px; color: var(--bw-plate-text); background: var(--bw-plate-solid); box-shadow: var(--bw-plate-shadow); font-family: Fredoka, "Open Sans", sans-serif; user-select: none; }
.bw-health-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .bw-health-head b { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600; }
        .bw-health-head b::before { content: ""; flex: none; width: 20px; height: 20px; background: var(--bw-pic) center / contain no-repeat; }
    .bw-health-head .bw-btn-x { padding: 0 9px; font-size: 19px; line-height: 26px; }
.bw-health-all { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; font-size: 14px; }
    .bw-health-all .bw-stat-bar { height: 11px; border-radius: 6px; }
.bw-health-sum { font-size: 13px; opacity: 0.8; }
.bw-health .bw-btn-fix { justify-content: flex-start; padding: 7px 11px; font-size: 14px; }
    .bw-health .bw-btn-fix .bw-cost { margin-left: auto; }
    .bw-health .bw-btn.bw-poor { opacity: 0.6; }
.bw-health-list { display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -4px; padding: 0 4px; }
.bw-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; }
    .bw-health-row:hover { background: rgba(127, 127, 127, 0.18); }
    .bw-health-row.bw-on { border-color: var(--bw-go); }
    .bw-health-row:focus-visible { outline: 2px solid #864cff; outline-offset: 1px; }
    .bw-health-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
        .bw-health-name i { font-style: normal; font-weight: 500; opacity: 0.65; }
    .bw-health-num { font-size: 12.5px; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.bw-stat-bar i.bw-stat-hp.bw-mid { background: #e0a020; }
.bw-stat-bar i.bw-stat-hp.bw-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) {
    .bw-health { top: calc(var(--bw-top) + 104px); left: 8px; right: 54px; width: auto; max-height: 42%; }
    .bw-side .bw-badge { top: -4px; right: -4px; min-width: 16px; height: 16px; font-size: 10px; line-height: 16px; }
}
@media (prefers-reduced-motion: reduce) { .bw-side .bw-warn .bw-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) {
    .bw-side { top: calc(var(--bw-top) + 54px); left: auto; right: 8px; bottom: calc(var(--bw-dock) + 8px); flex-direction: column; flex-wrap: wrap-reverse; align-content: flex-start; gap: 5px; }
        .bw-side .bw-side-tool { margin-left: 0; margin-top: 0; }
    .bw-hint, .bw-coach { top: calc(var(--bw-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) { .bw-health { right: 112px; } }
@media screen and (min-width: 561px) and (max-height: 520px) { .bw-health { top: calc(var(--bw-top) + 54px); right: 100px; max-height: calc(100% - var(--bw-top) - var(--bw-dock) - 70px); } }


/* ---- Bridge Works' own parts ----
   Everything above is the layout the full-window games share (plates, the tray down the left, the round
   buttons down the right, panels, the phone arrangements). What follows is this game's: the price of the
   bridge at the top, the materials in the tray, and the pictures for its own buttons. */
#bwScene { background: #74c6f7; }
#bwCanvas { cursor: crosshair; }
.bw-testing #bwCanvas { cursor: grab; }

/* Top right: what the bridge costs against the budget, then the prices that earn the second and third stars. */
.bw-stat-cost b { display: inline-flex; align-items: baseline; gap: 4px; }
    .bw-stat-cost em { font-style: normal; font-size: 12px; font-weight: 600; opacity: 0.65; }
    .bw-stat-cost.bw-over b { color: #d9342b; }
    body[data-theme="Dark"] .bw-stat-cost.bw-over b { color: #ff8a80; }
.bw-stat-cost i { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe680, var(--bw-gold)); box-shadow: inset 0 0 0 1.5px #a67c00; }
.bw-stat-star { gap: 4px; padding-left: 5px; padding-right: 7px; font-size: 13px; opacity: 0.6; }
    .bw-stat-star i { width: 15px; height: 15px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3 6.500 7 .9-5.200 4.800 1.400 7-6.200-3.500-6.200 3.500 1.400-7L2 9.400l7-.9z'/%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 2l3 6.500 7 .9-5.200 4.800 1.400 7-6.200-3.500-6.200 3.500 1.400-7L2 9.400l7-.9z'/%3E%3C/svg%3E") center / contain no-repeat; }
    .bw-stat-star.bw-met { opacity: 1; }
        .bw-stat-star.bw-met i { background: #f2b01e; }
.bw-stat-star .bw-stat-n { font-size: 10px; font-weight: 700; margin-left: -2px; margin-right: 1px; }

/* The tray: a bar of each material, its name and its price a square; then the two tools. */
.bw-mat-pic { flex: none; position: relative; width: 38px; height: 36px; background: center / contain no-repeat; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25)); }
.bw-mat-road { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2036%2036%27%3E%3Cdefs%3E%3CradialGradient%20id%3D%27p%27%20cx%3D%27.35%27%20cy%3D%27.3%27%20r%3D%27.8%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%23f1f4f7%27%2F%3E%3Cstop%20offset%3D%27.6%27%20stop-color%3D%27%23a9b2bb%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%235d666f%27%2F%3E%3C%2FradialGradient%3E%3ClinearGradient%20id%3D%27g%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%238a949e%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%23454d56%27%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cg%20transform%3D%27rotate(-24%2018%2018)%27%3E%3Crect%20x%3D%273%27%20y%3D%2716.500%27%20width%3D%2730%27%20height%3D%277%27%20rx%3D%271.500%27%20fill%3D%27url(%23g)%27%20stroke%3D%27%231f242b%27%20stroke-width%3D%271.200%27%2F%3E%3Cpath%20d%3D%27M8%2017.500v5M13%2017.500v5M18%2017.500v5M23%2017.500v5M28%2017.500v5%27%20stroke%3D%27%231f242b%27%20stroke-width%3D%27.7%27%20opacity%3D%27.45%27%2F%3E%3Crect%20x%3D%272%27%20y%3D%2711.500%27%20width%3D%2732%27%20height%3D%276%27%20rx%3D%271.200%27%20fill%3D%27%233d4248%27%20stroke%3D%27%231f242b%27%20stroke-width%3D%271.200%27%2F%3E%3Cpath%20d%3D%27M5%2014.500h4M12.500%2014.500h4M20%2014.500h4M27.500%2014.500h4%27%20stroke%3D%27%23f6c931%27%20stroke-width%3D%271.500%27%2F%3E%3Ccircle%20cx%3D%275%27%20cy%3D%2718%27%20r%3D%273.4%27%20fill%3D%27url(%23p)%27%20stroke%3D%27%23262c34%27%20stroke-width%3D%271%27%2F%3E%3Ccircle%20cx%3D%275%27%20cy%3D%2718%27%20r%3D%271.09%27%20fill%3D%27%23262c34%27%2F%3E%3Ccircle%20cx%3D%2731%27%20cy%3D%2718%27%20r%3D%273.4%27%20fill%3D%27url(%23p)%27%20stroke%3D%27%23262c34%27%20stroke-width%3D%271%27%2F%3E%3Ccircle%20cx%3D%2731%27%20cy%3D%2718%27%20r%3D%271.09%27%20fill%3D%27%23262c34%27%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); }
.bw-mat-wood { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2036%2036%27%3E%3Cdefs%3E%3CradialGradient%20id%3D%27p%27%20cx%3D%27.35%27%20cy%3D%27.3%27%20r%3D%27.8%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%23f1f4f7%27%2F%3E%3Cstop%20offset%3D%27.6%27%20stop-color%3D%27%23a9b2bb%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%235d666f%27%2F%3E%3C%2FradialGradient%3E%3ClinearGradient%20id%3D%27g%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%23e2b379%27%2F%3E%3Cstop%20offset%3D%27.55%27%20stop-color%3D%27%23b9834a%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%2386592c%27%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cg%20transform%3D%27rotate(-24%2018%2018)%27%3E%3Crect%20x%3D%272.500%27%20y%3D%2713%27%20width%3D%2731%27%20height%3D%2710%27%20rx%3D%275%27%20fill%3D%27url(%23g)%27%20stroke%3D%27%235e3c1c%27%20stroke-width%3D%271.300%27%2F%3E%3Cpath%20d%3D%27M7%2015.800c5-.9%209%20.9%2014%200s6-.8%209%200M7%2018.300c4%20.8%208-.8%2012%200s7%20.8%2011%200M8%2020.600c5-.7%209%20.7%2013%200s5-.5%208%200%27%20fill%3D%27none%27%20stroke%3D%27%236b4520%27%20stroke-width%3D%27.75%27%20opacity%3D%27.6%27%2F%3E%3Cellipse%20cx%3D%2718%27%20cy%3D%2718%27%20rx%3D%272.200%27%20ry%3D%271.100%27%20fill%3D%27none%27%20stroke%3D%27%236b4520%27%20stroke-width%3D%27.7%27%20opacity%3D%27.6%27%2F%3E%3Ccircle%20cx%3D%276%27%20cy%3D%2718%27%20r%3D%273.3%27%20fill%3D%27url(%23p)%27%20stroke%3D%27%23262c34%27%20stroke-width%3D%271%27%2F%3E%3Ccircle%20cx%3D%276%27%20cy%3D%2718%27%20r%3D%271.06%27%20fill%3D%27%23262c34%27%2F%3E%3Ccircle%20cx%3D%2730%27%20cy%3D%2718%27%20r%3D%273.3%27%20fill%3D%27url(%23p)%27%20stroke%3D%27%23262c34%27%20stroke-width%3D%271%27%2F%3E%3Ccircle%20cx%3D%2730%27%20cy%3D%2718%27%20r%3D%271.06%27%20fill%3D%27%23262c34%27%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); }
.bw-mat-steel { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2036%2036%27%3E%3Cdefs%3E%3CradialGradient%20id%3D%27p%27%20cx%3D%27.35%27%20cy%3D%27.3%27%20r%3D%27.8%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%23f1f4f7%27%2F%3E%3Cstop%20offset%3D%27.6%27%20stop-color%3D%27%23a9b2bb%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%235d666f%27%2F%3E%3C%2FradialGradient%3E%3ClinearGradient%20id%3D%27g%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%237f8c9a%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%235a6673%27%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cg%20transform%3D%27rotate(-24%2018%2018)%27%3E%3Crect%20x%3D%272.500%27%20y%3D%2713.500%27%20width%3D%2731%27%20height%3D%279%27%20rx%3D%274.500%27%20fill%3D%27url(%23g)%27%20stroke%3D%27%232a323c%27%20stroke-width%3D%271.300%27%2F%3E%3Cpath%20d%3D%27M6%2015h24%27%20stroke%3D%27%23e6edf3%27%20stroke-width%3D%272%27%2F%3E%3Cpath%20d%3D%27M6%2021h24%27%20stroke%3D%27%2339434e%27%20stroke-width%3D%272%27%2F%3E%3Cg%20fill%3D%27%23222a33%27%3E%3Ccircle%20cx%3D%2711.500%27%20cy%3D%2718%27%20r%3D%27.9%27%2F%3E%3Ccircle%20cx%3D%2715.800%27%20cy%3D%2718%27%20r%3D%27.9%27%2F%3E%3Ccircle%20cx%3D%2720.200%27%20cy%3D%2718%27%20r%3D%27.9%27%2F%3E%3Ccircle%20cx%3D%2724.500%27%20cy%3D%2718%27%20r%3D%27.9%27%2F%3E%3C%2Fg%3E%3Ccircle%20cx%3D%276%27%20cy%3D%2718%27%20r%3D%273.3%27%20fill%3D%27url(%23p)%27%20stroke%3D%27%23262c34%27%20stroke-width%3D%271%27%2F%3E%3Ccircle%20cx%3D%276%27%20cy%3D%2718%27%20r%3D%271.06%27%20fill%3D%27%23262c34%27%2F%3E%3Ccircle%20cx%3D%2730%27%20cy%3D%2718%27%20r%3D%273.3%27%20fill%3D%27url(%23p)%27%20stroke%3D%27%23262c34%27%20stroke-width%3D%271%27%2F%3E%3Ccircle%20cx%3D%2730%27%20cy%3D%2718%27%20r%3D%271.06%27%20fill%3D%27%23262c34%27%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); }
.bw-mat-cable { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2036%2036%27%3E%3Cdefs%3E%3CradialGradient%20id%3D%27p%27%20cx%3D%27.35%27%20cy%3D%27.3%27%20r%3D%27.8%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%23f1f4f7%27%2F%3E%3Cstop%20offset%3D%27.6%27%20stop-color%3D%27%23a9b2bb%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%235d666f%27%2F%3E%3C%2FradialGradient%3E%3ClinearGradient%20id%3D%27g%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%23dfe5ea%27%2F%3E%3Cstop%20offset%3D%27.5%27%20stop-color%3D%27%238b949d%27%2F%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%233d444b%27%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cg%20transform%3D%27rotate(-24%2018%2018)%27%3E%3Cpath%20d%3D%27M5%2018h26%27%20stroke%3D%27%231c2026%27%20stroke-width%3D%274.200%27%20stroke-linecap%3D%27round%27%2F%3E%3Cpath%20d%3D%27M5%2018h26%27%20stroke%3D%27%23aab3bd%27%20stroke-width%3D%272.200%27%20stroke-linecap%3D%27round%27%2F%3E%3Cpath%20d%3D%27M11%2019l1.300-2M13.500%2019l1.300-2M16%2019l1.300-2M18.500%2019l1.300-2M21%2019l1.300-2M23.500%2019l1.300-2%27%20stroke%3D%27%231c2026%27%20stroke-width%3D%27.7%27%20opacity%3D%27.7%27%2F%3E%3Crect%20x%3D%277.500%27%20y%3D%2714.800%27%20width%3D%275%27%20height%3D%276.400%27%20rx%3D%271%27%20fill%3D%27url(%23g)%27%20stroke%3D%27%231c2026%27%20stroke-width%3D%27.9%27%2F%3E%3Crect%20x%3D%2723.500%27%20y%3D%2714.800%27%20width%3D%275%27%20height%3D%276.400%27%20rx%3D%271%27%20fill%3D%27url(%23g)%27%20stroke%3D%27%231c2026%27%20stroke-width%3D%27.9%27%2F%3E%3Ccircle%20cx%3D%275%27%20cy%3D%2718%27%20r%3D%272.9%27%20fill%3D%27url(%23p)%27%20stroke%3D%27%23262c34%27%20stroke-width%3D%271%27%2F%3E%3Ccircle%20cx%3D%275%27%20cy%3D%2718%27%20r%3D%270.93%27%20fill%3D%27%23262c34%27%2F%3E%3Ccircle%20cx%3D%2731%27%20cy%3D%2718%27%20r%3D%272.9%27%20fill%3D%27url(%23p)%27%20stroke%3D%27%23262c34%27%20stroke-width%3D%271%27%2F%3E%3Ccircle%20cx%3D%2731%27%20cy%3D%2718%27%20r%3D%270.93%27%20fill%3D%27%23262c34%27%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); }
.bw-tower-btn:disabled { opacity: 0.45; cursor: default; }
.bw-tools { display: flex; gap: 4px; margin-top: 4px; padding-top: 5px; border-top: 1px solid rgba(127, 127, 127, 0.3); }
    .bw-tools .bw-tower-btn { flex: 1 1 0; justify-content: center; gap: 5px; padding: 6px 4px; font-family: Fredoka, "Open Sans", sans-serif; font-size: 13.5px; font-weight: 600; }
    .bw-tools .bw-tower-btn::before { content: ""; flex: none; width: 18px; height: 18px; background: var(--bw-pic) center / contain no-repeat; }
.bw-wave-btn:disabled { opacity: 0.55; }

/* Pictures for this game's buttons. */
.bw-ico-erase { --bw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 4.500l10.500 10.500-5 5H8.500L4 15.500z' fill='%23F28AA0' stroke='%237A1F33' stroke-width='1.600' stroke-linejoin='round'/%3E%3Cpath d='M4 15.500l5-5 5.500 5.500-4 4H8.500z' fill='%23FFF' stroke='%237A1F33' stroke-width='1.600' stroke-linejoin='round'/%3E%3Cpath d='M12 20h8.500' stroke='%237A1F33' stroke-width='1.800' stroke-linecap='round'/%3E%3C/svg%3E"); }
.bw-ico-undo { --bw-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='M8 5L3.500 9.500 8 14M4 9.500h9.500a6 6 0 0 1 0 12H9' stroke='%23134A94' stroke-width='4.600'/%3E%3Cpath d='M8 5L3.500 9.500 8 14M4 9.500h9.500a6 6 0 0 1 0 12H9' stroke='%235AA9F5' stroke-width='2.400'/%3E%3C/svg%3E"); }
.bw-ico-test { --bw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 15.500V10l4.500-.5 2.500-4h7l3 4 3 .8v5.200z' fill='%23FFF' stroke='%235A1408' stroke-width='1.500' stroke-linejoin='round'/%3E%3Cpath d='M8.500 9.500l1.500-2.500h5l2 2.500z' fill='%239FD8F5' stroke='%235A1408' stroke-width='1'/%3E%3Ccircle cx='7' cy='16' r='2.800' fill='%232B3038' stroke='%23FFF' stroke-width='1.200'/%3E%3Ccircle cx='17' cy='16' r='2.800' fill='%232B3038' stroke='%23FFF' stroke-width='1.200'/%3E%3C/svg%3E"); }
.bw-ico-build { --bw-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.500 9.500l3 3-8 8.500-3-3z' fill='%23C08A4A' stroke='%235E3C1C' stroke-width='1.500' stroke-linejoin='round'/%3E%3Cpath d='M9.500 5l4-2.500 7 7-2.500 4-2.500-2.500-2 1-3.500-3.500 1-2z' fill='%23C9D2DC' stroke='%232F3742' stroke-width='1.500' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.bw-ico-stress { --bw-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%3Cpath d='M4 17a8 8 0 0 1 2.300-5.600' stroke='%2346B95A' stroke-width='4.200'/%3E%3Cpath d='M8.300 9.800A8 8 0 0 1 15.700 9.800' stroke='%23F2B01E' stroke-width='4.200'/%3E%3Cpath d='M17.700 11.400A8 8 0 0 1 20 17' stroke='%23E5484D' stroke-width='4.200'/%3E%3Cpath d='M12 17l4-5' stroke='%23262C34' stroke-width='2.200'/%3E%3Ccircle cx='12' cy='17' r='1.800' fill='%23262C34'/%3E%3C/svg%3E"); }
.bw-side button:disabled { opacity: 0.45; cursor: default; }
.bw-side button.bw-ico-stress:not(.bw-on)::before { filter: grayscale(1); opacity: 0.6; }
.bw-score { margin: 4px 0 2px; font-size: 15px; }
    .bw-score b { font-family: Fredoka, "Open Sans", sans-serif; font-size: 26px; font-weight: 600; }
.bw-result-line { margin: 6px 0 0; font-size: 14px; line-height: 1.45; }
.bw-result-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }

/* How to play: the four materials side by side. */
.bw-help-mats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 8px 0 12px; }
    .bw-help-mats div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; border-radius: 12px; font-size: 12.5px; line-height: 1.3; text-align: center; background: var(--bw-chip); }
    .bw-help-mats b { font-family: Fredoka, "Open Sans", sans-serif; font-size: 15px; font-weight: 600; }
@media screen and (max-width: 560px) { .bw-help-mats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* How to play: the vehicles - a picture of each, its name, its weight and its axles. */
.bw-help-cars { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0 12px; }
    .bw-help-cars ul { grid-column: 1 / -1; margin: 0; }
.bw-help-car { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 6px 9px; border-radius: 12px; font-size: 12.5px; line-height: 1.3; text-align: center; background: var(--bw-chip); }
    .bw-help-car canvas { display: block; width: 100%; max-width: 180px; height: auto; }
    .bw-help-car b { font-family: Fredoka, "Open Sans", sans-serif; font-size: 14.5px; font-weight: 600; }
    .bw-help-car .bw-sb-wt { margin-left: 0; font-size: 13px; }
#bwWrapper.bw-real .bw-help-car { border-radius: 5px; box-shadow: 0 1px 0 var(--bw-chip-edge); }
    #bwWrapper.bw-real .bw-help-car b { font-family: "Open Sans", "Segoe UI", Arial, sans-serif; font-weight: 700; }

/* Phones: the tray is a row along the foot - the materials, then the two tools as squares at its end. */
@media screen and (max-width: 560px), screen and (max-height: 520px) {
    .bw-tray { display: flex; align-items: stretch; gap: 3px; }
    .bw-tools { flex: none; margin: 0; padding: 0 0 0 4px; border-top: 0; border-left: 1px solid rgba(127, 127, 127, 0.3); }
        .bw-tools .bw-tower-btn { flex: none; flex-direction: column; gap: 1px; min-width: 46px; padding: 4px 3px; font-size: 11px; }
}

/* A phone on its side: the tray goes in the bottom left corner, over the bank and clear of the gap, and
   the hint keeps to the left half so the bridge can be seen. */
@media screen and (min-width: 561px) and (max-height: 520px) {
    .bw-tray { left: 8px; right: auto; margin: 0; }
    .bw-hint { max-width: min(360px, 42%); }
}

/* ---- The sandbox ----
   Its setup panel: a line for each thing that can be turned up or down, and rows of choices. In the sandbox
   there are no stars to aim for, so their two prices at the top are put away. */
.bw-sandbox .bw-stat-stars { display: none !important; }
.bw-sb-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
    .bw-sb-name { flex: 0 0 84px; font-size: 14px; font-weight: 600; }
    .bw-sb-num { flex: 0 0 104px; font-size: 14px; text-align: center; font-variant-numeric: tabular-nums; }
    .bw-sb-row .bw-btn { min-width: 40px; padding: 5px 0; font-size: 18px; line-height: 1.2; }
    .bw-sb-row .bw-btn:disabled, .bw-choice:disabled { opacity: 0.4; cursor: default; }
.bw-sb-line { min-height: 34px; align-items: center; }
/* A vehicle's weight, on its button; and the weight of the whole line. */
.bw-sb-wt { display: inline-block; margin-left: 5px; padding: 0 6px; border-radius: 999px; font-size: 0.82em; font-weight: 700; font-variant-numeric: tabular-nums; background: rgba(127, 127, 127, 0.22); }
.bw-sb-total { margin-left: 4px; font-size: 13.5px; white-space: nowrap; opacity: 0.85; }

/* ---- The star helper, top right ----
   Three stars, lit for what the bridge would win at its price now, and beside them what to save for the next
   (the long form on a wide screen, just the sum on a phone). */
.bw-stat-stars { gap: 7px; padding-left: 10px; border-left: 1px solid rgba(127, 127, 127, 0.35); }
.bw-star-row { display: inline-flex; gap: 1px; font-size: 17px; line-height: 1; }
    .bw-star-row i { width: auto; height: auto; font-style: normal; color: rgba(127, 127, 127, 0.45); transition: color .2s ease, transform .2s ease; }
    .bw-star-row i.bw-lit { color: #f2b01e; text-shadow: 0 1px 0 rgba(120, 80, 0, 0.35); transform: scale(1.08); }
.bw-star-note { font-size: 13px; font-weight: 600; white-space: nowrap; }
.bw-star-short { display: none; }
@media (prefers-reduced-motion: reduce) { .bw-star-row i { transition: none; } }
@media screen and (max-width: 560px), screen and (max-height: 520px) {
    .bw-star-long { display: none; }
    .bw-star-short { display: inline; }
    .bw-stat-stars { padding-left: 6px; gap: 4px; }
    .bw-star-row { font-size: 15px; }
}

/* The star beside the count on the title screen. */
.bw-title-star { margin-right: 5px; font-size: 1.15em; line-height: 1; color: #f2b01e; text-shadow: 0 1px 0 rgba(120, 80, 0, 0.35); }

/* ---- The plain interface, for the realistic look ----
   With Graphics set to Realistic (BridgeWorks.js puts bw-real on the wrapper) the interface drops its toy-box
   manner to match: cool grey panels in place of cream and wood, steel blue in place of orange-red, square
   corners, flat buttons, the site's plain typeface, and quieter pictures on the buttons. Nothing moves or
   changes size, so every layout rule above still holds. The title screen and the tab bar are the shared
   gameShell.css; they are restyled here through the colours they read and their corners. */
body #bwWrapper.bw-real, body[data-theme="Default"] #bwWrapper.bw-real {
    --bw-plate: rgba(244, 246, 248, 0.9); --bw-plate-solid: #FFFFFF; --bw-plate-hover: #FFFFFF; --bw-plate-text: #1F262D; --bw-plate-shadow: 0 1px 5px rgba(0, 0, 0, 0.32);
    --bw-card: #F2F4F6; --bw-ink: #1F262D; --bw-soft: #5D6873; --bw-line: #CFD5DB; --bw-chip: #FFFFFF; --bw-chip-edge: #B9C1C9;
    --bw-go: #2F6FB0; --bw-go-edge: #1F4F80;
    --tt-wood: linear-gradient(160deg, #4A545E 0%, #2F373F 55%, #414A54 100%); --tt-wood-hi: rgba(255, 255, 255, 0.18);
    --tt-felt: #E4E8EC; --tt-tray: #CDD3D9; --tt-cream: #EEF1F4; --tt-cream-hover: #FFFFFF; --tt-cream-edge: #9AA4AE; --tt-cream-text: #1F262D; --tt-cream-soft: #5D6873;
    --tt-action: #2F6FB0; --tt-action-edge: #1F4F80;
}
body[data-theme="Dark"] #bwWrapper.bw-real {
    --bw-plate: rgba(22, 28, 34, 0.88); --bw-plate-solid: rgba(30, 37, 45, 0.97); --bw-plate-hover: #34404C; --bw-plate-text: #EEF2F5; --bw-plate-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
    --bw-card: #1C232B; --bw-ink: #E8EDF2; --bw-soft: #9AA7B4; --bw-line: #33404C; --bw-chip: #27313B; --bw-chip-edge: #12181E;
    --bw-go: #3B82C8; --bw-go-edge: #23588E;
    --tt-wood: linear-gradient(160deg, #353D46 0%, #1F262D 55%, #2C343C 100%); --tt-wood-hi: rgba(255, 255, 255, 0.1);
    --tt-felt: #1F2830; --tt-tray: #161D24; --tt-action: #3B82C8; --tt-action-edge: #23588E;
}
#bwWrapper.bw-real .bw-title, #bwWrapper.bw-real .bw-hud, #bwWrapper.bw-real .bw-tray, #bwWrapper.bw-real .bw-hint { border-radius: 6px; }
#bwWrapper.bw-real .bw-title, #bwWrapper.bw-real .bw-tower-name, #bwWrapper.bw-real .bw-btn, #bwWrapper.bw-real .bw-tools .bw-tower-btn, #bwWrapper.bw-real .bw-side button,
#bwWrapper.bw-real .bw-result-card h2, #bwWrapper.bw-real .bw-panel-head h2, #bwWrapper.bw-real .bw-era, #bwWrapper.bw-real .bw-score b, #bwWrapper.bw-real .bw-help-mats b { font-family: "Open Sans", "Segoe UI", Arial, sans-serif; font-weight: 700; }
#bwWrapper.bw-real .bw-level-badge { border-radius: 4px; box-shadow: none; }
#bwWrapper.bw-real .bw-tower-btn { border-radius: 4px; }
#bwWrapper.bw-real .bw-side button { border-radius: 6px; }
#bwWrapper.bw-real .bw-btn { border-radius: 5px; box-shadow: 0 1px 0 var(--bw-chip-edge); }
#bwWrapper.bw-real .bw-btn-go { box-shadow: 0 1px 0 var(--bw-go-edge); }
#bwWrapper.bw-real .bw-wave-btn { border: 0; border-radius: 5px; font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase; box-shadow: var(--bw-plate-shadow); }
#bwWrapper.bw-real .bw-panel-card, #bwWrapper.bw-real .bw-result-card { border-radius: 8px; }
#bwWrapper.bw-real button.bw-level, #bwWrapper.bw-real .bw-perk, #bwWrapper.bw-real .bw-help-mats div { border-radius: 5px; box-shadow: 0 1px 0 var(--bw-chip-edge); }
#bwWrapper.bw-real .bw-choice { border-radius: 4px; }
#bwWrapper.bw-real .bw-ico::before, #bwWrapper.bw-real .bw-tools .bw-tower-btn::before { filter: saturate(0.5); }
#bwWrapper.bw-real #gsTitlePlayBtn, #bwWrapper.bw-real .gs-title-option, #bwWrapper.bw-real .gs-title-best, #bwWrapper.bw-real .gs-title-tagline { border-radius: 6px; }
#bwWrapper.bw-real #gsTitlePlayBtn, #bwWrapper.bw-real .gs-title-option { font-family: "Open Sans", "Segoe UI", Arial, sans-serif; }
#bwWrapper.bw-real #gsDock, #bwWrapper.bw-real #gsDock .gs-dock-tab, #bwWrapper.bw-real #gsDockBubble, #bwWrapper.bw-real #gsDock .gs-dock-menu { border-radius: 6px; }
/* (The floating tab bar is dark here, so its words are light; the tab in use is the same steel blue as the buttons.) */
#bwWrapper.bw-real #gsDock:not(.gs-dock-inline) { color: #EEF2F5; }
#bwWrapper.bw-real #gsDockBubble { background: linear-gradient(135deg, #3B82C8, #2F6FB0) !important; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35) !important; }
/* The title screen's logo: the plain one with the realistic look, the cartoon one with the cartoon. */
#bwWrapper .bw-logo-real { display: none; }
#bwWrapper.bw-real .bw-logo-real { display: block; }
#bwWrapper.bw-real .bw-logo-toon { display: none; }
/* The wipe's sign in the plain typeface, with the detailed look. */
html body.bw-real-ui #gsTitleWipe.gs-wipe-fruit .gs-wipe-label { font-family: "Open Sans", "Segoe UI", Arial, sans-serif; letter-spacing: 0.04em; text-transform: uppercase; }

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

/* ---- The tutorial card: what could not be built, said under the step ---- */
.bw-coach-said { margin: 6px 0 0 0; padding: 5px 9px; border-radius: 8px; font-size: 13px; background: rgba(217, 72, 43, 0.12); box-shadow: inset 0 0 0 1px rgba(217, 72, 43, 0.35); }
.bw-coach-skip { white-space: nowrap; }
.bw-coach.bw-coach-last { z-index: 30; }

/* ---- 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: the
   level's name (a button: the list of levels) and a Menu button. The menu itself is a panel like the others,
   of big buttons. (The same as Tower Wardens.) */
#bwWrapper #bwScene, body[data-mode="spa"] #bwWrapper #bwScene { --bw-dock: 0px; }
.bw-top-left { display: flex; align-items: center; gap: 8px; min-width: 0; pointer-events: none; }
    .bw-top-left > * { pointer-events: auto; }
.bw-nav-btn { position: relative; flex: none; cursor: pointer; width: 48px; height: 48px; margin: 0; padding: 0; border: 0; border-radius: 16px; color: var(--bw-plate-text); background: var(--bw-plate); box-shadow: var(--bw-plate-shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background .15s ease, transform .1s ease; }
    .bw-nav-btn:hover { background: var(--bw-plate-hover); }
    .bw-nav-btn:active { transform: scale(0.94); }
    .bw-nav-btn.bw-ico::before { content: ""; position: absolute; top: 50%; left: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; background: var(--bw-pic) center / contain no-repeat; }
.bw-ico-menu { --bw-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='%23D9482B' stroke='%237A1F12' stroke-width='1.2'/%3E%3Crect x='3' y='10.2' width='18' height='3.6' rx='1.8' fill='%23E0A800' stroke='%237A5A00' stroke-width='1.2'/%3E%3Crect x='3' y='16.2' width='18' height='3.6' rx='1.8' fill='%232F7FE0' stroke='%23134A94' stroke-width='1.2'/%3E%3C/svg%3E"); }
.bw-title { padding: 0; pointer-events: auto; }
.bw-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; }
    .bw-title-btn:hover { background: var(--bw-plate-hover); }
    .bw-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); }
.bw-nav-btn:focus-visible, .bw-title-btn:focus-visible, .bw-menu-item:focus-visible { outline: 2px solid #864cff; outline-offset: 2px; }
.bw-menu { display: flex; flex-wrap: wrap; gap: 10px; }
.bw-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(--bw-plate-text); background: rgba(127, 127, 127, 0.13); transition: background .15s ease, transform .1s ease; }
    .bw-menu-item:hover { background: rgba(127, 127, 127, 0.24); }
    .bw-menu-item:active { transform: scale(0.98); }
    .bw-menu-item b { font-family: Fredoka, "Open Sans", sans-serif; font-size: 17px; font-weight: 600; }
    .bw-menu-item span { font-size: 12.5px; opacity: 0.75; }
    .bw-menu-item.bw-ico::before { content: ""; position: absolute; top: 50%; left: 16px; width: 32px; height: 32px; margin-top: -16px; background: var(--bw-pic) center / contain no-repeat; }
    .bw-menu-item.bw-menu-go { flex-basis: 100%; color: #fff; background: var(--bw-go); box-shadow: 0 4px 0 var(--bw-go-edge); }
        .bw-menu-item.bw-menu-go:hover { background: var(--bw-go); filter: brightness(1.07); }
        .bw-menu-item.bw-menu-go span { opacity: 0.9; }
    .bw-menu-item.bw-menu-off::before { filter: grayscale(1); opacity: 0.6; }
@media screen and (max-width: 775px) {
    .bw-top-left { gap: 6px; }
    .bw-nav-btn { width: 40px; height: 40px; border-radius: 13px; }
    .bw-title-btn { padding: 4px 9px 4px 4px; gap: 7px; }
        .bw-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 level there. */
    .bw-title-text { display: none; }
    .bw-title-btn { padding: 4px 8px 4px 4px; }
    .bw-menu-item { flex-basis: 100%; min-height: 56px; }
}
@media (prefers-reduced-motion: reduce) { .bw-nav-btn, .bw-title-btn, .bw-menu-item { transition: none; } }

/* ---- The pieces to build with, as cards (2026-11-23) - the same as Tower Wardens' tray of towers ----
   Two across in the left-hand column, one row along the foot of a phone. Each card is washed in its piece's
   colour (--bw-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 the one in hand; it keeps its
   room and its height, so nothing moves as it changes. A tab at the head folds the cards down to their
   pictures. And the Test button is at the head of the column, where a short screen can't push it out of sight. */
#bwMats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; grid-auto-rows: max-content; align-content: start; }
#bwMats .bw-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: 9px 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(--bw-mark) 30%, transparent), color-mix(in srgb, var(--bw-mark) 7%, transparent) 70%); box-shadow: inset 0 4px 0 var(--bw-mark); transition: transform .12s ease, box-shadow .15s ease, background .15s ease; }
    #bwMats .bw-tower-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: inset 0 4px 0 var(--bw-mark), 0 5px 12px rgba(0, 0, 0, 0.18); }
    #bwMats .bw-tower-btn:active:not(:disabled) { transform: scale(0.97); }
    #bwMats .bw-tower-btn.bw-on { border-color: var(--bw-mark); background: var(--bw-plate-solid); box-shadow: inset 0 4px 0 var(--bw-mark), 0 0 0 3px color-mix(in srgb, var(--bw-mark) 45%, transparent), 0 5px 12px rgba(0, 0, 0, 0.2); }
    #bwMats .bw-tower-btn .bw-mat-pic { width: 50px; height: 46px; margin: 0 0 -1px; }
    #bwMats .bw-tower-name { flex: none; max-width: 100%; overflow: hidden; font-size: 13.5px; line-height: 1.15; white-space: nowrap; text-overflow: ellipsis; }
    #bwMats .bw-tower-role { font-size: 9.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; opacity: 0.62; }
    #bwMats .bw-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); }
    #bwMats .bw-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(--bw-plate-text); background: rgba(127, 127, 127, 0.22); opacity: 0.75; }
.bw-mat-info { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; padding: 7px 9px 8px; border-left: 4px solid var(--bw-mark, rgba(127, 127, 127, 0.4)); border-radius: 10px; font-size: 12px; line-height: 1.3; background: rgba(127, 127, 127, 0.13); }
    .bw-mat-info-name { font-family: Fredoka, "Open Sans", sans-serif; font-size: 14px; font-weight: 600; }
    .bw-mat-info-text { opacity: 0.85; }
    .bw-mat-info-stats { margin-top: 2px; font-size: 11.5px; font-variant-numeric: tabular-nums; opacity: 0.9; }
.bw-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(--bw-plate-text); background: none; opacity: 0.75; transition: background .15s ease, opacity .15s ease; }
    .bw-tray-tab:hover { opacity: 1; background: rgba(127, 127, 127, 0.18); }
    .bw-tray-tab:focus-visible { outline: 2px solid #864cff; outline-offset: 2px; }
    .bw-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; }
    .bw-tray-mini .bw-tray-tab { margin-bottom: 4px; }
        .bw-tray-mini .bw-tray-tab i { margin-top: 4px; transform: rotate(-135deg); }
/* Folded: the pictures alone, four across, and the two tools as pictures too. */
.bw-tray-mini #bwMats { grid-template-columns: repeat(4, 1fr); gap: 4px; }
.bw-tray-mini #bwMats .bw-tower-btn { padding: 6px 0 3px; border-radius: 10px; box-shadow: inset 0 3px 0 var(--bw-mark); }
    .bw-tray-mini #bwMats .bw-tower-btn.bw-on { box-shadow: inset 0 3px 0 var(--bw-mark), 0 0 0 2px color-mix(in srgb, var(--bw-mark) 45%, transparent); }
    .bw-tray-mini #bwMats .bw-tower-btn .bw-mat-pic { width: 32px; height: 30px; margin: 0; }
.bw-tray-mini #bwMats .bw-tower-name, .bw-tray-mini #bwMats .bw-tower-role, .bw-tray-mini #bwMats .bw-cost, .bw-tray-mini #bwMats .bw-tower-key { display: none; }
#bwTray.bw-tray-mini .bw-mat-info { display: none !important; }
.bw-tray-mini .bw-tools .bw-tower-btn { font-size: 0; gap: 0; padding: 5px 4px; }
@media (hover: none) { #bwMats .bw-tower-key { display: none; } }
@media screen and (min-width: 561px) and (min-height: 521px) {
    .bw-left { bottom: 10px; }
    #bwButtons { order: -1; flex: none; }
    .bw-tray { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; overflow: hidden; }
    #bwMats { 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; }
    .bw-tools { flex: none; }
    .bw-mat-info { flex: none; box-sizing: border-box; height: 128px; overflow: hidden; }
        .bw-mat-info-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
}
@media screen and (min-width: 561px) and (min-height: 521px) and (max-height: 700px) {
    /* A wide screen that isn't tall: lower cards, and the strip gives the name and the numbers only. */
    #bwMats { gap: 4px; }
    #bwMats .bw-tower-btn { padding: 6px 4px 4px; }
        #bwMats .bw-tower-btn .bw-mat-pic { width: 38px; height: 34px; }
    #bwMats .bw-tower-role { display: none; }
    #bwMats .bw-cost { margin-top: 2px; }
    .bw-mat-info { height: 62px; }
        .bw-mat-info-text { display: none; }
}
@media screen and (max-width: 560px), screen and (max-height: 520px) {
    /* Along the foot of the scene: one row of narrower cards, no word under the name, no key. The strip floats
       just above the tray, where it takes no room, and only while the tray is open. The tab is a small handle
       standing on the tray's top left corner. */
    #bwMats { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 4px; }
    #bwMats .bw-tower-btn { flex: 0 0 60px; padding: 6px 2px 4px; border-radius: 12px; }
        #bwMats .bw-tower-btn .bw-mat-pic { width: 38px; height: 34px; margin: 0; }
    #bwMats .bw-tower-name { font-size: 11.5px; }
    #bwMats .bw-tower-role, #bwMats .bw-tower-key { display: none; }
    #bwMats .bw-cost { margin: 2px 0 0; padding: 0 7px 0 5px; font-size: 11.5px; }
    .bw-mat-info { position: absolute; left: 96px; right: auto; bottom: calc(100% + 6px); display: block; box-sizing: border-box; width: max-content; max-width: calc(100vw - 118px); overflow: hidden; margin: 0; padding: 3px 8px; border-left-width: 3px; font-size: 11.5px; white-space: normal; background: var(--bw-plate-solid); box-shadow: var(--bw-plate-shadow); pointer-events: none; }
        .bw-mat-info-name { margin-right: 7px; font-size: 12px; }
        .bw-mat-info-text { display: none; }
        .bw-mat-info-stats { display: inline; }
    .bw-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(--bw-plate-solid); box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.12); }
        .bw-tray-tab:hover { background: var(--bw-plate-solid); }
        .bw-tray-mini .bw-tray-tab { margin: 0; }
    .bw-tray-mini #bwMats { display: flex; gap: 3px; }
    .bw-tray-mini #bwMats .bw-tower-btn { flex: 0 0 44px; padding: 5px 0 4px; }
        .bw-tray-mini #bwMats .bw-tower-btn .bw-mat-pic { width: 30px; height: 28px; }
    .bw-tray-mini .bw-tools .bw-tower-btn { min-width: 36px; }
}
@media (prefers-reduced-motion: reduce) { #bwMats .bw-tower-btn, .bw-tray-tab, .bw-tray-tab i { transition: none; } #bwMats .bw-tower-btn:hover { transform: none; } }

/* On a phone the tray is as wide as what is in it, and no wider than the screen - not the full width whatever
   it holds (a level with two pieces left most of it empty). It sits in the middle of the foot of the scene. */
@media screen and (max-width: 560px) {
    .bw-tray { left: 8px; right: 8px; width: -moz-fit-content; width: fit-content; max-width: calc(100% - 16px); margin: 0 auto; }
    #bwMats { flex: 0 1 auto; min-width: 0; }
    #bwMats .bw-tower-btn { flex: 0 1 60px; }
}

/* ...and the strip floats over the middle of it, above the tab, no wider than the screen - so it stays on the
   screen however narrow the tray is. */
@media screen and (max-width: 560px) {
    .bw-mat-info { left: 50%; right: auto; bottom: calc(100% + 30px); max-width: calc(100vw - 16px); transform: translateX(-50%); text-align: center; }
}
