:root{
  --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;
}

*{ 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:'Sora', 'Poppins', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  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"] :is(.tref-head, .app-page-hero){
  background:
    radial-gradient(620px 180px at 72% -10%, rgba(232,109,31,.12), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,241,234,.98));
  border-color:rgba(114,80,49,.12);
  box-shadow:0 20px 42px rgba(138,94,50,.12);
}

html[data-theme="light"] :is(.app-stat-card, .app-empty-card){
  background:
    radial-gradient(320px 120px at 100% -10%, rgba(232,109,31,.08), transparent 66%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,243,236,.98));
  border-color:rgba(114,80,49,.12);
  box-shadow:0 18px 34px rgba(138,94,50,.10);
}

html[data-theme="light"] .app-stat-icon{
  border-color:rgba(232,109,31,.18);
  background:linear-gradient(160deg, rgba(232,109,31,.16), rgba(244,163,82,.08));
  color:#d4681d;
}

html[data-theme="light"] :is(.app-title, .app-stat-value){
  color:#26180f;
}

html[data-theme="light"] :is(.app-kicker, .app-field label){
  color:#c66b2a;
}

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; }
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 (top menu global) ===== */

.shell{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  gap:18px;
  padding:16px;
}

.sidebar-overlay{
  display:none;
}

.mobile-tabbar{
  display:none;
}

.mobile-fab-menu{
  display:none;
}

.app-topbar{
  width:100%;
  max-width:1380px;
  margin:0 auto;
  display:grid;
  gap:12px;
}

.app-topbar-row,
.app-subnav{
  border:1px solid var(--border);
  border-radius:28px;
  background:
    radial-gradient(620px 220px at 82% -14%, rgba(255,108,28,.12), transparent 58%),
    linear-gradient(180deg, rgba(24,24,24,.98), rgba(12,12,12,.98));
  box-shadow:var(--shadow);
}

.app-topbar-row{
  display:flex;
  align-items:center;
  gap:14px;
  padding:14px 16px;
}

.app-topbar-brand{
  display:flex;
  align-items:center;
  flex:0 0 auto;
}

.app-topbar-brand img{
  width:170px;
  height:auto;
  display:block;
}

.app-topbar-brand-fallback{
  font-family:'Poppins', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  font-size:26px;
  font-weight:800;
  letter-spacing:-.04em;
  color:#fffaf5;
}

.app-topbar-nav{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  flex:1 1 auto;
  flex-wrap:nowrap;
  min-width:0;
}

.app-topbar-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:44px;
  padding:0 12px;
  border:1px solid transparent;
  border-radius:16px;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
  white-space:nowrap;
  transition:transform .18s ease,border-color .18s ease,background .18s ease,color .18s ease,box-shadow .18s ease;
}

.app-topbar-link:hover,
.app-topbar-link.is-active,
.app-topbar-link[aria-current="page"]{
  color:#fff;
  background:linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
  border-color:var(--border-strong);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05), 0 0 0 1px rgba(255,138,24,.05);
}

.app-topbar-link:hover{
  transform:translateY(-1px);
}

.app-topbar-link-icon,
.app-subnav-icon,
.app-mobile-menu-icon{
  width:18px;
  height:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}

.app-topbar-link-icon svg,
.app-subnav-icon svg,
.app-mobile-menu-icon svg,
.mobile-fab-menu svg{
  width:18px;
  height:18px;
}

.app-topbar-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
}

.app-topbar-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:44px;
  padding:0 16px;
  border-radius:16px;
  border:1px solid var(--border);
  font-size:13px;
  font-weight:800;
  color:#fff;
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease,background .18s ease;
}

.app-topbar-btn:hover{
  transform:translateY(-1px);
}

.app-topbar-btn-ghost{
  background:rgba(255,255,255,.03);
  border-color:rgba(255,255,255,.14);
  color:#fff;
}

.app-topbar-btn-ghost:hover{
  background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.22);
}

.app-topbar-btn-primary{
  color:#fff9f2;
  border-color:rgba(255,129,45,.42);
  background:linear-gradient(180deg, rgba(255,140,24,.98), rgba(255,91,0,.92));
  box-shadow:0 22px 44px rgba(255,91,0,.18), inset 0 1px 0 rgba(255,255,255,.12);
}

.app-topbar-inline-form,
.app-mobile-menu-form{
  margin:0;
}

.app-topbar-user{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:44px;
  padding:4px 8px 4px 4px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  background:rgba(255,255,255,.03);
  color:#fff;
}

.app-topbar-user-copy{
  display:grid;
  gap:2px;
  min-width:0;
}

.app-topbar-user-copy strong{
  font-size:12px;
  line-height:1.1;
}

.app-topbar-user-copy small{
  color:var(--muted);
  font-size:10px;
  line-height:1.2;
}

.app-subnav{
  display:flex;
  align-items:center;
  gap:16px;
  padding:12px 16px;
}

.app-subnav-label{
  flex:0 0 auto;
  color:#ff9c5d;
  font-size:11px;
  font-weight:800;
  letter-spacing:.16em;
  text-transform:uppercase;
}

.app-subnav-links{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  min-width:0;
}

