/*
 * Boxing Underdog Live - base styles: design tokens, typography, the page shell (header, graphics pill, toasts,
 * modals, drag & drop, error screens) and shared components (buttons, tags, result chips, likes, progress, skeletons).
 * Screens: home.css (replays home), fight.css (fight page: watch / director / live), live.css (live hub).
 * Broadcast look: near-black, red #ff3838, gold #e9b949; Oswald (display), Inter (UI), JetBrains Mono (numbers).
 * Unity preprocesses template *.css files: never use triple curly braces here.
 */

:root {
  --bg: #07080b;
  --bg-2: #0b0d12;
  --surface-1: #0f1218;
  --surface-2: #141821;
  --surface-3: #1b202b;
  --glass: rgba(12, 14, 19, 0.72);
  --glass-strong: rgba(13, 15, 20, 0.94);
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --line-3: rgba(255, 255, 255, 0.2);
  --text: #f4f5f7;
  --text-2: #b3b8c2;
  --text-3: #7d838f;
  --text-4: #555b67;
  --red: #ff3838;
  --red-2: #ff5a5a;
  --red-3: #d91f1f;
  --red-soft: rgba(255, 56, 56, 0.14);
  --red-glow: rgba(255, 56, 56, 0.42);
  --gold: #e9b949;
  --gold-2: #f6d27a;
  --gold-3: #b98a1f;
  --gold-soft: rgba(233, 185, 73, 0.14);
  --blue: #3d86ff;
  --blue-2: #6aa3ff;
  --silver: #cdd2dc;
  --bronze: #d6905a;
  --ok: #3ddc84;
  --orange: #ff7a3d;
  --training: #8cb9ff;
  --radius-xs: 6px;
  --radius-sm: 9px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-1: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-2: 0 24px 64px rgba(0, 0, 0, 0.6);
  --font-display: "Oswald", "Arial Narrow", "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(20px, 3.6vw, 96px);
  /* the site's shared top bar (topbar.css): the pages leave its height, it follows this page's grid and layers */
  --header-h: var(--tb-h);
  --tb-maxw: none;
  --tb-gutter: var(--gutter);
  --tb-z: 40;
  --tb-tabbar-z: 45;
  /* One responsive system for every UNDERDOG TV screen (Tools/RESPONSIVE_TRACKER.md):
     --page-max  the content column of the catalogues (FILMY, POWTÓRKI 3D, NA ŻYWO), in page units;
     --ui-zoom   how much the whole content grows on a big, tall screen (an ultrawide or 4K monitor at 100 %): the
                 picture, the cards and the words grow together instead of a thin strip of small print in the
                 middle; the top bar keeps its own steps. --tab-space (topbar.css) is the phone tab bar's room. */
  --page-max: 1880px;
  --ui-zoom: 1;
}

@media (min-width: 2300px) and (min-height: 1200px) {
  :root {
    --ui-zoom: 1.12;
  }
}

@media (min-width: 3000px) and (min-height: 1150px) {
  :root {
    --page-max: 2100px;
    --ui-zoom: 1.25;
  }
}

@media (min-width: 3600px) and (min-height: 1900px) {
  :root {
    --ui-zoom: 1.4;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border: 1px solid var(--line-3);
  border-bottom-width: 2px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
}

.bu-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.bu-ic {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bu-ic-fill {
  fill: currentColor;
  stroke: none;
}

.bu-wrap {
  width: 100%;
  padding: 0 var(--gutter);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

#unity-canvas:focus-visible {
  outline: none;
}

/* ---------------------------------------------------------------------------
   The stage: one Unity canvas under every fight view (hidden while no fight is on screen)
   --------------------------------------------------------------------------- */

#unity-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  background: #000;
  outline: none;
  visibility: hidden;
}

html.bu-stage-on #unity-canvas {
  visibility: visible;
}

html.bu-idle #unity-canvas {
  cursor: none;
}

