/* Babe Battles (battles.php, ajax-battles.php, scripts/battles.js). Uses the site palette from style2020.css;
   body.lightsoff is the site's night mode. */
.bb-page, .bb-spotlight {
	--bb-accent: #b75a12;
	--bb-accent-strong: #8f450c;
	--bb-accent-soft: #fff2d8;
	--bb-card: #fffaf5;
	--bb-border: #e3d3c3;
	--bb-text: #272727;
	--bb-muted: #6b6257;
	--bb-ok: #2e7d32;
	--bb-ok-soft: #e8f3e8;
	--bb-warn: #9a5b00;
	--bb-danger: #b3261e;
	--bb-danger-soft: #fbe9e7;
	--bb-radius: 6px;
	--bb-shadow: 0 1px 3px rgba(80, 50, 20, .12);
}
.bb-page { color: var(--bb-text); max-width: 1100px; }
body.lightsoff .bb-page, body.lightsoff .bb-spotlight {
	--bb-accent: #f0a050;
	--bb-accent-strong: #ffbd78;
	--bb-accent-soft: #3a2a18;
	--bb-card: #1f1c19;
	--bb-border: #4a4238;
	--bb-text: #fffaf0;
	--bb-muted: #b8ae9f;
	--bb-ok: #7bc47f;
	--bb-ok-soft: #1f2e20;
	--bb-warn: #f0b860;
	--bb-danger: #f2938b;
	--bb-danger-soft: #3a1f1c;
	--bb-shadow: none;
}
.bb-page [hidden] { display: none !important; }
.bb-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bb-muted { color: var(--bb-muted); font-size: 13px; }
.bb-page h2 { margin: 0 0 8px; }
.bb-page h3 { margin: 16px 0 6px; font-size: 15px; }

