:root{
  --font-heading:'Sora', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-body:'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --bg:#0c0c0c;
  --bg-2:#161616;
  --panel:rgba(28,28,28,.92);
  --panel-2:rgba(20,20,20,.96);
  --panel-soft:rgba(255,255,255,.04);
  --text:#fff5ea;
  --muted:rgba(255,229,208,.68);
  --border:rgba(255,255,255,.09);
  --border-strong:rgba(255,140,67,.24);
  --accent:#ff5a00;
  --accent-2:#ff8a3d;
  --accent-soft:rgba(255,90,0,.16);
  --accent-soft-2:rgba(255,138,61,.10);
  --shadow:0 24px 60px rgba(0,0,0,.34);

  --friendly:#78f0ab;
  --friendly-soft:rgba(56,213,123,.14);
  --friendly-border:rgba(87,240,150,.28);

  --danger:#ff944d;
  --danger-soft:rgba(255,110,33,.16);
  --danger-border:rgba(255,139,73,.30);

  --info:#ffb579;
  --info-soft:rgba(255,147,69,.14);
  --info-border:rgba(255,168,96,.28);

  --safe-top:env(safe-area-inset-top, 0px);
  --safe-right:env(safe-area-inset-right, 0px);
  --safe-bottom:env(safe-area-inset-bottom, 0px);
  --safe-left:env(safe-area-inset-left, 0px);
  --mobile-tabbar-height:80px;
  --mobile-utility-height:48px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

html{
  scrollbar-color:rgba(255,126,50,.55) rgba(255,255,255,.06);
}

body{
  margin:0;
  font-family:var(--font-body);
  background:
    radial-gradient(880px 340px at 50% 0%, rgba(255,95,24,.24), transparent 64%),
    radial-gradient(760px 420px at 16% 16%, rgba(255,122,44,.10), transparent 70%),
    radial-gradient(920px 520px at 84% 88%, rgba(255,110,32,.09), transparent 76%),
    linear-gradient(180deg, #101010 0%, #0a0a0a 100%);
  color:var(--text);
  overflow-x:hidden;
  min-height:100vh;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,.012) 1px, transparent 1px);
  background-size:40px 40px;
  mask-image:linear-gradient(180deg, rgba(0,0,0,.42), transparent 88%);
  opacity:.24;
}

html[data-theme="dark"]{
  color-scheme:dark;
}

html[data-theme="light"]{
  color-scheme:light;
  --bg:#f7efe6;
  --bg-2:#efe4d8;
  --panel:rgba(255,255,255,.92);
  --panel-2:rgba(255,250,245,.98);
  --panel-soft:rgba(108,74,47,.05);
  --text:#26180f;
  --muted:rgba(98,67,44,.72);
  --border:rgba(114,80,49,.12);
  --border-strong:rgba(232,109,31,.26);
  --accent:#e86d1f;
  --accent-2:#f4a352;
  --accent-soft:rgba(232,109,31,.14);
  --accent-soft-2:rgba(244,163,82,.09);
  --shadow:0 20px 44px rgba(138,94,50,.14);
  --friendly:#1c8f5c;
  --friendly-soft:rgba(40,161,104,.12);
  --friendly-border:rgba(40,161,104,.24);
  --danger:#c96a2d;
  --danger-soft:rgba(201,106,45,.12);
  --danger-border:rgba(201,106,45,.24);
  --info:#b56b2a;
  --info-soft:rgba(181,107,42,.11);
  --info-border:rgba(181,107,42,.22);
}

html[data-theme="light"] body{
  background:
    radial-gradient(840px 320px at 50% 0%, rgba(232,109,31,.14), transparent 66%),
    radial-gradient(720px 380px at 14% 14%, rgba(244,163,82,.08), transparent 72%),
    radial-gradient(920px 520px at 84% 88%, rgba(218,160,109,.08), transparent 78%),
    linear-gradient(180deg, #f7efe6 0%, #f3e9de 100%);
}

html[data-theme="light"] body::before{
  background:
    linear-gradient(90deg, rgba(86,58,38,.032) 1px, transparent 1px),
    linear-gradient(180deg, rgba(86,58,38,.026) 1px, transparent 1px);
  opacity:.18;
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder{
  color:rgba(98,67,44,.42);
}

a{ color:inherit; text-decoration:none; }
button,input,select,textarea{ font:inherit; color:inherit; }
button,select{ cursor:pointer; }
h1,h2,h3,h4,h5,h6{ font-family:var(--font-heading); }
button,
.btn,
.iconbtn,
.theme-switch-btn,
.mobile-utility-chip,
.mobile-tabbar-link,
.sb-section,
.sb-link,
.sb-sub,
.top-context,
.top-title,
.page-title,
.label,
.table th,
.card-title{
  font-family:var(--font-heading);
}
input::placeholder,
textarea::placeholder{ color:rgba(255,228,204,.42); }
input:focus,
select:focus,
textarea:focus{
  outline:none;
  border-color:rgba(255,137,70,.52);
  box-shadow:0 0 0 3px rgba(255,90,0,.12);
}

::-webkit-scrollbar{
  width:10px;
  height:10px;
}
::-webkit-scrollbar-track{
  background:rgba(255,255,255,.03);
}
::-webkit-scrollbar-thumb{
  border-radius:999px;
  background:linear-gradient(180deg, rgba(255,105,24,.82), rgba(255,152,82,.66));
}

.theme-switch{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:4px;
  border-radius:16px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.02);
}

.theme-switch-btn{
  min-width:64px;
  min-height:32px;
  padding:0 12px;
  border:none;
  border-radius:12px;
  background:transparent;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  transition:background .16s ease, color .16s ease, box-shadow .16s ease, transform .12s ease;
}

.theme-switch-btn:hover{
  color:var(--text);
  background:rgba(255,255,255,.05);
}

.theme-switch-btn.is-active{
  color:#fff7ef;
  background:linear-gradient(180deg, rgba(255,98,20,.44), rgba(255,152,82,.22));
  box-shadow:0 10px 22px rgba(0,0,0,.18);
}

html[data-theme="light"] .theme-switch{
  background:rgba(255,255,255,.7);
  border-color:rgba(114,80,49,.12);
  box-shadow:0 10px 24px rgba(138,94,50,.10);
}

html[data-theme="light"] .theme-switch-btn:hover{
  background:rgba(232,109,31,.08);
}

html[data-theme="light"] .theme-switch-btn.is-active{
  color:#fffaf3;
  background:linear-gradient(180deg, rgba(232,109,31,.86), rgba(244,163,82,.70));
  box-shadow:0 12px 20px rgba(168,101,45,.18);
}

/* ===== Layout (sidebar + topbar) ===== */

.shell{
  min-height:100vh;
  display:grid;
  grid-template-columns:280px 1fr;
  gap:16px;
  padding:16px;
}
.sidebar-overlay{ display:none; }
.topbar-menu{ display:none; }
.mobile-tabbar{ display:none; }
.mobile-utility-bar{ display:none; }

.sidebar{
  position:relative;
  border:1px solid var(--border);
  border-radius:30px;
  background:
    linear-gradient(180deg, rgba(30,30,30,.98), rgba(16,16,16,.98)),
    radial-gradient(circle at top, rgba(255,98,20,.12), transparent 56%);
  backdrop-filter: blur(16px);
  padding:18px 14px;
  display:flex;
  flex-direction:column;
  gap:14px;
  box-shadow:var(--shadow);
  overflow:hidden;
}

.sidebar::before{
  content:"";
  position:absolute;
  left:0;
  top:24px;
  bottom:24px;
  width:4px;
  border-radius:999px;
  background:linear-gradient(180deg, #ff4100 0%, #ff9043 100%);
  box-shadow:0 0 24px rgba(255,91,0,.45);
}

.sb-brand{
  display:flex;
  gap:12px;
  align-items:center;
  padding:14px 14px 14px 18px;
  border:1px solid var(--border);
  border-radius:22px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
}

.sb-brand.has-logo-image{
  justify-content:center;
  padding:18px 16px;
}

.sb-brand-logo{
  display:block;
  width:min(100%, 206px);
  height:auto;
  object-fit:contain;
  filter:drop-shadow(0 16px 24px rgba(0,0,0,.22));
}

.sb-logo{
  width:48px;
  height:48px;
  border-radius:16px;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,145,76,.22);
  background: linear-gradient(160deg, rgba(255,94,11,.22), rgba(255,165,98,.10));
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.03);
}

.sb-logo-img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.sb-logo-fallback{
  font-family:var(--font-heading);
  font-weight:800;
  font-size:18px;
  letter-spacing:.04em;
}

.sb-name{
  font-family:var(--font-heading);
  font-weight:800;
  font-size:20px;
  line-height:1;
  letter-spacing:.01em;
}