.app-subnav-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:40px;
  padding:0 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.02);
  color:var(--muted);
  font-size:13px;
  font-weight:700;
  transition:transform .18s ease,border-color .18s ease,background .18s ease,color .18s ease;
}

.app-subnav-link:hover,
.app-subnav-link.is-active,
.app-subnav-link[aria-current="page"]{
  color:#fff;
  border-color:rgba(255,138,24,.18);
  background:rgba(255,138,24,.08);
}

.app-subnav-link:hover{
  transform:translateY(-1px);
}

.sidebar{
  display:none;
}

.app-mobile-menu-head{
  padding:4px 0 12px;
}

.app-mobile-menu-brand{
  display:flex;
  align-items:center;
}

.app-mobile-menu-brand img{
  width:178px;
  max-width:100%;
}

.app-mobile-menu-nav{
  display:grid;
  gap:8px;
}

.app-mobile-menu-section{
  margin-top:4px;
  color:#ff9c5d;
  font-size:11px;
  font-weight:800;
  letter-spacing:.16em;
  text-transform:uppercase;
  padding:8px 2px 2px;
}

.app-mobile-menu-link{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:46px;
  padding:0 14px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
  color:var(--muted);
  font-size:14px;
  font-weight:700;
}

.app-mobile-menu-link.is-active,
.app-mobile-menu-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));
}

.app-mobile-menu-footer{
  margin-top:auto;
  display:grid;
  gap:12px;
  padding-top:14px;
}

.app-mobile-menu-footer .app-topbar-btn{
  width:100%;
}

.app-mobile-menu-user{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  background:rgba(255,255,255,.03);
}

.app-mobile-menu-user div{
  display:grid;
  gap:2px;
}

.app-mobile-menu-user strong{
  font-size:14px;
  line-height:1.1;
}

.app-mobile-menu-user small{
  color:var(--muted);
  font-size:11px;
}

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

.iconbtn{
  min-width:42px;
  height:42px;
  border-radius:14px;
  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;
}

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

html[data-theme="light"] .app-topbar-row,
html[data-theme="light"] .app-subnav{
  background:
    radial-gradient(620px 200px at 82% -12%, rgba(232,109,31,.12), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,241,234,.98));
  border-color:rgba(114,80,49,.12);
  box-shadow:0 20px 42px rgba(138,94,50,.12);
}

html[data-theme="light"] .app-topbar-link:hover,
html[data-theme="light"] .app-topbar-link.is-active,
html[data-theme="light"] .app-topbar-link[aria-current="page"]{
  color:#2f1f12;
  background:linear-gradient(180deg, rgba(232,109,31,.10), rgba(232,109,31,.05));
}

html[data-theme="light"] .app-topbar-btn-ghost,
html[data-theme="light"] .app-topbar-user,
html[data-theme="light"] .app-subnav-link,
html[data-theme="light"] .app-mobile-menu-link,
html[data-theme="light"] .app-mobile-menu-user{
  background:rgba(255,255,255,.76);
  border-color:rgba(114,80,49,.12);
}

html[data-theme="light"] .app-topbar-user-copy small,
html[data-theme="light"] .app-subnav-link,
html[data-theme="light"] .app-mobile-menu-link,
html[data-theme="light"] .app-mobile-menu-user small{
  color:var(--muted);
}

html[data-theme="dark"] :is(
  .sidebar,
  .sb-brand,
  .mobile-tabbar,
  .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"] .mobile-tabbar,
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,
  .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,
  .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;
  display:grid;
  gap:16px;
}

.tref-head{
  position:relative;
  padding:24px 26px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  flex-wrap:wrap;
  border:1px solid var(--border);
  border-radius:28px;
  background:
    radial-gradient(620px 180px at 72% -10%, rgba(255,108,28,.16), transparent 62%),
    linear-gradient(180deg, rgba(24,24,24,.98), rgba(14,14,14,.98));
  box-shadow:var(--shadow);
  overflow:hidden;
}

.tref-head::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size:28px 28px;
  mask-image:linear-gradient(180deg, rgba(0,0,0,.30), transparent 82%);
  opacity:.18;
}

.tref-head > *{
  position:relative;
  z-index:1;
}

.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:34px;
  font-weight:800;
  letter-spacing:.01em;
  line-height:1.03;
}

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

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

.page-head-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
}

.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:16px;
}

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

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

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

.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:26px;
  overflow:hidden;
  background:
    radial-gradient(420px 140px at 100% -8%, rgba(255,102,24,.10), transparent 66%),
    linear-gradient(180deg, rgba(28,28,28,.96) 0%, rgba(18,18,18,.98) 100%);
  box-shadow: var(--shadow);
}

.tref-band{
  text-align:left;
  padding:12px 16px;
  font-size:11px;
  color: #fff4e8;
  letter-spacing:.18em;
  font-weight:800;
  text-transform:uppercase;
  border-bottom:1px solid rgba(255,255,255,.08);
  background:
    linear-gradient(90deg, rgba(255,88,0,.92) 0%, rgba(255,127,36,.88) 74%, rgba(255,159,89,.78) 100%);
}

.tref-body{
  padding:18px 18px 16px 18px;
  text-align:left;
  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:20px;
}

