/* ==========================================================================
   ClipBot.gg design system — loaded after styles.css and overrides it.
   One set of tokens, readable type, consistent components, accessible focus.
   ========================================================================== */

:root {
  /* Surfaces */
  --cb-bg: #080b1a;
  --cb-surface: #10132a;
  --cb-surface-2: #171b36;
  --cb-surface-3: #1f2446;
  --cb-border: rgba(255, 255, 255, 0.08);
  --cb-border-strong: rgba(255, 255, 255, 0.16);

  /* Text (all pass WCAG AA on --cb-bg and --cb-surface) */
  --cb-text: #f3f4fb;
  --cb-text-soft: #c2c5dc;
  --cb-text-muted: #a3a7c3;

  /* Brand */
  --cb-primary: #7045f5;
  --cb-primary-hover: #7a52ff;
  --cb-primary-soft: rgba(124, 77, 255, 0.16);
  --cb-link: #b9a3ff;
  --cb-accent: #5de8ba;
  --cb-accent-hover: #7ff0cb;
  --cb-highlight: #fff45c;
  --cb-twitch: #9146ff;
  --cb-danger: #ff6b85;
  --cb-success: #3ddc97;
  --cb-warning: #ffcc4d;

  /* Shape & depth */
  --cb-radius: 16px;
  --cb-radius-sm: 10px;
  --cb-radius-pill: 999px;
  --cb-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --cb-shadow-glow: 0 12px 34px rgba(124, 77, 255, 0.35);

  /* Type */
  --cb-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --cb-font-display: 'Orbitron', 'Inter', sans-serif;
  --cb-font-ui: 'Rajdhani', 'Inter', sans-serif;

  --cb-sidebar-w: 248px;
  --cb-ease: cubic-bezier(.2, .7, .2, 1);

  /* Keep legacy variable names pointing at the new palette */
  --bg-primary: var(--cb-bg);
  --bg-secondary: var(--cb-surface);
  --bg-accent: var(--cb-surface-2);
  --text-primary: var(--cb-text);
  --text-secondary: var(--cb-text-soft);
  --accent-color: var(--cb-primary);
  --accent-hover: var(--cb-primary-hover);
  --secondary-color: var(--cb-accent);
  --secondary-hover: var(--cb-accent-hover);
  --highlight-color: var(--cb-highlight);

  /* Bootstrap bridges */
  --bs-body-bg: var(--cb-bg);
  --bs-body-color: var(--cb-text);
  --bs-secondary-color: var(--cb-text-muted);
  --bs-border-color: var(--cb-border);
  --bs-link-color: var(--cb-link);
  --bs-link-hover-color: #d6c9ff;
  --bs-emphasis-color: var(--cb-text);
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body {
  font-family: var(--cb-font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--cb-text);
  background: var(--cb-bg);
  zoom: normal;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--cb-font-body) !important;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--cb-text);
  text-shadow: none;
}
h1, h2, .display-heading {
  font-family: var(--cb-font-display) !important;
  letter-spacing: 0.01em;
}
h1 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3rem); }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 2.1rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.15rem; }
p { color: inherit; }
a { color: var(--cb-link); text-underline-offset: 3px; }
a:hover { color: #d6c9ff; }
img, video { max-width: 100%; }
.text-muted, .text-body-secondary { color: var(--cb-text-muted) !important; }
.text-soft { color: var(--cb-text-soft) !important; }
.text-highlight, .highlight { color: var(--cb-highlight); }
.text-accent { color: var(--cb-accent); }
hr { border-color: var(--cb-border-strong); opacity: 1; }
main { display: block; outline: none; }
::selection { background: var(--cb-primary); color: #fff; }

/* Accessible focus: visible for keyboard users, invisible for mouse clicks */
:focus-visible {
  outline: 3px solid var(--cb-accent) !important;
  outline-offset: 3px !important;
  box-shadow: none !important;
}
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible { outline-offset: 2px !important; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 3000;
  background: var(--cb-accent);
  color: #06121a;
  padding: 10px 16px;
  border-radius: var(--cb-radius-sm);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: #06121a; }

/* Background glow — calmer than before, and off for reduced motion */
.animated-bg::before { opacity: 0.14; filter: blur(120px); }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--cb-font-ui);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.72rem 1.3rem;
  border-radius: var(--cb-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform .15s var(--cb-ease), box-shadow .15s var(--cb-ease), background-color .15s, color .15s;
}
.btn-sm { font-size: 0.86rem; padding: 0.42rem 0.8rem; }
.btn-lg { font-size: 1.15rem; padding: 0.95rem 1.7rem; }
.btn-primary, .btn-twitch, .btn-purple {
  background: var(--cb-primary);
  border: 1px solid transparent;
  color: #fff;
}
.btn-primary:hover, .btn-twitch:hover, .btn-purple:hover,
.btn-primary:focus-visible, .btn-twitch:focus-visible {
  background: var(--cb-primary-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--cb-shadow-glow);
}
.btn-twitch { background: var(--cb-twitch); }
.btn-secondary, .btn-accent {
  background: var(--cb-accent);
  border: 1px solid transparent;
  color: #06121a;
}
.btn-secondary:hover, .btn-accent:hover { background: var(--cb-accent-hover); color: #06121a; transform: translateY(-2px); box-shadow: 0 12px 30px rgba(93, 232, 186, 0.3); }
.btn-ghost, .btn-outline-light, .btn-outline-primary, .btn-outline-secondary, .btn-dark {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--cb-border-strong);
  color: var(--cb-text);
}
.btn-ghost:hover, .btn-outline-light:hover, .btn-outline-primary:hover, .btn-outline-secondary:hover, .btn-dark:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.btn-danger { background: var(--cb-danger); border-color: transparent; color: #1a0610; }
.btn-danger:hover { background: #ff8a9e; color: #1a0610; }
.btn:disabled, .btn.disabled { opacity: 0.55; transform: none !important; box-shadow: none !important; }
.btn-icon { padding: 0.55rem; width: 2.5rem; height: 2.5rem; }
.btn-header { padding: 0.55rem 1rem; }
@media (max-width: 576px) {
  /* legacy styles.css made every button full-width on phones — only do that when asked */
  .btn { width: auto; }
  .btn-block-mobile { width: 100%; }
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--cb-border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cb-text);
  font-size: 1.15rem;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(160deg, var(--cb-surface-2), var(--cb-surface));
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  color: var(--cb-text);
  box-shadow: var(--cb-shadow);
}
.card:hover { transform: none; box-shadow: var(--cb-shadow); }
.card-hover { transition: transform .2s var(--cb-ease), box-shadow .2s var(--cb-ease), border-color .2s; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--cb-shadow-glow); border-color: rgba(124, 77, 255, 0.45); }
.card-header { background: transparent; border-bottom: 1px solid var(--cb-border); font-weight: 700; }
.card-body { color: var(--cb-text); }
.panel {
  background: linear-gradient(160deg, var(--cb-surface-2), var(--cb-surface));
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  padding: clamp(1rem, 0.6rem + 1.4vw, 1.75rem);
}

/* ---------- Forms ---------- */
.form-control, .form-select {
  background-color: var(--cb-surface-3);
  border: 1px solid var(--cb-border-strong);
  color: var(--cb-text);
  border-radius: var(--cb-radius-sm);
}
.form-control::placeholder { color: var(--cb-text-muted); opacity: 1; }
.form-control:focus, .form-select:focus {
  background-color: var(--cb-surface-3);
  color: var(--cb-text);
  border-color: var(--cb-primary);
  box-shadow: 0 0 0 0.2rem var(--cb-primary-soft);
}
.form-label { font-weight: 600; color: var(--cb-text-soft); }
.form-text { color: var(--cb-text-muted); }
.form-check-input { background-color: var(--cb-surface-3); border-color: var(--cb-border-strong); }
.form-check-input:checked { background-color: var(--cb-primary); border-color: var(--cb-primary); }

/* ---------- Alerts / badges / tables / modals ---------- */
.alert { border-radius: var(--cb-radius-sm); border: 1px solid transparent; }
.alert-success { background: rgba(61, 220, 151, 0.12); border-color: rgba(61, 220, 151, 0.35); color: #b8f5d9; }
.alert-info { background: rgba(124, 77, 255, 0.14); border-color: rgba(124, 77, 255, 0.4); color: #ddd2ff; }
.alert-warning { background: rgba(255, 204, 77, 0.12); border-color: rgba(255, 204, 77, 0.35); color: #ffe7a8; }
.alert-danger { background: rgba(255, 107, 133, 0.12); border-color: rgba(255, 107, 133, 0.35); color: #ffc7d1; }
.alert .btn-close { filter: invert(1); }
.flash-wrap { margin-top: 1rem; }

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--cb-radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--cb-text-soft);
  border: 1px solid var(--cb-border);
  white-space: nowrap;
}
.badge-soft.is-hot { background: rgba(255, 107, 133, 0.16); color: #ffc2cd; border-color: rgba(255, 107, 133, 0.35); }
.badge-soft.is-top { background: rgba(255, 244, 92, 0.14); color: #fff6a6; border-color: rgba(255, 244, 92, 0.35); }
.badge-soft.is-chat { background: rgba(93, 232, 186, 0.14); color: #b9f7e2; border-color: rgba(93, 232, 186, 0.35); }
.badge-soft.is-voice { background: rgba(124, 77, 255, 0.18); color: #d9ccff; border-color: rgba(124, 77, 255, 0.4); }
.badge-soft.is-live { background: #c8103e; color: #fff; border-color: transparent; }

.table { --bs-table-bg: transparent; --bs-table-color: var(--cb-text); --bs-table-border-color: var(--cb-border); color: var(--cb-text); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.modal-content { background: var(--cb-surface); border: 1px solid var(--cb-border-strong); border-radius: var(--cb-radius); color: var(--cb-text); }
.modal-header, .modal-footer { border-color: var(--cb-border); }
.modal .btn-close { filter: invert(1) grayscale(1) brightness(2); }
.dropdown-menu-dark { --bs-dropdown-bg: var(--cb-surface-2); --bs-dropdown-link-hover-bg: rgba(124, 77, 255, 0.25); --bs-dropdown-border-color: var(--cb-border-strong); }

.pagination {
  --bs-pagination-color: var(--cb-text);
  --bs-pagination-bg: var(--cb-surface-2);
  --bs-pagination-border-color: var(--cb-border-strong);
  --bs-pagination-hover-color: #fff;
  --bs-pagination-hover-bg: var(--cb-surface-3);
  --bs-pagination-hover-border-color: var(--cb-border-strong);
  --bs-pagination-focus-bg: var(--cb-surface-3);
  --bs-pagination-focus-color: #fff;
  --bs-pagination-focus-box-shadow: 0 0 0 0.2rem var(--cb-primary-soft);
  --bs-pagination-active-bg: var(--cb-primary);
  --bs-pagination-active-border-color: var(--cb-primary);
  --bs-pagination-disabled-bg: var(--cb-surface);
  --bs-pagination-disabled-color: var(--cb-text-muted);
  --bs-pagination-disabled-border-color: var(--cb-border);
  flex-wrap: wrap;
  gap: 4px;
}
.pagination .page-link { border-radius: 8px !important; min-width: 40px; text-align: center; }

/* ---------- Public header / nav ---------- */
header { margin: 0; padding: 0; border: 0; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: rgba(8, 11, 26, 0.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--cb-border);
}
.site-header-inner { display: flex; align-items: center; gap: 1rem; min-height: 72px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--cb-font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: #fff; }
.topnav { gap: 0.25rem; margin-left: auto; align-items: center; }
.topnav-link {
  font-family: var(--cb-font-ui);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cb-text-soft);
  text-decoration: none;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
}
.topnav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.topnav-link.active { color: #fff; background: var(--cb-primary-soft); box-shadow: inset 0 0 0 1px rgba(124, 77, 255, 0.45); }
.site-header-actions { display: flex; align-items: center; gap: 0.6rem; margin-left: 0.5rem; }
@media (max-width: 991.98px) { .site-header-actions { margin-left: auto; } }
@media (max-width: 420px) { .btn-header span { display: none; } .brand { font-size: 1.15rem; } }

.site-offcanvas { background: var(--cb-surface); color: var(--cb-text); border-left: 1px solid var(--cb-border); }
.offcanvas-nav { list-style: none; padding: 0; margin: 0; }
.offcanvas-nav a {
  display: block;
  padding: 0.85rem 0.25rem;
  border-bottom: 1px solid var(--cb-border);
  color: var(--cb-text);
  text-decoration: none;
  font-family: var(--cb-font-ui);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.offcanvas-nav a.active, .offcanvas-nav a:hover { color: var(--cb-accent); }

.topbar-search { position: relative; align-items: center; }
.topbar-search input {
  width: 100%;
  min-width: 220px;
  background: var(--cb-surface-2);
  border: 1px solid var(--cb-border-strong);
  border-radius: var(--cb-radius-pill);
  color: var(--cb-text);
  padding: 0.55rem 2.6rem 0.55rem 1rem;
}
.topbar-search input::placeholder { color: var(--cb-text-muted); }
.topbar-search button {
  position: absolute;
  right: 6px;
  border: 0;
  background: transparent;
  color: var(--cb-text-soft);
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

/* ---------- App (logged-in) layout ---------- */
.sidebar {
  background: linear-gradient(180deg, #121531 0%, #0d1027 100%);
  border-right: 1px solid var(--cb-border);
  color: var(--cb-text-soft);
  width: var(--cb-sidebar-w) !important;
  z-index: 1045;
}
@media (min-width: 992px) {
  .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0;
    height: 100vh;
    overflow-y: auto;
    visibility: visible !important;
    transform: none !important;
  }
  .app-main { margin-left: var(--cb-sidebar-w); }
}
@media (max-width: 991.98px) {
  .sidebar.offcanvas-lg { max-width: 86vw; }
}
.sidebar-content { display: flex; flex-direction: column; min-height: 100%; padding: 18px 14px; gap: 14px; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; }
.sidebar-header .brand { font-size: 1.15rem; }
.sidebar-search { position: relative; margin: 0; }
.sidebar-search input { background: var(--cb-surface-3); border: 1px solid var(--cb-border); color: var(--cb-text); padding-right: 38px; }
.sidebar-search button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--cb-text-muted); width: 32px; height: 32px; }
.sidebar-nav { list-style: none; padding: 0; margin: 0; max-height: none !important; flex: 1; }
.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--cb-text-soft);
  padding: 11px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
}
.sidebar .nav-link span { font-size: 0.95rem; text-transform: none; letter-spacing: 0; font-weight: 600; display: inline !important; }
.sidebar .nav-link i { width: 20px; text-align: center; font-size: 1.05rem; margin: 0 !important; }
.sidebar .nav-link:hover i { animation: none; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sidebar .nav-link.active { background: var(--cb-primary-soft); color: #fff; box-shadow: inset 3px 0 0 var(--cb-primary); }
.sidebar-section { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--cb-text-muted); padding: 16px 12px 6px; }
.sidebar-upgrade {
  display: block;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.35), rgba(93, 232, 186, 0.18));
  border: 1px solid rgba(124, 77, 255, 0.45);
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
}
.sidebar-upgrade strong { display: block; margin-bottom: 2px; }
.sidebar-upgrade span { color: var(--cb-text-soft); }
.sidebar-upgrade:hover { color: #fff; border-color: var(--cb-accent); }
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--cb-border);
}
.sidebar-footer-text { flex: 1; min-width: 0; }
.sidebar-footer .name { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer .sb-plan { font-size: 0.8rem; color: var(--cb-text-muted); }
.sidebar-footer .sb-plan.is-partner { color: #c7a8ff; }
.btn-logout { color: var(--cb-text-soft); padding: 8px; border-radius: 8px; }
.btn-logout:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 68px;
  padding: 0.6rem clamp(1rem, 0.5rem + 1.5vw, 2rem);
  background: rgba(8, 11, 26, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--cb-border);
}
.app-topbar .brand { font-size: 1.05rem; }
.app-topbar .topnav { margin-left: 0; }
.app-topbar .topbar-search { flex: 0 1 340px; margin-left: auto; }
.avatar-btn { border: 0; background: transparent; padding: 2px; border-radius: 50%; color: var(--cb-text-soft); display: inline-flex; align-items: center; gap: 4px; }
.avatar-btn img { border-radius: 50%; border: 2px solid var(--cb-border-strong); }
.app-page-head { padding: 1.5rem clamp(1rem, 0.5rem + 1.5vw, 2rem) 0; }
.app-page-title { font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.2rem); margin: 0; }
.is-app main { padding: 1.25rem clamp(1rem, 0.5rem + 1.5vw, 2rem) 2rem; }
.is-app main > .container, .is-app main .container { max-width: 1400px; }

/* Neutralise the legacy manual sidebar offsets — the new layout handles it */
.app-main .offset-md-2-5, .app-main .main-content.offset-md-2-5 { margin-left: 0 !important; }
.app-main .col-md-9-5 { width: 100% !important; }
#sidebarToggle, #sidebar-wrapper { display: none !important; }

.impersonation-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.6rem 1rem;
  background: #ffcc4d;
  color: #1c1400;
  position: relative;
  z-index: 1100;
}
.impersonation-bar .btn { margin-left: auto; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 4rem; border-top: 1px solid var(--cb-border); padding: 3rem 0 2.5rem; text-align: left; background: rgba(8, 11, 26, 0.6); }
.site-footer-inner { display: flex; flex-wrap: wrap; gap: 2.5rem; justify-content: space-between; }
.site-footer-brand { max-width: 320px; }
.site-footer-brand p { color: var(--cb-text-muted) !important; margin: 0.5rem 0 0; }
.site-footer-brand a:not(.brand) { color: var(--cb-text-soft) !important; }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 2.5rem 3.5rem; }
.site-footer-links h2 { font-family: var(--cb-font-body) !important; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--cb-text-muted); margin-bottom: 0.75rem; }
.site-footer-links ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.site-footer-links a { color: var(--cb-text-soft) !important; text-decoration: none; }
.site-footer-links a:hover { color: #fff !important; text-decoration: underline; }
footer, footer p, footer a, footer .nav-link { margin: 0; }

/* ---------- Section scaffolding ---------- */
.section { padding: clamp(3rem, 2rem + 4vw, 6rem) 0; }
.section-tight { padding: clamp(2rem, 1.5rem + 2vw, 3.5rem) 0; }
.eyebrow {
  display: inline-block;
  font-family: var(--cb-font-ui);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.9rem;
  color: var(--cb-accent);
  margin-bottom: 0.75rem;
}
.section-head { max-width: 720px; margin: 0 auto 2.5rem; text-align: center; }
.section-head p { color: var(--cb-text-soft); font-size: 1.1rem; }
.lead-soft { color: var(--cb-text-soft); font-size: clamp(1.05rem, 1rem + 0.35vw, 1.25rem); }
.page-intro { padding: 2rem 0 1rem; }
.page-intro p { color: var(--cb-text-soft); max-width: 680px; }

/* ---------- Clip grid + clip card (Discover, games, profiles, search, My Clips) ---------- */
.clip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.clip-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, var(--cb-surface-2), var(--cb-surface));
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  overflow: hidden;
  height: 100%;
  transition: transform .2s var(--cb-ease), box-shadow .2s var(--cb-ease), border-color .2s;
}
.clip-card:hover, .clip-card:focus-within { transform: translateY(-4px); box-shadow: var(--cb-shadow-glow); border-color: rgba(124, 77, 255, 0.5); }
.clip-card-media { position: relative; aspect-ratio: 16 / 9; background: #05070f; overflow: hidden; display: block; }
.clip-card-media img, .clip-card-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.clip-card-media video { opacity: 0; transition: opacity .25s; }
.clip-card.is-previewing .clip-card-media video { opacity: 1; }
.clip-card-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.55));
  opacity: 0.85;
  transition: opacity .2s;
}
.clip-card-play span {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(124, 77, 255, 0.92);
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}
.clip-card.is-previewing .clip-card-play { opacity: 0; }
.clip-card-badges { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; flex-wrap: wrap; z-index: 2; pointer-events: none; }
.clip-card-badges .badge-soft { backdrop-filter: blur(6px); background: rgba(8, 11, 26, 0.72); color: #fff; }
.clip-card-body { padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.clip-card-title { font-family: var(--cb-font-body) !important; font-size: 1.02rem; font-weight: 700; line-height: 1.35; margin: 0; color: #fff; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clip-card-link { color: inherit; text-decoration: none; }
.clip-card-link::after { content: ''; position: absolute; inset: 0; z-index: 1; } /* whole card is clickable */
.clip-card-link:hover { color: #fff; }
.clip-card-meta { display: flex; align-items: center; gap: 0.5rem; font-size: 0.86rem; color: var(--cb-text-muted); margin-top: auto; flex-wrap: wrap; }
.clip-card-meta img { width: 22px; height: 22px; border-radius: 50%; }
.clip-card-meta a { position: relative; z-index: 2; color: var(--cb-text-soft); text-decoration: none; }
.clip-card-meta a:hover { color: #fff; text-decoration: underline; }
.clip-card-meta .ups { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.clip-card-actions { position: absolute; top: 8px; right: 8px; z-index: 3; display: flex; gap: 6px; opacity: 0; transition: opacity .2s; }
.clip-card:hover .clip-card-actions, .clip-card:focus-within .clip-card-actions { opacity: 1; }
.clip-card-actions button, .clip-card-actions a {
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: rgba(8, 11, 26, 0.8); color: #fff; text-decoration: none;
}
.clip-card-actions button[aria-pressed="true"] { background: var(--cb-primary); }
@media (hover: none) { .clip-card-actions { opacity: 1; } }

/* ---------- Clip player dialog ---------- */
.clip-dialog .modal-dialog { max-width: min(1100px, 94vw); }
.clip-dialog .modal-body { padding: 0; }
.clip-dialog video { width: 100%; max-height: 70vh; background: #000; display: block; }
.clip-dialog-info { padding: 1.1rem 1.25rem 1.25rem; display: grid; gap: 0.75rem; }
.clip-dialog-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.vote-group { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--cb-border-strong); border-radius: var(--cb-radius-pill); overflow: hidden; }
.vote-group button { border: 0; background: transparent; color: var(--cb-text); padding: 0.45rem 0.85rem; display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; }
.vote-group button:hover { background: rgba(255, 255, 255, 0.08); }
.vote-group button[aria-pressed="true"].vote-up { color: var(--cb-success); }
.vote-group button[aria-pressed="true"].vote-down { color: var(--cb-danger); }
.vote-group .vote-count { min-width: 1.5rem; }

/* ---------- Streamer chip / avatar list ---------- */
.streamer-chip { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--cb-text); text-decoration: none; font-weight: 600; }
.streamer-chip img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.streamer-chip:hover { color: #fff; text-decoration: underline; }

/* ---------- Empty states + skeletons ---------- */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  border: 1px dashed var(--cb-border-strong);
  border-radius: var(--cb-radius);
  background: rgba(255, 255, 255, 0.02);
}
.empty-state .icon { font-size: 2.2rem; color: var(--cb-accent); margin-bottom: 0.75rem; }
.empty-state h2, .empty-state h3 { font-family: var(--cb-font-body) !important; font-size: 1.25rem; }
.empty-state p { color: var(--cb-text-soft); max-width: 520px; margin: 0.5rem auto 1.25rem; }
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.1) 37%, rgba(255,255,255,0.04) 63%);
  background-size: 400% 100%;
  animation: cb-shimmer 1.4s ease infinite;
  border-radius: 8px;
}
.skeleton-card { height: 260px; border-radius: var(--cb-radius); }
@keyframes cb-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Progress / status ---------- */
.progress { background: rgba(255, 255, 255, 0.08); border-radius: var(--cb-radius-pill); height: 8px; }
.progress-bar { background: linear-gradient(90deg, var(--cb-primary), var(--cb-accent)); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--cb-text-muted); }
.status-dot.live { background: #ff3b6b; box-shadow: 0 0 0 0 rgba(255, 59, 107, 0.6); animation: cb-pulse 1.6s infinite; }
@keyframes cb-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 59, 107, 0.6); } 70% { box-shadow: 0 0 0 10px rgba(255, 59, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 107, 0); } }