.sb-sub{
  font-size:11px;
  color:var(--muted);
  margin-top:6px;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.sb-nav{ display:flex; flex-direction:column; gap:8px; padding:0 6px; }

.sb-section{
  margin-top:12px;
  font-size:11px;
  color:#ff9c5d;
  letter-spacing:.18em;
  text-transform:uppercase;
  padding:6px 10px;
  font-weight:800;
}

.sb-link{
  padding:12px 12px 12px 16px;
  border-radius:16px;
  border:1px solid var(--border);
  color:var(--muted);
  display:block;
  background:rgba(255,255,255,.02);
  transition:transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}

.sb-link:hover{
  color:var(--text);
  transform:translateY(-1px);
  border-color:var(--border-strong);
  background: rgba(255,255,255,.05);
}

.sb-link.is-active,
.sb-link[aria-current="page"]{
  color:#fff8f1;
  border-color:rgba(255,127,47,.34);
  background:linear-gradient(90deg, rgba(255,79,0,.18), rgba(255,137,68,.08));
  box-shadow:inset 3px 0 0 #ff5a00;
}

.sb-footer{ margin-top:auto; padding:0 6px; }
.sb-muted{
  color:var(--muted);
  font-size:11px;
  padding:10px 12px 4px 12px;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.main{
  min-width:0;
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
}

.top-left{
  min-width:0;
  display:flex;
  align-items:center;
  gap:12px;
  flex:1 1 auto;
}

.top-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.top-context{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-width:0;
  color:#ffb179;
  font-size:10px;
  font-weight:800;
  letter-spacing:.16em;
  text-transform:uppercase;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.top-context::before{
  content:"";
  width:7px;
  height:7px;
  border-radius:999px;
  flex:0 0 auto;
  background:linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow:0 0 16px rgba(255,96,22,.35);
}

.topbar2{
  width:100%;
  min-height:62px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 18px;
  border:1px solid var(--border);
  border-radius:26px;
  background:linear-gradient(180deg, rgba(31,31,31,.96), rgba(18,18,18,.96));
  backdrop-filter: blur(16px);
  box-shadow:var(--shadow);
}

.top-title{
  font-weight:800;
  opacity:.98;
  letter-spacing:.01em;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.top-actions{ display:flex; align-items:center; gap:10px; }

.iconbtn{
  min-width:38px;
  height:38px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 10px;
  transition:background .16s ease, border-color .16s ease, transform .12s ease;
}

html[data-theme="dark"] :is(
  .sidebar,
  .sb-brand,
  .topbar2,
  .mobile-tabbar,
  .mobile-utility-menu,
  .mobile-utility-chip,
  .mobile-utility-avatar,
  .tref-card,
  .card,
  .app-shell-card,
  .pub-side-brand,
  .pub-side-card,
  .pub-meta-card,
  .pub-list-box,
  .pub-key,
  .pub-phase,
  .pub-mobile-brand-spotlight,
  .pub-hero,
  .pub-progress-board,
  .pub-summary-card,
  .pub-ranking-item,
  .pub-insc-card,
  .pub-game,
  .bt-card,
  .reg,
  .s8-metric,
  .s8-round,
  .s8-match,
  .ko-match,
  .ko-team,
  .pf-card,
  .pf-summary-card,
  .pf-partner-card,
  .pf-metric-card,
  .pf-duo-card,
  .pf-source-shell,
  .pf-participation-card,
  .pf-match-card,
  .pf-overview-note,
  .pf-search-panel,
  .pf-search-shell,
  .pf-search-option,
  .pf-table-wrap,
  .pf-metric-item,
  .sg-card,
  .cx-logo-card,
  .cx-logo-preview,
  .ce-logo-card,
  .ce-logo-preview,
  .ae-usage,
  .ath-check-item,
  .st-select-panel,
  .st-athletes-list,
  .st-athletes-item,
  .sg8m-player,
  .sg8m-round,
  .sg8m-match,
  .pub-legend-item,
  .pub-preview-item,
  .pub-meta-inline,
  .pub-score-box,
  .rk-hall-item,
  .rk-hall-item-drama,
  .rk-hall-stat,
  .rk-duck-match,
  .rk-duck-result,
  .rk-lore-card,
  .rk-lore-block,
  .rk-lore-pane,
  .rk-ranking-card,
  .rk-mobile-rank-card,
  .rk-modal,
  .re-field
){
  background:
    radial-gradient(280px 120px at 50% -8%, rgba(255,98,20,.10), transparent 68%),
    linear-gradient(180deg, rgba(31,31,31,.97) 0%, rgba(14,14,14,.99) 100%) !important;
  border-color:rgba(255,162,96,.12) !important;
  box-shadow:
    0 22px 50px rgba(0,0,0,.34),
    inset 0 1px 0 rgba(255,255,255,.03) !important;
}

html[data-theme="dark"] .tref-body{
  background:linear-gradient(180deg, rgba(20,20,20,.98), rgba(12,12,12,.99));
  border-bottom-color:rgba(255,255,255,.05);
}

html[data-theme="dark"] .tref-actions{
  background:linear-gradient(180deg, rgba(22,22,22,.96), rgba(14,14,14,.99));
  border-top:1px solid rgba(255,255,255,.04);
}

html[data-theme="dark"] :is(
  .input,
  .tt-input,
  .tt-select,
  .cs-input,
  .cs-select,
  .tref-input,
  .tref-select,
  .bt-field select,
  .cx-input,
  .cx-textarea,
  .ce-input,
  .ce-textarea,
  .ae-input,
  .ath-input,
  .st-input,
  .st-select,
  .sg8-input,
  .sg8-textarea,
  .sg8m-input,
  .sg8m-select,
  .sg8m-textarea,
  .rk-input,
  .rk-textarea,
  .rk-lore-select,
  .lg-input,
  .te-input,
  .te-select,
  .se-input,
  .se-textarea,
  .re-input,
  .re-select
){
  background:rgba(255,255,255,.05);
  border-color:rgba(255,165,100,.12);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.02);
}

html[data-theme="dark"] :is(
  .tref-pill,
  .tt-pill,
  .cs-pill,
  .pf-chip,
  .pf-pill,
  .pf-tab,
  .pf-filter-btn,
  .pf-participation-pill,
  .pf-source-badge,
  .sg8-pill,
  .s8-pill,
  .st-pill,
  .st-athletes-state,
  .cx-badge,
  .cx-pill,
  .ae-badge,
  .sg8m-pill,
  .pub-chip,
  .pub-score,
  .pub-ranking-chip,
  .meta,
  .pill,
  .rk-tab,
  .rk-lore-tab,
  .rk-mobile-rank-stat,
  .rk-hall-rank,
  .rk-hall-rank-drama,
  .se-pill,
  .mobile-tabbar-link
){
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border-color:rgba(255,166,97,.12);
  color:var(--text);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.02);
}

html[data-theme="dark"] :is(
  .pf-source-mini,
  .pf-participation-stat,
  .pub-legend-dot,
  .pub-ranking-pos,
  .sg8m-player-slot.is-empty
){
  background:linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border-color:rgba(255,166,97,.12);
  color:var(--text);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.02);
}

html[data-theme="dark"] .table-stack-mobile tr{
  border-color:rgba(255,162,96,.12);
  background:
    radial-gradient(240px 100px at 100% -18%, rgba(255,98,20,.07), transparent 72%),
    linear-gradient(180deg, rgba(28,28,28,.98), rgba(14,14,14,.99));
  box-shadow:
    0 14px 28px rgba(0,0,0,.24),
    inset 0 1px 0 rgba(255,255,255,.02);
}

html[data-theme="dark"] :is(
  .pf-search-option:hover,
  .pf-search-option.is-active,
  .pf-tab:hover,
  .pf-tab.is-active,
  .pf-filter-btn:hover,
  .pf-filter-btn.is-active,
  .rk-tab:hover,
  .rk-tab.active,
  .rk-lore-tab.active
){
  border-color:rgba(255,140,67,.28);
  background:
    linear-gradient(90deg, rgba(255,92,18,.18), rgba(255,255,255,.06)),
    linear-gradient(180deg, rgba(31,31,31,.97), rgba(14,14,14,.99));
  box-shadow:0 12px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.03);
}

html[data-theme="dark"] .mobile-tabbar-link.is-active,
html[data-theme="dark"] .mobile-tabbar-link[aria-current="page"]{
  color:#fff7f0;
  border-color:rgba(255,136,63,.34);
  background:linear-gradient(180deg, rgba(255,94,11,.20), rgba(255,158,89,.10));
  box-shadow:inset 0 0 0 1px rgba(255,145,86,.12);
}

html[data-theme="dark"] .pf-source-badge.is-circuit{
  border-color:rgba(91,240,174,.24);
  background:rgba(91,240,174,.10);
  color:#cbffe7;
}

html[data-theme="dark"] .pf-source-badge.is-tournament{
  border-color:rgba(255,173,92,.24);
  background:rgba(255,173,92,.12);
  color:#ffe7cf;
}

html[data-theme="dark"] .pf-source-badge.is-special{
  border-color:rgba(129,171,255,.24);
  background:rgba(129,171,255,.12);
  color:#dde7ff;
}

html[data-theme="dark"] .st-athletes-item.is-selected{
  background:rgba(16,185,129,.10);
  border-color:rgba(16,185,129,.28);
}

html[data-theme="dark"] .st-athletes-item.is-pending{
  background:rgba(59,130,246,.08);
  border-color:rgba(96,165,250,.24);
}

html[data-theme="dark"] .st-athletes-state.is-selected{
  background:rgba(16,185,129,.14);
  border-color:rgba(16,185,129,.35);
  color:#9ef0c1;
}

html[data-theme="dark"] .st-athletes-state.is-pending{
  background:rgba(59,130,246,.12);
  border-color:rgba(96,165,250,.35);
  color:#bfdbfe;
}

html[data-theme="dark"] .pub-chip.hora{
  border-color:rgba(255,121,42,.34);
  background:rgba(255,104,25,.18);
  color:#ffe7d7;
}

html[data-theme="dark"] .pub-score.vencedor{
  background:linear-gradient(180deg, rgba(255,101,23,.92) 0%, rgba(255,146,83,.86) 100%);
  color:#1b0d05;
}

html[data-theme="dark"] .pub-legend-dot.qual{
  background:rgba(16,185,129,.16);
  color:#dffced;
}

html[data-theme="dark"] .pub-legend-dot.direct{
  background:rgba(255,142,43,.24);
  color:#fff1df;
}

html[data-theme="dark"] .pub-legend-dot.out{
  background:rgba(220,38,38,.18);
  color:#ffd6d6;
}