.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:14px 18px 18px 18px;
  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:40px;
  border-radius: 14px;
  font-weight:700;
  font-size:12px;
  letter-spacing:.04em;
  text-transform:none;
  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);
}

.app-page-hero{
  position:relative;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:26px 28px;
  border:1px solid var(--border);
  border-radius:30px;
  background:
    radial-gradient(720px 220px at 76% -8%, rgba(255,108,28,.18), transparent 60%),
    linear-gradient(180deg, rgba(24,24,24,.98), rgba(14,14,14,.98));
  box-shadow:var(--shadow);
  overflow:hidden;
}

.app-page-hero::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,.015) 1px, transparent 1px);
  background-size:30px 30px;
  mask-image:linear-gradient(180deg, rgba(0,0,0,.26), transparent 84%);
}

.app-page-hero > *{
  position:relative;
  z-index:1;
}

.app-page-copy{
  min-width:0;
  flex:1 1 auto;
}

.app-kicker{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin-bottom:10px;
  color:#ffb179;
  font-size:11px;
  font-weight:800;
  letter-spacing:.18em;
  text-transform:uppercase;
}

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

.app-title{
  margin:0;
  font-family:'Poppins', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  font-size:42px;
  line-height:1.02;
  letter-spacing:.01em;
}

.app-lead{
  margin:12px 0 0;
  max-width:860px;
  color:var(--muted);
  font-size:15px;
  line-height:1.6;
}

.app-page-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  align-self:center;
  gap:10px;
  flex-wrap:wrap;
  flex:0 0 auto;
}

.app-home-simple{
  gap:16px;
}

.app-home-hero{
  min-height:0;
  padding:24px 28px;
}

.app-home-hero .app-lead{
  max-width:640px;
}

.app-home-hero-actions .tref-btn{
  min-width:150px;
}

.app-home-actions-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:16px;
}

.app-home-action-card{
  display:flex;
  flex-direction:column;
  min-height:238px;
  overflow:hidden;
}

.app-home-action-card::before{
  content:"";
  display:block;
  height:7px;
  background:linear-gradient(90deg, var(--accent), var(--accent-2));
}

.app-home-action-card .tref-body{
  flex:1;
  text-align:left;
  padding:22px 22px 18px;
}

.app-home-action-label{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin-bottom:10px;
  color:#ff9b4a;
  font-size:11px;
  font-weight:900;
  letter-spacing:.16em;
  text-transform:uppercase;
}

.app-home-action-label::before{
  content:"";
  width:7px;
  height:7px;
  border-radius:999px;
  background:var(--accent);
  box-shadow:0 0 16px rgba(255,98,20,.45);
}

.app-home-tools-card .tref-body{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  text-align:left;
}

.app-home-tools-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
  flex:0 0 auto;
}

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

.app-stat-card{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center;
  gap:14px;
  padding:18px;
  min-height:124px;
  border:1px solid var(--border);
  border-radius:24px;
  background:
    radial-gradient(320px 120px at 100% -10%, rgba(255,103,24,.10), transparent 66%),
    linear-gradient(180deg, rgba(28,28,28,.96), rgba(18,18,18,.98));
  box-shadow:var(--shadow);
}

.app-stat-icon{
  width:58px;
  height:58px;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,145,76,.22);
  background:linear-gradient(160deg, rgba(255,94,11,.18), rgba(255,165,98,.08));
  color:#ffad74;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.03);
}

.app-stat-icon svg{
  width:26px;
  height:26px;
}

.app-stat-copy{
  min-width:0;
  display:grid;
  gap:4px;
}

.app-stat-label{
  color:rgba(255,238,225,.70);
  font-size:11px;
  font-weight:800;
  letter-spacing:.16em;
  text-transform:uppercase;
}

.app-stat-value{
  font-family:'Poppins', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  font-size:20px;
  line-height:1.1;
  font-weight:800;
  color:#fff7ef;
}

.app-stat-note{
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}

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

.app-field-grid.is-2{
  grid-template-columns:repeat(2, minmax(0, 1fr));
}

.app-field-grid.is-4{
  grid-template-columns:repeat(4, minmax(0, 1fr));
}

.app-field{
  display:grid;
  gap:6px;
}

.app-field label{
  color:#ffb179;
  font-size:11px;
  font-weight:800;
  letter-spacing:.14em;
  text-transform:uppercase;
}

.app-input,
.app-select,
.app-textarea{
  width:100%;
  min-height:44px;
  padding:0 12px;
  border-radius:14px;
  border:1px solid rgba(255,165,100,.12);
  background:rgba(255,255,255,.05);
  color:var(--text);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.02);
}

.app-textarea{
  min-height:110px;
  padding:10px 12px;
  resize:vertical;
}

.app-note{
  padding:14px 16px;
  border:1px solid var(--border);
  border-radius:18px;
  background:rgba(255,255,255,.03);
  color:var(--muted);
  font-size:13px;
  line-height:1.55;
}

