/*
 * Case simulator, /cs2-case-simulator/ only (template-case-sim.php; loaded in functions.php). Our own look in the site's
 * tokens; item colours (--rc) are the skins' CS2 rarity colours from the presets, or a value tier for "Your own case".
 * Phone first. Motion: transform/opacity (plus a short blur while the reel is fast); the floating case and the rays
 * start only when the script adds .is-live, and prefers-reduced-motion turns all of it off (global rule in style.css;
 * the script also skips the spin and the particles).
 */
.sim { --rc: #8b8e95; --case-glow: #4f7dff; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 20px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--s1); }
/* Case cards (dake_sim_case_cards(), here and on the bonus case list): a row that snaps card by card; on phones one
   card and a bit of the next, on wider screens arrows (assets/sim/cases.js). The case art sits in a fixed box. */
.cases { display: grid; gap: 10px; min-width: 0; }
.cases__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cases__title { margin: 0; color: var(--heading); font: 700 18px/1.25 var(--font-ui); }
.cases__nav { display: none; gap: 6px; }
.cases__arrow { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--s2); color: var(--text); cursor: pointer; transition: border-color var(--t), opacity var(--t); }
.cases__arrow .icon { width: 16px; height: 16px; }
.cases__arrow--prev .icon { transform: scaleX(-1); }
.cases__arrow:hover { border-color: var(--text-3); }
.cases__arrow:disabled { opacity: .35; cursor: default; }
.cases__row { position: relative; display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; scroll-padding: 0 2px; scrollbar-width: none; overscroll-behavior-x: contain; }
.cases__row::-webkit-scrollbar { display: none; }
.case-card { --tc: var(--text-3); position: relative; flex: 0 0 76%; display: grid; grid-template-rows: auto auto 1fr auto; gap: 8px; padding: 12px; scroll-snap-align: start; border: 1px solid color-mix(in srgb, var(--tc) 32%, var(--line)); border-radius: var(--r-3); background: radial-gradient(80% 55% at 50% 42%, color-mix(in srgb, var(--tc) 18%, transparent), transparent 76%), var(--s2); transition: border-color var(--t), box-shadow var(--t); }
.sim .case-card { cursor: pointer; }
.case-card:hover { border-color: color-mix(in srgb, var(--tc) 65%, var(--line)); }
.case-card.is-on { border-color: var(--tc); box-shadow: 0 0 0 1px var(--tc), 0 0 22px color-mix(in srgb, var(--tc) 38%, transparent); }
.case-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.case-card__name { margin: 0; overflow: hidden; color: var(--heading); font: 700 16px/1.25 var(--font-ui); text-overflow: ellipsis; white-space: nowrap; }
.case-card__lv { flex: none; padding: 3px 7px; border-radius: var(--r-1); background: color-mix(in srgb, var(--tc) 22%, var(--s1)); color: color-mix(in srgb, var(--tc) 55%, #fff); font: 700 11px/1.2 var(--font-ui); letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.case-card__art { display: flex; align-items: center; justify-content: center; height: 128px; }
.case-card__art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .55)); }
.case-card__line { display: -webkit-box; min-height: 2.7em; overflow: hidden; color: var(--text-2); font-size: 12.5px; line-height: 1.35; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.case-card__cta { display: flex; align-items: center; gap: 10px; }
.case-card__btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 10px; border: 1px solid color-mix(in srgb, var(--tc) 55%, var(--line-2)); border-radius: var(--r-2); background: color-mix(in srgb, var(--tc) 14%, var(--s1)); color: var(--heading); font: 600 14px/1 var(--font-ui); text-decoration: none; cursor: pointer; transition: background-color var(--t), border-color var(--t); }
.case-card__btn:hover { background: color-mix(in srgb, var(--tc) 26%, var(--s1)); }
.case-card.is-on .case-card__btn { border-color: var(--tc); background: var(--tc); color: #0b0b0d; }
.case-card__link { flex: none; color: var(--text-2); font-size: 13px; }
.case-card__btn:focus-visible, .case-card__link:focus-visible, .cases__arrow:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (min-width: 640px) {
	.cases__nav:not([hidden]) { display: flex; }
	.case-card { flex-basis: 214px; }
	.case-card__art { height: 136px; }
}
.sim__sound { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 38px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: transparent; color: var(--text-2); cursor: pointer; transition: color var(--t), border-color var(--t); }
.sim__sound svg { width: 20px; height: 20px; }
.sim__sound .is-off, .sim__sound[aria-pressed="false"] .is-on { display: none; }
.sim__sound[aria-pressed="false"] .is-off { display: block; }
.sim__sound:hover { border-color: var(--text-3); color: var(--text); }
.sim__own { display: grid; gap: 14px; padding: 14px; border-radius: var(--r-2); background: var(--s2); }
.sim__own[hidden] { display: none; }
.sim__own .sim__btn { justify-self: start; }

/* The case before an opening, then the drop. Fixed height: the reveal moves nothing below it.
   Case art: the owner's ChatGPT art (assets/sim/case.webp, case-open.webp, 20 Oct 2026). The open crate is drawn at its measured share of the closed one's width
   and shift (--open-w, --open-x, --open-y from inc/case-sim-art.json), so both stand on the same base. */
.sim__hero { --case-w: 200px; position: relative; isolation: isolate; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; height: 296px; padding: 36px 12px 14px; overflow: hidden; border-radius: var(--r-2); background: radial-gradient(70% 62% at 50% 46%, color-mix(in srgb, var(--rc) 30%, transparent), transparent 72%), linear-gradient(180deg, var(--s2), var(--bg)); text-align: center; }
.sim__hero.has-art { --rc: var(--case-glow); }
.sim__badge { position: absolute; z-index: 4; top: 10px; left: 10px; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: var(--r-1); background: color-mix(in srgb, var(--bg) 72%, transparent); color: var(--text); font: 700 11px/1 var(--font-ui); letter-spacing: .07em; text-transform: uppercase; }
.sim__pic { position: relative; z-index: 2; width: 100%; height: 100%; min-height: 0; }
.sim__box, .sim__drop { position: absolute; inset: 0; transition: opacity .35s ease, transform .35s ease; }
.sim__box { transform-origin: 50% 92%; }
.sim__box::before { content: ""; position: absolute; left: 50%; bottom: 4%; width: calc(var(--case-w) * 1.2); height: 72%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--rc) 50%, transparent), transparent); opacity: .5; }
.sim__case { position: absolute; bottom: 0; left: 50%; width: var(--case-w); height: auto; transform: translateX(-50%); transform-origin: 50% 100%; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .6)); transition: opacity .3s ease; }
.sim__case--open { width: calc(var(--case-w) * var(--open-w, .959)); transform: translate(var(--open-x, -47.7%), var(--open-y, 0%)); opacity: 0; }
.sim__case--skin { top: 50%; bottom: auto; width: auto; max-width: min(300px, 88%); max-height: 100%; transform: translate(-50%, -50%); }
.sim__hero[data-state="opening"] .sim__case--closed { opacity: 0; }
.sim__hero[data-state="opening"] .sim__case--open { opacity: 1; animation: sim-open .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.sim__hero[data-state="win"] .sim__box { opacity: 0; transform: scale(.9); }
.sim__drop { display: flex; align-items: center; justify-content: center; opacity: 0; }
.sim__hero[data-state="win"] .sim__drop { opacity: 1; }
.sim__drop img, .sim__drop svg { display: block; width: auto; max-width: min(300px, 88%); height: auto; max-height: 100%; object-fit: contain; color: var(--rc); filter: drop-shadow(0 0 22px color-mix(in srgb, var(--rc) 75%, transparent)) drop-shadow(0 12px 16px rgba(0, 0, 0, .5)); }
.sim__drop svg { width: 150px; }
.sim__hero.is-pop .sim__drop > * { animation: sim-pop .65s cubic-bezier(.2, 1.5, .4, 1) both; }
.sim.is-live .sim__hero[data-state="case"] .sim__box { animation: sim-float 4.5s ease-in-out infinite; }
.sim.is-live .sim__hero[data-state="case"] .sim__box::before { animation: sim-glow 3s ease-in-out infinite; }
.sim.is-live .sim__hero .sim__box.is-shake, .sim .sim__box.is-shake { animation: sim-shake .45s ease-in-out both; }
.sim__flash { position: absolute; z-index: 3; left: 50%; bottom: 18%; width: 340px; height: 300px; margin-left: -170px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, .95), color-mix(in srgb, var(--case-glow) 65%, transparent) 42%, transparent 74%); opacity: 0; pointer-events: none; }
.sim__hero[data-state="opening"] .sim__flash { animation: sim-flash .7s ease-out both; }
.sim__say { position: relative; z-index: 2; display: grid; gap: 4px; justify-items: center; max-width: 100%; min-width: 0; }
.sim__rarity { padding: 3px 8px; border-radius: var(--r-1); background: color-mix(in srgb, var(--rc) 24%, transparent); color: color-mix(in srgb, var(--rc) 55%, #fff); font: 700 11px/1.2 var(--font-ui); letter-spacing: .07em; text-transform: uppercase; }
.sim__name { max-width: 100%; overflow: hidden; color: var(--heading); font: 700 20px/1.2 var(--font-ui); text-overflow: ellipsis; white-space: nowrap; }
.sim__meta { color: var(--text-2); font-size: 13px; line-height: 1.4; }
.sim__rays { position: absolute; z-index: 1; left: 50%; top: 40%; width: 680px; height: 680px; margin: -340px 0 0 -340px; border-radius: 50%; background: repeating-conic-gradient(color-mix(in srgb, var(--rc) 30%, transparent) 0deg 6deg, transparent 6deg 20deg); -webkit-mask: radial-gradient(closest-side, #000 14%, transparent 70%); mask: radial-gradient(closest-side, #000 14%, transparent 70%); opacity: .4; pointer-events: none; transition: opacity .5s; }
.sim.is-live .sim__rays { animation: sim-spin 30s linear infinite; }
.sim__hero[data-state="case"] .sim__rays { opacity: .28; }
.sim__hero[data-state="opening"] .sim__rays { opacity: .9; animation-duration: 5s; }
.sim__hero[data-state="win"] .sim__rays { opacity: .2; }
.sim__hero.is-epic .sim__rays { opacity: 1; animation-duration: 9s; }
.sim__burst { position: absolute; z-index: 3; left: 50%; top: 40%; width: 0; height: 0; pointer-events: none; }
.sim__burst i { position: absolute; left: 0; top: 0; width: var(--s); height: calc(var(--s) * .6); margin: calc(var(--s) / -2); border-radius: 2px; background: var(--c); animation: sim-burst 1.15s cubic-bezier(.12, .7, .3, 1) var(--d) both; }

/* The reel */
.sim__stage { position: relative; overflow: hidden; padding: 12px 0; border-radius: var(--r-2); background: var(--bg); }
.sim__stage::before, .sim__stage::after { content: ""; position: absolute; z-index: 2; top: 0; bottom: 0; width: 13%; pointer-events: none; }
.sim__stage::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.sim__stage::after { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }
.sim__track { display: flex; gap: 8px; width: max-content; padding: 0 8px; will-change: transform; }
.sim__track.is-in { animation: sim-fade .35s ease-out both; }
.sim__track.is-blur-1 { filter: blur(1px); }
.sim__track.is-blur-2 { filter: blur(2.5px); }
.sim__tile { position: relative; flex: none; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; justify-items: center; width: 118px; height: 146px; padding: 8px 6px 13px; border: 1px solid var(--line); border-radius: var(--r-2); background: radial-gradient(85% 70% at 50% 42%, color-mix(in srgb, var(--rc) 36%, transparent), transparent 74%), linear-gradient(180deg, var(--s2), var(--s1)); text-align: center; }
.sim__tile::after, .sim__card::after, .sim__mini::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: 5px; height: 3px; border-radius: 2px; background: var(--rc); box-shadow: 0 0 10px var(--rc); }
.sim__tile img, .sim__tile svg { align-self: center; width: 100%; height: 100%; max-height: 80px; object-fit: contain; color: var(--rc); }
.sim__coins { filter: drop-shadow(0 0 10px color-mix(in srgb, #e4ae39 55%, transparent)); }
.sim__tile span { max-width: 100%; overflow: hidden; color: var(--text-3); font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.sim__tile b { max-width: 100%; overflow: hidden; color: var(--text); font-size: 12.5px; font-weight: 600; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.sim__tile.is-win { z-index: 1; border-color: var(--rc); box-shadow: 0 0 0 1px var(--rc), 0 0 28px color-mix(in srgb, var(--rc) 70%, transparent); animation: sim-pop .55s cubic-bezier(.2, 1.5, .4, 1) both; }
.sim__line { position: absolute; z-index: 3; top: 3px; bottom: 3px; left: 50%; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--heading); box-shadow: 0 0 12px 2px color-mix(in srgb, var(--heading) 50%, transparent); }
.sim__line::before, .sim__line::after { content: ""; position: absolute; left: -6px; border: 7px solid transparent; }
.sim__line::before { top: -3px; border-top-color: var(--heading); }
.sim__line::after { bottom: -3px; border-bottom-color: var(--heading); }

/* Buttons: one big light "Open case" (never the Claim accent), then small secondary controls */
.sim__controls { display: grid; gap: 10px; justify-items: center; }
.sim__btn { min-height: 46px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--s3); color: var(--heading); font: 600 15px/1 var(--font-ui); cursor: pointer; transition: border-color var(--t), background-color var(--t), transform var(--t); }
.sim__btn:hover { border-color: var(--text-3); }
.sim__btn:active { transform: translateY(1px); }
.sim__btn--main { width: 100%; max-width: 440px; min-height: 56px; border-color: var(--heading); background: var(--heading); color: var(--bg); font-size: 18px; letter-spacing: .01em; }
.sim__btn--main:hover { background: var(--text); }
.sim__more { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sim__btn--small { min-height: 38px; padding: 0 12px; font-size: 14px; }
.sim__btn--quiet { background: transparent; color: var(--text-2); font-weight: 400; }
.sim__btn:disabled, .case-card__btn:disabled { opacity: .5; cursor: default; }
.sim__btn:focus-visible, .sim__sound:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Open 10 / Open 100: the drops as mini cards */
.sim__batch { display: grid; gap: 10px; }
.sim__batch[hidden] { display: none; }
.sim__batch-sum { color: var(--text-2); font-size: 14px; }
.sim__batch-sum b { color: var(--heading); }
.sim__minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.sim__mini { position: relative; display: grid; justify-items: center; gap: 1px; padding: 6px 4px 11px; border: 1px solid var(--line); border-radius: var(--r-2); background: radial-gradient(85% 70% at 50% 40%, color-mix(in srgb, var(--rc) 32%, transparent), transparent 76%), var(--s2); color: var(--text-2); font-size: 11px; line-height: 1.3; animation: sim-in .35s ease-out both; animation-delay: calc(var(--i, 0) * 40ms); }
.sim__mini img, .sim__mini svg { width: 100%; height: 46px; object-fit: contain; color: var(--rc); }
.sim__mini b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.sim__mini em { position: absolute; top: 3px; right: 4px; color: var(--heading); font-style: normal; font-weight: 700; }

.sim__stats { padding: 0 14px 2px; border-radius: var(--r-2); background: var(--s2); }
.sim__stats .calc__rows div:first-child { border-top: 0; }

/* Items in this case: like a case page, by value */
.sim__h { margin: 6px 0 0; color: var(--heading); font: 700 19px/1.25 var(--font-ui); }
.sim__items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.sim__card { position: relative; display: grid; justify-items: center; gap: 1px; padding: 22px 8px 15px; border: 1px solid var(--line); border-radius: var(--r-2); background: radial-gradient(85% 65% at 50% 36%, color-mix(in srgb, var(--rc) 32%, transparent), transparent 76%), linear-gradient(180deg, var(--s2), var(--s1)); text-align: center; }
.sim__card img, .sim__card svg { width: 100%; height: auto; aspect-ratio: 4 / 3; max-height: 96px; object-fit: contain; color: var(--rc); }
.sim__card-p { position: absolute; top: 6px; right: 8px; color: var(--text-2); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.sim__card-n { position: absolute; top: 5px; left: 6px; padding: 2px 6px; border-radius: var(--r-1); background: var(--rc); color: #0b0b0d; font: 700 11.5px/1.3 var(--font-ui); }
.sim__card-n[hidden] { display: none; }
.sim__card-w { color: var(--text-3); font-size: 11.5px; }
.sim__card-s { color: var(--text); font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.sim__card-v { color: var(--heading); font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sim__card-r { color: color-mix(in srgb, var(--rc) 60%, #fff); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.sim__odds { color: var(--text-2); font-size: 14px; }

@media (min-width: 640px) {
	.sim { gap: 14px; padding: 16px; }
	.sim__hero { --case-w: 270px; height: 340px; }
	.sim__drop img { max-width: min(360px, 80%); }
	.sim__tile { width: 138px; height: 166px; }
	.sim__tile img { max-height: 98px; }
	.sim__items { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.sim__minis { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}
@media (min-width: 900px) {
	.sim { padding: 24px; }
	.sim__hero { --case-w: 300px; height: 380px; }
	.sim__name { font-size: 24px; }
}

@keyframes sim-float { 50% { transform: translateY(-7px); } }
@keyframes sim-glow { 50% { opacity: .85; transform: translateX(-50%) scale(1.06); } }
@keyframes sim-shake { 0%, 100% { transform: none; } 15% { transform: translateX(-4px) rotate(-3deg); } 30% { transform: translateX(4px) rotate(3deg); } 45% { transform: translateX(-3px) rotate(-2deg); } 60% { transform: translateX(3px) rotate(2deg); } 80% { transform: translateX(-1px) rotate(-1deg); } }
@keyframes sim-open { 0% { transform: translate(var(--open-x, -47.7%), var(--open-y, 0%)) scale(.88); opacity: .2; } 55% { transform: translate(var(--open-x, -47.7%), var(--open-y, 0%)) scale(1.07); opacity: 1; } 100% { transform: translate(var(--open-x, -47.7%), var(--open-y, 0%)) scale(1); opacity: 1; } }
@keyframes sim-flash { 0% { transform: scale(.4); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes sim-fade { from { opacity: .2; } }
@keyframes sim-pop { 0% { transform: scale(.8); } 60% { transform: scale(1.1); } 100% { transform: scale(1.03); } }
@keyframes sim-spin { to { transform: rotate(1turn); } }
@keyframes sim-burst { 0% { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; } 100% { transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(.5); opacity: 0; } }
@keyframes sim-in { from { transform: translateY(6px) scale(.94); opacity: 0; } }

/* Bonus case list (template-bonus-cases.php): the same cards, plus the summary, the averages as bars and the notes. */
.sim__card-t { color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.bc-name { display: inline-flex; align-items: center; gap: 8px; color: var(--heading); font-weight: 600; }
.bc-name::before, .bc-case > h2::before, .bc-bar__name::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--tc); box-shadow: 0 0 10px var(--tc); }
.bc-sub { margin: 28px 0 10px; color: var(--heading); font: 600 17px/1.3 var(--font-ui); }
.bc-bars { display: grid; gap: 10px; margin: 0 0 10px; padding: 0; list-style: none; }
.bc-bar { display: grid; grid-template-columns: 7.2em minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 14px; }
.bc-bar__name { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.bc-bar__track { height: 12px; overflow: hidden; border-radius: 6px; background: var(--s2); }
.bc-bar__track span { display: block; height: 100%; border-radius: 6px; background: var(--tc); box-shadow: 0 0 12px color-mix(in srgb, var(--tc) 55%, transparent); }
.bc-bar__v { min-width: 8.5em; color: var(--heading); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.bc-case > h2 { display: flex; align-items: center; gap: 12px; }
.bc-meta { margin: 4px 0 14px; color: var(--text-2); font-size: 14px; }
.bc-items { margin-bottom: 14px; }
.bc-notes { margin: 8px 0 0; padding-left: 18px; }
.bc-case .sim-link, .wrap > .sim-link { margin-top: 10px; }
@media (max-width: 639px) {
	.bc-bar { grid-template-columns: 6em minmax(0, 1fr); }
	.bc-bar__v { grid-column: 2; min-width: 0; text-align: left; font-size: 13px; }
}
.intro + .cases { margin-top: 24px; }

/* Owner, 20 Oct 2026: the case art, reel, skin tiles and cards can't be selected or dragged, so a swipe on a phone
   never starts an image drag. Links ("What’s inside") stay selectable, and so does the text of the page sections. */
.sim__hero, .sim__stage, .case-card, .sim__card, .sim__mini, .bt__lanes, .sim__modes, .bt__seg { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none; }
.sim__hero img, .sim__stage img, .case-card img, .sim__card img, .sim__mini img, .bt__lanes img { -webkit-user-drag: none; }
.case-card__link { -webkit-user-select: text; user-select: text; }

/* Case battle (owner, 20 Oct 2026; Google: "case battle simulator", "cs2 case battle demo"): the mode switch, the
   settings, a lane per player and the result. Phones: stacked lanes with the usual sideways reel; 640 px and up: a
   column per player with a vertical reel, like battle sites. Lane colour --pc: you blue, bots their own; teams by side. */
.sim__modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--bg); }
.sim__modes[hidden] { display: none; }
.sim__mode { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-2); background: transparent; color: var(--text-2); font: 600 15px/1 var(--font-ui); cursor: pointer; transition: background-color var(--t), color var(--t); }
.sim__mode svg { flex: none; width: 22px; height: 20px; }
.sim__mode:hover { color: var(--heading); }
.sim__mode[aria-pressed="true"] { background: var(--s3); color: var(--heading); box-shadow: inset 0 0 0 1px var(--line-2); }
.sim__mode:disabled { opacity: .5; cursor: default; }
.sim__mode:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sim.is-battle .sim__hero, .sim.is-battle .sim__stage, .sim.is-battle .sim__controls, .sim.is-battle .sim__batch, .sim.is-battle .sim__stats { display: none; }

.bt { --gold: #e9b44c; position: relative; display: grid; gap: 12px; padding: 12px; border-radius: var(--r-2); background: radial-gradient(90% 50% at 50% 0%, color-mix(in srgb, var(--case-glow) 16%, transparent), transparent 72%), linear-gradient(180deg, var(--s2), var(--bg)); }
.bt[hidden] { display: none; }
.bt__setup { display: grid; gap: 10px; }
.bt__opt { display: grid; gap: 5px; min-width: 0; }
.bt__label { color: var(--text-2); font-size: 13px; }
.bt__seg { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--bg); }
.bt__seg button { flex: 1; min-width: 0; min-height: 38px; padding: 0 6px; border: 0; border-radius: calc(var(--r-2) - 2px); background: transparent; color: var(--text-2); font: 600 14px/1 var(--font-ui); font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; transition: background-color var(--t), color var(--t); }
.bt__seg button:hover { color: var(--heading); }
.bt__seg button[aria-pressed="true"] { background: var(--heading); color: var(--bg); }
.bt__seg button:disabled { opacity: .5; cursor: default; }
.bt__seg button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.bt__go { display: grid; justify-items: center; }
.bt[data-state="end"] .bt__go { display: none; } /* the result has its own "Battle again" */
.bt__bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.bt__title { color: var(--heading); font: 700 16px/1.3 var(--font-ui); }
.bt__badge { margin-top: 3px; color: var(--text-3); font: 700 10.5px/1.3 var(--font-ui); letter-spacing: .07em; text-transform: uppercase; }
.bt__status { display: flex; align-items: center; gap: 14px; color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.bt__round { display: inline-flex; align-items: center; gap: 8px; }
.bt__dots { display: inline-flex; gap: 4px; }
.bt__dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); transition: background-color .3s, box-shadow .3s; }
.bt__dots i.is-done { background: var(--text-2); }
.bt__dots i.is-on { background: var(--case-glow); box-shadow: 0 0 8px var(--case-glow); }
.bt__pot b { color: var(--heading); }

.bt__lanes { display: grid; gap: 14px; }
.bt__lane { --pc: #4f7dff; position: relative; display: grid; grid-template-columns: 26px auto minmax(0, 1fr) auto; grid-template-areas: "ava name got total" "reel reel reel reel"; align-items: center; gap: 6px 8px; min-width: 0; padding: 8px; border: 1px solid color-mix(in srgb, var(--pc) 30%, var(--line)); border-radius: var(--r-2); background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 12%, var(--s1)), var(--s1) 60%); transition: opacity .45s, filter .45s, border-color .3s, box-shadow .3s; }
.bt__lane + .bt__lane::before { content: "VS"; position: absolute; z-index: 4; top: -18px; left: 50%; width: 30px; height: 22px; margin-left: -15px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--s3); color: var(--text-2); font: 800 10.5px/20px var(--font-ui); letter-spacing: .04em; text-align: center; }
.bt.is-teams .bt__lane:nth-child(2)::before, .bt.is-teams .bt__lane:nth-child(4)::before { content: none; }
.bt__ava { grid-area: ava; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--pc) 32%, var(--s2)); color: color-mix(in srgb, var(--pc) 35%, #fff); }
.bt__ava svg { width: 16px; height: 16px; }
.bt__name { grid-area: name; color: var(--heading); font: 600 14px/1.15 var(--font-ui); white-space: nowrap; }
.bt__name small { display: block; color: var(--text-3); font-size: 11px; font-weight: 400; }
.bt__total { grid-area: total; color: var(--heading); font: 700 15px/1 var(--font-ui); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.bt__total.is-up { animation: bt-up .5s cubic-bezier(.2, 1.5, .4, 1); }
.bt__got { grid-area: got; display: flex; justify-content: flex-end; gap: 3px; min-width: 0; margin: 0; padding: 0; overflow: hidden; list-style: none; }
.bt__got li { position: relative; flex: none; width: 30px; height: 24px; border-radius: 4px; background: radial-gradient(closest-side, color-mix(in srgb, var(--rc) 50%, transparent), transparent); animation: sim-in .35s ease-out both; }
.bt__got img, .bt__got svg { display: block; width: 100%; height: 100%; object-fit: contain; color: var(--rc); }
.bt__got b { display: none; }
.bt__reel { grid-area: reel; position: relative; height: 96px; overflow: hidden; border-radius: var(--r-2); background: var(--bg); }
.bt__reel::before, .bt__reel::after { content: ""; position: absolute; z-index: 2; top: 0; bottom: 0; width: 14%; pointer-events: none; }
.bt__reel::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.bt__reel::after { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }
.bt__track { display: flex; gap: 6px; width: max-content; padding: 6px; will-change: transform; }
.bt__track.is-blur-1 { filter: blur(1px); }
.bt__track.is-blur-2 { filter: blur(2px); }
.sim__tile.bt__tile { grid-template-rows: minmax(0, 1fr) auto; width: 80px; height: 84px; padding: 5px 4px 11px; }
.bt__tile img, .bt__tile svg { max-height: 52px; }
.bt__tile b { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.bt__mark { position: absolute; z-index: 3; top: 3px; bottom: 3px; left: 50%; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--heading); box-shadow: 0 0 10px 2px color-mix(in srgb, var(--heading) 45%, transparent); }
.bt__lane.is-win { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 26px color-mix(in srgb, var(--gold) 35%, transparent); }
.bt__lane.is-win::after { content: "Winner"; position: absolute; z-index: 5; top: -10px; right: 10px; padding: 3px 8px; border-radius: var(--r-1); background: var(--gold); color: #0b0b0d; font: 800 10px/1.3 var(--font-ui); letter-spacing: .07em; text-transform: uppercase; box-shadow: 0 4px 14px color-mix(in srgb, var(--gold) 45%, transparent); }
.bt__lane.is-lost { opacity: .5; filter: saturate(.4); }

.bt__end { --end: var(--text-3); position: relative; display: grid; gap: 8px; justify-items: center; overflow: hidden; padding: 18px 14px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: radial-gradient(70% 90% at 50% 0%, color-mix(in srgb, var(--end) 22%, transparent), transparent 72%), var(--s1); text-align: center; animation: sim-in .4s ease-out both; }
.bt__end[hidden] { display: none; }
.bt.is-you-won .bt__end { --end: var(--gold); border-color: color-mix(in srgb, var(--gold) 60%, var(--line-2)); }
.bt__end-tag { padding: 3px 8px; border-radius: var(--r-1); background: color-mix(in srgb, var(--end) 24%, transparent); color: color-mix(in srgb, var(--end) 55%, #fff); font: 700 11px/1.2 var(--font-ui); letter-spacing: .07em; text-transform: uppercase; }
.bt__end-title { color: var(--heading); font: 800 24px/1.15 var(--font-ui); }
.bt.is-you-won .bt__end-title { color: var(--gold); text-shadow: 0 0 22px color-mix(in srgb, var(--gold) 45%, transparent); }
.bt__end-pot { color: var(--text-2); font-size: 14px; }
.bt__end-pot b { color: var(--heading); }
.bt__end .sim__minis { display: flex; flex-wrap: wrap; justify-content: center; width: 100%; }
.bt__end .sim__mini { width: 78px; }
.bt__end-note { max-width: 62ch; color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.bt__end .sim__btn { margin-top: 4px; }
.bt__burst { top: 24%; }
.bt__record { color: var(--text-2); font-size: 13.5px; line-height: 1.45; text-align: center; }
.bt__record[hidden] { display: none; }

@media (min-width: 640px) {
	.bt { gap: 14px; padding: 16px; }
	.bt__setup { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; }
	.bt__opt { display: flex; align-items: center; gap: 8px; }
	.bt__seg button { flex: none; min-width: 46px; padding: 0 12px; }
	.bt__lanes { grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 14px; }
	.bt__lane { grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: "ava name total" "reel reel reel" "got got got"; align-content: start; padding: 10px; }
	.bt__lane + .bt__lane::before { top: 12px; left: -22px; margin-left: 0; }
	.bt__ava { width: 28px; height: 28px; }
	.bt__name { overflow: hidden; text-overflow: ellipsis; }
	.bt__reel { height: 290px; }
	.bt__reel::before, .bt__reel::after { left: 0; right: 0; width: auto; height: 22%; }
	.bt__reel::before { top: 0; bottom: auto; background: linear-gradient(180deg, var(--bg), transparent); }
	.bt__reel::after { top: auto; bottom: 0; background: linear-gradient(0deg, var(--bg), transparent); }
	.bt__track { flex-direction: column; align-items: center; width: auto; }
	.sim__tile.bt__tile { width: min(100%, 168px); height: 100px; }
	.bt__tile img, .bt__tile svg { max-height: 64px; }
	.bt__mark { top: 50%; bottom: auto; left: 3px; right: 3px; width: auto; height: 2px; margin: -1px 0 0; }
	.bt__got { flex-wrap: wrap; justify-content: flex-start; min-height: 34px; }
	.bt__got li { width: 40px; height: 34px; }
	.bt__end-title { font-size: 28px; }
	.bt__end .sim__mini { width: 96px; }
}
@keyframes bt-up { 40% { transform: scale(1.22); color: var(--gold); } }