.bu-overlay-preview {
  position: fixed;
  z-index: 1;
  pointer-events: none;
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */

.bu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease),
    box-shadow 160ms var(--ease), color 160ms var(--ease), opacity 160ms var(--ease);
}

.bu-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.bu-btn:active {
  transform: translateY(1px);
}

.bu-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.bu-btn .bu-ic {
  width: 18px;
  height: 18px;
}

.bu-btn-primary {
  background: linear-gradient(180deg, #ff4b4b 0%, #e62828 100%);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: 0 10px 28px rgba(255, 56, 56, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.bu-btn-primary:hover {
  background: linear-gradient(180deg, #ff5f5f 0%, #ef3434 100%);
  box-shadow: 0 14px 36px rgba(255, 56, 56, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.bu-btn-gold {
  background: linear-gradient(180deg, #f3c95e 0%, #dca935 100%);
  border-color: rgba(255, 255, 255, 0.22);
  color: #1a1305;
  box-shadow: 0 10px 28px rgba(233, 185, 73, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.bu-btn-gold:hover {
  background: linear-gradient(180deg, #f7d47a 0%, #e5b443 100%);
}

.bu-btn-glass {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line-2);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

.bu-btn-glass:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: var(--line-3);
}

.bu-btn-ghost {
  background: transparent;
  border-color: var(--line-2);
  color: var(--text-2);
}

.bu-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.bu-btn-danger {
  background: rgba(255, 56, 56, 0.16);
  border-color: rgba(255, 56, 56, 0.45);
  color: #ffd9d9;
}

.bu-btn-danger:hover {
  background: rgba(255, 56, 56, 0.28);
}

.bu-btn-sm {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  gap: 8px;
}

.bu-btn-sm .bu-ic {
  width: 16px;
  height: 16px;
}

.bu-btn-lg {
  height: 50px;
  padding: 0 24px;
  font-size: 15.5px;
}

.bu-btn-xl {
  height: 58px;
  padding: 0 30px;
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bu-btn-xl .bu-ic {
  width: 20px;
  height: 20px;
}

.bu-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  transition: background-color 140ms var(--ease), color 140ms var(--ease), transform 140ms var(--ease), opacity 140ms var(--ease);
}

.bu-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.bu-icon-btn:active {
  transform: scale(0.94);
}

.bu-icon-btn:disabled {
  opacity: 0.3;
  cursor: default;
  background: transparent;
  transform: none;
}

.bu-icon-btn .bu-ic {
  width: 22px;
  height: 22px;
}

.bu-text-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.bu-text-btn:hover {
  color: var(--gold-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bu-text-btn:disabled {
  opacity: 0.4;
  cursor: default;
  text-decoration: none;
}

/* ---------------------------------------------------------------------------
   Tags, result chips, likes, stats
   --------------------------------------------------------------------------- */

.bu-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-xs);
  background: rgba(8, 9, 12, 0.62);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.bu-tag .bu-ic {
  width: 13px;
  height: 13px;
}

.bu-tag-gold {
  border-color: rgba(233, 185, 73, 0.45);
  background: rgba(40, 30, 6, 0.7);
  color: var(--gold-2);
}

.bu-chip-result {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.bu-chip-result[data-code="KO"] {
  background: var(--red);
  box-shadow: 0 6px 16px rgba(255, 56, 56, 0.35);
}

.bu-chip-result[data-code="TKO"] {
  background: var(--orange);
  box-shadow: 0 6px 16px rgba(255, 122, 61, 0.3);
}

.bu-chip-result[data-code="DECISION"] {
  background: var(--gold);
  color: #1a1305;
}

.bu-chip-result[data-code="DRAW"] {
  background: #c3c8d1;
  color: #121418;
}

.bu-chip-result[data-code="TRAINING"] {
  background: rgba(140, 185, 255, 0.2);
  color: var(--training);
  box-shadow: inset 0 0 0 1px rgba(140, 185, 255, 0.45);
}

.bu-chip-result[data-code="FORFEIT"],
.bu-chip-result[data-code="DISCONNECT"] {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-2);
}

.bu-like {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  transition: background-color 140ms var(--ease), color 140ms var(--ease), border-color 140ms var(--ease);
}

.bu-like:hover {
  background: rgba(255, 56, 56, 0.1);
  color: var(--text);
}

.bu-like .bu-ic {
  width: 18px;
  height: 18px;
}

.bu-like .bu-like-on {
  display: none;
}

.bu-like.bu-liked {
  color: #ffd6d6;
}

.bu-like.bu-liked .bu-like-on {
  display: block;
  color: var(--red);
  animation: bu-heart-pop 420ms var(--ease-out);
}

.bu-like.bu-liked .bu-like-off {
  display: none;
}

.bu-like-count {
  font-size: 13px;
  font-weight: 600;
}

.bu-like-xl {
  height: 58px;
  min-width: 58px;
  padding: 0 18px;
  border-color: var(--line-2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.bu-like-xl .bu-ic {
  width: 22px;
  height: 22px;
}

.bu-like-xl .bu-like-count {
  font-size: 15px;
}

.bu-like-xl.bu-liked {
  border-color: rgba(255, 56, 56, 0.55);
  background: rgba(255, 56, 56, 0.14);
}

@keyframes bu-heart-pop {
  0% {
    transform: scale(0.6);
  }
  55% {
    transform: scale(1.28);
  }
  100% {
    transform: scale(1);
  }
}

.bu-stat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  font-size: 13.5px;
  white-space: nowrap;
}

.bu-stat .bu-ic {
  width: 16px;
  height: 16px;
  color: var(--text-3);
}

.bu-kicker {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.bu-pulse-dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.bu-pulse-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.7;
  animation: bu-pulse 1.6s var(--ease) infinite;
}

@keyframes bu-pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.85;
  }
  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

/* ---------------------------------------------------------------------------
   Progress, spinner, skeletons, switch, segmented control, inputs, details
   --------------------------------------------------------------------------- */

.bu-progress {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
}

.bu-progress-fill {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(0);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red-3) 0%, var(--red) 60%, var(--gold) 100%);
  transition: transform 320ms var(--ease);
}

.bu-progress.bu-running .bu-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.45) 50%, transparent 100%);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: bu-sheen 1.6s linear infinite;
}

@keyframes bu-sheen {
  from {
    background-position: -40% 0;
  }
  to {
    background-position: 140% 0;
  }
}

.bu-spinner {
  width: 46px;
  height: 46px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--red);
  border-right-color: var(--gold);
  border-radius: 50%;
  animation: bu-rotate 0.9s linear infinite;
}

.bu-spin {
  animation: bu-rotate 1.1s linear infinite;
}

@keyframes bu-rotate {
  to {
    transform: rotate(360deg);
  }
}

.bu-skel {
  border-radius: 8px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.04) 30%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.04) 70%);
  background-size: 300% 100%;
  animation: bu-shimmer 1.5s linear infinite;
}