.athlete-profile-summary{display:flex;align-items:center;gap:16px;margin-bottom:18px}
.athlete-profile-avatar{width:82px;height:82px;border-radius:50%;overflow:hidden;flex:0 0 82px;border:2px solid rgba(255,137,70,.5);background:linear-gradient(145deg,rgba(255,92,0,.9),rgba(88,32,10,.9));display:grid;place-items:center;color:#fff;font-size:26px;font-weight:900;letter-spacing:.04em;box-shadow:0 12px 28px rgba(0,0,0,.28)}
.athlete-profile-avatar img{width:100%;height:100%;object-fit:cover}
.athlete-profile-card .app-note{margin:18px 0}
.athlete-profile-fields{margin-top:14px}
.athlete-profile-city{margin-top:14px}
.athlete-profile-file{padding:8px 10px;min-height:44px;font-size:12px}
.athlete-profile-remove{display:inline-flex;align-items:center;gap:7px;margin-top:12px;color:var(--muted);font-size:12px}
.athlete-profile-actions{display:flex;justify-content:flex-end;gap:10px;margin:18px -18px -16px;padding:14px 18px 18px}
.athlete-profile-actions .tref-btn{padding:0 18px}
.athlete-profile-flash{margin:14px 0;padding:10px 12px;border:1px solid var(--border);border-radius:12px;font-size:13px}.athlete-profile-flash.is-success{color:var(--friendly);border-color:var(--friendly-border);background:var(--friendly-soft)}.athlete-profile-flash.is-error{color:#ffcfaa;border-color:var(--danger-border);background:var(--danger-soft)}
.athlete-ibge-location{margin-top:14px}.athlete-ibge-location-values{margin-top:12px}.athlete-ibge-city-field{position:relative}.athlete-ibge-city-list{position:absolute;z-index:5;top:100%;right:0;left:0;max-height:210px;overflow:auto;margin-top:5px;padding:5px;border:1px solid rgba(255,165,100,.25);border-radius:12px;background:#141313;box-shadow:0 16px 28px rgba(0,0,0,.38)}.athlete-ibge-city-option{display:block;width:100%;padding:9px 11px;border:0;border-radius:8px;background:transparent;color:var(--text);font:inherit;text-align:left;cursor:pointer}.athlete-ibge-city-option:hover,.athlete-ibge-city-option[aria-selected="true"]{background:rgba(255,125,42,.16);color:#fff}.athlete-ibge-city-empty{margin:5px 7px;color:var(--muted);font-size:13px}.athlete-ibge-location-error{margin:8px 0 0;color:#ffcfaa;font-size:12px;line-height:1.45}
.event-thumbnail{position:relative;display:grid;place-items:center;overflow:hidden;border:1px solid rgba(255,151,63,.2);border-radius:12px;background:radial-gradient(circle at 72% 18%,rgba(255,124,27,.46),transparent 28%),linear-gradient(135deg,#29201a,#0e1012 72%);isolation:isolate}.event-thumbnail::after{content:"";position:absolute;inset:0;background:linear-gradient(135deg,transparent 30%,rgba(255,119,23,.18) 30.5%,transparent 31%);pointer-events:none}.event-thumbnail img{width:100%;height:100%;object-fit:cover}.event-thumbnail.is-fallback small,.event-thumbnail.is-fallback strong{position:relative;z-index:1}.event-thumbnail.is-fallback small{font-size:9px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:rgba(255,237,219,.7)}.event-thumbnail.is-fallback strong{font-size:22px;letter-spacing:-.08em;color:#fff}.event-thumbnail--form{width:116px;height:78px;flex:0 0 116px}
@media (max-width:560px){.athlete-profile-summary{align-items:flex-start}.athlete-profile-avatar{width:66px;height:66px;flex-basis:66px;font-size:21px}.athlete-profile-actions{flex-direction:column}.athlete-profile-actions .tref-btn{width:100%}}

.app-empty-card{
  padding:18px 20px;
  border:1px solid var(--border);
  border-radius:22px;
  background:
    radial-gradient(320px 120px at 100% -10%, rgba(255,103,24,.08), transparent 66%),
    linear-gradient(180deg, rgba(24,24,24,.98), rgba(16,16,16,.99));
  box-shadow:var(--shadow);
  color:var(--muted);
  font-size:14px;
  line-height:1.6;
}

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;
}

.app-action-grid{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.app-chip-scroll{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.app-mini-actions{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}

.app-action-grid > form,
.app-mini-actions > form{
  margin:0;
}

.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)); }
  .app-topbar-row{
    gap:12px;
    padding:12px 14px;
  }
  .app-topbar-brand img{
    width:152px;
  }
  .app-topbar-link{
    min-height:42px;
    padding:0 10px;
    font-size:12px;
  }
  .app-topbar-btn{
    min-height:42px;
    padding:0 14px;
    font-size:12px;
  }
  .app-topbar-user-copy small{
    display:none;
  }
  .app-topbar-user-copy strong{
    font-size:11px;
  }
}

@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; }
  .app-home-actions-grid{ grid-template-columns:1fr; }
  .app-stat-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .app-field-grid,
  .app-field-grid.is-4{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .app-page-hero{
    padding:22px;
  }
  .app-title{
    font-size:34px;
  }
}

@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(92px + var(--safe-top));
  }
  body.no-mobile-tabbar{
    padding-bottom:calc(18px + var(--safe-bottom));
  }
  .shell{
    gap:10px;
    padding:calc(8px + var(--safe-top)) calc(10px + var(--safe-right)) calc(10px + var(--safe-bottom)) calc(10px + var(--safe-left));
  }
  .app-topbar{
    gap:10px;
  }
  .app-topbar-row{
    gap:12px;
    padding:12px 14px;
  }
  .app-topbar-brand{
    min-width:0;
  }
  .app-topbar-brand img{
    width:148px;
  }
  .app-topbar-nav,
  .app-topbar-btn-desktop,
  .app-topbar-inline-form-desktop,
  .app-subnav{
    display:none;
  }
  .app-topbar-actions{
    margin-left:auto;
    gap:8px;
  }
  .app-topbar-user{
    min-height:42px;
    padding:4px 6px 4px 4px;
  }
  .app-topbar-user-copy{
    display:none;
  }
  .mobile-fab-menu{
    position:static;
    z-index:auto;
    display:inline-flex;
    flex:0 0 auto;
  }
  .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{
    display:flex;
    flex-direction:column;
    gap:12px;
    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;
    border:1px solid var(--border);
    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%);
    padding:18px 14px calc(20px + var(--safe-bottom));
    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;
  }
  .iconbtn{
    min-width:34px;
    height:34px;
    padding:0 8px;
  }
  .main{
    gap:10px;
  }
  .avatar{
    width:34px;
    height:34px;
  }
  .content{
    width:100%;
    max-width:1200px;
    padding:4px 0 calc(22px + var(--safe-bottom)) 0;
    margin:0 auto;
  }
  .footer2{
    display:none;
  }
  .tref-page{
    padding:0 2px;
    display:grid;
    gap:14px;
  }
  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;
  }
  .app-page-hero{
    padding:18px 16px;
    border-radius:24px;
    gap:14px;
    flex-direction:column;
  }
  .app-page-actions{
    width:100%;
    justify-content:flex-start;
    align-self:stretch;
  }
  .app-home-hero{
    padding:18px 16px;
  }
  .app-home-hero-actions .tref-btn,
  .app-home-tools-actions .tref-btn{
    width:100%;
  }
  .app-home-action-card{
    min-height:0;
  }
  .app-home-action-card .tref-body{
    padding:18px 18px 14px;
  }
  .app-home-tools-card .tref-body{
    align-items:stretch;
    flex-direction:column;
  }
  .app-home-tools-actions{
    width:100%;
    justify-content:flex-start;
  }
  .app-title{
    font-size:28px;
  }
  .app-lead{
    font-size:14px;
    line-height:1.55;
  }
  .app-stat-grid,
  .app-field-grid,
  .app-field-grid.is-2,
  .app-field-grid.is-4{
    grid-template-columns:1fr;
  }
  .app-stat-card{
    min-height:0;
    padding:16px;
    border-radius:22px;
  }
  .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;
  }
  .tref-btn,
  .btn,
  .bt-btn{
    min-height:44px;
    height:auto !important;
    line-height:1.2 !important;
    white-space:normal !important;
    overflow-wrap:anywhere;
    word-break:normal;
    text-align:center;
    text-wrap:balance;
    padding:10px 12px !important;
  }
  .tref-head > div:last-child:not(:first-child),
  .tref-head > form:last-child:not(:first-child),
  .page-head-actions,
  .panel-actions,
  .tt-actions,
  .pf-actions,
  .cs-actions,
  .sg-actions,
  .sg8-actions,
  .bt-actions,
  .reg-actions,
  .actions,
  .gsi-actions,
  .gsi-match-actions,
  .cx-manual-actions,
  .pub-hero-actions,
  .app-action-grid{
    display:grid !important;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:8px;
    width:100%;
    overflow:visible !important;
    padding-bottom:0 !important;
  }
  .tref-head > div:last-child:not(:first-child) > *,
  .tref-head > form:last-child:not(:first-child) > *,
  .page-head-actions > *,
  .panel-actions > *,
  .tt-actions > *,
  .pf-actions > *,
  .cs-actions > *,
  .sg-actions > *,
  .sg8-actions > *,
  .bt-actions > *,
  .reg-actions > *,
  .actions > *,
  .gsi-actions > *,
  .gsi-match-actions > *,
  .cx-manual-actions > *,
  .pub-hero-actions > *,
  .app-action-grid > *{
    min-width:0;
    width:100% !important;
  }
  .tref-head > div:last-child:not(:first-child) > form,
  .tref-head > form:last-child:not(:first-child) > form,
  .page-head-actions > form,
  .panel-actions > form,
  .tt-actions > form,
  .pf-actions > form,
  .cs-actions > form,
  .sg-actions > form,
  .sg8-actions > form,
  .bt-actions > form,
  .reg-actions > form,
  .actions > form,
  .gsi-actions > form,
  .gsi-match-actions > form,
  .cx-manual-actions > form,
  .pub-hero-actions > form,
  .app-action-grid > form{
    display:flex;
    min-width:0;
    width:100%;
  }
  .tref-head > div:last-child:not(:first-child) > :is(.theme-switch, .tt-status-pill),
  .tref-head > form:last-child:not(:first-child) > :is(.theme-switch, .tt-status-pill),
  .page-head-actions > :is(.theme-switch, .tt-status-pill),
  .panel-actions > :is(.theme-switch, .tt-status-pill),
  .tt-actions > :is(.theme-switch, .tt-status-pill),
  .pf-actions > :is(.theme-switch, .tt-status-pill),
  .cs-actions > :is(.theme-switch, .tt-status-pill),
  .sg-actions > :is(.theme-switch, .tt-status-pill),
  .sg8-actions > :is(.theme-switch, .tt-status-pill),
  .bt-actions > :is(.theme-switch, .tt-status-pill),
  .reg-actions > :is(.theme-switch, .tt-status-pill),
  .actions > :is(.theme-switch, .tt-status-pill),
  .gsi-actions > :is(.theme-switch, .tt-status-pill),
  .gsi-match-actions > :is(.theme-switch, .tt-status-pill),
  .cx-manual-actions > :is(.theme-switch, .tt-status-pill),
  .pub-hero-actions > :is(.theme-switch, .tt-status-pill),
  .app-action-grid > :is(.theme-switch, .tt-status-pill){
    grid-column:1 / -1;
    width:auto !important;
    justify-self:flex-start;
  }
  .app-mini-actions{
    display:grid !important;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:6px;
    width:100%;
  }
  .app-mini-actions > *{
    min-width:0;
    width:100% !important;
  }
  .app-mini-actions > form{
    display:flex;
    min-width:0;
    width:100%;
  }
  .app-chip-scroll,
  .rk-tabs,
  .cx-group-tabs,
  .gst-tabs,
  .pf-tab-bar,
  .s8-pills{
    display:flex !important;
    flex-wrap:nowrap !important;
    overflow-x:auto;
    overflow-y:hidden;
    padding-bottom:4px;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }
  .app-chip-scroll::-webkit-scrollbar,
  .rk-tabs::-webkit-scrollbar,
  .cx-group-tabs::-webkit-scrollbar,
  .gst-tabs::-webkit-scrollbar,
  .pf-tab-bar::-webkit-scrollbar,
  .s8-pills::-webkit-scrollbar{
    display:none;
  }
  .app-chip-scroll > *,
  .rk-tabs > *,
  .cx-group-tabs > *,
  .gst-tabs > *,
  .pf-tab-bar > *,
  .s8-pills > *{
    flex:0 0 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;
  }
}