/* ---------- Toasts ---------- */
.cb-toast { background: var(--cb-surface-2); color: var(--cb-text); border: 1px solid var(--cb-border-strong); border-radius: 12px; box-shadow: var(--cb-shadow); }
.cb-toast .toast-body { display: flex; align-items: center; gap: 0.6rem; }

/* ---------- Segmented tabs / filters ---------- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--cb-surface); border: 1px solid var(--cb-border); }
.seg a, .seg button { border: 0; background: transparent; color: var(--cb-text-soft); padding: 0.45rem 0.9rem; border-radius: 9px; font-weight: 600; text-decoration: none; font-size: 0.95rem; }
.seg a:hover, .seg button:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.seg a.active, .seg a[aria-current], .seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--cb-primary); color: #fff; }
.chip-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.8rem; border-radius: var(--cb-radius-pill); border: 1px solid var(--cb-border-strong); color: var(--cb-text-soft); text-decoration: none; font-size: 0.9rem; background: rgba(255, 255, 255, 0.03); }
.chip:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.chip.active { background: var(--cb-primary-soft); border-color: var(--cb-primary); color: #fff; }
.chip .count { color: var(--cb-text-muted); font-size: 0.8rem; }

/* ---------- Order page highlight cards ---------- */
#SuggestedHighlights { display: block; padding: 0; }
.highlight-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.highlight-card { margin: 0; border: 1px solid var(--cb-border); border-radius: var(--cb-radius); }
.highlight-card.is-hidden-by-owner { opacity: 0.55; }
.highlight-thumbnail { aspect-ratio: 16 / 9; height: auto; }
.highlight-title { font-family: var(--cb-font-body) !important; font-size: 1.05rem; }
.highlight-description { color: var(--cb-text-soft); font-size: 0.95rem; max-height: none; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.highlight-overlay { opacity: 1; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,0.55)); }
.highlight-feedback { gap: 0; margin: 0; border-top: 1px solid var(--cb-border); }
.btn-thumbs { font-size: 0.95rem; font-weight: 600; padding: 10px 0; }