@keyframes bu-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.bu-switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease);
}

.bu-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: transform 200ms var(--ease-out);
}

.bu-switch[aria-checked="true"] {
  border-color: rgba(255, 56, 56, 0.6);
  background: var(--red);
}

.bu-switch[aria-checked="true"] .bu-switch-knob {
  transform: translateX(20px);
}

.bu-switch:disabled {
  opacity: 0.45;
  cursor: default;
}

.bu-seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
}

.bu-seg button {
  height: 36px;
  min-width: 64px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}

.bu-seg button:hover {
  color: var(--text);
}

.bu-seg button.bu-on {
  background: rgba(255, 255, 255, 0.92);
  color: #0b0c10;
}

.bu-seg button:disabled {
  opacity: 0.45;
  cursor: default;
}

.bu-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.bu-input:focus {
  outline: none;
  border-color: rgba(233, 185, 73, 0.7);
  box-shadow: 0 0 0 3px rgba(233, 185, 73, 0.16);
}

.bu-field-label {
  display: block;
  margin: 0 0 8px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.bu-hint {
  margin: 10px 0 0;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.55;
}

.bu-details {
  border-top: 1px solid var(--line);
}

.bu-details summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.bu-details summary::-webkit-details-marker {
  display: none;
}

.bu-details summary:hover {
  color: var(--text);
}

.bu-details summary .bu-ic {
  width: 16px;
  height: 16px;
  transition: transform 180ms var(--ease);
}

.bu-details[open] summary .bu-ic {
  transform: rotate(90deg);
}

.bu-details-body {
  padding: 0 0 16px 24px;
  color: var(--text-2);
  font-size: 14px;
}

.bu-details-body p {
  margin: 0;
}

/* "Szczegóły": the reason code of something this browser cannot do, for support (collapsed by default) */
.bu-code {
  margin-top: 14px;
  font-size: 13px;
}

.bu-code summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.bu-code summary::-webkit-details-marker {
  display: none;
}

.bu-code summary:hover,
.bu-code summary:focus-visible {
  color: var(--text);
}

.bu-code summary .bu-ic {
  width: 14px;
  height: 14px;
  transition: transform 180ms var(--ease);
}

.bu-code[open] summary .bu-ic {
  transform: rotate(90deg);
}

.bu-code-body {
  margin: 8px 0 0;
  color: var(--text-3);
  line-height: 1.5;
}

.bu-code-body code {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 8px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

.bu-empty {
  margin: 0;
  padding: 28px 0;
  color: var(--text-3);
  font-size: 14.5px;
}

.bu-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 0;
  padding: 14px 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface-1);
  color: var(--text-2);
  font-size: 14.5px;
}