@media (max-width: 420px){
  .tref-head > div:last-child:not(:first-child),
  .tref-head > form:last-child:not(:first-child),
  .page-head-actions,
  .panel-actions,
  .tt-actions,
  .pf-actions,
  .cs-actions,
  .sg-actions,
  .sg8-actions,
  .bt-actions,
  .reg-actions,
  .actions,
  .gsi-actions,
  .gsi-match-actions,
  .cx-manual-actions,
  .pub-hero-actions,
  .app-action-grid,
  .app-mini-actions{
    grid-template-columns:1fr;
  }
  .tref-head > div:last-child:not(:first-child) > :is(.theme-switch, .tt-status-pill),
  .tref-head > form:last-child:not(:first-child) > :is(.theme-switch, .tt-status-pill),
  .page-head-actions > :is(.theme-switch, .tt-status-pill),
  .panel-actions > :is(.theme-switch, .tt-status-pill),
  .tt-actions > :is(.theme-switch, .tt-status-pill),
  .pf-actions > :is(.theme-switch, .tt-status-pill),
  .cs-actions > :is(.theme-switch, .tt-status-pill),
  .sg-actions > :is(.theme-switch, .tt-status-pill),
  .sg8-actions > :is(.theme-switch, .tt-status-pill),
  .bt-actions > :is(.theme-switch, .tt-status-pill),
  .reg-actions > :is(.theme-switch, .tt-status-pill),
  .actions > :is(.theme-switch, .tt-status-pill),
  .gsi-actions > :is(.theme-switch, .tt-status-pill),
  .gsi-match-actions > :is(.theme-switch, .tt-status-pill),
  .cx-manual-actions > :is(.theme-switch, .tt-status-pill),
  .pub-hero-actions > :is(.theme-switch, .tt-status-pill),
  .app-action-grid > :is(.theme-switch, .tt-status-pill){
    width:100% !important;
    justify-self:stretch;
  }
}