/* Pills, buttons, alerts */
.bb-pill { white-space: nowrap; display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--bb-border); font-size: 11px; line-height: 18px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--bb-muted); background: var(--bb-card); vertical-align: middle; }
.bb-pill-admin { border-color: var(--bb-accent); color: var(--bb-accent); background: var(--bb-accent-soft); }
.bb-pill-final { border-color: var(--bb-ok); color: var(--bb-ok); background: var(--bb-ok-soft); }
.bb-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 6px 14px; border: 1px solid var(--bb-border); border-radius: var(--bb-radius); background: var(--bb-card); color: var(--bb-text); font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; box-sizing: border-box; }
.bb-button:hover { border-color: var(--bb-accent); color: var(--bb-text); }
.bb-button:focus-visible, .bb-icon-button:focus-visible, .bb-subnav a:focus-visible, .bb-tabs button:focus-visible, .bb-link-button:focus-visible { outline: 3px solid var(--bb-accent); outline-offset: 2px; }
.bb-button[disabled] { opacity: .5; cursor: not-allowed; }
.bb-button-primary { background: var(--bb-accent); border-color: var(--bb-accent); color: #fff; font-weight: 600; }
body.lightsoff .bb-button-primary { color: #1f1c19; }
.bb-button-primary:hover { background: var(--bb-accent-strong); border-color: var(--bb-accent-strong); color: #fff; }
body.lightsoff .bb-button-primary:hover { color: #1f1c19; }
.bb-button-large { min-height: 48px; padding: 10px 28px; font-size: 18px; }
.bb-button-small { min-height: 28px; padding: 2px 10px; font-size: 13px; }
.bb-button-quiet { border-color: transparent; background: transparent; color: var(--bb-accent); }
.bb-button-danger { border-color: var(--bb-danger); color: var(--bb-danger); }
.bb-key { display: inline-block; min-width: 18px; padding: 0 4px; border: 1px solid currentColor; border-radius: 3px; font-size: 11px; line-height: 16px; opacity: .7; }
.bb-icon-button { min-width: 36px; min-height: 36px; border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--bb-accent); font-size: 18px; line-height: 1; cursor: pointer; }
.bb-icon-button:hover { border-color: var(--bb-border); background: var(--bb-accent-soft); }
.bb-link-button { border: 0; padding: 4px 0; background: none; color: var(--bb-accent); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.bb-alert { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--bb-border); border-left: 4px solid var(--bb-warn); border-radius: var(--bb-radius); background: var(--bb-card); }
.bb-alert-error { border-left-color: var(--bb-danger); background: var(--bb-danger-soft); }
.bb-alert-ok { border-left-color: var(--bb-ok); background: var(--bb-ok-soft); }
.bb-feedback-note { border-left-color: var(--bb-accent); }

/* Sub navigation */
.bb-subnav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; border-bottom: 1px solid var(--bb-border); }
.bb-subnav a { padding: 8px 12px; border-bottom: 3px solid transparent; text-decoration: none; font-weight: 600; font-size: 14px; }
.bb-subnav a[aria-current="page"] { border-bottom-color: var(--bb-accent); color: var(--bb-text); }

/* Hero */
.bb-hero { position: relative; margin: 0 0 16px; padding: 18px 20px 16px; border: 1px solid var(--bb-border); border-radius: var(--bb-radius); background: var(--bb-card); box-shadow: var(--bb-shadow); }
.bb-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.bb-hero h1, .bb-vote-head h1, .bb-page-head h1 { margin: 0; line-height: 1.1; }
.bb-phase { margin: 0 0 4px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--bb-accent); }
.bb-headline { margin: 0 0 6px; font-family: "Roboto Slab", serif; font-size: 26px; line-height: 1.25; }
.bb-countdown, .bb-next { margin: 0 0 4px; font-size: 15px; }
.bb-countdown { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 8px 0; }
/* The countdown clock: tabular digits so it doesn't jitter while it ticks. */
.bb-clock { display: inline-block; padding: 2px 8px; border-radius: 4px; background: var(--bb-text); color: var(--bb-card); font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
/* The month in one line: 5,000 → 250 → 25 → 1. */
.bb-funnel { margin: 6px 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--bb-muted); }
.bb-funnel .bb-funnel-arrow { font-weight: 400; margin: 0 2px; }
.bb-funnel .bb-funnel-now { color: var(--bb-accent); }
/* "How does it work?": small, closed by default (the /contribute help box, in Battles colours). */
.bb-help { margin: 0 0 16px; border: 1px solid var(--bb-border); border-left: 4px solid var(--bb-accent); border-radius: var(--bb-radius); background: var(--bb-card); overflow: hidden; }
.bb-help summary { cursor: pointer; padding: 9px 12px; background: var(--bb-accent-soft); color: var(--bb-text); font-size: 15px; font-weight: 700; }
.bb-help summary::marker { color: var(--bb-accent); }
.bb-help-body { padding: 2px 14px 10px; }
.bb-help-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.bb-help-step { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; padding: 10px 8px; border-bottom: 1px solid var(--bb-border); }
.bb-help-step:nth-last-child(-n+2) { border-bottom: 0; }
.bb-help-icon { font-size: 20px; line-height: 1.2; text-align: center; }
.bb-help-step strong { display: block; margin-bottom: 2px; }
.bb-help-step p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--bb-muted); }
.bb-hero-actions { margin: 14px 0 0; }
.bb-stepper { display: grid; grid-template-columns: 2.2fr repeat(10, 1fr); gap: 3px; margin: 14px 0 0; padding: 0; list-style: none; }
.bb-step { padding: 4px 2px; border-radius: 3px; background: rgba(0, 0, 0, .06); text-align: center; font-size: 11px; line-height: 1.2; color: var(--bb-muted); }
body.lightsoff .bb-step { background: rgba(255, 255, 255, .08); }
.bb-step-label { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-step-field { display: block; font-variant-numeric: tabular-nums; }
.bb-step-done { background: var(--bb-accent-soft); color: var(--bb-text); }
.bb-step-current { background: var(--bb-accent); color: #fff; box-shadow: 0 0 0 2px var(--bb-accent-soft); }
/* Night mode: "body.lightsoff .bb-step" above is more specific than the state classes, so restate them. */
body.lightsoff .bb-step-done { background: var(--bb-accent-soft); color: var(--bb-text); }
body.lightsoff .bb-step-current { background: var(--bb-accent); color: #1f1c19; }
/* The step's date as a small tooltip on hover, tap (focus) or keyboard focus; edge steps align inwards. */
.bb-step { position: relative; cursor: default; }
.bb-step:focus { outline: none; }
.bb-step:focus-visible { outline: 2px solid var(--bb-accent); outline-offset: 1px; }
.bb-step::after { content: attr(data-bb-date); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5; padding: 3px 8px; border-radius: 4px; background: var(--bb-text); color: var(--bb-card); font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; }
.bb-step:first-child::after { left: 0; transform: none; }
.bb-step:last-child::after { left: auto; right: 0; transform: none; }
.bb-step:hover::after, .bb-step:focus::after { opacity: 1; }

/* Layout and cards */
.bb-lounge { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.bb-col-main, .bb-col-side { display: grid; gap: 16px; min-width: 0; }
.bb-card { padding: 14px 16px; border: 1px solid var(--bb-border); border-radius: var(--bb-radius); background: var(--bb-card); box-shadow: var(--bb-shadow); min-width: 0; }
.bb-card + .bb-card { margin-top: 0; }
.bb-page > .bb-card { margin-bottom: 16px; }
.bb-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin-bottom: 6px; }
.bb-card-head h2 { margin: 0; }
.bb-page-head { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.bb-empty { padding: 14px; border: 1px dashed var(--bb-border); border-radius: var(--bb-radius); color: var(--bb-muted); text-align: center; }
.bb-empty p { margin: 4px 0; }
.bb-meta { margin: 0 0 8px; font-size: 13px; color: var(--bb-muted); }
.bb-list { margin: 0; padding: 0; list-style: none; }
.bb-list li { padding: 5px 0; border-bottom: 1px solid var(--bb-border); }
.bb-list li:last-child { border-bottom: 0; }
.bb-progress { height: 8px; margin: 8px auto; max-width: 320px; border-radius: 4px; background: rgba(0, 0, 0, .08); overflow: hidden; }
.bb-progress span { display: block; height: 100%; background: var(--bb-accent); }
.bb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.bb-chips a, .bb-chip-disabled { padding: 4px 10px; border: 1px solid var(--bb-border); border-radius: 999px; font-size: 13px; text-decoration: none; background: var(--bb-card); color: var(--bb-text); font-family: inherit; cursor: pointer; }
.bb-chips a[aria-current="page"] { border-color: var(--bb-accent); background: var(--bb-accent-soft); font-weight: 600; }
.bb-chip-disabled { color: var(--bb-muted); cursor: default; opacity: .6; }
.bb-chips form { margin: 0; }

/* Standings */
.bb-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 8px; }
.bb-tabs button { padding: 6px 12px; border: 1px solid var(--bb-border); border-radius: 999px; background: transparent; color: var(--bb-text); font: inherit; font-size: 13px; cursor: pointer; }
.bb-tabs button[aria-selected="true"] { border-color: var(--bb-accent); background: var(--bb-accent-soft); font-weight: 600; }
.bb-tab-link { margin-left: auto; font-size: 13px; }
.bb-standings { margin: 0; padding: 0; list-style: none; }
.bb-row { display: grid; grid-template-columns: 34px 40px minmax(0, 1fr) auto 46px auto; align-items: center; gap: 8px; padding: 5px 4px; border-bottom: 1px solid var(--bb-border); }
.bb-row-roster { background: var(--bb-accent-soft); }
.bb-rank { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.bb-row-thumb { width: 40px; height: 56px; object-fit: cover; object-position: top; border-radius: 3px; background: rgba(0, 0, 0, .06); }
.bb-row-main { display: flex; flex-direction: column; min-width: 0; }
.bb-row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-row-state, .bb-nominated { font-size: 12px; color: var(--bb-muted); }
.bb-row-above .bb-row-state { color: var(--bb-ok); }
.bb-row-wildcard .bb-row-state { color: var(--bb-accent); font-weight: 600; }
.bb-row-score { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--bb-muted); }
.bb-move { font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.bb-move-up { color: var(--bb-ok); }
.bb-move-down { color: var(--bb-danger); }
.bb-move-same, .bb-move-new { color: var(--bb-muted); }
.bb-cutoff { position: relative; margin: 6px 0; border-top: 2px dashed var(--bb-accent); text-align: center; }
.bb-cutoff span { position: relative; top: -10px; padding: 0 8px; background: var(--bb-card); color: var(--bb-accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.bb-refresh-notice { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 6px 10px; border-radius: var(--bb-radius); background: var(--bb-accent-soft); font-size: 14px; }
.bb-refresh-notice[hidden] { display: none; }
.bb-filter { margin: 0 0 8px; }
.bb-filter input, .bb-search input, .bb-chat-form input, .bb-admin input[type=text], .bb-admin input[type=number], .bb-admin input[type=month], .bb-admin input[type=datetime-local], .bb-admin select { min-height: 36px; padding: 4px 8px; border: 1px solid var(--bb-border); border-radius: var(--bb-radius); background: var(--bb-card); color: var(--bb-text); font: inherit; font-size: 14px; box-sizing: border-box; }
.bb-diagnostics { margin: 0 0 10px; font-size: 13px; }
.bb-standings-notes { margin-top: 10px; }
.bb-standings-notes .bb-meta { margin: 0 0 4px; }

/* Roster */
.bb-roster { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 6px 0 10px; padding: 0; list-style: none; }
.bb-roster-card { line-height: 1.3; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; border: 1px solid var(--bb-border); border-radius: var(--bb-radius); text-align: center; font-size: 13px; min-width: 0; }
.bb-roster-photo img { width: 100%; max-width: 100px; height: auto; aspect-ratio: 5 / 7; object-fit: cover; object-position: top; border-radius: 4px; background: rgba(0, 0, 0, .06); }
.bb-roster-name { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-roster-status { font-weight: 600; font-size: 12px; }
.bb-roster-pos { font-size: 12px; color: var(--bb-muted); }
.bb-roster-cut { font-size: 12px; font-weight: 600; }
.bb-state-advancing .bb-roster-cut { color: var(--bb-ok); }
.bb-state-below_cutoff .bb-roster-cut { color: var(--bb-muted); }
.bb-state-advancing .bb-roster-status, .bb-state-advanced .bb-roster-status, .bb-state-qualified .bb-roster-status { color: var(--bb-ok); }
.bb-state-champion { border-color: var(--bb-accent); background: var(--bb-accent-soft); }
.bb-state-champion .bb-roster-status { color: var(--bb-accent); }
.bb-state-eliminated, .bb-state-not_qualified, .bb-state-withdrawn { opacity: .8; }
.bb-state-eliminated .bb-roster-photo img, .bb-state-not_qualified .bb-roster-photo img { filter: grayscale(.8); }
.bb-state-eliminated .bb-roster-status, .bb-state-not_qualified .bb-roster-status, .bb-state-below_cutoff .bb-roster-status { color: var(--bb-danger); }
.bb-roster-empty { justify-content: center; border-style: dashed; color: var(--bb-muted); }
.bb-roster-placeholder { display: flex; align-items: center; justify-content: center; width: 60px; height: 84px; border: 2px dashed var(--bb-border); border-radius: 4px; font-size: 26px; }
.bb-search { position: relative; display: grid; gap: 4px; }
.bb-search label { font-weight: 600; font-size: 14px; }
.bb-search-results { margin: 0; padding: 0; list-style: none; }
.bb-search-results li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--bb-border); }
.bb-search-results img { width: 36px; height: 50px; object-fit: cover; object-position: top; border-radius: 3px; }
.bb-search-results .bb-search-name { flex: 1; min-width: 0; }
.bb-search-results .bb-muted { display: block; }

/* Voter leaderboard */
.bb-voters { margin: 4px 0 8px; padding: 0; list-style: none; }
.bb-voter { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 4px; border-bottom: 1px solid var(--bb-border); font-size: 14px; }
.bb-voter:last-child { border-bottom: 0; }
.bb-voter-rank { text-align: center; font-variant-numeric: tabular-nums; color: var(--bb-muted); }
.bb-voter-top .bb-voter-rank { font-size: 18px; }
.bb-voter-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bb-voter-score { font-variant-numeric: tabular-nums; font-weight: 700; }
.bb-voter-me { background: var(--bb-accent-soft); border-radius: 4px; }
.bb-voter-own { margin: 6px 0 2px; font-size: 14px; }
.bb-top-voters { max-width: 460px; }

/* Chat */
.bb-chat { display: flex; flex-direction: column; }
/* A quiet chat stays small: the log grows with its messages up to 340px, then scrolls. */
.bb-chat-log { max-height: 340px; min-height: 44px; overflow-y: auto; margin: 6px 0; padding: 6px 8px; border: 1px solid var(--bb-border); border-radius: var(--bb-radius); background: rgba(0, 0, 0, .02); overscroll-behavior: contain; }
.bb-chat-msg { margin: 0 0 6px; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.bb-chat-msg .bb-chat-user { font-weight: 700; }
.bb-chat-msg time { margin-left: 4px; font-size: 11px; color: var(--bb-muted); }
.bb-chat-msg.bb-chat-own .bb-chat-user { color: var(--bb-accent); }
.bb-chat-msg.bb-chat-pending { opacity: .6; }
.bb-chat-msg.bb-chat-failed { color: var(--bb-danger); }
.bb-chat-retry { margin-left: 6px; }
.bb-chat-remove { margin-left: 8px; font-size: 11px; color: var(--bb-muted); }
.bb-chat-new { align-self: center; margin: -42px 0 8px; position: relative; z-index: 1; border: 0; border-radius: 999px; padding: 4px 12px; background: var(--bb-accent); color: #fff; cursor: pointer; font: inherit; font-size: 13px; }
.bb-chat-new[hidden] { display: none; }
.bb-chat-form { display: flex; gap: 6px; }
.bb-chat-form input { flex: 1; min-width: 0; }
.bb-chat-error { margin: 4px 0 0; color: var(--bb-danger); font-size: 13px; }

.bb-champions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13px; text-align: center; }
.bb-champions img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 7; object-fit: cover; object-position: top; border-radius: 4px; margin-bottom: 2px; }
.bb-champions a { display: block; text-decoration: none; }
.bb-checkbox { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.bb-checkbox input { width: 18px; height: 18px; margin-top: 2px; }
#battle-email { margin-top: 16px; }

/* Vote */
.bb-vote-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.bb-vote-clock { margin: 0 0 0 auto; font-size: 13px; color: var(--bb-muted); }
.bb-vote-clock .bb-clock { font-size: 14px; }
.bb-vote-context { margin: 4px 0 12px; color: var(--bb-muted); }
.bb-arena { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bb-contender { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--bb-border); border-radius: var(--bb-radius); background: var(--bb-card); box-shadow: var(--bb-shadow); min-width: 0; transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease, border-color .18s ease; }
/* The pick: the chosen card glows with a tick, the other fades (about 0.2 s, then the next matchup). */
.bb-contender.bb-picked { transform: scale(1.025); border-color: var(--bb-ok); box-shadow: 0 0 0 3px var(--bb-ok-soft), 0 0 18px rgba(46, 125, 50, .35); }
.bb-contender.bb-passed { opacity: .45; transform: scale(.98); }
.bb-picked .bb-photo-frame::after { content: "\2713"; position: absolute; left: 50%; top: 50%; z-index: 3; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: var(--bb-ok); color: #fff; font-size: 38px; line-height: 64px; text-align: center; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); animation: bb-tick .22s ease-out; }
@keyframes bb-tick { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
.bb-photo { position: relative; }
/* Sized from the viewport height so both vote buttons stay visible without scrolling. */
.bb-photo-frame { position: relative; width: min(100%, max(220px, calc((100vh - 500px) * 5 / 7))); aspect-ratio: 5 / 7; border-radius: 4px; overflow: hidden; background: rgba(0, 0, 0, .08); margin: 0 auto; }
.bb-photo-frame { cursor: zoom-in; }
.bb-photo-frame:focus-visible { outline: 3px solid var(--bb-accent); outline-offset: 2px; }
.bb-photo-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity .45s ease; }
.bb-photo-frame img.bb-active { opacity: 1; }
.bb-photo-missing { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--bb-muted); font-size: 14px; text-align: center; padding: 10px; }
.bb-photo-missing::before { content: ''; width: 64px; height: 64px; border-radius: 50%; background: rgba(0, 0, 0, .1); }
.bb-skeleton { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.05), rgba(0,0,0,.11), rgba(0,0,0,.05)); background-size: 200% 100%; animation: bb-shimmer 1.4s infinite linear; }
@keyframes bb-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.bb-photo-controls { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; gap: 2px; padding: 0 4px; border-radius: 999px; background: rgba(255, 250, 245, .85); }
body.lightsoff .bb-photo-controls { background: rgba(31, 28, 25, .85); }
.bb-photo-controls[hidden] { display: none; }
.bb-dots { display: inline-flex; gap: 4px; }
.bb-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--bb-border); }
.bb-dots i.bb-active { background: var(--bb-accent); }
.bb-contender-info { min-height: 76px; }
#content .bb-contender-name { margin: 0; font-size: 20px; line-height: 1.2; overflow-wrap: anywhere; }
.bb-profile-link { font-size: 16px; text-decoration: none; vertical-align: 1px; }
.bb-position, .bb-nominators { margin: 2px 0 0; font-size: 13px; color: var(--bb-muted); }
/* Ratings, copied from the profile page (babe.php: .ratings-row, .rating-box, .rating-user, #vote-modal) and
   scoped to the vote screen so they look identical there. The pop-up has no Submit button: a star click saves. */
.bb-vote .ratings-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin: 4px 0 0; }
/* Name, rating boxes and the position line are centred on the vote cards. */
.bb-vote .bb-contender-info, .bb-vote .bb-contender .bb-position { text-align: center; }
.bb-vote .rating-box { flex: 0 1 120px; background: floralwhite; border: 1px solid #ddd; text-align: center; padding: 0.5rem; }
body.lightsoff .bb-vote .rating-box { background: #363333; border: 1px solid #666; }
.bb-vote .rating-box strong { display: block; font-size: 1.4rem; }
.bb-vote .rating-box small { font-size: 0.8rem; color: #666; }
body.lightsoff .bb-vote .rating-box small { color: #aaa; }
.bb-vote .rating-user { cursor: pointer; transition: all 0.2s ease; position: relative; overflow: hidden; }
.bb-vote .rating-user::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); transition: left 0.5s; }
.bb-vote .rating-user:hover { background: #f0f8ff; border-color: #4a90e2; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.bb-vote .rating-user:hover::before { left: 100%; }
.bb-vote .rating-user:focus-visible { outline: 2px solid #4a90e2; outline-offset: 1px; }
.bb-vote .vote-modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); backdrop-filter: blur(3px); }
.bb-vote .vote-modal-content { background-color: floralwhite; margin: 5% auto; padding: 0; width: 90%; max-width: 600px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); animation: bb-modal-in 0.3s ease-out; overflow: hidden; }
@keyframes bb-modal-in { from { opacity: 0; transform: translateY(-50px) scale(0.9); } to { opacity: 1; transform: translateY(0) scale(1); } }
.bb-vote .vote-modal-header { background-color: #EA7728; padding: 20px; text-align: center; position: relative; }
.bb-vote .vote-modal-header h2 { margin: 0; font-size: 1.4rem; font-weight: bold; color: white !important; }
.bb-vote .close-modal { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #000; opacity: 0.6; transition: opacity 0.2s; }
.bb-vote .close-modal:hover { opacity: 1; }
.bb-vote .vote-modal-body { padding: 30px; text-align: center; }
.bb-vote .star-rating { display: flex; justify-content: center; gap: 3px; margin: 20px 0 30px; flex-wrap: wrap; }
.bb-vote .star-button { background: none; border: none; font-size: 2.5rem; cursor: pointer; color: #ddd; transition: all 0.2s ease; position: relative; padding: 5px; border-radius: 50%; }
.bb-vote .star-button:hover { transform: scale(1.2); background: rgba(245, 197, 24, 0.1); }
.bb-vote .star-button.active { color: #f5c518; text-shadow: 0 0 10px rgba(245, 197, 24, 0.5); }
.bb-vote .rating-text { font-size: 1.2rem; margin: 20px 0; height: 30px; color: #333; font-weight: 500; }
.bb-vote .vote-actions { display: flex; gap: 15px; justify-content: center; margin-top: 30px; flex-direction: column; }
/* A short pop on "Your Rating" when a rating is saved. */
.bb-star-pop { animation: bb-star-pop .35s ease-out; }
@keyframes bb-star-pop { 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.bb-button-vote { width: 100%; min-height: 52px; font-size: 17px; margin-top: auto; }
.bb-button-vote [data-bb-vote-name] { max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-vote-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 6px; }
.bb-vote-help { text-align: center; }
.bb-result { margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--bb-border); border-left: 4px solid var(--bb-ok); border-radius: var(--bb-radius); background: var(--bb-card); font-size: 14px; }
.bb-result p { margin: 2px 0; }
.bb-split { display: flex; height: 10px; margin: 6px 0 2px; border-radius: 5px; overflow: hidden; background: var(--bb-border); max-width: 420px; }
.bb-split span { transition: width .6s ease-out; }
.bb-split span:first-child { background: var(--bb-accent); }
.bb-split span:last-child { background: var(--bb-muted); }
.bb-arena[aria-busy="true"] .bb-button-vote { opacity: .5; }
.bb-arena-waiting .bb-photo-frame { opacity: .45; transition: opacity .15s; }
.bb-photo-opening { cursor: progress; }
.bb-vote-count { font-size: 13px; color: var(--bb-muted); }
/* Today's tally: count, streak and a thin bar towards the next milestone. */
.bb-tally { position: relative; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; align-self: center; }
.bb-tally[hidden] { display: none; }
.bb-streak { font-size: 13px; font-weight: 700; color: var(--bb-warn); }
.bb-milestone { flex-basis: 100%; height: 3px; border-radius: 2px; background: var(--bb-border); overflow: hidden; }
.bb-milestone span { display: block; height: 100%; width: 0; background: var(--bb-accent); transition: width .3s ease-out; }
.bb-vote-count.bb-bump { animation: bb-bump .3s ease-out; }
@keyframes bb-bump { 40% { transform: scale(1.12); color: var(--bb-accent); } }
.bb-plus-one { position: absolute; right: -4px; top: -6px; font-size: 14px; font-weight: 800; color: var(--bb-accent); pointer-events: none; animation: bb-plus-one .9s ease-out forwards; }
@keyframes bb-plus-one { 0% { opacity: 0; transform: translateY(4px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-22px); } }
/* Milestone and streak celebrations: a card that pops up over the screen for about two seconds. */
.bb-celebrate { position: fixed; left: 50%; top: 32%; z-index: 9000; transform: translateX(-50%); pointer-events: none; }
.bb-celebrate-card { position: relative; display: none; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px; background: var(--bb-text); color: var(--bb-card); font-size: 18px; font-weight: 700; white-space: nowrap; box-shadow: 0 6px 24px rgba(0, 0, 0, .3); }
.bb-celebrate-on .bb-celebrate-card { display: inline-flex; animation: bb-celebrate 2.2s ease-out forwards; }
.bb-celebrate-icon { font-size: 26px; }
@keyframes bb-celebrate { 0% { opacity: 0; transform: scale(.6); } 12% { opacity: 1; transform: scale(1.08); } 20% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-12px); } }
.bb-burst { position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3px; border-radius: 2px; background: #f5c518; animation: bb-burst .8s ease-out forwards; }
.bb-burst:nth-child(3n) { background: var(--bb-accent); }
.bb-burst:nth-child(3n+1) { background: #e84a8a; }
@keyframes bb-burst { 0% { transform: rotate(var(--a)) translateX(0); opacity: 1; } 100% { transform: rotate(var(--a)) translateX(var(--d)); opacity: 0; } }
.bb-email-nudge { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0; padding: 10px 12px; border: 1px solid var(--bb-border); border-radius: var(--bb-radius); background: var(--bb-accent-soft); }
.bb-email-nudge p { margin: 0; flex: 1 1 220px; }
.bb-toast { position: fixed; left: 50%; bottom: 20px; z-index: 200; transform: translateX(-50%); max-width: 90vw; padding: 10px 16px; border-radius: var(--bb-radius); background: #333; color: #fff; font-size: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.bb-toast button { margin-left: 10px; }

/* Results and archive */
.bb-champion-banner { display: flex; gap: 16px; align-items: center; margin: 0 0 16px; padding: 14px; border: 2px solid var(--bb-accent); border-radius: var(--bb-radius); background: var(--bb-accent-soft); }
.bb-champion-banner img { width: 125px; height: 175px; object-fit: cover; object-position: top; border-radius: 4px; }
.bb-champion-banner h2 { margin: 0; font-size: 28px; }
.bb-eyebrow { margin: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--bb-accent); }
.bb-spotlight { position: relative; }
.bb-spotlight .bb-pill-admin { position: absolute; top: 6px; left: 6px; z-index: 1; }

/* Admin */
.bb-admin .bb-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.bb-inline-form { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.bb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bb-table th, .bb-table td { padding: 5px 6px; border-bottom: 1px solid var(--bb-border); text-align: left; vertical-align: top; }

@media (max-width: 900px) {
	.bb-lounge { grid-template-columns: 1fr; }
	.bb-roster { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
	.bb-hero { padding: 14px 12px; }
	.bb-headline { font-size: 21px; }
	.bb-funnel { font-size: 17px; }
	.bb-help-steps { grid-template-columns: 1fr; }
	.bb-help-step:nth-last-child(2) { border-bottom: 1px solid var(--bb-border); }
	.bb-stepper { grid-template-columns: repeat(6, 1fr); }
	.bb-step:first-child { grid-column: span 2; }
	.bb-arena { gap: 8px; }
	.bb-contender { padding: 6px; }
	#content .bb-contender-name { font-size: 16px; }
	.bb-contender-info { min-height: 0; }
	.bb-button-vote { font-size: 15px; min-height: 48px; padding: 6px 8px; }
	.bb-button-vote .bb-key, .bb-vote-help { display: none; }
	.bb-photo-frame { width: 100%; }
	.bb-roster { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
	.bb-roster-placeholder { width: 44px; height: 62px; }
	.bb-row { grid-template-columns: 28px 34px minmax(0, 1fr) auto auto; gap: 6px; }
	.bb-row-score { display: none; }
	.bb-row-thumb { width: 34px; height: 48px; }
	.bb-champion-banner { flex-direction: column; text-align: center; }
	.bb-chat-log { max-height: 300px; }
	/* Compact vote screen on phones: one-line sub navigation, no context or position lines. */
	.bb-subnav { flex-wrap: nowrap; overflow-x: auto; gap: 0; scrollbar-width: none; }
	.bb-subnav a { padding: 8px 9px; white-space: nowrap; font-size: 13px; }
	.bb-subnav .bb-subnav-archive { display: none; }
	.bb-vote-context, .bb-position { display: none; }
	.bb-tally { flex-basis: 100%; justify-content: center; text-align: center; }
	/* Profile mobile rules for the pop-up; the boxes shrink to fit the narrow vote cards side by side. */
	.bb-vote .vote-modal-content { width: 95%; margin: 10% auto; }
	.bb-vote .vote-modal-body { padding: 30px 5px; }
	.bb-vote .star-button { font-size: 1.7rem; padding: 4px; }
	.bb-vote .rating-text { height: 60px; }
	.bb-vote .star-rating { gap: 0px; margin: 0; flex-wrap: nowrap; } /* one row: at 390px the tenth star would wrap by a pixel */
	.bb-vote .ratings-row { gap: 4px; flex-wrap: nowrap; }
	.bb-vote .rating-box { flex: 1 1 0; min-width: 0; padding: 0.35rem 0.15rem; }
	.bb-vote .rating-box strong { font-size: 1rem; white-space: nowrap; }
	.bb-vote .rating-box small { font-size: 0.68rem; white-space: nowrap; }
	.bb-milestone { max-width: 260px; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
	.bb-photo-frame img { transition: none; }
	.bb-skeleton { animation: none; }
	.bb-contender, .bb-split span, .bb-milestone span { transition: none; }
	.bb-star-pop, .bb-celebrate-on .bb-celebrate-card { animation: none; }
}

/* Battles photo gallery (Fancybox 6, opened from the vote screen): the site's justified body text would
   space out the model's name in the caption. */
.fancybox__container .fancybox__caption { text-align: center; }