.bu-note .bu-ic {
  color: var(--gold);
}

.bu-note .bu-btn {
  margin-left: auto;
}

.bu-note-soft {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
}

/* ---------------------------------------------------------------------------
   Header
   --------------------------------------------------------------------------- */

/* The site's top bar is topbar.css (shared with the homepage). Here only how this page hides it while a fight plays
   and the pointer rests (fight.css: the full-screen fight, tv.css: the phone feed). */
html.bu-idle.bu-stage-on .tb {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

@keyframes bu-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.bu-header-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
}

.bu-header-btn .bu-ic {
  width: 18px;
  height: 18px;
}

/* Install app (Chromium) / Add to Dock (Safari on a Mac) */
.bu-install {
  position: relative;
}

.bu-install .bu-header-btn[aria-expanded="true"] {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.bu-dock-pop {
  width: 340px;
}

/* Graphics pill */
.bu-gfx {
  position: relative;
}

.bu-gfx-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  max-width: 260px;
  padding: 0 14px 0 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}

.bu-gfx-pill:hover,
.bu-gfx-pill[aria-expanded="true"] {
  border-color: var(--line-3);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.bu-gfx-glyph {
  position: relative;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
}

.bu-gfx-glyph .bu-ic {
  width: 17px;
  height: 17px;
}

.bu-gfx-ring {
  width: 20px;
  height: 20px;
  transform: rotate(-90deg);
}

.bu-gfx-ring circle {
  fill: none;
  stroke-width: 3;
}

.bu-gfx-ring-bg {
  stroke: rgba(255, 255, 255, 0.16);
}

.bu-gfx-ring-fg {
  stroke: var(--red);
  stroke-linecap: round;
  transition: stroke-dasharray 400ms var(--ease);
}

.bu-gfx-text {
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.bu-gfx-pill[data-state="install"] {
  border-color: rgba(233, 185, 73, 0.45);
  background: rgba(233, 185, 73, 0.1);
  color: var(--gold-2);
}

.bu-gfx-pill[data-state="install"]:hover {
  background: rgba(233, 185, 73, 0.18);
}

.bu-gfx-pill[data-state="downloading"],
.bu-gfx-pill[data-state="update"] {
  color: var(--text);
}

.bu-gfx-pill[data-state="ready"] .bu-ic {
  color: var(--ok);
}

.bu-gfx-pill[data-state="error"] {
  border-color: rgba(255, 56, 56, 0.5);
  background: rgba(255, 56, 56, 0.12);
  color: #ffc9c9;
}

.bu-gfx-pill[data-state="checking"] .bu-gfx-text {
  color: var(--text-3);
}

/* also the compact form in the site's top bar when its row needs the room (topbar.js fit guard) */
.bu-gfx-pill.bu-gfx-icon-only,
.tb.tb-fit-tools .bu-gfx-pill {
  justify-content: center;
  width: 36px;
  padding: 0;
}

.bu-gfx-pill.bu-gfx-icon-only .bu-gfx-text,
.tb.tb-fit-tools .bu-gfx-pill .bu-gfx-text {
  display: none;
}

.bu-gfx-pop {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 50;
  width: 360px;
  padding: 20px 20px 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--glass-strong);
  box-shadow: var(--shadow-2);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  animation: bu-drop-in 220ms var(--ease-out) both;
}

.bu-gfx-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bu-gfx-pop[data-state="error"] .bu-gfx-title {
  color: #ffb4b4;
}

.bu-gfx-pop[data-state="ready"] .bu-gfx-title {
  color: var(--ok);
}

.bu-gfx-body {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.55;
}

.bu-gfx-size {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(233, 185, 73, 0.1);
  color: var(--gold-2);
  font-size: 13.5px;
  font-weight: 600;
}

.bu-gfx-size .bu-ic {
  width: 16px;
  height: 16px;
}

.bu-gfx-size strong {
  margin-left: auto;
  color: var(--text);
  font-size: 15px;
}

.bu-gfx-progress {
  margin-top: 16px;
}

.bu-gfx-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-top: 10px;
  color: var(--text-3);
  font-size: 13px;
}