/* =========================================================
   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-family:'Poppins', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  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;
  }
}

/* =========================================================
   Sistema compacto global
   Mantém a KV, mas reduz altura, padding e fontes grandes.
   Esta camada usa !important porque várias páginas possuem
   estilos próprios dentro das views.
   ========================================================= */

:root{
  --shadow:0 14px 34px rgba(0,0,0,.30);
  --mobile-tabbar-height:68px;
}

body{
  font-size:14px;
  line-height:1.45;
}

.shell{
  gap:12px !important;
  padding:12px 14px !important;
}

.content,
.app-topbar{
  max-width:1280px !important;
}

.app-topbar{
  gap:10px !important;
}

.app-topbar-row,
.app-subnav{
  border-radius:22px !important;
}

.app-topbar-row{
  gap:10px !important;
  padding:10px 12px !important;
}

.app-topbar-brand img{
  width:148px !important;
}

.app-topbar-link,
.app-topbar-btn,
.app-topbar-user,
.app-subnav-link,
.app-mobile-menu-link{
  min-height:36px !important;
  border-radius:13px !important;
  font-size:12px !important;
}

.app-topbar-link{
  gap:6px !important;
  padding:0 10px !important;
}

.app-topbar-btn{
  gap:8px !important;
  padding:0 13px !important;
}

