/* Shared visitor interface. Colours follow the existing duelist theme picker. */
body.tbb-site-ui {
    margin: 0;
    padding: 0 0 80px;
    max-width: none;
    min-height: 100vh;
}
.tbb-site-ui > .container {
    box-sizing: border-box;
    width: calc(100% - 40px);
    margin: 0 auto;
    padding-top: 36px;
}
.tbb-site-ui.tbb-document > .container { max-width: 800px; margin-top: 32px; }
.tbb-site-ui footer { box-sizing: border-box; }
.tbb-navigation, .tbb-navigation * { box-sizing: border-box; }
.tbb-navigation {
    position: relative;
    z-index: 30;
    align-self: stretch;
    width: 100%;
    border-bottom: 1px solid var(--tbb-border);
    background: var(--tbb-page-bg);
    box-shadow: 0 6px 30px rgb(0 0 0 / 16%);
    font: 600 13px/1.4 system-ui, sans-serif;
}
.tbb-navigation-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 1400px;
    min-height: 84px;
    margin: auto;
    padding: 16px 28px;
}
.tbb-navigation .tbb-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--tbb-text);
    text-decoration: none;
    letter-spacing: 1px;
    flex-shrink: 0;
}
.tbb-brand-logo {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: contain;
    border: 1px solid var(--tbb-border);
    border-radius: 9px;
}
.tbb-brand small { display: block; margin-top: 4px; color: var(--tbb-muted); font-size: 9px; letter-spacing: 1.5px; }
.tbb-navigation-links { display: flex; flex-wrap: wrap; gap: 4px; }
.tbb-navigation-links a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--tbb-muted);
    text-decoration: none;
    transition: color .18s, background-color .18s, border-color .18s;
}
.tbb-icon { flex: 0 0 17px; width: 17px; height: 17px; vertical-align: middle; }
.tbb-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    min-height: 42px;
    padding: 10px 15px;
    border: 1px solid var(--tbb-border);
    border-radius: 8px;
    background: var(--tbb-surface);
    color: var(--tbb-text);
    font: 600 12px/1.5 system-ui, sans-serif;
    cursor: pointer;
}
.tbb-button:hover { border-color: var(--tbb-accent); }
.tbb-button-primary, .tbb-site-ui .btn-market { background: var(--tbb-accent); border-color: var(--tbb-accent); color: var(--tbb-page-bg); }
.tbb-site-ui .btn-binder { background: var(--tbb-surface); border-color: var(--tbb-border); color: var(--tbb-text); }
.tbb-bracket-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.tbb-control-status { color: var(--tbb-muted); font: 12px/1.6 system-ui, sans-serif; }
.tbb-bracket-actions .tbb-control-status { width: 100%; min-height: 20px; margin: 0; text-align: center; }
.tbb-match-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.tbb-filter-button { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--tbb-border); border-radius: 8px; background: var(--tbb-surface); color: var(--tbb-muted); font: 600 12px/1.5 system-ui, sans-serif; cursor: pointer; }
.tbb-filter-button:hover, .tbb-filter-button[aria-pressed="true"] { border-color: var(--tbb-accent); color: var(--tbb-accent); background: rgb(var(--tbb-accent-rgb) / 10%); }
.tbb-filter-count { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 3px; border-radius: 4px; background: var(--tbb-page-bg); font-variant-numeric: tabular-nums; }
.tbb-empty-state[hidden], .tbb-duel-card[hidden] { display: none; }
.tbb-empty-state .tbb-button { margin-top: 12px; }
.tbb-standing-identity { display: flex; align-items: center; gap: 10px; }
.tbb-standing-identity .tbb-duel-avatar { flex: 0 0 32px; width: 32px; height: 36px; font-size: 14px; }
.tbb-mobile-stats { display: none; }
.tbb-skeleton-art, .tbb-skeleton-line, .tbb-site-ui .loading::after { background: linear-gradient(100deg, var(--tbb-border) 20%, var(--tbb-surface) 45%, var(--tbb-border) 70%); background-size: 250% 100%; animation: tbb-loading 1.8s ease-in-out infinite; border-radius: 7px; }
.tbb-skeleton-art { height: 205px; margin-bottom: 18px; }
.tbb-skeleton-line { height: 14px; margin: 12px 0; }
.tbb-skeleton-short { width: 65%; }
.tbb-site-ui .loading::after { content: ''; display: block; max-width: 340px; height: 110px; margin: 24px auto 0; }
@keyframes tbb-loading { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.tbb-navigation-links a:hover, .tbb-navigation-links a[aria-current] {
    color: var(--tbb-accent);
    background: rgb(var(--tbb-accent-rgb) / 8%);
    border-color: rgb(var(--tbb-accent-rgb) / 24%);
}
.tbb-menu-toggle { display: none; padding: 10px 16px; background: var(--tbb-surface); color: var(--tbb-text); border: 1px solid var(--tbb-border); border-radius: 6px; font: inherit; cursor: pointer; }
.tbb-site-ui :is(a, button, input, select, [tabindex]):focus-visible { outline: 2px solid var(--tbb-accent); outline-offset: 4px; }
.tbb-site-ui :is(.server-card, .promo-banner, .tbb-showcase, .rules-box), .tbb-hub .grid > .card {
    border: 1px solid var(--tbb-border);
    border-top: 2px solid rgb(var(--tbb-accent-rgb) / 55%);
    border-radius: 12px;
    background: linear-gradient(135deg, rgb(var(--tbb-accent-rgb) / 5%), transparent 60%), var(--tbb-surface);
    box-shadow: 0 12px 30px rgb(0 0 0 / 16%);
}
.tbb-site-ui :is(.server-info h3, .card h3) { overflow-wrap: anywhere; }
.tbb-site-ui .server-card { flex-wrap: wrap; gap: 20px; }
.tbb-site-ui .server-card .links { flex-wrap: wrap; }
.tbb-site-ui :is(.tab-btn.active, .tab.active) { background: rgb(var(--tbb-accent-rgb) / 12%); color: var(--tbb-accent); border-color: var(--tbb-accent); }
.tbb-site-ui .tabs { max-width: 100%; overflow-x: auto; padding: 5px 3px; box-sizing: border-box; }
.tbb-site-ui .tabs > :is(.tab, .tab-btn) { flex-shrink: 0; }
.tbb-site-ui .binder-nav { max-width: 100%; box-sizing: border-box; overflow-x: auto; }
.tbb-site-ui .binder-sub-btn { flex-shrink: 0; }
.tbb-site-ui :is(.btn, .tab-btn, .tab) { transition: border-color .18s, box-shadow .18s, transform .18s; }
.tbb-site-ui :is(.btn, .tab-btn, .tab):hover { box-shadow: 0 0 18px rgb(var(--tbb-accent-rgb) / 16%); }
.tbb-section-heading { margin: 36px 0 20px; scroll-margin-top: 24px; }
.tbb-section-heading h2 { margin: 0 0 8px; font-family: 'Orbitron', system-ui, sans-serif; font-size: 1.3rem; }
.tbb-section-heading p, .tbb-page-intro { color: var(--tbb-muted); line-height: 1.6; }
.tbb-league .tbb-page-heading { margin: 16px 0 28px; text-align: left; }
.tbb-league .tbb-page-heading h1 { text-align: left; font-size: clamp(1.6rem, 5vw, 2.5rem); overflow-wrap: anywhere; }
.tbb-league .tbb-page-heading h2 { text-align: left; color: var(--tbb-muted); margin: 10px 0; font: 500 1.1rem/1.5 system-ui, sans-serif; overflow-wrap: anywhere; }
.tbb-eyebrow { margin: 0 0 10px; color: var(--tbb-secondary); font: 700 10px/1.5 system-ui, sans-serif; letter-spacing: 2px; }
.tbb-league-tabs { display: flex; gap: 8px; margin-bottom: 26px; padding: 5px; width: fit-content; border: 1px solid var(--tbb-border); border-radius: 10px; background: var(--tbb-surface); }
.tbb-league-tabs a { padding: 10px 18px; border-radius: 6px; color: var(--tbb-muted); font: 600 13px/1.5 system-ui, sans-serif; text-decoration: none; }
.tbb-league-tabs a[aria-current] { color: var(--tbb-accent); background: rgb(var(--tbb-accent-rgb) / 12%); }
.tbb-standings-toolbar { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.tbb-standings-toolbar label { display: grid; gap: 8px; width: min(100%, 340px); color: var(--tbb-muted); font: 600 12px/1.5 system-ui, sans-serif; }
.tbb-standings-toolbar input { box-sizing: border-box; width: 100%; padding: 12px 14px; border: 1px solid var(--tbb-border); border-radius: 8px; color: var(--tbb-text); background: var(--tbb-surface); font: 14px/1.5 system-ui, sans-serif; }
.tbb-standings-toolbar p { color: var(--tbb-muted); margin: 0; font: 13px/1.5 system-ui, sans-serif; }
.tbb-table-scroll { overflow-x: auto; border: 1px solid var(--tbb-border); border-radius: 12px; scrollbar-color: var(--tbb-border) var(--tbb-surface); }
.tbb-league .tbb-standings { min-width: 760px; border-radius: 0; font-size: 1rem; }
.tbb-standings caption { text-align: left; padding: 14px 18px; color: var(--tbb-muted); background: var(--tbb-surface); font: 12px/1.5 system-ui, sans-serif; }
.tbb-league .tbb-standings th { background: rgb(var(--tbb-accent-rgb) / 6%); font: 600 11px/1.4 system-ui, sans-serif; text-transform: uppercase; letter-spacing: .8px; white-space: nowrap; }
.tbb-league .tbb-standings :is(th, td) { padding: 16px 18px; }
.tbb-league .tbb-standings :is(th, td):nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
.tbb-league .tbb-standings .tbb-duelist-name { min-width: 170px; max-width: 280px; overflow-wrap: anywhere; }
.tbb-points { color: var(--tbb-accent); font-size: 1.25rem; font-weight: 700; }
.tbb-standings tr.is-current-player { background: rgb(var(--tbb-accent-rgb) / 10%); box-shadow: inset 3px 0 var(--tbb-accent); }
.tbb-rank-emblem { display: inline-grid; place-items: center; min-width: 32px; height: 34px; box-sizing: border-box; padding: 4px 7px; border: 1px solid var(--tbb-border); border-radius: 7px 2px; color: var(--tbb-muted); font: 700 13px/1 system-ui, sans-serif; }
.tbb-rank-1 { color: #ffdb79; border-color: #b18a36; background: #392d17; }
.tbb-rank-2 { color: #e2ecfa; border-color: #8394b0; background: #252e3e; }
.tbb-rank-3 { color: #f0ba97; border-color: #ac7652; background: #38271e; }
.tbb-you { margin-left: 8px; padding: 3px 6px; border-radius: 4px; color: var(--tbb-accent); background: rgb(var(--tbb-accent-rgb) / 12%); font: 700 9px/1.5 system-ui, sans-serif; }
.tbb-league .schedule-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); align-items: start; }
.tbb-duel-card { overflow: hidden; border: 1px solid var(--tbb-border); border-radius: 12px; background: var(--tbb-surface); box-shadow: 0 12px 28px rgb(0 0 0 / 18%); }
.tbb-duel-topline { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--tbb-border); color: var(--tbb-muted); font: 600 11px/1.5 system-ui, sans-serif; }
.tbb-match-status { display: inline-block; padding: 4px 8px; border: 1px solid var(--tbb-border); border-radius: 5px; color: var(--tbb-muted); background: var(--tbb-page-bg); font: 600 10px/1.4 system-ui, sans-serif; letter-spacing: .4px; }
.tbb-state-ready { border-color: #5086ab; color: #b2dcfa; background: #142c3e; }
.tbb-state-complete { border-color: #398763; color: #a7e8c4; background: #132f23; }
.tbb-state-pending { border-color: #9c8147; color: #f4d590; background: #322917; }
.tbb-duel-versus { display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); align-items: center; gap: 8px; padding: 26px 18px; background: radial-gradient(ellipse at center, rgb(var(--tbb-accent-rgb) / 9%), transparent 75%); }
.tbb-duel-player { align-self: stretch; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; min-width: 0; }
.tbb-duel-avatar { position: relative; display: grid; place-items: center; overflow: hidden; width: 48px; height: 52px; border: 1px solid var(--tbb-border); border-radius: 10px 3px; background: var(--tbb-page-bg); color: var(--tbb-secondary); font: 700 20px/1 system-ui, sans-serif; }
.tbb-duel-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; opacity: 0; }
.tbb-duel-avatar img.is-loaded { opacity: 1; }
.tbb-duel-player h3 { margin: 0; color: var(--tbb-text); font: 700 1.05rem/1.35 system-ui, sans-serif; overflow-wrap: anywhere; }
.tbb-duel-player p { margin: 0; color: var(--tbb-muted); font: 12px/1.5 system-ui, sans-serif; overflow-wrap: anywhere; }
.tbb-duel-vs { text-align: center; color: var(--tbb-accent); font: 900 20px/1 system-ui, sans-serif; font-style: italic; }
.tbb-duel-player.is-winner .tbb-duel-avatar { color: #a7e8c4; border-color: #398763; box-shadow: 0 0 18px rgb(46 204 113 / 10%); }
.tbb-duel-result { color: #a7e8c4; font: 700 10px/1.5 system-ui, sans-serif; text-transform: uppercase; letter-spacing: 1px; }
.tbb-duel-meta { display: flex; flex-wrap: wrap; gap: 14px 24px; margin: 0; padding: 16px 18px; border-top: 1px solid var(--tbb-border); background: var(--tbb-page-bg); }
.tbb-duel-meta div { min-width: 0; flex: 1 1 110px; }
.tbb-duel-meta dt { color: var(--tbb-muted); font: 600 10px/1.5 system-ui, sans-serif; text-transform: uppercase; letter-spacing: 1px; }
.tbb-duel-meta dd { margin: 5px 0 0; color: var(--tbb-text); overflow-wrap: anywhere; font: 13px/1.5 system-ui, sans-serif; }
.tbb-empty-state { grid-column: 1/-1; padding: 36px 24px; border: 1px dashed var(--tbb-border); border-radius: 12px; background: var(--tbb-surface); color: var(--tbb-muted); text-align: center; line-height: 1.6; }
.tbb-bracket .match-card { width: 280px; border-radius: 10px; box-shadow: 0 8px 24px rgb(0 0 0 / 20%); }
.tbb-bracket .match-card:hover { transform: none; }
.tbb-bracket .match-player { gap: 10px; padding: 14px; }
.tbb-bracket .player-info { min-width: 0; flex-wrap: wrap; }
.tbb-bracket .player-name { max-width: 185px; white-space: normal; overflow-wrap: anywhere; }
.tbb-bracket .score { flex-shrink: 0; background: var(--tbb-page-bg); }
.tbb-bracket .tbb-bracket-match-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--tbb-border); color: var(--tbb-muted); font: 600 10px/1.5 system-ui, sans-serif; }
.tbb-bracket .tbb-bracket-vs { color: var(--tbb-accent); font-weight: 900; font-style: italic; }
.tbb-bracket .round { flex: 0 0 280px; position: relative; padding-top: 48px; box-sizing: border-box; }
.tbb-bracket .round-title { position: absolute; top: 0; left: 0; width: 100%; margin: 0; }
.tbb-bracket .bracket-grid { min-height: 360px; }
.tbb-bracket-track { position: relative; display: flex; gap: 50px; min-width: 100%; }
.tbb-bracket-track:has(.registration-grid) { flex: 1; }
.tbb-bracket .tbb-bracket-track:has(.registration-grid) > .round { flex: 1 1 auto; }
.tbb-bracket .tbb-bracket-track:has(.registration-grid) .round-title { position: static; margin-bottom: 24px; }
.tbb-bracket .tbb-bracket-track:has(.registration-grid) > .round { padding-top: 0; }
.tbb-bracket-connectors { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.tbb-bracket-connectors path { fill: none; stroke: var(--tbb-border); stroke-width: 2; }
.tbb-bracket-connectors .tbb-connector-winner { stroke: #398763; }
.tbb-bracket .has-connectors .match-container::before, .tbb-bracket .has-connectors .match-container::after { display: none; }
.tbb-bracket .tbb-player-highlight { border-color: var(--tbb-accent); box-shadow: 0 0 18px rgb(var(--tbb-accent-rgb) / 25%); background: rgb(var(--tbb-accent-rgb) / 12%); }
.tbb-bracket .standings-wrapper { overflow-x: auto; }
.tbb-bracket .standings-table { min-width: 850px; }
.tbb-bracket .standings-table th { background: var(--tbb-surface); font: 600 11px/1.5 system-ui, sans-serif; }
.tbb-bracket .content-section.active, .tbb-duel-card { animation: tbb-panel-appear .25s ease-out; }
@keyframes tbb-panel-appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (max-width: 1100px) {
    .tbb-navigation-inner { gap: 12px; padding: 12px 20px; }
    .tbb-menu-toggle { display: block; }
    .tbb-navigation-links { display: none; width: 100%; padding: 8px 0; border-top: 1px solid var(--tbb-border); }
    .tbb-navigation.is-open .tbb-navigation-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .tbb-league .tbb-standings { min-width: 0; table-layout: fixed; }
    .tbb-league .tbb-standings :is(th, td) { padding: 13px 9px; vertical-align: top; }
    .tbb-league .tbb-standings :is(th, td):first-child { width: 38px; }
    .tbb-league .tbb-standings :is(th, td):nth-child(3) { width: 48px; }
    .tbb-league .tbb-standings :is(th, td):nth-child(n+4) { display: none; }
    .tbb-league .tbb-standings .tbb-duelist-name { min-width: 0; max-width: none; }
    .tbb-league .tbb-standings caption { font-size: 11px; padding: 12px 9px; }
    .tbb-standing-identity { align-items: start; gap: 7px; }
    .tbb-standing-identity > div { min-width: 0; }
    .tbb-standing-identity .tbb-duel-avatar { flex-basis: 27px; width: 27px; height: 31px; }
    .tbb-mobile-stats { display: block; margin-top: 10px; color: var(--tbb-muted); font: 11px/1.5 system-ui, sans-serif; }
    .tbb-mobile-stats summary { width: fit-content; padding: 5px 0; color: var(--tbb-secondary); cursor: pointer; }
    .tbb-mobile-stats dl { display: grid; gap: 6px; margin-bottom: 0; }
    .tbb-mobile-stats dl div { display: flex; justify-content: space-between; gap: 8px; }
    .tbb-mobile-stats dd { margin: 0; color: var(--tbb-text); font-weight: 700; }
    .tbb-bracket-actions .tbb-button { flex: 1 1 auto; }
    .tbb-site-ui > .container { width: calc(100% - 28px); padding-top: 24px; }
    .tbb-site-ui.tbb-document > .container { padding: 22px; }
    .tbb-site-ui .tbb-page-heading { margin-top: 4px; }
    .tbb-site-ui .binder-nav { justify-content: flex-start; gap: 8px; }
    .tbb-navigation-inner { min-height: 76px; padding: 12px 14px; }
    .tbb-brand small { font-size: 8px; }
    .tbb-hub .card-meta { flex-wrap: wrap; gap: 12px; }
    .tbb-hub .promo-banner { padding: 24px 16px; }
    .tbb-league-tabs { box-sizing: border-box; width: 100%; }
    .tbb-league-tabs a { flex: 1; padding: 10px; text-align: center; }
    .tbb-bracket .round { width: 280px; min-width: 280px; }
    .tbb-bracket .tbb-bracket-track:has(.registration-grid) > .round { min-width: 0; }
    .tbb-bracket-track { gap: 32px; }
    .tbb-bracket .tabs { padding: 4px; }
    .tbb-site-ui > .container > header { flex-wrap: wrap; gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .tbb-site-ui *, .tbb-site-ui *::before, .tbb-site-ui *::after { animation: none !important; transition: none !important; }
    .tbb-site-ui :is(.card, .btn, .match-card):hover { transform: none; }
}