html[data-theme="dark"] .pub-legend-dot.vice{
  background:rgba(197,206,221,.14);
  color:#edf3ff;
}

html[data-theme="dark"] .pub-ranking-item.is-top-1 .pub-ranking-pos{
  background:linear-gradient(180deg, #ffd45a 0%, #ff9e19 100%);
  color:#2b1600;
}

html[data-theme="dark"] .pub-ranking-item.is-top-2 .pub-ranking-pos{
  background:linear-gradient(180deg, #dbe3ee 0%, #a9b6ca 100%);
  color:#162030;
}

html[data-theme="dark"] .pub-ranking-item.is-top-3 .pub-ranking-pos{
  background:linear-gradient(180deg, #f3bd89 0%, #ca7d3b 100%);
  color:#271205;
}

html[data-theme="dark"] .pub-ranking-chip.points{
  border-color:rgba(255,127,34,.28);
  background:rgba(255,92,0,.15);
}

html[data-theme="dark"] .pub-ranking-chip.trophy{
  border-color:rgba(255,211,90,.24);
  background:rgba(255,211,90,.12);
  color:#ffe7a8;
}

html[data-theme="dark"] .pub-ranking-chip.vice{
  border-color:rgba(197,206,221,.24);
  background:rgba(197,206,221,.12);
  color:#edf3ff;
}

html[data-theme="light"] .sidebar,
html[data-theme="light"] .sb-brand,
html[data-theme="light"] .topbar2,
html[data-theme="light"] .mobile-tabbar,
html[data-theme="light"] .mobile-utility-menu,
html[data-theme="light"] .mobile-utility-chip,
html[data-theme="light"] .mobile-utility-avatar,
html[data-theme="light"] .tref-card,
html[data-theme="light"] .card,
html[data-theme="light"] .app-shell-card,
html[data-theme="light"] .pub-side-brand,
html[data-theme="light"] .pub-side-card,
html[data-theme="light"] .pub-meta-card,
html[data-theme="light"] .pub-list-box,
html[data-theme="light"] .pub-key,
html[data-theme="light"] .pub-phase,
html[data-theme="light"] .pub-mobile-brand-spotlight,
html[data-theme="light"] .pub-hero,
html[data-theme="light"] .pub-progress-board,
html[data-theme="light"] .pub-summary-card,
html[data-theme="light"] .pub-ranking-item,
html[data-theme="light"] .pub-insc-card,
html[data-theme="light"] .pub-game,
html[data-theme="light"] .bt-card,
html[data-theme="light"] .reg,
html[data-theme="light"] .s8-metric,
html[data-theme="light"] .s8-round,
html[data-theme="light"] .s8-match,
html[data-theme="light"] .ko-match,
html[data-theme="light"] .ko-team{
  background:
    linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(247,241,234,.98) 100%) !important;
  border-color:rgba(114,80,49,.10) !important;
  box-shadow:0 16px 34px rgba(138,94,50,.10) !important;
  color:var(--text);
}

html[data-theme="light"] .sidebar::before{
  box-shadow:0 0 18px rgba(232,109,31,.20);
}

html[data-theme="light"] .sb-link{
  background:rgba(255,255,255,.58);
  color:rgba(98,67,44,.78);
}

html[data-theme="light"] .sb-link:hover{
  background:rgba(255,255,255,.86);
  color:var(--text);
}

html[data-theme="light"] .sb-link.is-active,
html[data-theme="light"] .sb-link[aria-current="page"]{
  color:var(--text);
  background:linear-gradient(90deg, rgba(232,109,31,.14), rgba(244,163,82,.10));
  box-shadow:inset 3px 0 0 #e86d1f;
}

html[data-theme="light"] .iconbtn{
  background:rgba(255,255,255,.82);
  border-color:rgba(114,80,49,.12);
  color:var(--text);
  box-shadow:0 10px 22px rgba(138,94,50,.10);
}

html[data-theme="light"] .iconbtn:hover{
  background:rgba(255,255,255,.96);
}

html[data-theme="light"] .avatar{
  color:var(--text);
  border-color:rgba(232,109,31,.18);
  background:linear-gradient(180deg, rgba(232,109,31,.18), rgba(244,163,82,.12));
}

html[data-theme="light"] .tref-body{
  background:rgba(255,255,255,.60);
}

html[data-theme="light"] .tref-actions{
  background:rgba(255,255,255,.54);
  border-top:1px solid rgba(114,80,49,.06);
}

html[data-theme="light"] .ca-head-logo{
  border-color:rgba(114,80,49,.10);
  background:linear-gradient(180deg, rgba(255,255,255,.94) 0%, rgba(247,241,234,.98) 100%);
  box-shadow:0 18px 36px rgba(138,94,50,.12);
}

html[data-theme="light"] :is(
  .sb-name,
  .top-title,
  .page-title,
  .tref-title,
  .pub-side-brand h2,
  .pub-side-card-title,
  .pub-hero-title,
  .pub-stat-value,
  .pub-podium-name,
  .reg-dupla
){
  color:var(--text) !important;
}

html[data-theme="light"] :is(
  .sb-sub,
  .sb-muted,
  .tref-sub,
  .page-subtitle,
  .muted,
  .top-context,
  .pub-side-brand p,
  .pub-side-card p,
  .pub-hero-sub,
  .pub-hero-crumbs,
  .pub-side-link small,
  .pub-side-meta,
  .pub-stat-label,
  .pub-list-empty,
  .pub-empty,
  .pub-podium-sub,
  .tt-small,
  .s8-note
){
  color:var(--muted) !important;
}

html[data-theme="light"] :is(
  .input,
  .tt-input,
  .tt-select,
  .cs-input,
  .cs-select,
  .tref-input,
  .tref-select,
  .bt-field select,
  input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not(.pf-search-input),
  select,
  textarea
){
  background:rgba(255,255,255,.86);
  border-color:rgba(114,80,49,.14);
  color:var(--text);
}

html[data-theme="light"] :is(
  .tref-pill,
  .tt-pill,
  .cs-pill,
  .pill,
  .meta,
  .mobile-tabbar-link
){
  background:rgba(255,255,255,.68);
  border-color:rgba(114,80,49,.12);
  color:var(--text);
}

html[data-theme="light"] .pub-side-link,
html[data-theme="light"] .pub-side-stat,
html[data-theme="light"] .pub-action,
html[data-theme="light"] .pub-progress-step,
html[data-theme="light"] .pub-podium-card{
  border-color:rgba(114,80,49,.12);
  color:var(--text);
}

html[data-theme="light"] .pub-side-link,
html[data-theme="light"] .pub-side-stat,
html[data-theme="light"] .pub-action,
html[data-theme="light"] .pub-progress-step{
  background:rgba(255,255,255,.68);
}

html[data-theme="light"] .pub-side-link:hover{
  background:rgba(255,255,255,.9);
  border-color:rgba(232,109,31,.24);
}

html[data-theme="light"] .pub-side-link.active{
  color:var(--text);
  border-color:rgba(232,109,31,.28);
  background:linear-gradient(90deg, rgba(232,109,31,.18), rgba(244,163,82,.12));
  box-shadow:inset 3px 0 0 #e86d1f;
}

html[data-theme="light"] .pub-action{
  background:rgba(255,255,255,.8);
}

html[data-theme="light"] .pub-status-badge-live{
  color:#ffffff;
  border-color:rgba(255,255,255,.78);
  background:linear-gradient(180deg, #ff2d2d 0%, #d30f0f 100%);
  box-shadow:
    0 0 0 2px rgba(255,255,255,.12) inset,
    0 12px 30px rgba(255,45,45,.26);
}

html[data-theme="light"] .pub-status-badge-live::before{
  background:#ffffff;
}

html[data-theme="light"] .pub-status-badge-closed,
html[data-theme="light"] .pub-action.is-muted{
  border-color:rgba(28,143,92,.28);
  background:rgba(28,143,92,.10);
  color:#17603f;
}

html[data-theme="light"] .pub-action.is-live{
  border-color:rgba(232,109,31,.28);
  background:linear-gradient(90deg, rgba(232,109,31,.22), rgba(244,163,82,.16));
  color:#8b4518;
}

html[data-theme="light"] .pub-progress-step{
  box-shadow:0 12px 24px rgba(138,94,50,.08);
}

html[data-theme="light"] .pub-progress-label{
  color:var(--text);
}

html[data-theme="light"] .pub-progress-value{
  color:#c8671a;
}

html[data-theme="light"] .pub-progress-meta{
  color:rgba(98,67,44,.72);
}

html[data-theme="light"] .pub-progress-track{
  background:rgba(114,80,49,.10);
}

html[data-theme="light"] .pub-progress-fill{
  background:linear-gradient(90deg, #e86d1f 0%, #f4a352 100%);
}

html[data-theme="light"] .pub-progress-step.is-done .pub-progress-fill{
  background:linear-gradient(90deg, #d95f14 0%, #ef9740 100%);
}

html[data-theme="light"] .pub-progress-step.is-muted .pub-progress-fill{
  background:linear-gradient(90deg, rgba(114,80,49,.18) 0%, rgba(114,80,49,.08) 100%);
}

html[data-theme="light"] .pub-podium-card{
  background:linear-gradient(180deg, rgba(255,255,255,.94) 0%, rgba(248,241,233,.98) 100%);
  box-shadow:0 16px 34px rgba(138,94,50,.12);
}

html[data-theme="light"] .pub-podium-card.gold{
  background:linear-gradient(180deg, rgba(255,223,118,.34) 0%, rgba(255,191,74,.18) 100%);
  border-color:rgba(223,169,58,.34);
}

html[data-theme="light"] .pub-podium-card.silver{
  background:linear-gradient(180deg, rgba(228,233,241,.62) 0%, rgba(210,218,229,.34) 100%);
  border-color:rgba(177,188,203,.30);
}

html[data-theme="light"] .pub-podium-card.bronze{
  background:linear-gradient(180deg, rgba(236,193,150,.38) 0%, rgba(210,139,77,.18) 100%);
  border-color:rgba(185,120,64,.28);
}

html[data-theme="light"] .mobile-tabbar-link.is-active,
html[data-theme="light"] .mobile-tabbar-link[aria-current="page"]{
  color:#fffaf3;
  background:linear-gradient(180deg, rgba(232,109,31,.84), rgba(244,163,82,.68));
  border-color:rgba(232,109,31,.26);
}

html[data-theme="light"] .mobile-tabbar-dot{
  background:rgba(114,80,49,.18);
  box-shadow:0 0 0 4px rgba(114,80,49,.04);
}

html[data-theme="light"] .pub-mobile-summary-toggle{
  background:rgba(255,255,255,.82);
  border-color:rgba(114,80,49,.14);
  color:var(--text);
}

html[data-theme="light"] .table th{
  color:#9d5824;
}

html[data-theme="light"] .table-stack-mobile tr{
  background:rgba(255,255,255,.82);
  border-color:rgba(114,80,49,.10);
  box-shadow:0 12px 26px rgba(138,94,50,.08);
}

html[data-theme="light"] :is(
  .tt-input,
  .tt-select,
  .cs-input,
  .cs-select,
  .sg8-input,
  .sg8-textarea
){
  background:rgba(255,255,255,.88);
  border-color:rgba(114,80,49,.14);
  color:var(--text);
}

html[data-theme="light"] :is(
  .tt-pill,
  .cs-pill,
  .sg8-pill,
  .s8-pill
){
  background:rgba(255,255,255,.78);
  border-color:rgba(114,80,49,.12);
  color:var(--text);
}

html[data-theme="light"] :is(
  .tt-small,
  .cs-small,
  .sg8-small,
  .s8-note
){
  color:var(--muted);
}

html[data-theme="light"] .cs-help{
  background:rgba(255,255,255,.72);
  border-color:rgba(114,80,49,.12);
}

html[data-theme="light"] .cs-help li{
  color:var(--muted);
}

html[data-theme="light"] .cs-create-card,
html[data-theme="light"] .cs-modal{
  background:
    radial-gradient(520px 220px at 22% -14%, rgba(232,109,31,.14), transparent 64%),
    linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(244,238,232,.98) 100%);
  border-color:rgba(114,80,49,.10);
  box-shadow:0 24px 54px rgba(138,94,50,.16);
}

html[data-theme="light"] .cs-create-copy strong,
html[data-theme="light"] .cs-modal-title{
  color:var(--text);
}

html[data-theme="light"] .cs-create-copy span,
html[data-theme="light"] .cs-modal-sub{
  color:var(--muted);
}

html[data-theme="light"] .cs-modal-head{
  border-bottom-color:rgba(114,80,49,.10);
}

html[data-theme="light"] .cs-modal-close{
  background:rgba(255,255,255,.78);
  border-color:rgba(114,80,49,.12);
  color:var(--text);
}

html[data-theme="light"] :is(.tt-status-pill,.cs-status-pill,.s8-live-pill,.s8-status-pill){
  border-color:rgba(114,80,49,.14);
}

html[data-theme="light"] .tt-status-pill-live,
html[data-theme="light"] .cs-status-pill-running,
html[data-theme="light"] .s8-live-pill{
  color:#ffffff;
  border-color:rgba(255,255,255,.82);
  background:linear-gradient(180deg, #ff2d2d 0%, #d30f0f 100%);
  box-shadow:
    0 0 0 2px rgba(255,255,255,.12) inset,
    0 12px 30px rgba(255,45,45,.26);
}

html[data-theme="light"] .tt-status-pill-live::before,
html[data-theme="light"] .cs-status-pill-running::before,
html[data-theme="light"] .s8-live-dot{
  background:#ffffff;
}

html[data-theme="light"] .tt-status-pill-closed,
html[data-theme="light"] .cs-status-pill-closed,
html[data-theme="light"] .s8-status-pill,
html[data-theme="light"] .sg8-status-finished{
  color:#17603f;
}

html[data-theme="light"] .tt-status-pill-closed,
html[data-theme="light"] .cs-status-pill-closed,
html[data-theme="light"] .s8-status-pill{
  border-color:rgba(28,143,92,.28);
  background:rgba(28,143,92,.10);
}

html[data-theme="light"] .tt-status-pill-open,
html[data-theme="light"] .sg8-status-open{
  color:#8b4518;
  border-color:rgba(232,109,31,.22);
  background:rgba(232,109,31,.10);
}

html[data-theme="light"] .sg8-status-running{
  color:#17603f;
}

html[data-theme="light"] .bt-card-h{
  border-bottom-color:rgba(114,80,49,.10);
  color:#9d5824;
}

html[data-theme="light"] .bt-btn{
  background:rgba(255,255,255,.82);
  border-color:rgba(114,80,49,.12);
  color:var(--text);
}

html[data-theme="light"] .bt-btn:hover{
  background:rgba(255,255,255,.96);
}

html[data-theme="light"] .bt-btn-primary{
  background:rgba(70,137,224,.10);
  border-color:rgba(70,137,224,.24);
  color:#355b91;
}

html[data-theme="light"] .bt-btn-ok{
  color:#ffffff;
  border-color:rgba(25,133,74,.46);
  background:linear-gradient(180deg, #2db765 0%, #218a50 100%);
  box-shadow:0 12px 24px rgba(33,138,80,.16);
}

html[data-theme="light"] .bt-btn-ok:hover{
  background:linear-gradient(180deg, #35c56f 0%, #249958 100%);
  border-color:rgba(25,133,74,.60);
  box-shadow:0 16px 28px rgba(33,138,80,.22);
}

html[data-theme="light"] .bt-btn-warn{
  background:rgba(232,109,31,.10);
  border-color:rgba(232,109,31,.22);
  color:#8b4518;
}

html[data-theme="light"] .bt-btn-bad{
  background:rgba(199,109,89,.10);
  border-color:rgba(199,109,89,.24);
  color:#8d5143;
}

html[data-theme="light"] .tref-field{
  background:rgba(255,255,255,.72);
  border-color:rgba(114,80,49,.12);
}

html[data-theme="light"] :is(.tm-status-pill,.tsu-status-pill){
  border-color:rgba(114,80,49,.14);
}

html[data-theme="light"] .tm-status-pill-running,
html[data-theme="light"] .tsu-status-pill-live{
  color:#ffffff;
  border-color:rgba(255,255,255,.82);
  background:linear-gradient(180deg, #ff2d2d 0%, #d30f0f 100%);
  box-shadow:
    0 0 0 2px rgba(255,255,255,.12) inset,
    0 12px 30px rgba(255,45,45,.26);
}

html[data-theme="light"] .tm-status-pill-running::before,
html[data-theme="light"] .tsu-status-pill-live::before{
  background:#ffffff;
}

html[data-theme="light"] .tm-status-pill-closed,
html[data-theme="light"] .tsu-status-pill-closed{
  color:#17603f;
  border-color:rgba(28,143,92,.28);
  background:rgba(28,143,92,.10);
}

html[data-theme="light"] .tsu-status-pill-open{
  color:#8b4518;
  border-color:rgba(232,109,31,.22);
  background:rgba(232,109,31,.10);
}

html[data-theme="light"] :is(.bts-status-pill,.bts-status-pill-live,.bts-status-pill-closed,.bts-status-pill-open){
  border-color:rgba(114,80,49,.14);
}

html[data-theme="light"] .bts-status-pill-live{
  color:#ffffff;
  border-color:rgba(255,255,255,.82);
  background:linear-gradient(180deg, #ff2d2d 0%, #d30f0f 100%);
  box-shadow:
    0 0 0 2px rgba(255,255,255,.12) inset,
    0 12px 30px rgba(255,45,45,.26);
}

html[data-theme="light"] .bts-status-pill-live::before{
  background:#ffffff;
}

html[data-theme="light"] .bts-status-pill-closed{
  color:#17603f;
  border-color:rgba(28,143,92,.28);
  background:rgba(28,143,92,.10);
}

html[data-theme="light"] .bts-status-pill-open{
  color:#8b4518;
  border-color:rgba(232,109,31,.22);
  background:rgba(232,109,31,.10);
}

html[data-theme="light"] .s8-metric-label{
  color:#a55e26;
}

html[data-theme="light"] .s8-score-pill{
  background:rgba(232,109,31,.14);
  border-color:rgba(232,109,31,.26);
  color:#8b4518;
}

html[data-theme="light"] .s8-score-pending{
  background:rgba(114,80,49,.08);
  border-color:rgba(114,80,49,.12);
  color:var(--muted);
}

html[data-theme="light"] .s8-table th,
html[data-theme="light"] .s8-table td{
  border-bottom-color:rgba(114,80,49,.10);
  color:var(--text);
}

html[data-theme="light"] .s8-table th{
  color:#9d5824;
}

html[data-theme="light"] :is(
  .pf-card,
  .pf-summary-card,
  .pf-partner-card,
  .pf-metric-card,
  .pf-duo-card,
  .pf-source-shell,
  .pf-participation-card,
  .pf-match-card,
  .pf-overview-note,
  .pf-search-panel,
  .pf-search-shell,
  .pf-search-option,
  .pf-table-wrap,
  .pf-metric-item
){
  background:linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,241,234,.98));
  border-color:rgba(114,80,49,.10);
  box-shadow:0 16px 34px rgba(138,94,50,.10);
  color:var(--text);
}

html[data-theme="light"] .pf-band{
  border-bottom-color:rgba(114,80,49,.10);
  background:linear-gradient(90deg, rgba(118,68,38,.94), rgba(168,108,70,.86));
  color:#fff3ea;
}

html[data-theme="light"] .pf-search-shell{
  background:rgba(255,255,255,.86);
  box-shadow:inset 0 1px 0 rgba(114,80,49,.04);
}

html[data-theme="light"] .pf-search-shell:focus-within{
  border-color:rgba(232,109,31,.36);
  background:rgba(255,255,255,.98);
  box-shadow:0 0 0 4px rgba(232,109,31,.10), inset 0 1px 0 rgba(114,80,49,.04);
}

html[data-theme="light"] .pf-search-icon,
html[data-theme="light"] .pf-field label,
html[data-theme="light"] .pf-kicker,
html[data-theme="light"] .pf-summary-label,
html[data-theme="light"] .pf-partner-label,
html[data-theme="light"] .pf-section-head .pf-kicker,
html[data-theme="light"] .pf-metric-label{
  color:#a55e26;
}

html[data-theme="light"] .pf-search-input,
html[data-theme="light"] .pf-athlete-name,
html[data-theme="light"] .pf-search-option-name,
html[data-theme="light"] .pf-section-title,
html[data-theme="light"] .pf-summary-value,
html[data-theme="light"] .pf-partner-name,
html[data-theme="light"] .pf-metric-value,
html[data-theme="light"] .pf-duo,
html[data-theme="light"] .pf-duo-name,
html[data-theme="light"] .pf-match-title,
html[data-theme="light"] .pf-source-name,
html[data-theme="light"] .pf-tab.is-active{
  color:var(--text);
}

html[data-theme="light"] .pf-search-input::placeholder{
  color:rgba(98,67,44,.40);
}

html[data-theme="light"] .pf-search-input{
  background:transparent !important;
  border:none !important;
  box-shadow:none !important;
}

html[data-theme="light"] :is(
  .pf-search-status,
  .pf-search-option-meta,
  .pf-athlete-sub,
  .pf-section-copy,
  .pf-summary-foot,
  .pf-note,
  .pf-partner-meta,
  .pf-overview-note,
  .pf-subline,
  .pf-source-sub,
  .pf-source-fallback,
  .pf-participation-meta,
  .pf-empty
){
  color:var(--muted);
}

html[data-theme="light"] .pf-search-option{
  background:linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,242,235,.98));
  border-color:rgba(114,80,49,.12);
  color:var(--text);
}

html[data-theme="light"] .pf-search-clear{
  background:rgba(232,109,31,.10);
  color:#8b4518;
}

html[data-theme="light"] .pf-search-clear:hover{
  background:rgba(232,109,31,.18);
}

html[data-theme="light"] .pf-search-option:hover,
html[data-theme="light"] .pf-search-option.is-active,
html[data-theme="light"] .pf-tab:hover,
html[data-theme="light"] .pf-tab.is-active{
  border-color:rgba(232,109,31,.26);
  background:linear-gradient(90deg, rgba(232,109,31,.16), rgba(255,255,255,.88));
}

html[data-theme="light"] .pf-chip,
html[data-theme="light"] .pf-participation-pill,
html[data-theme="light"] .pf-tab{
  border-color:rgba(114,80,49,.12);
  background:rgba(255,255,255,.72);
  color:var(--text);
}

html[data-theme="light"] .pf-chip strong{
  color:var(--text);
}

html[data-theme="light"] .pf-table th,
html[data-theme="light"] .pf-table td{
  border-bottom-color:rgba(114,80,49,.10);
  color:var(--text);
}

html[data-theme="light"] .pf-table th{
  background:rgba(232,109,31,.08);
  color:#9d5824;
}

html[data-theme="light"] .pf-source-badge{
  background:rgba(255,255,255,.84);
  border-color:rgba(114,80,49,.12);
  color:#72442a;
}

html[data-theme="light"] .pf-source-badge.is-circuit{
  border-color:rgba(28,143,92,.24);
  background:rgba(28,143,92,.10);
  color:#17603f;
}

html[data-theme="light"] .pf-source-badge.is-tournament{
  border-color:rgba(232,109,31,.22);
  background:rgba(232,109,31,.10);
  color:#8b4518;
}

html[data-theme="light"] .pf-source-badge.is-special{
  border-color:rgba(109,137,201,.22);
  background:rgba(109,137,201,.10);
  color:#37527c;
}

html[data-theme="light"] .pf-result{
  color:#1c8f5c;
}

html[data-theme="light"] .pf-result.loss{
  color:#c76d59;
}

html[data-theme="light"] .pub-dashboard{
  background:
    radial-gradient(900px 320px at 46% -8%, rgba(232,109,31,.18), transparent 58%),
    linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(244,238,232,.98) 100%);
  border-color:rgba(114,80,49,.10);
  box-shadow:0 28px 56px rgba(138,94,50,.16);
}

html[data-theme="light"] .pub-dashboard::before{
  box-shadow:0 0 20px rgba(232,109,31,.22);
}

html[data-theme="light"] .pub-dashboard-sidebar{
  border-right-color:rgba(114,80,49,.10);
}

html[data-theme="light"] :is(
  .pub-table th,
  .pub-list-table th
){
  color:#9d5824;
  background:rgba(232,109,31,.08);
}

html[data-theme="light"] :is(
  .pub-table td,
  .pub-list-table td
){
  border-bottom-color:rgba(114,80,49,.10);
  color:var(--text);
}

html[data-theme="light"] .pub-key-head small,
html[data-theme="light"] .pub-chip,
html[data-theme="light"] .pub-score{
  color:var(--text);
}

html[data-theme="light"] .pub-chip{
  background:rgba(255,255,255,.78);
}

html[data-theme="light"] .pub-chip.hora{
  border-color:rgba(232,109,31,.24);
  background:rgba(232,109,31,.10);
  color:#8b4518;
}

html[data-theme="light"] .pub-game{
  border-color:rgba(114,80,49,.10);
  background:rgba(255,255,255,.70);
}

html[data-theme="light"] .pub-team{
  color:var(--text);
}

html[data-theme="light"] .pub-team.winner{
  padding:10px 12px;
  border:1px solid rgba(31,143,92,.22);
  border-radius:14px;
  background:linear-gradient(180deg, rgba(33,167,93,.94) 0%, rgba(23,131,72,.96) 100%);
  color:#ffffff;
  box-shadow:0 14px 28px rgba(31,143,92,.18);
}

html[data-theme="light"] .pub-score-box{
  background:rgba(255,255,255,.82);
  border-color:rgba(114,80,49,.12);
}

html[data-theme="light"] .pub-score{
  background:rgba(114,80,49,.10);
}

html[data-theme="light"] .pub-score.vencedor{
  background:linear-gradient(180deg, rgba(33,167,93,.96) 0%, rgba(23,131,72,.98) 100%);
  border:1px solid rgba(31,143,92,.28);
  color:#ffffff;
  box-shadow:0 12px 22px rgba(31,143,92,.16);
}

html[data-theme="light"] .pub-ranking-pos{
  background:rgba(114,80,49,.10);
  color:var(--text);
  box-shadow:inset 0 0 0 1px rgba(114,80,49,.06);
}

html[data-theme="light"] .pub-ranking-name,
html[data-theme="light"] .pub-ranking-chip strong{
  color:var(--text);
}

html[data-theme="light"] .pub-ranking-sub{
  color:var(--muted);
}

html[data-theme="light"] .pub-ranking-chip{
  border-color:rgba(114,80,49,.12);
  background:rgba(255,255,255,.82);
  color:var(--text);
}

html[data-theme="light"] .pub-ranking-chip.points{
  border-color:rgba(232,109,31,.22);
  background:rgba(232,109,31,.10);
}

html[data-theme="light"] .pub-ranking-chip.trophy{
  border-color:rgba(223,169,58,.28);
  background:rgba(223,169,58,.12);
  color:#8b6a18;
}

html[data-theme="light"] .pub-ranking-chip.vice{
  border-color:rgba(177,188,203,.28);
  background:rgba(177,188,203,.14);
  color:#506179;
}

html[data-theme="light"] :is(
  .pub-legend-item,
  .pub-preview-item,
  .pub-meta-inline
){
  border-color:rgba(114,80,49,.10);
  background:linear-gradient(180deg, rgba(255,255,255,.94), rgba(248,242,235,.98));
  box-shadow:0 14px 26px rgba(138,94,50,.08);
}

html[data-theme="light"] .pub-preview-name{
  color:var(--text);
}

html[data-theme="light"] .pub-preview-sub{
  color:var(--muted);
}

html[data-theme="light"] .pub-legend-dot{
  background:rgba(114,80,49,.10);
  color:var(--text);
}

html[data-theme="light"] :is(
  .cx-input,
  .cx-textarea,
  .cx-file,
  .ce-input,
  .ce-textarea,
  .ce-file,
  .ae-input,
  .ath-input,
  .st-input,
  .st-select,
  .sg8m-input,
  .sg8m-select,
  .sg8m-textarea,
  .rk-input,
  .rk-textarea,
  .rk-lore-select
){
  background:rgba(255,255,255,.88);
  border-color:rgba(114,80,49,.14);
  color:var(--text);
}

html[data-theme="light"] :is(
  .lg-input,
  .te-input,
  .te-select,
  .se-input,
  .se-textarea,
  .re-input,
  .re-select
){
  background:rgba(255,255,255,.88);
  border-color:rgba(114,80,49,.14);
  color:var(--text);
}

html[data-theme="light"] :is(
  .cx-field label,
  .ce-field label,
  .ae-field label,
  .ath-toolbar label,
  .st-field label,
  .sg8m-field label
){
  color:#a55e26;
}

html[data-theme="light"] :is(
  .lg-field label,
  .te-field label,
  .se-field label,
  .re-label,
  .sg8-field label,
  .tref-label
){
  color:#a55e26;
}

html[data-theme="light"] :is(
  .cx-badge,
  .ae-badge,
  .st-pill,
  .sg8m-pill,
  .rk-tab,
  .rk-mobile-rank-stat,
  .rk-hall-rank,
  .rk-hall-rank-drama
){
  background:rgba(255,255,255,.78);
  border-color:rgba(114,80,49,.12);
  color:var(--text);
}

html[data-theme="light"] .se-pill{
  background:rgba(255,255,255,.78);
  border-color:rgba(114,80,49,.12);
  color:var(--text);
}

html[data-theme="light"] :is(
  .cx-logo-card,
  .cx-logo-preview,
  .ce-logo-card,
  .ce-logo-preview,
  .ae-usage,
  .ath-check-item,
  .st-select-panel,
  .st-athletes-list,
  .st-athletes-item,
  .sg8m-player,
  .sg8m-round,
  .sg8m-match,
  .rk-lore-tab,
  .rk-hall-item,
  .rk-hall-stat,
  .rk-duck-match,
  .rk-mobile-rank-card,
  .rk-modal
){
  background:linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,241,234,.98));
  border-color:rgba(114,80,49,.10);
  box-shadow:0 16px 34px rgba(138,94,50,.10);
  color:var(--text);
}

html[data-theme="light"] .re-field{
  background:rgba(255,255,255,.72);
  border-color:rgba(114,80,49,.12);
}

html[data-theme="light"] .sg8m-player.is-empty{
  background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(245,239,232,.96));
}

html[data-theme="light"] .rk-hall-item-drama{
  background:linear-gradient(180deg, rgba(255,244,241,.98), rgba(250,236,230,.98));
  border-color:rgba(195,109,89,.16);
}

html[data-theme="light"] :is(
  .cx-stat,
  .tt-small,
  .ath-small,
  .st-small,
  .sg8m-note,
  .se-small,
  .sg8-small,
  .tref-help,
  .rafa-note,
  .cx-logo-preview span,
  .ce-logo-preview span,
  .rk-small,
  .rk-lore-subtitle,
  .rk-hall-meta,
  .rk-lore-note,
  .rk-duck-result-meta,
  .rk-duck-match-stage,
  .rk-duck-match-type,
  .rk-mobile-rank-meta
){
  color:var(--muted);
}

html[data-theme="light"] :is(
  .sg8m-team,
  .rk-lore-title,
  .rk-hall-title,
  .rk-duck-result-name,
  .rk-duck-match-pairing,
  .rk-modal-title,
  .rk-mobile-rank-name,
  .rk-mobile-rank-points
){
  color:var(--text);
}

html[data-theme="light"] .rk-tab.active,
html[data-theme="light"] .rk-tab:hover,
html[data-theme="light"] .rk-lore-tab.active{
  border-color:rgba(232,109,31,.28);
  background:linear-gradient(90deg, rgba(232,109,31,.16), rgba(255,255,255,.92));
  color:var(--text);
}

html[data-theme="light"] .rk-tab-edit{
  border-color:rgba(232,109,31,.22);
  color:#8b4518;
}

html[data-theme="light"] .rk-modal-head{
  border-bottom-color:rgba(114,80,49,.10);
  background:linear-gradient(90deg, rgba(118,68,38,.94), rgba(168,108,70,.86));
}

html[data-theme="light"] .rk-modal-title,
html[data-theme="light"] .rk-modal-sub{
  color:#fff3ea;
}

html[data-theme="light"] :is(
  .ath-table th,
  .st-table th,
  .sg8m-table th,
  .rk-table th,
  .cx-table th
){
  color:#9d5824;
  background:rgba(232,109,31,.08);
}

html[data-theme="light"] :is(
  .ath-table td,
  .st-table td,
  .sg8m-table td,
  .rk-table td,
  .cx-table td,
  .ath-table th,
  .st-table th,
  .sg8m-table th,
  .rk-table th,
  .cx-table th
){
  border-bottom-color:rgba(114,80,49,.10);
  color:var(--text);
}

html[data-theme="light"] .st-athletes-list{
  background:rgba(255,255,255,.82);
}

html[data-theme="light"] .st-athletes-item{
  background:rgba(255,255,255,.72);
  border-color:rgba(114,80,49,.08);
}

html[data-theme="light"] .st-athletes-item.is-selected{
  background:rgba(28,143,92,.12);
  border-color:rgba(28,143,92,.28);
}

html[data-theme="light"] .st-athletes-item.is-pending{
  background:rgba(59,130,246,.08);
  border-color:rgba(96,165,250,.26);
}

html[data-theme="light"] .st-athletes-state{
  border-color:rgba(114,80,49,.12);
  background:rgba(255,255,255,.76);
  color:var(--text);
}

html[data-theme="light"] .st-athletes-state.is-selected{
  background:rgba(28,143,92,.10);
  border-color:rgba(28,143,92,.24);
  color:#17603f;
}

html[data-theme="light"] .st-athletes-state.is-pending{
  background:rgba(59,130,246,.08);
  border-color:rgba(96,165,250,.24);
  color:#365a8c;
}

html[data-theme="light"] .sg8m-player-slot{
  background:rgba(232,109,31,.14);
  color:#9d5824;
}

.sg8m-player-slot.is-empty{
  background:rgba(255,255,255,.10);
  color:rgba(255,255,255,.82);
}

html[data-theme="light"] .sg8m-player-slot.is-empty{
  background:rgba(114,80,49,.08);
  color:#8b5d33;
}

html[data-theme="light"] .sg8m-score-pending{
  background:rgba(255,255,255,.72);
  border-color:rgba(114,80,49,.12);
  color:var(--text);
}

.iconbtn:hover{
  background: rgba(255,255,255,.08);
  border-color:var(--border-strong);
}

.avatar{
  width:36px;height:36px;border-radius:999px;
  display:flex;align-items:center;justify-content:center;
  border:1px solid rgba(255,143,75,.26);
  background: linear-gradient(180deg, rgba(255,101,22,.26), rgba(255,154,89,.12));
  font-weight:800;
  color:#fff8f2;
}

.content{
  width:100%;
  max-width:1380px;
  padding:0 2px;
  margin:0 auto;
}

.content > *{
  width:100%;
  margin-left:auto;
  margin-right:auto;
}

.footer2{
  width:100%;
  padding: 14px 18px 6px 18px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing:.08em;
  text-transform:uppercase;
}

/* =========================================================
   TORNEIOS - Cartoes + botoes
   ========================================================= */

.tref-page{ padding: 0 6px; }

.tref-head{
  padding: 10px 0 16px 0;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}

.tref-head > *{
  min-width:0;
}

.tref-head > div:last-child:not(:first-child),
.tref-head > a:last-child:not(:first-child),
.tref-head > form:last-child:not(:first-child){
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

.tref-h1{
  margin:0 0 6px 0;
  font-size:28px;
  font-weight:800;
  letter-spacing:.01em;
}

.tref-sub{
  color: var(--muted);
  line-height:1.5;
}

.page-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.page-head-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

.page-head-actions::-webkit-scrollbar{
  display:none;
}

.panel-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

.cards-grid-2{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
}

.cards-grid-3{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:12px;
}

.cards-grid-4{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:12px;
}

.cards-grid-5{
  display:grid;
  grid-template-columns:repeat(5, minmax(0, 1fr));
  gap:12px;
}

.table-wrap{
  width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

.table-wrap > table{
  min-width:640px;
}

.table-wrap.table-wrap-compact > table{
  min-width:520px;
}

.tref-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1100px){
  .tref-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px){
  .tref-grid{ grid-template-columns: 1fr; }
}

.tref-card{
  border:1px solid var(--border);
  border-radius: 22px;
  overflow:hidden;
  background:
    linear-gradient(180deg, rgba(28,28,28,.96) 0%, rgba(18,18,18,.98) 100%);
  box-shadow: var(--shadow);
}

.tref-band{
  text-align:center;
  padding: 11px 14px;
  font-size:11px;
  color: #fff4e8;
  letter-spacing:.16em;
  font-weight:800;
  text-transform:uppercase;
  border-bottom:1px solid rgba(255,255,255,.08);
  background: linear-gradient(90deg, #ff5a00 0%, #ff7f24 72%, #ff9f59 100%);
}

.tref-body{
  padding: 16px 16px 14px 16px;
  text-align:center;
  background: var(--panel-2);
  border-bottom:1px solid rgba(255,255,255,.06);
}

.tref-title{
  font-weight:800;
  line-height:1.25;
  margin-bottom:10px;
  font-size:18px;
}

.tref-pills{
  display:flex;
  gap:10px;
  justify-content:center;
  flex-wrap:wrap;
}

.tref-pill{
  display:inline-flex;
  align-items:center;
  padding: 7px 11px;
  border-radius: 999px;
  font-size:11px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  color: var(--text);
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:700;
}

.tref-pill-status{ background: rgba(0,0,0,.22); }

.tref-status-open{ border-color: var(--friendly-border); color: var(--friendly); }
.tref-status-live{ border-color: var(--danger-border); color: var(--danger); }
.tref-status-done{ border-color: var(--info-border); color: var(--info); }

.tref-actions{
  padding: 12px 16px 16px 16px;
  background: rgba(255,255,255,.02);
}

.tref-actions-row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tref-actions-single{
  grid-template-columns: 1fr;
  margin-top: 10px;
}

.tref-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height: 38px;
  border-radius: 14px;
  font-weight:700;
  font-size:12px;
  letter-spacing:.06em;
  text-transform:uppercase;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color:var(--text);
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .12s ease, box-shadow .16s ease;
  cursor:pointer;
  box-shadow:inset 0 -1px 0 rgba(255,255,255,.02);
}

.tref-btn:hover{
  background: rgba(255,255,255,.08);
  border-color: var(--border-strong);
  box-shadow:0 12px 24px rgba(0,0,0,.18);
}

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

.tref-green{
  color: #fff8f1;
  border-color: var(--friendly-border);
  background: linear-gradient(180deg, rgba(37,177,101,.32), rgba(24,118,67,.22));
}

.tref-green:hover{
  background: linear-gradient(180deg, rgba(46,196,114,.38), rgba(24,118,67,.28));
  border-color: rgba(94,229,145,.62);
}

html[data-theme="light"] .tref-green{
  color:#ffffff;
  border-color:rgba(25,133,74,.48);
  background:linear-gradient(180deg, #2db765 0%, #218a50 100%);
  box-shadow:0 12px 24px rgba(33,138,80,.18);
}

html[data-theme="light"] .tref-green:hover{
  background:linear-gradient(180deg, #35c56f 0%, #249958 100%);
  border-color:rgba(25,133,74,.62);
  box-shadow:0 16px 28px rgba(33,138,80,.24);
}

.tref-blue{
  color: #fff7ee;
  border-color: var(--info-border);
  background: linear-gradient(180deg, rgba(255,111,36,.30), rgba(255,154,82,.18));
}

.tref-blue:hover{
  background: linear-gradient(180deg, rgba(255,111,36,.40), rgba(255,154,82,.24));
  border-color: rgba(255,177,111,.60);
}

.tref-orange,
body .cx-danger,
body .cs-danger,
body .rk-danger{
  color: var(--danger) !important;
  border-color: var(--danger-border) !important;
  background: var(--danger-soft) !important;
}

.tref-orange:hover,
body .cx-danger:hover,
body .cs-danger:hover,
body .rk-danger:hover{
  background: rgba(255,125,56,.30) !important;
  border-color: rgba(255,162,104,.62) !important;
}

body .st-ok,
body .cx-ok,
body .rk-ok,
body .ath-usage-ok{ color: var(--friendly) !important; }

body .st-warn,
body .cx-warn,
body .ath-usage-block,
body .ae-warn{ color: var(--danger) !important; }

.tref-btn-disabled{
  border:1px dashed var(--border);
  background: transparent;
  color:var(--muted);
}

.app-shell-card{
  border:1px solid rgba(255,255,255,.08);
  border-radius:24px;
  background:
    radial-gradient(380px 160px at 18% -12%, rgba(255,95,24,.12), transparent 64%),
    linear-gradient(180deg, rgba(28,28,28,.98), rgba(14,14,14,.98));
  box-shadow:var(--shadow);
}

.app-inline-scroll{
  display:flex;
  gap:10px;
  flex-wrap:nowrap;
  overflow-x:auto;
  overflow-y:hidden;
  padding-bottom:4px;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}

.app-inline-scroll::-webkit-scrollbar{
  display:none;
}

.app-inline-scroll > *{
  flex:0 0 auto;
}

.ca-head-brand{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.ca-head-logo{
  width:104px;
  height:104px;
  border-radius:24px;
  padding:14px;
  flex:0 0 auto;
  border:1px solid rgba(255,255,255,.10);
  background:linear-gradient(180deg, rgba(255,255,255,.08) 0%, rgba(255,255,255,.03) 100%);
  box-shadow:0 22px 44px rgba(0,0,0,.20);
  display:flex;
  align-items:center;
  justify-content:center;
}

.ca-head-logo img{
  display:block;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
}

@media (max-width: 1100px){
  .cards-grid-5{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px){
  .cards-grid-4{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .cards-grid-3{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .cards-grid-2{ grid-template-columns:1fr; }
}

@media (max-width: 760px){
  html[data-theme="light"] .tref-head{
    border-color:rgba(114,80,49,.10);
    background:
      radial-gradient(320px 120px at 14% -10%, rgba(232,109,31,.12), transparent 68%),
      linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,241,234,.98));
    box-shadow:0 18px 40px rgba(138,94,50,.12);
  }

  html[data-theme="light"] .page-head-actions{
    scrollbar-color:rgba(232,109,31,.42) transparent;
  }

  body.sidebar-lock{
    overflow:hidden;
  }
  body{
    scroll-padding-top:calc(var(--mobile-utility-height) + 18px + var(--safe-top));
  }
  body.has-mobile-tabbar{
    padding-bottom:calc(var(--mobile-tabbar-height) + 26px + var(--safe-bottom));
  }
  body.no-mobile-tabbar{
    padding-bottom:calc(18px + var(--safe-bottom));
  }
  .shell{
    grid-template-columns:1fr;
    gap:10px;
    padding:calc(8px + var(--safe-top)) calc(10px + var(--safe-right)) calc(10px + var(--safe-bottom)) calc(10px + var(--safe-left));
  }
  .mobile-utility-bar{
    position:fixed;
    top:calc(10px + var(--safe-top));
    left:calc(10px + var(--safe-left));
    right:calc(10px + var(--safe-right));
    z-index:1110;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    pointer-events:none;
  }
  .mobile-utility-bar > *{
    pointer-events:auto;
  }
  .mobile-utility-actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
    min-width:0;
  }
  .mobile-utility-actions .theme-switch{
    padding:3px;
    gap:3px;
  }
  .mobile-utility-actions .theme-switch-btn{
    min-width:54px;
    min-height:36px;
    padding:0 10px;
    font-size:10px;
  }
  .mobile-utility-menu,
  .mobile-utility-avatar,
  .mobile-utility-chip{
    border:1px solid rgba(255,255,255,.10);
    background:
      linear-gradient(180deg, rgba(29,29,29,.96), rgba(14,14,14,.94)),
      radial-gradient(circle at top, rgba(255,100,22,.12), transparent 62%);
    backdrop-filter:blur(16px);
    box-shadow:0 16px 34px rgba(0,0,0,.26);
  }
  .mobile-utility-menu{
    min-width:42px;
    height:42px;
    border-radius:16px;
  }
  .mobile-utility-avatar{
    width:42px;
    height:42px;
    border-radius:16px;
    flex:0 0 auto;
  }
  .mobile-utility-chip{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:42px;
    padding:0 14px;
    border-radius:16px;
    color:#fff5eb;
    font-size:12px;
    font-weight:800;
    letter-spacing:.04em;
    text-transform:none;
    white-space:nowrap;
  }
  .sidebar-overlay{
    display:block;
    position:fixed;
    inset:0;
    background:rgba(2,10,22,.62);
    opacity:0;
    pointer-events:none;
    visibility:hidden;
    transition:opacity .2s ease;
    z-index:-1;
  }
  .sidebar{
    position:fixed;
    left:0;
    top:0;
    bottom:0;
    width:min(84vw, 320px);
    max-width:320px;
    transform:translateX(-104%);
    transition:transform .22s ease;
    z-index:1001;
    box-shadow: 0 20px 40px rgba(0,0,0,.38);
    border-radius:0 28px 28px 0;
    padding-bottom:calc(20px + var(--safe-bottom));
  }
  .shell.sidebar-open .sidebar{ transform:translateX(0); }
  .shell.sidebar-open .sidebar-overlay{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    z-index:1000;
  }
  .topbar-menu{
    display:inline-flex;
    position:relative;
    z-index:1002;
  }
  .topbar2{
    display:none;
  }
  .top-left{ gap:10px; }
  .top-copy{ gap:2px; }
  .top-context{
    font-size:9px;
    letter-spacing:.18em;
  }
  .top-title{
    font-size:14px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .top-actions{ gap:6px; }
  .iconbtn{
    min-width:34px;
    height:34px;
    padding:0 8px;
  }
  .avatar{
    width:34px;
    height:34px;
  }
  .content{
    width:100%;
    max-width:1200px;
    padding:calc(var(--mobile-utility-height) + 18px) 0 calc(22px + var(--safe-bottom)) 0;
    margin:0 auto;
  }
  body.has-mobile-tabbar .content{
    padding-bottom:calc(var(--mobile-tabbar-height) + 18px + var(--safe-bottom));
  }
  .footer2{
    display:none;
  }
  .tref-page{
    padding:0 2px;
    display:grid;
    gap:14px;
  }
  body.has-mobile-tabbar .tref-page > *:last-child{
    margin-bottom:calc(var(--mobile-tabbar-height) + 18px + var(--safe-bottom));
  }
  body.no-mobile-tabbar .tref-page > *:last-child{
    margin-bottom:calc(18px + var(--safe-bottom));
  }
  .tref-head{
    padding:18px 16px 16px 16px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:24px;
    background:
      radial-gradient(320px 120px at 14% -10%, rgba(255,94,14,.16), transparent 68%),
      linear-gradient(180deg, rgba(24,24,24,.98), rgba(15,15,15,.98));
    box-shadow:0 18px 40px rgba(0,0,0,.22);
  }
  .tref-h1{
    font-size:25px;
    margin-bottom:4px;
  }
  .tref-sub{
    font-size:13px;
    line-height:1.55;
  }
  .page-head-actions,
  .panel-actions{
    width:100%;
  }
  .tref-head > div:last-child:not(:first-child),
  .tref-head > a:last-child:not(:first-child),
  .tref-head > form:last-child:not(:first-child){
    width:100%;
  }
  .page-head-actions{
    flex-wrap:nowrap;
    overflow-x:auto;
    overflow-y:hidden;
    padding-bottom:4px;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }
  .page-head-actions > *{
    flex:0 0 auto;
  }
  .tref-head > div:last-child:not(:first-child),
  .tref-head > form:last-child:not(:first-child){
    flex-wrap:nowrap;
    overflow-x:auto;
    overflow-y:hidden;
    padding-bottom:4px;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }
  .tref-head > div:last-child:not(:first-child)::-webkit-scrollbar,
  .tref-head > form:last-child:not(:first-child)::-webkit-scrollbar{
    display:none;
  }
  .tref-head > div:last-child:not(:first-child) > *,
  .tref-head > form:last-child:not(:first-child) > *{
    flex:0 0 auto;
  }
  .tref-head > a:last-child:not(:first-child){
    display:inline-flex;
    width:auto;
  }
  .cards-grid-5,
  .cards-grid-4,
  .cards-grid-3,
  .cards-grid-2{
    grid-template-columns:1fr;
  }
  .tref-card{ border-radius:18px; }
  .tref-band{
    text-align:left;
    padding:12px 14px;
    font-size:10px;
  }
  .tref-body{ padding:14px; }
  .tref-actions{ padding:12px 14px 14px 14px; }
  .tref-actions-row{ grid-template-columns:1fr; }
  .tref-btn{
    min-height:42px;
    font-size:11px;
    letter-spacing:.04em;
    padding:0 14px;
  }
  .tref-pills{
    justify-content:flex-start;
  }
  .ca-head-brand{
    width:100%;
    align-items:center;
  }
  .ca-head-logo{
    width:84px;
    height:84px;
    padding:12px;
    border-radius:20px;
  }
  .table-wrap{
    margin:0 -4px;
    padding:0 4px;
  }
  .table-wrap > table{ min-width:560px; }
  .table-wrap.table-wrap-compact > table{ min-width:480px; }
  .mobile-tabbar{
    position:fixed;
    left:12px;
    right:12px;
    bottom:calc(10px + var(--safe-bottom));
    z-index:1100;
    display:grid;
    grid-template-columns:repeat(5, minmax(0, 1fr));
    gap:7px;
    padding:7px;
    border:1px solid rgba(255,255,255,.10);
    border-radius:24px;
    background:
      linear-gradient(180deg, rgba(27,27,27,.98), rgba(13,13,13,.96)),
      radial-gradient(circle at top, rgba(255,95,24,.12), transparent 62%);
    backdrop-filter:blur(18px);
    box-shadow:0 24px 60px rgba(0,0,0,.34);
  }
  .mobile-tabbar-link{
    min-width:0;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:4px;
    min-height:44px;
    padding:6px 4px;
    border-radius:16px;
    border:1px solid rgba(255,255,255,.06);
    background:rgba(255,255,255,.03);
    color:rgba(255,233,216,.72);
    text-align:center;
    transition:background .18s ease,border-color .18s ease,transform .18s ease,color .18s ease;
  }
  .mobile-tabbar-link.is-active,
  .mobile-tabbar-link[aria-current="page"]{
    color:#fff7f0;
    border-color:rgba(255,136,63,.34);
    background:linear-gradient(180deg, rgba(255,94,11,.20), rgba(255,158,89,.10));
    box-shadow:inset 0 0 0 1px rgba(255,145,86,.12);
  }
  .mobile-tabbar-link:active{
    transform:translateY(1px);
  }
  .mobile-tabbar-dot{
    width:8px;
    height:8px;
    border-radius:999px;
    background:rgba(255,255,255,.16);
    box-shadow:0 0 0 4px rgba(255,255,255,.03);
  }
  .mobile-tabbar-link.is-active .mobile-tabbar-dot,
  .mobile-tabbar-link[aria-current="page"] .mobile-tabbar-dot{
    background:linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
    box-shadow:0 0 18px rgba(255,96,22,.35);
  }
  .mobile-tabbar-text{
    display:block;
    min-width:0;
    font-size:9px;
    font-weight:800;
    letter-spacing:.06em;
    text-transform:uppercase;
    line-height:1.15;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
}

/* =========================================================
   LEGACY UI (home + rafa)
   ========================================================= */

.card{
  border:1px solid var(--border);
  border-radius:22px;
  background:linear-gradient(180deg, rgba(28,28,28,.96), rgba(18,18,18,.98));
  box-shadow:var(--shadow);
}

.card-body{ padding:18px; }

.card-title{
  padding:14px 18px 0 18px;
  font-size:13px;
  font-weight:800;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:#ff9d5c;
}

.page-title{
  margin:0;
  font-size:30px;
  font-weight:800;
}

.page-subtitle{
  margin-top:6px;
  color:var(--muted);
}

.muted{ color:var(--muted); }

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:var(--text);
  font-weight:700;
  font-size:12px;
  letter-spacing:.06em;
  text-transform:uppercase;
  padding:0 14px;
  text-decoration:none;
  cursor:pointer;
  transition:background .16s ease,border-color .16s ease,transform .12s ease,box-shadow .16s ease;
}

.btn:hover{
  background:rgba(255,255,255,.08);
  border-color:var(--border-strong);
  box-shadow:0 12px 24px rgba(0,0,0,.18);
}

.btn-primary{
  color:#fff7ee;
  border-color:rgba(255,168,96,.34);
  background:linear-gradient(180deg, rgba(255,98,20,.34), rgba(255,150,76,.18));
}

.btn-secondary{
  border-color:var(--border);
  background:rgba(255,255,255,.04);
}

.btn-danger{
  color:#fff3ea;
  border-color:var(--danger-border);
  background:linear-gradient(180deg, rgba(255,112,36,.28), rgba(140,45,0,.16));
}

.btn-warning,
.btn-soft{
  color:#fff6ec;
  border-color:rgba(255,156,92,.28);
  background:rgba(255,122,44,.12);
}

.btn-ghost{
  background:transparent;
  color:var(--muted);
}

.label{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin:0 0 6px 0;
}

.input{
  width:100%;
  height:42px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:var(--text);
  padding:0 12px;
  outline:none;
}

.alert{
  border:1px solid var(--border);
  border-radius:16px;
  padding:12px 14px;
  font-size:13px;
}

.alert-success{
  color:var(--friendly);
  border-color:var(--friendly-border);
  background:var(--friendly-soft);
}

.alert-danger{
  color:var(--danger);
  border-color:var(--danger-border);
  background:var(--danger-soft);
}

.table-responsive{
  width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

.table{
  width:100%;
  border-collapse:collapse;
  background:transparent;
}

.table th,
.table td{
  text-align:left;
  padding:10px 8px;
  border-bottom:1px solid rgba(255,255,255,.06);
  font-size:13px;
}

.table th{
  color:#ffbb86;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:10px;
}

/* =========================================================
   Global responsive hardening
   ========================================================= */

img{
  max-width:100%;
  height:auto;
}

@media (max-width: 1100px){
  .tref-grid[style*="repeat(5"]{
    grid-template-columns:repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 980px){
  .tref-grid[style*="repeat(5"],
  .tref-grid[style*="repeat(4"]{
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px){
  .tref-grid,
  .tref-grid[style*="repeat("]{
    grid-template-columns:1fr !important;
  }

  .tref-head,
  .page-head{
    flex-direction:column;
    align-items:flex-start !important;
  }

  .tref-page [style*="min-width:"],
  .content [style*="min-width:"]{
    min-width:0 !important;
  }

  .tref-page [style*="grid-template-columns"],
  .content [style*="grid-template-columns"]{
    grid-template-columns:1fr !important;
  }

  .tref-body,
  .table-responsive,
  .pub-list-box,
  .pub-key,
  .pub-phase,
  .ko-phases-wrap,
  .cx-qualifiers-wrap{
    overflow-x:auto !important;
    -webkit-overflow-scrolling:touch;
  }

  .pub-game{
    grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) !important;
    align-items:center !important;
    justify-items:stretch;
  }

  .pub-team{
    width:auto;
    text-align:left !important;
    overflow-wrap:anywhere;
  }

  .pub-team.right{
    text-align:right !important;
  }

  .pub-center-stack{
    min-width:104px !important;
    width:auto;
    align-items:center !important;
  }

  .table-stack-mobile{
    width:100% !important;
    min-width:0 !important;
    border-collapse:separate !important;
    border-spacing:0 10px !important;
    table-layout:auto !important;
  }

  .table-stack-mobile thead{
    display:none !important;
  }

  .table-stack-mobile tbody{
    display:block;
    width:100%;
  }

  .table-stack-mobile tr{
    display:block;
    width:100%;
    margin:0 0 10px 0;
    border:1px solid var(--border);
    border-radius:12px;
    overflow:hidden;
    background:rgba(255,255,255,.04);
    box-shadow:0 10px 24px rgba(0,0,0,.16);
  }

  .table-stack-mobile td{
    display:grid !important;
    grid-template-columns:minmax(92px, 118px) minmax(0,1fr);
    gap:8px;
    align-items:flex-start;
    width:100% !important;
    min-width:0 !important;
    padding:9px 10px !important;
    text-align:left !important;
    white-space:normal !important;
    overflow-wrap:anywhere;
    border-bottom:1px solid rgba(255,255,255,.08) !important;
  }

  .table-stack-mobile td:last-child{
    border-bottom:none !important;
  }

  .table-stack-mobile td::before{
    content:attr(data-label);
    display:block;
    min-width:0;
    color:var(--muted);
    font-size:10px;
    font-weight:800;
    letter-spacing:.06em;
    text-transform:uppercase;
    line-height:1.35;
  }

  .table-stack-mobile td > *{
    min-width:0;
  }
}