.app-topbar-user{
  padding:3px 7px 3px 3px !important;
}

.app-topbar-user-copy strong{
  font-size:11px !important;
}

.app-topbar-user-copy small{
  font-size:9px !important;
}

.app-subnav{
  gap:12px !important;
  padding:9px 12px !important;
}

.app-subnav-links{
  gap:8px !important;
}

.app-subnav-link{
  gap:6px !important;
  padding:0 12px !important;
}

.app-topbar-link-icon,
.app-subnav-icon,
.app-mobile-menu-icon,
.app-topbar-link-icon svg,
.app-subnav-icon svg,
.app-mobile-menu-icon svg{
  width:16px !important;
  height:16px !important;
}

.avatar{
  width:32px !important;
  height:32px !important;
  font-size:13px !important;
}

.tref-page,
.app-home-simple,
.content :is(.sg-page,.sg8-page,.gst-page,.gsi-page,.pf-page,.cx-page,.bt-page,.reg-page,.tt-page,.pub-page){
  gap:12px !important;
}

.content :is(
  .tref-head,
  .app-page-hero,
  .card,
  .tref-card,
  .app-stat-card,
  .app-shell-card,
  .app-empty-card,
  .pub-side-card,
  .pub-meta-card,
  .pub-summary-card,
  .pub-insc-card,
  .bt-card,
  .pf-card,
  .pf-summary-card,
  .pf-partner-card,
  .pf-metric-card,
  .pf-duo-card,
  .pf-participation-card,
  .pf-match-card,
  .sg-card,
  .sg8-card,
  .gst-panel,
  .gst-subpanel,
  .gsi-panel,
  .gsi-card,
  .cx-logo-card,
  .cx-card,
  .ce-logo-card,
  .rk-lore-card,
  .rk-ranking-card,
  .rk-mobile-rank-card,
  .app-home-action-card
){
  border-radius:20px !important;
  box-shadow:0 14px 34px rgba(0,0,0,.28) !important;
}

.content :is(.tref-head,.app-page-hero){
  padding:18px 20px !important;
  gap:12px !important;
}

.content :is(
  .card-body,
  .tref-body,
  .tref-actions,
  .gst-panel-body,
  .gsi-panel-body,
  .sg-card-body,
  .sg8-card-body,
  .bt-card-body,
  .pf-card-body,
  .cx-card-body,
  .app-home-action-card .tref-body
){
  padding:13px 14px !important;
}

.content :is(
  .tref-band,
  .card-title,
  .gst-panel-head,
  .gsi-panel-head,
  .sg-card-head,
  .sg8-card-head,
  .bt-card-h,
  .pf-card-head,
  .cx-card-head
){
  padding:10px 14px !important;
}

.content :is(
  .tref-h1,
  .app-title,
  .page-title,
  .pub-title,
  .sg-title,
  .sg8-title,
  .gst-title,
  .gsi-title,
  .pf-title,
  .cx-title
){
  font-size:clamp(24px, 2.45vw, 34px) !important;
  line-height:1.06 !important;
  letter-spacing:-.02em !important;
}

.content :is(h2,h3,.tref-title,.card-title,.app-stat-value){
  line-height:1.15 !important;
}

.content :is(.tref-title,.app-stat-value){
  font-size:18px !important;
}

.content :is(
  .tref-sub,
  .app-lead,
  .page-subtitle,
  .app-stat-note,
  .muted,
  .gst-panel-head p,
  .gsi-panel-head p
){
  font-size:13px !important;
  line-height:1.45 !important;
}

.content :is(
  .app-kicker,
  .app-stat-label,
  .tref-band,
  .card-title,
  .label,
  .gst-block-kicker,
  .gsi-kicker
){
  font-size:10px !important;
  letter-spacing:.12em !important;
}

.cards-grid-2,
.cards-grid-3,
.cards-grid-4,
.cards-grid-5,
.tref-grid,
.app-stat-grid,
.app-home-actions-grid,
.content :is(.gst-grid,.gst-config-grid,.gsi-grid,.pf-grid,.sg-grid,.sg8-grid,.cx-grid,.bt-grid,.reg-grid){
  gap:12px !important;
}

.app-stat-card{
  min-height:92px !important;
  gap:10px !important;
  padding:14px !important;
}

.app-stat-icon{
  width:46px !important;
  height:46px !important;
  border-radius:14px !important;
}

.app-stat-icon svg{
  width:21px !important;
  height:21px !important;
}

.app-stat-copy{
  gap:2px !important;
}

.content :is(
  .btn,
  .tref-btn,
  .bt-btn,
  .sg-btn,
  .sg8-btn,
  .gst-btn,
  .gsi-btn,
  .pf-btn,
  .cx-btn,
  .reg-btn,
  .tt-btn,
  .pub-btn,
  .app-mini-btn
){
  min-height:34px !important;
  padding:0 12px !important;
  border-radius:12px !important;
  font-size:11px !important;
  letter-spacing:.04em !important;
}