.bu-gfx-percent {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.bu-gfx-eta {
  margin-left: auto;
}

.bu-gfx-note {
  margin: 14px 0 0;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.5;
}

.bu-gfx-pop .bu-btn {
  margin-top: 16px;
}

@keyframes bu-drop-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------------------------
   Pages (scroll containers under the fixed header)
   --------------------------------------------------------------------------- */

.bu-page {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow-x: hidden;
  overflow-y: auto;
  /* focus and scroll-into-view stop clear of the fixed bars (WCAG 2.4.11) */
  scroll-padding-top: calc(var(--header-h) + 8px);
  scroll-padding-bottom: calc(var(--tab-space, 0px) + 8px);
  background: var(--bg);
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  scrollbar-width: thin;
}

.bu-page::-webkit-scrollbar {
  width: 10px;
}

.bu-page::-webkit-scrollbar-track {
  margin-top: var(--header-h);
  background: transparent;
}

.bu-page::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  background-clip: padding-box;
}

.bu-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.bu-section-copy {
  min-width: 0;
}

.bu-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 1.7vw, 32px);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.1;
  text-transform: uppercase;
}

.bu-section-title .bu-ic {
  width: 26px;
  height: 26px;
  color: var(--gold);
}

.bu-section-sub {
  margin: 6px 0 0;
  color: var(--text-3);
  font-size: 14.5px;
}

/* ---------------------------------------------------------------------------
   Toasts
   --------------------------------------------------------------------------- */

.bu-toasts {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(620px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

html.bu-stage-on .bu-toasts {
  bottom: 200px;
}

html.bu-mode-director .bu-toasts {
  left: calc((100vw - clamp(360px, 24vw, 460px)) / 2);
  bottom: 230px;
}

.bu-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 10px 12px 16px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--glass-strong);
  box-shadow: var(--shadow-1);
  pointer-events: auto;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  animation: bu-toast-in 280ms var(--ease-out) both;
}

.bu-toast.bu-leaving {
  animation: bu-toast-out 220ms var(--ease) both;
}

.bu-toast > .bu-ic {
  width: 20px;
  height: 20px;
  color: var(--gold);
}

.bu-toast[data-kind="error"] {
  border-color: rgba(255, 56, 56, 0.4);
}