/* ---------- Home page ---------- */
.hero { padding: clamp(2.5rem, 1rem + 5vw, 5.5rem) 0 clamp(2.5rem, 1.5rem + 3vw, 4rem); position: relative; }
.hero h1 { font-size: clamp(2.2rem, 1.2rem + 3.8vw, 4rem); line-height: 1.08; margin-bottom: 1.25rem; }
.hero .lead-soft { max-width: 560px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 1rem; }
.hero-proof { display: flex; align-items: center; gap: 0.75rem; color: var(--cb-text-soft); font-size: 0.95rem; flex-wrap: wrap; }
.avatar-stack { display: flex; }
.avatar-stack img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--cb-bg); margin-left: -10px; object-fit: cover; background: var(--cb-surface-2); }
.avatar-stack img:first-child { margin-left: 0; }
.hero-media {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--cb-border-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(124, 77, 255, 0.25);
  aspect-ratio: 16 / 10;
  background: #05070f;
}
.hero-media video, .hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-media-caption {
  position: absolute; left: 14px; right: 14px; bottom: 14px;
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.8rem; border-radius: 12px;
  background: rgba(8, 11, 26, 0.78); backdrop-filter: blur(8px);
  font-size: 0.92rem; color: #fff;
}
.hero-media-caption a { color: #fff; }
.logo-strip { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; justify-content: center; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; counter-reset: step; }
.step { position: relative; padding: 1.5rem; }
.step-num { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-family: var(--cb-font-display); font-weight: 800; background: var(--cb-primary-soft); color: #d9ccff; margin-bottom: 1rem; border: 1px solid rgba(124, 77, 255, 0.45); }
.step h3 { font-size: 1.2rem; }
.step p { color: var(--cb-text-soft); margin: 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.feature { padding: 1.5rem; }
.feature .icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; background: rgba(93, 232, 186, 0.14); color: var(--cb-accent); margin-bottom: 1rem; }
.feature h3 { font-size: 1.15rem; }
.feature p { color: var(--cb-text-soft); margin: 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.stat { text-align: center; padding: 1.5rem 1rem; }
.stat strong { display: block; font-family: var(--cb-font-display); font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.6rem); color: #fff; }
.stat span { color: var(--cb-text-soft); }
.compare-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 560px; }
.compare-table th, .compare-table td { padding: 0.9rem 1rem; border-bottom: 1px solid var(--cb-border); text-align: left; vertical-align: top; }
.compare-table thead th { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--cb-text-muted); }
.compare-table td.yes { color: var(--cb-success); font-weight: 700; }
.compare-table td.no { color: var(--cb-text-muted); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; max-width: 860px; margin: 0 auto; }
.plan { padding: 1.75rem; display: flex; flex-direction: column; gap: 1rem; }
.plan.is-featured { border-color: rgba(124, 77, 255, 0.6); box-shadow: var(--cb-shadow-glow); position: relative; }
.plan .price { font-family: var(--cb-font-display); font-size: 2.4rem; color: #fff; line-height: 1; }
.plan .price small { font-family: var(--cb-font-body); font-size: 1rem; color: var(--cb-text-muted); }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; color: var(--cb-text-soft); }
.plan li i { color: var(--cb-accent); margin-right: 0.5rem; }
.plan .btn { margin-top: auto; }
.plan-flag { position: absolute; top: -12px; right: 18px; }
.faq { max-width: 820px; margin: 0 auto; }
.faq details { border: 1px solid var(--cb-border); border-radius: 12px; background: rgba(255, 255, 255, 0.02); margin-bottom: 0.75rem; }
.faq summary { cursor: pointer; padding: 1rem 1.25rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.3rem; line-height: 1; color: var(--cb-accent); }
.faq details[open] summary::after { content: '–'; }
.faq details p { padding: 0 1.25rem 1.1rem; margin: 0; color: var(--cb-text-soft); }
.cta-band {
  border-radius: 24px;
  padding: clamp(2rem, 1.5rem + 3vw, 3.5rem);
  text-align: center;
  background: radial-gradient(120% 140% at 10% 0%, rgba(124, 77, 255, 0.45), transparent 55%),
              radial-gradient(120% 140% at 100% 100%, rgba(93, 232, 186, 0.28), transparent 50%),
              var(--cb-surface);
  border: 1px solid var(--cb-border-strong);
}
.cta-band p { color: var(--cb-text-soft); max-width: 560px; margin: 0.75rem auto 1.5rem; }
.quote { padding: 1.5rem; }
.quote p { font-size: 1.05rem; color: var(--cb-text); }
.quote footer { background: none; border: 0; padding: 0; margin: 0; }

/* ---------- Profile ---------- */
.profile-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; padding: 1.75rem; }
.profile-hero img.avatar { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(124, 77, 255, 0.6); }
.profile-hero h1 { margin: 0; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem); }
.profile-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-left: auto; }
.profile-stats div { text-align: center; }
.profile-stats strong { display: block; font-size: 1.5rem; font-family: var(--cb-font-display); }
.profile-stats span { color: var(--cb-text-muted); font-size: 0.85rem; }
.broadcast-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.broadcast-card .placeholder-thumb { aspect-ratio: 16 / 9; display: grid; place-items: center; background: linear-gradient(135deg, #1b1f3d, #0d1027); color: var(--cb-text-muted); font-size: 2rem; }

/* ---------- Motion & accessibility preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  #particle-container { display: none; }
  .clip-card:hover, .card-hover:hover, .btn:hover { transform: none !important; }
}
@media (max-width: 767.98px) {
  .clip-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
  .profile-stats { margin-left: 0; }
}
@media (max-width: 480px) {
  .clip-grid { grid-template-columns: 1fr; }
}

/* ---------- Legacy page contrast fixes (analytics, discord, admin) ---------- */
.refresh-btn { border-color: var(--cb-link) !important; color: var(--cb-link) !important; }
.refresh-btn:hover { background: var(--cb-primary) !important; border-color: var(--cb-primary) !important; color: #fff !important; }
.chart-subtitle, .stat-label, .metric-label { color: var(--cb-text-muted) !important; }
.btn-success { background: var(--cb-accent); border-color: transparent; color: #06121a; }
.btn-success:hover { background: var(--cb-accent-hover); color: #06121a; }
.btn.disabled, .btn:disabled { color: var(--cb-text-soft) !important; }
#heroSound { position: relative; z-index: 3; }

/* Order-page player: undo the legacy side-by-side #videoModal layout from styles.css */
#videoModal.clip-dialog .modal-dialog { max-width: min(1100px, 94vw) !important; margin: 1.75rem auto !important; }
#videoModal.clip-dialog .modal-content { display: block; max-height: none; }
#videoModal.clip-dialog .modal-body { display: block; max-height: none; overflow: visible; padding: 0; }
.highlight-actions .btn-sm { padding: 0.4rem 0.7rem; font-size: 0.8rem; }

/* ---------- Home: floating streamers (social proof) + overview video ---------- */
.proof-stage { position: relative; overflow: hidden; padding-bottom: clamp(1.5rem, 1rem + 2vw, 3rem); }
.proof-stage > .hero, .proof-stage > .container { position: relative; z-index: 1; }
.proof-stage .clipbot-mosaic {
  position: absolute; inset: 0; top: 0; height: 100%; width: 100%;
  z-index: 0; opacity: 0.2; pointer-events: none;
}
/* The streamers themselves use the original slide animation from styles.css, unchanged:
   no mask, clipping or rounded corners here — those made it stutter in Chrome. */
.proof-stage .clipbot-streamer span { font-size: 0.8em; }
.clipbot-proof-title {
  text-align: center; margin: 0;
  font-family: var(--cb-font-display); font-weight: 800;
  font-size: clamp(1.3rem, 0.9rem + 1.8vw, 2.2rem);
  color: var(--cb-highlight);
  text-shadow: 0 0 10px #8f1fc3, 0 0 22px rgba(7, 255, 118, 0.55), 0 0 32px rgba(143, 31, 195, 0.5);
}
.overview-video { cursor: pointer; }
.overview-video img, .overview-video video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.overview-video video { object-fit: contain; }
.overview-play {
  position: absolute; inset: 0; border: 0; background: linear-gradient(180deg, rgba(8,11,26,0) 40%, rgba(8,11,26,.55));
  display: grid; place-items: center; cursor: pointer;
}
.overview-play span {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
  background: var(--cb-primary); color: #fff; font-size: 1.7rem;
  box-shadow: 0 0 0 10px rgba(112, 69, 245, 0.25), 0 16px 40px rgba(0,0,0,.5);
  transition: transform .2s var(--cb-ease);
}
.overview-play:hover span, .overview-play:focus-visible span { transform: scale(1.08); }
/* Reduce Motion: streamers still appear, but fade in place instead of sliding across. */
@keyframes clipbot-fadeInOut { 0%, 100% { opacity: 0; } 20%, 80% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .proof-stage .clipbot-streamer {
    /* longhands, so each streamer's inline animation-delay still staggers them */
    animation-name: clipbot-fadeInOut !important; animation-duration: 16s !important;
    animation-timing-function: ease-in-out !important; animation-iteration-count: infinite !important;
    animation-fill-mode: backwards !important;
  }
}

/* ---------- How it works: the story of one stream ---------- */
.story { position: relative; display: grid; gap: clamp(2.5rem, 2rem + 3vw, 5rem); margin: 0; }
.story::before {
  content: ''; position: absolute; left: 27px; top: 10px; bottom: 10px; width: 2px;
  background: linear-gradient(180deg, var(--cb-primary), var(--cb-accent) 60%, transparent);
  opacity: .45;
}
.story-step { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 1rem 1.5rem; }
.story-marker { grid-row: span 2; display: flex; flex-direction: column; align-items: center; gap: .4rem; position: relative; z-index: 1; }
.story-dot {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.25rem;
  background: var(--cb-surface-2); border: 1px solid rgba(112, 69, 245, .55); color: #d9ccff;
  box-shadow: 0 0 0 6px var(--cb-bg), 0 10px 30px rgba(112, 69, 245, .25);
}
.story-time { order: 2; font-family: var(--cb-font-ui); font-weight: 700; font-size: .8rem; letter-spacing: .08em; color: var(--cb-accent); text-transform: uppercase; text-align: center; background: var(--cb-bg); padding: 2px 4px; }
.story-copy h3 { font-size: clamp(1.25rem, 1rem + .9vw, 1.7rem); margin-bottom: .6rem; }
.story-copy p { color: var(--cb-text-soft); font-size: 1.05rem; }
.story-tip { font-size: .95rem !important; background: rgba(93, 232, 186, .08); border: 1px solid rgba(93, 232, 186, .25); border-radius: 10px; padding: .6rem .8rem; }
.story-tip i { color: var(--cb-accent); margin-right: .35rem; }
.story-signals { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.story-signals li { display: flex; align-items: center; gap: .5rem; padding: .55rem .7rem; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--cb-border); color: var(--cb-text); font-weight: 500; }
.story-signals i { color: var(--cb-accent); width: 18px; text-align: center; }
.story-visual { grid-column: 2; }
@media (min-width: 992px) {
  .story::before { left: 50%; transform: translateX(-1px); }
  .story-step { grid-template-columns: 1fr 80px 1fr; align-items: center; gap: 2rem; }
  .story-marker { grid-column: 2; grid-row: 1; }
  .story-copy { grid-column: 1; grid-row: 1; text-align: right; }
  .story-visual { grid-column: 3; grid-row: 1; }
  .story-step:nth-child(even) .story-copy { grid-column: 3; text-align: left; }
  .story-step:nth-child(even) .story-visual { grid-column: 1; }
  .story-copy .story-signals { direction: ltr; text-align: left; }
  .story-step:nth-child(odd) .story-tip { display: inline-block; }
}
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--cb-ease), transform .7s var(--cb-ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* Mock-ups used as illustrations */
.mock-card {
  background: linear-gradient(160deg, var(--cb-surface-2), var(--cb-surface));
  border: 1px solid var(--cb-border-strong); border-radius: 18px; padding: 1.1rem;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.mock-live-top { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.mock-live-screen { aspect-ratio: 16 / 9; border-radius: 12px; background-size: cover; background-position: center; margin-bottom: .75rem; }
.mock-chat { display: grid; gap: .3rem; font-size: .92rem; }
.mock-chat p { margin: 0; padding: .35rem .6rem; border-radius: 8px; background: rgba(255,255,255,.04); animation: mockChat 6s infinite both; }
.mock-chat p:nth-child(2) { animation-delay: .6s; } .mock-chat p:nth-child(3) { animation-delay: 1.2s; }
@keyframes mockChat { 0%, 8% { opacity: 0; transform: translateY(6px); } 14%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.mock-progress { animation: mockProgress 5s ease-in-out infinite alternate; }
@keyframes mockProgress { from { width: 18%; } to { width: 86%; } }
.mock-wave { width: 100%; height: auto; display: block; margin-bottom: .4rem; }
.mock-peaks circle { fill: var(--cb-highlight); stroke: #080b1a; stroke-width: 3; animation: mockPulse 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.mock-peaks circle:nth-child(2) { animation-delay: .3s; } .mock-peaks circle:nth-child(3) { animation-delay: .6s; }
@keyframes mockPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }
.mock-scores li { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-bottom: 1px solid var(--cb-border); flex-wrap: wrap; }
.mock-scores li:last-child { border-bottom: 0; }
.mock-scores li span:nth-child(2) { flex: 1; min-width: 140px; }
.mock-scores .score { width: 44px; text-align: center; font-family: var(--cb-font-display); font-weight: 800; border-radius: 8px; padding: .2rem 0; background: rgba(255,255,255,.06); }
.mock-scores .score.is-top { background: rgba(255, 244, 92, .16); color: #fff6a6; }
.mock-scores li.is-cut { opacity: .45; text-decoration: line-through; }
.mock-clips { position: relative; height: 300px; }
.mock-clip {
  position: absolute; width: 72%; left: calc(var(--i) * 14%); top: calc(var(--i) * 70px);
  border-radius: 14px; overflow: hidden; border: 1px solid var(--cb-border-strong);
  box-shadow: 0 20px 50px rgba(0,0,0,.55); background: var(--cb-surface); text-decoration: none;
  transform: rotate(calc((var(--i) - 1) * 3deg)); transition: transform .25s var(--cb-ease), z-index 0s;
}
.mock-clip:hover, .mock-clip:focus-visible { transform: rotate(0) translateY(-6px); z-index: 5; }
.mock-clip img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.mock-clip span { display: block; padding: .5rem .7rem; color: #fff; font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mock-phone {
  width: 210px; aspect-ratio: 9 / 19; border-radius: 30px; padding: 10px; position: relative;
  background: #05070f; border: 2px solid var(--cb-border-strong); box-shadow: 0 30px 70px rgba(0,0,0,.6), 0 0 0 6px rgba(112,69,245,.15);
  display: grid; grid-template-rows: 1fr 2fr; gap: 4px; overflow: hidden;
}
.mock-phone-cam, .mock-phone-game { border-radius: 18px 18px 4px 4px; background-size: cover; }
.mock-phone-cam { background-position: 100% 0; background-size: 330%; }
.mock-phone-game { border-radius: 4px 4px 18px 18px; background-position: 30% 60%; background-size: 260%; }
.mock-phone-caption {
  position: absolute; left: 14px; right: 14px; top: 58%; text-align: center;
  font-family: 'Bangers', 'Impact', sans-serif; font-weight: 800; font-size: 1.15rem; line-height: 1.1; color: #fff;
  text-shadow: 2px 2px 0 #000, -2px 2px 0 #000, 2px -2px 0 #000, -2px -2px 0 #000;
  animation: mockCaption 3s ease-in-out infinite;
}
@keyframes mockCaption { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.feature-video { aspect-ratio: 16 / 9; }
.feature-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 575.98px) {
  .story-signals { grid-template-columns: 1fr; }
  .mock-clips { height: 240px; }
  .mock-clip { width: 80%; left: calc(var(--i) * 10%); top: calc(var(--i) * 56px); }
}

/* How it works: compact intro so the story is visible almost immediately */
.story-hero { padding: clamp(1.25rem, 0.8rem + 1.5vw, 2.25rem) 0 0; }
.story-hero-inner { display: flex; align-items: center; gap: clamp(1rem, 0.5rem + 2vw, 2.5rem); }
.story-hero-text { flex: 1 1 auto; min-width: 0; max-width: 760px; }
.story-hero h1 { font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.5rem); line-height: 1.15; margin-bottom: .6rem; }
.story-hero .eyebrow { margin-bottom: .4rem; }
.story-hero-video { flex: 0 0 340px; aspect-ratio: 16 / 9; border-radius: 16px; }
.story-hero-video .overview-play span { width: 60px; height: 60px; font-size: 1.2rem; box-shadow: 0 0 0 7px rgba(112, 69, 245, .25), 0 10px 26px rgba(0,0,0,.5); }
.story-hero-video .hero-media-caption { left: 10px; right: auto; bottom: 10px; padding: .35rem .6rem; font-size: .8rem; }
.story-hero-video.is-playing { flex-basis: 520px; }
.story-section { padding-top: clamp(1.75rem, 1rem + 2vw, 3rem); }
.story-section .section-head { margin-bottom: 1.75rem; }
@media (max-width: 991.98px) {
  .story-hero-inner { flex-direction: column; align-items: stretch; }
  .story-hero-video { flex-basis: auto; max-width: 420px; width: 100%; }
}

/* ==========================================================================
   Shorts editor
   ========================================================================== */
/* Same TTF files the server renders with, so the preview matches the export */
@font-face { font-family: 'CB Bangers'; src: url('/public/fonts/Bangers-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'CB Anton'; src: url('/public/fonts/Anton-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'CB Bebas'; src: url('/public/fonts/BebasNeue-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'CB Spartan'; src: url('/public/fonts/LeagueSpartan-Bold.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'CB Montserrat'; src: url('/public/fonts/Montserrat-Bold.ttf') format('truetype'); font-display: swap; }

.se .modal-content { background: var(--cb-bg); border: 0; border-radius: 0; }
.se-head { display: flex; align-items: center; gap: 1rem; padding: .75rem 1.25rem; border-bottom: 1px solid var(--cb-border); background: var(--cb-surface); }
.se-title { font-family: var(--cb-font-body) !important; font-size: 1.15rem; margin: 0; }
.se-sub { margin: 0; color: var(--cb-text-muted); font-size: .85rem; max-width: 40vw; }
.se-head-actions { margin-left: auto; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.se-confirm { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; border-radius: 0; }
.se-confirm span { flex: 1; min-width: 220px; }
.se-shortcuts { position: absolute; right: 1.25rem; top: 64px; z-index: 20; width: 320px; box-shadow: var(--cb-shadow); }
.se-shortcuts dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem .9rem; margin: 0; font-size: .88rem; }
.se-shortcuts dt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--cb-accent); font-weight: 600; }
.se-shortcuts dd { margin: 0; color: var(--cb-text-soft); }

.se-body { display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; gap: 1rem; padding: 1rem 1.25rem; overflow: auto; }
.se-panel { display: flex; flex-direction: column; gap: .75rem; min-width: 0; }
.se-tabs { width: 100%; }
.se-tabs button { flex: 1; font-size: .88rem; padding: .45rem .5rem; }
.se-pane { background: var(--cb-surface); border: 1px solid var(--cb-border); border-radius: var(--cb-radius); padding: 1rem; overflow: auto; max-height: calc(100vh - 200px); }
.se-label { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--cb-text-muted); font-weight: 600; margin-bottom: .4rem; }
.se-templates { display: grid; gap: .5rem; }
.se-template { display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; border: 1px solid var(--cb-border-strong); border-radius: 12px; cursor: pointer; font-weight: 600; font-size: .92rem; }
.se-template input { position: absolute; opacity: 0; pointer-events: none; }
.se-template:has(input:checked) { border-color: var(--cb-primary); background: var(--cb-primary-soft); }
.se-template:has(input:focus-visible) { outline: 3px solid var(--cb-accent); outline-offset: 2px; }
.se-tpl-art { width: 28px; height: 48px; border-radius: 5px; border: 1.5px solid var(--cb-text-muted); position: relative; overflow: hidden; flex: none; }
.se-tpl-art i, .se-tpl-art b { position: absolute; display: block; }
.se-tpl-stacked i { inset: 0 0 66% 0; background: #ff6b85; } .se-tpl-stacked b { inset: 34% 0 0 0; background: #3ddc97; }
.se-tpl-full b { inset: 28% 0 28% 0; background: #3ddc97; } .se-tpl-full i { right: 2px; top: 3px; width: 11px; height: 7px; background: #ff6b85; }
.se-tpl-crop b { inset: 0; background: #3ddc97; } .se-tpl-crop i { right: 2px; top: 3px; width: 11px; height: 7px; background: #ff6b85; }
.se-corners { display: grid; grid-template-columns: repeat(2, 44px); gap: 6px; }
.se-corners label { width: 44px; height: 44px; position: relative; cursor: pointer; }
.se-corners input { position: absolute; opacity: 0; }
.se-corners span { position: absolute; inset: 0; border-radius: 8px; border: 1px solid var(--cb-border-strong); background: rgba(255,255,255,.03); }
.se-corners label:nth-child(1) span::after, .se-corners label:nth-child(2) span::after, .se-corners label:nth-child(3) span::after, .se-corners label:nth-child(4) span::after { content: ''; position: absolute; width: 14px; height: 10px; border-radius: 2px; background: var(--cb-text-muted); }
.se-corners label:nth-child(1) span::after { left: 5px; top: 5px; } .se-corners label:nth-child(2) span::after { right: 5px; top: 5px; }
.se-corners label:nth-child(3) span::after { left: 5px; bottom: 5px; } .se-corners label:nth-child(4) span::after { right: 5px; bottom: 5px; }
.se-corners input:checked + span { border-color: var(--cb-primary); background: var(--cb-primary-soft); }
.se-corners input:checked + span::after { background: #ff6b85; }
.se-corners input:focus-visible + span { outline: 3px solid var(--cb-accent); outline-offset: 2px; }

.se-presets { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.se-presets label { cursor: pointer; }
.se-presets input { position: absolute; opacity: 0; }
.se-presets span { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .6rem .3rem; border-radius: 12px; border: 1px solid var(--cb-border-strong); background: #0b0d18; text-align: center; }
.se-presets b { font-family: 'CB Bangers', sans-serif; font-weight: 400; font-size: 1.05rem; letter-spacing: .02em; color: #fff; -webkit-text-stroke: 1px #000; text-shadow: 2px 2px 0 rgba(0,0,0,.6); }
.se-presets b em { font-style: normal; color: var(--cb-highlight); }
.se-presets .p-pop { font-family: 'CB Anton', sans-serif; font-size: 1.3rem; color: var(--cb-highlight); }
.se-presets .p-clean { font-family: 'CB Montserrat', sans-serif; -webkit-text-stroke: 0; font-size: .95rem; }
.se-presets small { font-size: .72rem; color: var(--cb-text-muted); }
.se-presets input:checked + span { border-color: var(--cb-primary); box-shadow: 0 0 0 1px var(--cb-primary) inset; }
.se-presets input:focus-visible + span { outline: 3px solid var(--cb-accent); outline-offset: 2px; }
.se-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.se-swatches button, .se-swatch-custom { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--cb-border-strong); background: var(--sw); cursor: pointer; padding: 0; position: relative; }
.se-swatches button[aria-checked="true"] { box-shadow: 0 0 0 2px var(--cb-bg), 0 0 0 4px var(--cb-accent); }
.se-swatch-custom { display: grid; place-items: center; background: conic-gradient(#ff6b85, #fff45c, #5de8ba, #58c7ff, #b9a3ff, #ff6b85); color: #000; font-size: .7rem; }
.se-swatch-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.se-caplist { display: grid; gap: .4rem; margin: 0; max-height: 46vh; overflow: auto; }
.se-cap { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "time actions" "text text"; gap: .35rem; align-items: center; padding: .45rem; border-radius: 10px; border: 1px solid var(--cb-border); background: rgba(255,255,255,.02); }
.se-cap > .se-cap-time { grid-area: time; justify-self: start; }
.se-cap > .se-cap-actions { grid-area: actions; justify-self: end; }
.se-cap > input, .se-cap > select { grid-area: text; }
.se-cap.selected { border-color: var(--cb-primary); background: var(--cb-primary-soft); }
.se-cap-time { border: 0; background: rgba(255,255,255,.06); color: var(--cb-text-soft); border-radius: 7px; font-size: .74rem; padding: .3rem .4rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.se-cap-actions { display: flex; gap: 2px; }
.se-cap-actions button { border: 0; background: transparent; color: var(--cb-text-muted); width: 26px; height: 28px; border-radius: 6px; }
.se-cap-actions button:hover { background: rgba(255,255,255,.08); color: #fff; }
.se-empty { padding: .6rem; border: 1px dashed var(--cb-border-strong); border-radius: 10px; }
.se-inline { display: inline-flex; align-items: center; gap: .35rem; color: var(--cb-text-muted); }
.se-inline input { width: 84px; }

.se-main { min-width: 0; display: flex; flex-direction: column; }
.se-stage { position: relative; background: #000; border-radius: var(--cb-radius); overflow: hidden; height: min(52vh, 560px); border: 1px solid var(--cb-border); }
.se-stage video { width: 100%; height: 100%; object-fit: contain; display: block; }
.se-boxes { position: absolute; }
.se-box { position: absolute; border: 2px solid; border-radius: 4px; cursor: move; touch-action: none; box-shadow: 0 0 0 9999px rgba(0,0,0,0); }
.se-box-gp { border-color: #3ddc97; background: rgba(61,220,151,.08); }
.se-box-wc { border-color: #ff6b85; background: rgba(255,107,133,.12); z-index: 2; }
.se-box.is-dragging, .se-box:focus-visible { outline: 3px solid var(--cb-accent) !important; outline-offset: 0 !important; }
.se-box-label { position: absolute; left: -2px; top: -24px; font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 6px 6px 6px 0; color: #06121a; white-space: nowrap; pointer-events: none; }
.se-box-gp .se-box-label { background: #3ddc97; } .se-box-wc .se-box-label { background: #ff6b85; }
.se-h { position: absolute; width: 16px; height: 16px; background: #fff; border: 2px solid #111; border-radius: 50%; touch-action: none; }
.se-h.nw { left: -9px; top: -9px; cursor: nwse-resize; } .se-h.ne { right: -9px; top: -9px; cursor: nesw-resize; }
.se-h.sw { left: -9px; bottom: -9px; cursor: nesw-resize; } .se-h.se { right: -9px; bottom: -9px; cursor: nwse-resize; }
.se-loading, .se-error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; background: rgba(8,11,26,.85); color: var(--cb-text-soft); text-align: center; padding: 1rem; }
.se-transport { display: flex; align-items: center; gap: .5rem; margin: .5rem 0; }
.se-time, .se-length { font-variant-numeric: tabular-nums; font-size: .9rem; color: var(--cb-text-soft); }

.se-timeline { position: relative; user-select: none; touch-action: none; background: var(--cb-surface); border: 1px solid var(--cb-border); border-radius: 12px; padding: 0 0 6px; cursor: text; }
.se-ruler { position: relative; height: 24px; border-bottom: 1px solid var(--cb-border); }
.se-ruler i { position: absolute; bottom: 0; width: 1px; height: 6px; background: var(--cb-border-strong); }
.se-ruler i.major { height: 11px; background: var(--cb-text-muted); }
.se-ruler i span { position: absolute; bottom: 12px; left: 3px; font-size: .68rem; color: var(--cb-text-muted); font-style: normal; white-space: nowrap; }
.se-track { position: relative; margin: 6px 0 0; }
.se-track-video { height: 44px; background: linear-gradient(90deg, rgba(112,69,245,.35), rgba(93,232,186,.25)); border-radius: 6px; margin: 6px 8px 0; }
.se-trim-shade { position: absolute; top: 0; bottom: 0; background: rgba(0,0,0,.62); pointer-events: none; }
.se-trim-shade.left { left: 0; border-radius: 6px 0 0 6px; } .se-trim-shade.right { border-radius: 0 6px 6px 0; }
.se-trim-handle { position: absolute; top: -4px; bottom: -4px; width: 14px; margin-left: -7px; background: var(--cb-highlight); border-radius: 5px; cursor: ew-resize; z-index: 3; touch-action: none; }
.se-trim-handle::after { content: ''; position: absolute; left: 5px; top: 30%; bottom: 30%; width: 4px; border-left: 1px solid #333; border-right: 1px solid #333; }
.se-trim-handle span { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: .7rem; font-weight: 700; color: var(--cb-highlight); white-space: nowrap; }
.se-track-captions, .se-track-zooms { height: 26px; margin: 6px 8px 0; background: rgba(255,255,255,.03); border-radius: 6px; }
.se-cap-bar, .se-zoom-mark { position: absolute; top: 2px; bottom: 2px; border-radius: 5px; overflow: hidden; cursor: grab; display: flex; align-items: center; font-size: .7rem; font-weight: 600; touch-action: none; }
.se-cap-bar { background: rgba(88,199,255,.28); border: 1px solid rgba(88,199,255,.7); color: #d8f2ff; }
.se-cap-bar span { padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.se-cap-bar.selected, .se-zoom-mark.selected { outline: 2px solid var(--cb-highlight); z-index: 2; }
.se-edge { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.se-edge.l { left: 0; } .se-edge.r { right: 0; }
.se-zoom-mark { background: rgba(255,159,67,.3); border: 1px solid rgba(255,159,67,.8); color: #ffd9b3; justify-content: center; min-width: 18px; }
.se-playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; pointer-events: none; z-index: 4; box-shadow: 0 0 6px rgba(255,255,255,.7); }
.se-playhead::before { content: ''; position: absolute; top: 0; left: -5px; border: 6px solid transparent; border-top-color: #fff; }

.se-side { display: flex; flex-direction: column; min-width: 0; }
.se-preview-wrap { position: relative; width: 100%; max-width: 300px; margin: 0 auto; aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; border: 1px solid var(--cb-border-strong); background: #000; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.se-preview-wrap canvas { width: 100%; height: 100%; display: block; }
.se-safe span { position: absolute; display: flex; align-items: center; justify-content: center; font-size: .62rem; font-weight: 700; color: #fff; background: rgba(255, 107, 133, .28); border: 1px dashed rgba(255, 107, 133, .9); text-align: center; padding: 2px; }
.se-safe .top { left: 0; right: 0; top: 0; height: 8%; }
.se-safe .right { right: 0; top: 38%; width: 15%; height: 42%; writing-mode: vertical-rl; }
.se-safe .bottom { left: 0; right: 0; bottom: 0; height: 17%; }
.se-platforms { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.se-export-status { margin-top: .6rem; }

@media (max-width: 1199.98px) {
  .se-body { grid-template-columns: 280px minmax(0, 1fr); }
  .se-side { grid-column: 1 / -1; display: grid; grid-template-columns: 240px 1fr; gap: 1rem; align-items: start; }
  .se-side > :not(.se-preview-wrap) { grid-column: 2; }
  .se-preview-wrap { grid-row: 1 / span 6; }
}
@media (max-width: 767.98px) {
  .se-head { padding: .6rem .75rem; }
  .se-head-actions .btn span { display: none; }
  .se-sub { max-width: 60vw; }
  .se-body { grid-template-columns: 1fr; padding: .75rem; }
  .se-side { order: -1; display: flex; }
  .se-preview-wrap { max-width: 200px; }
  .se-stage { height: 34vh; }
  .se-pane { max-height: none; }
  .se-h { width: 22px; height: 22px; }
}

/* ---------- Leaderboard ---------- */
.lb { --gold-1: #fff1a8; --gold-2: #ffc93c; --gold-3: #d08a12;
      --silver-1: #ffffff; --silver-2: #cfd6e4; --silver-3: #8590a6;
      --bronze-1: #ffd2ac; --bronze-2: #e6955a; --bronze-3: #9c5327; }
.lb-hero { position: relative; overflow: hidden; padding: clamp(1.5rem, 1rem + 2vw, 3rem) 0 clamp(1rem, .5rem + 1vw, 1.5rem);
  background: radial-gradient(ellipse 60% 90% at 50% 0%, rgba(255, 201, 60, .16), transparent 70%); }
.lb-beams { position: absolute; inset: -20% 0 auto; height: 160%; pointer-events: none; opacity: .5;
  background:
    conic-gradient(from 180deg at 50% -10%, transparent 160deg, rgba(255, 214, 102, .22) 172deg, transparent 180deg, rgba(112, 69, 245, .25) 190deg, transparent 200deg);
  animation: lb-sway 9s ease-in-out infinite alternate; transform-origin: 50% 0; }
@keyframes lb-sway { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
.lb-hero .eyebrow { color: var(--gold-2); }
.lb-title { font-family: var(--cb-font-display); font-weight: 800; letter-spacing: .02em; margin: .2rem 0 .5rem;
  font-size: clamp(2.2rem, 1.4rem + 4vw, 4.2rem); line-height: 1;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2) 55%, var(--gold-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 18px rgba(255, 201, 60, .35)); }
.lb-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.lb-tabs { display: inline-flex; padding: 4px; border-radius: var(--cb-radius-pill); background: var(--cb-surface-2); border: 1px solid var(--cb-border-strong); }
.lb-tabs button { border: 0; background: none; color: var(--cb-text-soft); font-weight: 700; padding: .5rem 1.1rem; border-radius: var(--cb-radius-pill); font-family: var(--cb-font-ui); font-size: 1.05rem; letter-spacing: .03em; }
.lb-tabs button[aria-selected="true"] { background: linear-gradient(180deg, var(--gold-2), var(--gold-3)); color: #1d1300; box-shadow: 0 6px 18px rgba(255, 201, 60, .3); }
.lb-tabs button:focus-visible { outline: 2px solid var(--gold-1); outline-offset: 2px; }
.lb-reset { display: inline-flex; align-items: center; gap: .5rem; color: var(--cb-text-soft); }
.lb-reset strong { font-family: var(--cb-font-display); color: #fff; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.lb-reset .fa-hourglass-half { color: var(--gold-2); }
.lb-h2 { font-family: var(--cb-font-body) !important; font-size: 1.15rem; margin-bottom: 1rem; }

/* Podium */
.podium { list-style: none; margin: clamp(1rem, .5rem + 2vw, 2.5rem) auto 0; padding: 0; max-width: 920px;
  display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: clamp(.5rem, .2rem + 1.5vw, 1.5rem); }
.podium-spot { display: flex; flex-direction: column; align-items: stretch; min-width: 0;
  animation: lb-rise .8s var(--cb-ease) backwards; animation-delay: calc((3 - var(--rank)) * .18s + .1s); }
.podium-spot.is-silver { order: 1; } .podium-spot.is-gold { order: 2; } .podium-spot.is-bronze { order: 3; }
@keyframes lb-rise { from { opacity: 0; transform: translateY(40px); } }
.podium-card { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .3rem;
  padding: 1.1rem .6rem 1rem; color: var(--cb-text); text-decoration: none; transition: transform .25s var(--cb-ease); }
.podium-card:hover, .podium-card:focus-visible { transform: translateY(-6px); color: #fff; }
.podium-avatar { position: relative; isolation: isolate; width: clamp(64px, 40px + 7vw, 104px); aspect-ratio: 1; border-radius: 50%; padding: 4px; margin-bottom: .4rem;
  background: conic-gradient(from 0deg, var(--t1), var(--t2), var(--t3), var(--t2), var(--t1)); box-shadow: 0 0 0 4px rgba(8, 11, 26, .9), 0 0 30px var(--glow); }
.podium-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: var(--cb-surface); }
.podium-title { font-family: var(--cb-font-ui); text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--t2); }
.podium-name { font-weight: 800; font-size: clamp(.95rem, .8rem + .6vw, 1.25rem); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-ups { font-family: var(--cb-font-display); font-weight: 800; font-size: clamp(1.15rem, .9rem + 1.2vw, 1.8rem); color: #fff; font-variant-numeric: tabular-nums; line-height: 1.1; display: flex; align-items: baseline; gap: .35rem; flex-wrap: wrap; justify-content: center; }
.podium-ups .fa-arrow-up { color: var(--cb-success); font-size: .75em; }
.podium-ups .fa-film { color: var(--t2); font-size: .7em; }
.podium-ups small { font-family: var(--cb-font-body); font-size: .5em; font-weight: 600; color: var(--cb-text-muted); letter-spacing: .02em; }
.podium-clips { font-size: .85rem; color: var(--cb-text-muted); }
.podium-block { position: relative; display: grid; place-items: center; border-radius: 14px 14px 4px 4px; overflow: hidden;
  height: var(--h); background: linear-gradient(180deg, var(--t2), var(--t3)); box-shadow: inset 0 2px 0 rgba(255,255,255,.55), inset 0 -18px 30px rgba(0,0,0,.25), 0 18px 40px rgba(0,0,0,.4);
  transform-origin: bottom; animation: lb-grow .9s var(--cb-ease) backwards; animation-delay: calc((3 - var(--rank)) * .18s); }
.podium-block::before { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.35) 45%, transparent 60%); transform: translateX(-100%); animation: lb-shine 5s ease-in-out infinite; animation-delay: calc(var(--rank) * .7s + 1s); }
.podium-block span { position: relative; font-family: var(--cb-font-display); font-weight: 800; font-size: clamp(2rem, 1.2rem + 3vw, 3.6rem); color: rgba(0,0,0,.28); text-shadow: 0 1px 0 rgba(255,255,255,.45); }
@keyframes lb-grow { from { transform: scaleY(0); } }
@keyframes lb-shine { 0%, 60% { transform: translateX(-100%); } 85%, 100% { transform: translateX(100%); } }
.is-gold   { --t1: var(--gold-1);   --t2: var(--gold-2);   --t3: var(--gold-3);   --glow: rgba(255, 201, 60, .55); --h: clamp(110px, 70px + 8vw, 180px); }
.is-silver { --t1: var(--silver-1); --t2: var(--silver-2); --t3: var(--silver-3); --glow: rgba(207, 214, 228, .35); --h: clamp(80px, 50px + 5.5vw, 125px); }
.is-bronze { --t1: var(--bronze-1); --t2: var(--bronze-2); --t3: var(--bronze-3); --glow: rgba(230, 149, 90, .35); --h: clamp(60px, 40px + 4vw, 95px); }
/* The champion: bigger, a spinning ring, a floating crown and a spotlight */
.podium-spot.is-gold .podium-avatar { width: clamp(84px, 50px + 9vw, 136px); }
.podium-spot.is-gold .podium-avatar::before { content: ''; position: absolute; inset: -8px; border-radius: 50%; z-index: -1;
  background: conic-gradient(from 0deg, transparent, var(--gold-1), transparent 30%, var(--gold-2), transparent 60%, var(--gold-1), transparent 90%);
  animation: lb-spin 6s linear infinite; filter: blur(2px); }
.podium-spot.is-gold .podium-card::before { content: ''; position: absolute; inset: -30% -20% 20%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 214, 102, .28), transparent); }
.podium-spot.is-gold .podium-name { color: var(--gold-1); }
.podium-crown { position: absolute; top: -.9rem; left: 50%; font-size: clamp(1.5rem, 1rem + 1.5vw, 2.3rem); color: var(--gold-2); z-index: 1;
  filter: drop-shadow(0 4px 10px rgba(255, 201, 60, .6)); animation: lb-bob 3s ease-in-out infinite; }
@keyframes lb-spin { to { transform: rotate(360deg); } }
@keyframes lb-bob { 0%, 100% { transform: translate(-50%, 0) rotate(-6deg); } 50% { transform: translate(-50%, -6px) rotate(6deg); } }
.podium .badge-soft { font-size: .68rem; }
.badge-soft.is-you { background: var(--cb-primary); color: #fff; border-color: transparent; }
.podium-spot.is-me .podium-card { outline: 2px solid var(--cb-primary); outline-offset: 4px; border-radius: 18px; }

/* Ranks 4+ */
.rank-list { list-style: none; margin: 1.25rem auto 0; padding: 0; max-width: 920px; display: grid; gap: .5rem; }
.rank-row { display: grid; grid-template-columns: 2.6rem minmax(0, 1.4fr) auto minmax(80px, 1fr) auto auto auto; align-items: center; gap: .5rem 1rem;
  padding: .6rem 1rem; border-radius: 14px; background: var(--cb-surface); border: 1px solid var(--cb-border);
  transition: transform .2s var(--cb-ease), border-color .2s, background .2s;
  animation: lb-rise .6s var(--cb-ease) backwards; }
.rank-row:nth-child(-n+8) { animation-delay: calc(.6s + var(--i, 0) * .05s); }
.rank-row:hover { transform: translateX(4px); border-color: var(--cb-border-strong); background: var(--cb-surface-2); }
.rank-row.is-me { border-color: var(--cb-primary); box-shadow: var(--cb-shadow-glow); background: linear-gradient(90deg, var(--cb-primary-soft), var(--cb-surface) 60%); }
.rank-num { font-family: var(--cb-font-display); font-weight: 800; font-size: 1.15rem; color: var(--cb-text-muted); text-align: center; font-variant-numeric: tabular-nums; }
.rank-who { display: flex; align-items: center; gap: .65rem; min-width: 0; color: var(--cb-text); text-decoration: none; font-weight: 700; }
.rank-who:hover { color: #fff; text-decoration: underline; }
.rank-who img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-tags { display: flex; gap: .3rem; }
.rank-bar, .game-bar { display: block; height: 6px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.rank-bar span, .game-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cb-primary), var(--cb-accent)); }
.rank-gap { font-size: .8rem; color: var(--cb-text-muted); white-space: nowrap; }
.rank-clips { font-size: .9rem; color: var(--cb-text-soft); white-space: nowrap; text-align: right; }
.rank-clips small { color: var(--cb-text-muted); }
.rank-ups { font-family: var(--cb-font-display); font-weight: 700; color: #fff; white-space: nowrap; text-align: right; min-width: 4.5rem; font-variant-numeric: tabular-nums; }
.rank-ups .fa-arrow-up { color: var(--cb-success); font-size: .8em; }
.rank-ups .fa-film { color: var(--cb-text-muted); font-size: .8em; }
.rank-ups small { font-family: var(--cb-font-body); font-size: .7em; color: var(--cb-text-muted); font-weight: 600; }
.lb-aside-wide { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; align-items: start; }
.lb-aside-wide > .panel { margin: 0 !important; }
.rank-me { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; max-width: 920px; margin: 1rem auto 0; border-color: var(--cb-primary); box-shadow: var(--cb-shadow-glow); }
.rank-me .rank-num { color: #fff; font-size: 1.6rem; }
.game-bars { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.game-bars a { display: flex; justify-content: space-between; gap: .5rem; color: var(--cb-text); text-decoration: none; margin-bottom: .3rem; font-weight: 600; }
.game-bars a:hover { color: #fff; text-decoration: underline; }
.lb-clips { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
@media (max-width: 767.98px) {
  .podium { gap: .35rem; }
  .podium-card { padding: .9rem .2rem .7rem; }
  .podium-clips, .podium-title { font-size: .68rem; }
  .rank-row { grid-template-columns: 2rem minmax(0, 1fr) auto; padding: .55rem .75rem; gap: .35rem .6rem; }
  .rank-ups { grid-column: 3; grid-row: 1; }
  .rank-tags, .rank-clips { display: none; }
  .rank-bar { grid-column: 2 / 3; grid-row: 2; }
  .rank-gap { grid-column: 3; grid-row: 2; text-align: right; }
}
