/* Beasties: Bumper Cars (BumperView.swift). .bmp holds one SVG (100 units per cell, the ring around the field) and
 * an FX layer in px. PHP draws the start, beasties-bumper.js (bstBmp) moves the rides. */
.bmp { position: relative; width: 100%; }
.bmp-svg { display: block; width: 100%; height: auto; overflow: visible; }
.bmp-fx { position: absolute; inset: 0; z-index: 3; pointer-events: none; }

/* colour gates: shut while a car of their colour is around (the family monster waits under the barrier), then the
 * barrier swings up at its left post */
.bmp-gate-bg { fill-opacity: .28; stroke-opacity: .8; transition: fill-opacity .3s; }
.bmp-gate.is-open .bmp-gate-bg { fill-opacity: .12; stroke-dasharray: 6 6; }
.bmp-bar { transform-box: view-box; transform-origin: 20.9px 50px; transition: transform .5s cubic-bezier(.3, 1.45, .5, 1); }
.bmp-gate.is-open .bmp-bar { transform: rotate(-80deg); }
.bmp-gate-m { transition: opacity .25s, transform .3s; transform-box: view-box; transform-origin: 50px 90px; }
.bmp-gate.is-open .bmp-gate-m { opacity: 0; transform: scale(.4); }

/* holes: the metal bridge drops in once the button is pressed */
.bmp-bridge { opacity: 0; transform: scale(1.4); transform-box: view-box; transform-origin: 50px 50px; transition: opacity .3s, transform .45s cubic-bezier(.3, 1.4, .5, 1); }
.bmp-hole.is-on .bmp-bridge { opacity: 1; transform: none; }
.bmp-btn .is-down { display: none; }
.bmp-btn.is-on .is-up { display: none; }
.bmp-btn.is-on .is-down { display: inline; }

/* rides */
.bmp-cp { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.bmp-ride.is-mark .bmp-p { filter: drop-shadow(0 0 5px #ffd400) drop-shadow(0 0 10px rgba(255, 212, 0, .8)); animation: bmp-glow .8s ease-in-out infinite alternate; }
@keyframes bmp-glow { from { opacity: 1; } to { opacity: .82; } }

/* the way of a ride, as dots: to the edge, or up to a red cross (a crash) / a red ring (the hole) */
.bmp-rt-o, .bmp-rt { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 0 30; }
.bmp-rt-o { stroke: #0e0b1a; stroke-width: 26; }
.bmp-rt { stroke: #ffd400; stroke-width: 16; animation: bmp-march .7s linear infinite; }
.bmp-rt-o { animation: bmp-march .7s linear infinite; }
.bmp-rt-g { animation: bmp-route 2.6s ease both; }
.bmp-rt-x { transform-box: fill-box; transform-origin: center; animation: bmp-x .45s cubic-bezier(.3, 1.6, .5, 1) .25s both; }
@keyframes bmp-march { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }
@keyframes bmp-route { 0% { opacity: 0; } 12%, 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bmp-x { from { opacity: 0; scale: .3; } to { opacity: 1; scale: 1; } }

@media (prefers-reduced-motion: reduce) { .bmp *, .gx.is-bumper * { transition: none !important; animation: none !important; } }

/* a board on a card: Gnatz peeks over its top edge */
.bst-board-card.is-bumper { padding: 14px 14px 22px; }
.bmp-stage { --pw: 19%; position: relative; padding-top: calc(var(--pw) * .764); }
.bmp-stage .gx-peek { --px: .5; }
.bmp-well { position: relative; z-index: 1; }

/* ---------- the game screen ---------- */
.gx.is-bumper .gx-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; margin-top: 2px; }
.gx.is-bumper .gx-icons, .gx.is-bumper .gx-pill { margin-top: 14px; }
.gx.is-bumper .gx-title { gap: 1px; }
.gx.is-bumper .gx-stars { justify-content: center; gap: 3px; margin-top: 2px; }
.gx.is-bumper .st { width: 17px; height: 17px; }
.gx-left { margin-top: 2px; font-size: .66rem; font-weight: 600; color: #8f86b8; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bst-phone .gx-stage.is-bumper { margin-top: 14px; }
.gx-well.is-bumper { display: block; padding: 0; background: none; box-shadow: none; }
.bst-phone .gx.is-bumper .gx-bottom { margin-top: auto; margin-bottom: 18px; }
.gx-tools.is-1 { grid-template-columns: 1fr; }
.gx.is-bumper .gx-toast { top: 45%; }

/* ---------- on the site ---------- */
.bst-mini.is-bumper { background: #1a1533; }
.bst-tier.is-bumper .bst-tier-board { margin-bottom: 4px; }
.bst-fan-card.is-bumper { display: flex; }
.bmp-fan { flex: 1; display: flex; align-items: center; min-width: 0; }
.bmp-fan .bmp { flex: 1; }
.bst-how-pic .bst-scene:has(.bst-how-bmp) { grid-template-columns: 1fr; }
.bst-scene-visual:has(> .bst-how-bmp) { width: 150px; }
.bst-how-bmp { width: 100%; }
.bst-game.is-bumper .bst-game-monster { display: none; }

/* one level */
.bst-level.is-bumper { max-width: 760px; }
.bst-stk-stage.bmp-stage-lv { max-width: 470px; margin-inline: auto; padding: 0; background: none; box-shadow: none; border-radius: 0; }
.bst-level.is-bumper .bst-player figcaption, .bst-level.is-bumper .bst-player-bar { max-width: 560px; margin-inline: auto; }
.bmp-facts { list-style: none; margin: 0 auto 28px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 560px; }
.bmp-facts li { display: grid; gap: 2px; justify-items: center; text-align: center; padding: 12px 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.bmp-facts strong { font-family: var(--display); font-size: 1.7rem; line-height: 1; color: var(--text); }
.bmp-facts span { font-size: .8rem; color: var(--muted); line-height: 1.3; }
.bmp-facts .is-stars strong { display: inline-flex; gap: 2px; color: #ffd400; }
.bmp-facts .st { width: 22px; height: 22px; }
.bst-level.is-bumper .bst-move-list small { color: var(--muted); }
@media (max-width: 560px) {
	.bmp-facts { gap: 6px; }
	.bmp-facts strong { font-size: 1.4rem; }
	.bmp-facts .st { width: 17px; height: 17px; }
}