.content :is(
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .input
){
  min-height:36px !important;
  height:auto !important;
  padding:7px 10px !important;
  border-radius:12px !important;
  font-size:13px !important;
}

.content textarea{
  min-height:84px !important;
}

.content :is(.alert,.gst-state-box,.gsi-state-box){
  padding:10px 12px !important;
  border-radius:13px !important;
  font-size:12px !important;
}

.content table{
  font-size:12px !important;
}

.content table :is(th,td),
.table :is(th,td){
  padding:7px 8px !important;
  font-size:12px !important;
  line-height:1.35 !important;
}

.content table th,
.table th{
  font-size:9px !important;
  letter-spacing:.07em !important;
}

.content :is(.tref-pill,.gst-top-chip,.gsi-chip,.sg-chip,.sg8-chip,.bt-chip,.pf-chip,.cx-chip,.tt-status-pill){
  min-height:24px !important;
  padding:4px 8px !important;
  border-radius:999px !important;
  font-size:9px !important;
  line-height:1.1 !important;
}

.content :is(.page-head,.page-head-actions,.panel-actions,.tref-pills,.actions){
  gap:8px !important;
}

.footer2{
  padding:8px 12px 2px !important;
  font-size:9px !important;
}

@media (max-width: 980px){
  .shell{
    padding:10px !important;
  }

  .content :is(.tref-head,.app-page-hero){
    padding:16px !important;
  }

  .app-stat-grid,
  .cards-grid-4,
  .cards-grid-5{
    grid-template-columns:repeat(2, minmax(0,1fr)) !important;
  }
}

@media (max-width: 760px){
  body{
    font-size:13px !important;
  }

  .shell{
    padding:8px !important;
    gap:8px !important;
  }

  .content{
    padding:0 !important;
  }

  .app-topbar-row{
    min-height:58px !important;
    padding:8px 10px !important;
    border-radius:18px !important;
  }

  .app-topbar-brand img,
  .app-mobile-menu-brand img{
    width:128px !important;
  }

  .app-subnav{
    padding:8px 10px !important;
    border-radius:18px !important;
  }

  .content :is(
    .tref-head,
    .app-page-hero,
    .card,
    .tref-card,
    .app-stat-card,
    .gst-panel,
    .gst-subpanel,
    .gsi-panel,
    .sg-card,
    .sg8-card,
    .bt-card,
    .pf-card,
    .cx-card
  ){
    border-radius:16px !important;
  }

  .content :is(.tref-head,.app-page-hero){
    padding:14px !important;
  }

  .content :is(
    .card-body,
    .tref-body,
    .tref-actions,
    .gst-panel-body,
    .gsi-panel-body,
    .sg-card-body,
    .sg8-card-body,
    .bt-card-body,
    .pf-card-body,
    .cx-card-body
  ){
    padding:11px !important;
  }

  .content :is(
    .tref-h1,
    .app-title,
    .page-title,
    .pub-title,
    .sg-title,
    .sg8-title,
    .gst-title,
    .gsi-title,
    .pf-title,
    .cx-title
  ){
    font-size:clamp(21px, 7.2vw, 28px) !important;
  }

  .content :is(.tref-title,.app-stat-value){
    font-size:16px !important;
  }

  .content :is(
    .tref-sub,
    .app-lead,
    .page-subtitle,
    .app-stat-note,
    .muted,
    .gst-panel-head p,
    .gsi-panel-head p
  ){
    font-size:12px !important;
  }

  .app-stat-grid,
  .cards-grid-2,
  .cards-grid-3,
  .cards-grid-4,
  .cards-grid-5,
  .app-home-actions-grid{
    grid-template-columns:1fr !important;
  }

  .app-stat-card{
    min-height:76px !important;
    padding:11px !important;
  }

  .app-stat-icon{
    width:40px !important;
    height:40px !important;
  }

  .content :is(
    .btn,
    .tref-btn,
    .bt-btn,
    .sg-btn,
    .sg8-btn,
    .gst-btn,
    .gsi-btn,
    .pf-btn,
    .cx-btn,
    .reg-btn,
    .tt-btn,
    .pub-btn,
    .app-mini-btn
  ){
    min-height:32px !important;
    padding:0 10px !important;
    font-size:10px !important;
  }

  .content table :is(th,td),
  .table :is(th,td){
    padding:6px 7px !important;
    font-size:11px !important;
  }

  .table-stack-mobile{
    border-spacing:0 7px !important;
  }

  .table-stack-mobile td{
    padding:7px 8px !important;
    grid-template-columns:minmax(78px, 104px) minmax(0,1fr) !important;
  }

  .mobile-tabbar{
    min-height:64px !important;
    padding:6px calc(8px + var(--safe-right)) calc(6px + var(--safe-bottom)) calc(8px + var(--safe-left)) !important;
    border-radius:20px 20px 0 0 !important;
  }

  .mobile-tabbar-link{
    min-height:50px !important;
    border-radius:14px !important;
    font-size:10px !important;
  }
}