.bu-toast[data-kind="error"] > .bu-ic {
  color: var(--red-2);
}

.bu-toast[data-kind="success"] > .bu-ic {
  color: var(--ok);
}

.bu-toast-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.45;
}

.bu-toast-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-3);
}

.bu-toast-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.bu-toast-close .bu-ic {
  width: 16px;
  height: 16px;
}

@keyframes bu-toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes bu-toast-out {
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

/* ---------------------------------------------------------------------------
   Modals (film ready, keyboard shortcuts)
   --------------------------------------------------------------------------- */

.bu-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 4, 6, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: bu-fade 200ms var(--ease) both;
}

.bu-modal-card {
  position: relative;
  max-width: 100%;
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #13161e 0%, #0d0f14 100%);
  box-shadow: var(--shadow-2);
  animation: bu-rise 320ms var(--ease-out) both;
}

.bu-keys-card {
  width: min(760px, 100%);
  padding: 26px 30px 30px;
}

.bu-keys-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.bu-keys-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bu-keys-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
}

.bu-keys-group {
  margin: 0 0 12px;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.bu-keys {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px 18px;
  margin: 0;
}

.bu-keys dt {
  display: flex;
  gap: 6px;
  margin: 0;
}

.bu-keys-to {
  align-self: center;
  color: var(--text-3);
}

.bu-keys dd {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}

@keyframes bu-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes bu-rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------------------------
   Drag and drop overlay
   --------------------------------------------------------------------------- */

.bu-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(5, 6, 8, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  pointer-events: none;
  animation: bu-fade 160ms var(--ease) both;
}

.bu-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(760px, 100%);
  padding: 64px 40px;
  border: 2px dashed rgba(255, 56, 56, 0.7);
  border-radius: 28px;
  background: radial-gradient(70% 70% at 50% 40%, rgba(255, 56, 56, 0.14), transparent 70%);
  text-align: center;
}

.bu-drop-icon {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background: var(--red);
  box-shadow: 0 20px 50px rgba(255, 56, 56, 0.45);
  color: #fff;
  animation: bu-bob 1.6s ease-in-out infinite;
}

.bu-drop-icon .bu-ic {
  width: 40px;
  height: 40px;
}

.bu-drop-title {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bu-drop-text {
  margin: 0;
  color: var(--text-2);
  font-size: 16px;
}

@keyframes bu-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ---------------------------------------------------------------------------
   Error screens
   --------------------------------------------------------------------------- */

.bu-state {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(60% 50% at 50% 30%, rgba(255, 56, 56, 0.12) 0%, rgba(255, 56, 56, 0) 70%),
    var(--bg);
}

.bu-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(520px, 100%);
  text-align: center;
}

.bu-state-logo {
  width: 260px;
  height: auto;
  margin-bottom: 20px;
}

.bu-state-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--red-soft);
  color: var(--red-2);
}

.bu-state-icon .bu-ic {
  width: 28px;
  height: 28px;
}

.bu-state-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bu-state-text {
  margin: 0 0 12px;
  color: var(--text-2);
  font-size: 15.5px;
}

html.bu-halted .tb,
html.bu-halted .bu-page,
html.bu-halted .bu-fight {
  visibility: hidden;
}

/* ---------------------------------------------------------------------------
   Reduced motion
   --------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1180px) {
  .bu-gfx-pill {
    max-width: 180px;
  }
}

/* iPhone/iPad Safari zooms the whole page in when a field with text under 16px gets focus and leaves it zoomed
   (content wider than the screen, sideways scroll). Touch screens get 16px fields; !important because some pages
   set the field font with !important (live-preview.css). */
@media (pointer: coarse) {
  body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
    font-size: 16px !important;
  }
}

/* The page's static text for bots that run no JavaScript (Tools/monologic-site/seo/build_seo.py writes it on
   boxingunderdog.com; site-routes.js removes it as the app starts): out of sight until then. */
.bu-seo{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:normal;border:0}
