/* Portal visual enhancements */

/* Hero progress ring */
.pv-progress-ring {
    position: relative;
    width: var(--ring-size, 64px);
    height: var(--ring-size, 64px);
    flex-shrink: 0;
}
.pv-progress-ring svg { transform: rotate(-90deg); }
.pv-ring-track {
    fill: none;
    stroke: rgba(255,255,255,0.08);
    stroke-width: 4;
}
.pv-ring-fill {
    fill: none;
    stroke: var(--league-accent, var(--accent-cyan));
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}
.pv-ring-inner {
    position: absolute;
    inset: 8px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
}
.pv-ring-inner img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pv-ring-pct {
    position: absolute;
    bottom: -2px;
    right: -4px;
    font-size: 9px;
    font-weight: 800;
    background: var(--league-accent, var(--accent-cyan));
    color: #000;
    padding: 1px 4px;
    border-radius: 999px;
}
.league-hero-head-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.league-hero-head-row--dual {
    flex-wrap: wrap;
    align-items: center;
}
.league-hero-brand--partner-banner {
    flex: 1 1 100%;
    max-width: min(100%, 720px);
    margin-bottom: 8px;
}
.league-hero-partner-banner {
    display: block;
    width: 100%;
    max-width: 680px;
    height: auto;
    max-height: 88px;
    object-fit: contain;
    object-position: left center;
    background: #fff;
    border-radius: 8px;
    padding: 8px 14px;
    box-sizing: border-box;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.25));
}
.league-hero-brand--prominent {
    max-width: min(100%, 960px);
    margin-bottom: 12px;
}
.league-hero-partner-banner--prominent {
    max-width: 100%;
    max-height: 280px;
    padding: 16px 24px;
    border-radius: 14px;
}
.league-hero-partner-composite {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 14px 20px;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    padding: 14px 22px;
    box-sizing: border-box;
    filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.28));
}
.league-hero-partner-composite--prominent {
    padding: 18px 28px;
    border-radius: 14px;
    gap: 16px 24px;
}
.league-hero-partner-composite .lpc-logo {
    display: block;
    height: auto;
    object-fit: contain;
}
.league-hero-partner-composite .lpc-tdf {
    width: min(220px, 38vw);
    max-height: 64px;
}
.league-hero-partner-composite .lpc-velux {
    width: min(160px, 28vw);
    max-height: 52px;
}
.league-hero-partner-composite--prominent .lpc-tdf {
    width: min(320px, 55vw);
    max-height: 88px;
}
.league-hero-partner-composite--prominent .lpc-velux {
    width: min(220px, 38vw);
    max-height: 72px;
}
.league-hero-partner-composite .lpc-official {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #64748b;
    white-space: nowrap;
}
.league-hero-brand--logo-only .comp-logo-group {
    --comp-logo-h: 52px;
    display: inline-flex;
    align-items: center;
    max-width: min(100%, 200px);
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.league-hero-brand--logo-only .comp-logo-img {
    display: block;
    height: var(--comp-logo-h, 52px);
    width: auto;
    max-width: 180px;
    object-fit: contain;
}
.league-hero-brand--prominent-logo .comp-logo-group {
    --comp-logo-h: 72px;
    max-width: min(100%, 280px);
}
.league-hero-brand--prominent-logo .comp-logo-img {
    max-width: 260px;
}
.league-hero-head-row:not(.league-hero-head-row--prominent-banner):not(.league-hero-head-row--partner-banner) .league-hero-brand {
    flex-shrink: 0;
}
.league-hero-head-row:not(.league-hero-head-row--prominent-banner):not(.league-hero-head-row--partner-banner) > div:last-child {
    min-width: 0;
    flex: 1;
}
.league-hero-head-row--prominent-banner {
    flex-direction: column;
    align-items: stretch;
}
.league-hero-head-row--prominent-banner .league-hero-brand {
    order: -1;
    width: 100%;
}
.hero-journey-progress {
    margin: 10px 0 6px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.hero-journey-progress--race {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.06), rgba(30, 58, 138, 0.1));
    border-color: rgba(255, 215, 0, 0.15);
}
.hjp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 8px;
}
.hjp-head strong {
    color: var(--league-accent, var(--accent-cyan, #00f0ff));
    font-size: 13px;
}
.hjp-track {
    position: relative;
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: visible;
}
.hjp-fill {
    height: 100%;
    width: calc(var(--journey-pct, 0) * 1%);
    border-radius: 999px;
    background: linear-gradient(90deg, var(--league-accent, #00f0ff), rgba(255, 215, 0, 0.85));
    transition: width 0.6s ease;
}
.hjp-rider {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -58%);
    font-size: 20px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
    transition: left 0.6s ease;
    pointer-events: none;
}
.hjp-pips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
}
.hjp-pip {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}
.hjp-pip.is-done {
    background: var(--league-accent, var(--accent-cyan, #00f0ff));
    box-shadow: 0 0 6px rgba(0, 240, 255, 0.45);
}
.league-hero-head-row--partner-banner {
    flex-direction: column;
    align-items: stretch;
}
.league-hero-head-row--partner-banner > div:last-child {
    width: 100%;
}
.comp-logo-group--partner-banner {
    display: inline-flex;
    max-width: min(100%, 420px);
    background: #fff;
    border-radius: 6px;
    padding: 4px 10px;
}
.comp-logo-partner-banner {
    width: 100%;
    height: auto;
    max-height: var(--comp-logo-h, 56px);
    object-fit: contain;
}
.league-hero-brand--dual {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 1 1 100%;
    min-width: 280px;
    max-width: 520px;
    margin-bottom: 4px;
}
.league-hero-logo-img {
    height: var(--hero-logo-h, 76px);
    width: auto;
    max-width: min(38vw, 210px);
    object-fit: contain;
    object-position: center;
    flex: 1 1 0;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}
.league-hero-logo-left { object-position: left center; }
.league-hero-logo-right { object-position: right center; }
.league-hero-brand-center {
    flex: 0 0 auto;
}
.league-hero-ring-pct {
    font-size: 11px;
    font-weight: 800;
    color: var(--league-accent, var(--accent-cyan));
}
.league-hero-head-row--dual + div {
    flex: 1 1 220px;
    min-width: 0;
}
.league-hero-sparkline-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}
.pv-sparkline { display: block; vertical-align: middle; }

/* Hero countdown */
.pv-hero-countdown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-variant-numeric: tabular-nums;
    color: var(--accent-neon);
    font-weight: 700;
}
.pv-hero-countdown.is-live { color: #ff4466; animation: pv-count-pulse 1.2s ease infinite; }
@keyframes pv-count-pulse { 0%,100%{opacity:1} 50%{opacity:.65} }

/* New result flash */
.league-hero-panel.pv-new-result-flash {
    animation: pv-hero-result-flash 2.5s ease;
}
@keyframes pv-hero-result-flash {
    0%,100% { box-shadow: none; }
    15%,45% { box-shadow: 0 0 0 2px rgba(0,255,170,0.45), 0 0 28px rgba(0,255,170,0.15); }
}
.pv-new-result-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0,255,170,0.12);
    color: var(--accent-neon);
    font-size: 11px;
    font-weight: 700;
    margin-top: 6px;
    animation: pv-badge-pop 0.5s ease;
}
@keyframes pv-badge-pop { from{ transform:scale(0.85); opacity:0; } to{ transform:scale(1); opacity:1; } }

/* Team rank delta in standings */
.team-rank-delta {
    font-size: 10px;
    font-weight: 800;
    margin-left: 4px;
    vertical-align: middle;
}
.team-rank-up { color: #00ffaa; }
.team-rank-down { color: #ff5577; }
.team-rank-same { color: var(--text-muted); font-size: 8px; }

/* Team hover preview */
.gs-team-cell { position: relative; }
.gs-team-cell .team-hover-preview {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 1200;
    min-width: 200px;
    padding: 8px 10px;
    background: rgba(10,16,32,0.98);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.45);
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    pointer-events: none;
}
.gs-team-cell:hover .team-hover-preview,
.gs-team-cell:focus-within .team-hover-preview { display: flex; }
.team-hover-match { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.team-hover-match em { color: var(--text-muted); font-style: normal; margin-left: auto; }
.pv-form-badge {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 800;
}
.pv-form-w { background: rgba(0,200,120,0.25); color: #00ffaa; }
.pv-form-d { background: rgba(255,200,0,0.2); color: #ffd060; }
.pv-form-l { background: rgba(255,70,90,0.2); color: #ff6688; }

/* Match day groups */
.match-day-group { margin-bottom: 18px; }
.match-day-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 4px 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    z-index: 5;
    background: linear-gradient(to bottom, var(--bg-main, #0a1020) 80%, transparent);
}
.match-day-header strong { font-size: 14px; color: #fff; }
.match-day-header span { font-size: 12px; color: var(--text-muted); }

/* Sticky match filters */
.matches-filter-sticky {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(8,12,24,0.92);
    backdrop-filter: blur(10px);
    padding: 8px 0 10px;
    margin: -8px 0 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.viewing-user-tips-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin: 0 0 16px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(0, 240, 255, 0.35);
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(255, 0, 85, 0.08));
    box-shadow: 0 0 24px rgba(0, 240, 255, 0.08);
}

.viewing-user-tips-banner-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.viewing-user-tips-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-cyan);
}

.viewing-user-tips-name {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.viewing-user-tips-back {
    white-space: nowrap;
    background: rgba(0, 240, 255, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 240, 255, 0.35);
}

.matches-quick-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.matches-quick-filters a {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-muted);
    background: rgba(255,255,255,0.03);
}
.matches-quick-filters a.active,
.matches-quick-filters a:hover {
    color: #000;
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

/* Enhanced bet save */
.match-card.bet-saved-success {
    animation: pv-bet-success 1.1s ease;
    border-color: rgba(0,255,170,0.55) !important;
    box-shadow: 0 0 0 1px rgba(0,255,170,0.25), 0 8px 24px rgba(0,255,170,0.08);
}
@keyframes pv-bet-success {
    0% { transform: scale(1); }
    20% { transform: scale(1.008); }
    100% { transform: scale(1); }
}
.pv-bet-toast-inline {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0,255,170,0.15);
    color: var(--accent-neon);
    font-size: 11px;
    font-weight: 700;
    animation: pv-badge-pop 0.4s ease;
    pointer-events: none;
    z-index: 2;
}

/* Team profile WDL + form */
.pv-wdl-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 10px 0 14px;
}
.pv-wdl-chart h5 { margin: 0 0 8px; font-size: 12px; color: var(--text-muted); }
.pv-wdl-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    height: 56px;
}
.pv-wdl-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.pv-wdl-bar {
    display: block;
    width: 100%;
    max-width: 28px;
    min-height: 4px;
    border-radius: 4px 4px 2px 2px;
    transition: height 0.4s ease;
}
.pv-wdl-w { background: linear-gradient(to top, #00aa66, #00ffaa); }
.pv-wdl-d { background: linear-gradient(to top, #aa8800, #ffd060); }
.pv-wdl-l { background: linear-gradient(to top, #aa2244, #ff5577); }
.pv-wdl-col em { font-size: 10px; color: var(--text-muted); font-style: normal; }
.team-profile-match-list li.is-clickable {
    cursor: pointer;
    transition: background 0.15s;
}
.team-profile-match-list li.is-clickable:hover { background: rgba(255,255,255,0.06); }

/* Tip comparison */
.pv-tip-comparison {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    font-size: 11px;
}
.pv-tip-comparison strong { color: var(--text-muted); font-weight: 600; margin-right: 4px; }

/* Tip streak badge */
.pv-tip-streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255,200,0,0.12);
    color: #ffd060;
    font-size: 10px;
    font-weight: 800;
    margin-left: 4px;
}

/* Arena live ticker */
.pv-arena-ticker {
    position: sticky;
    top: 0;
    z-index: 35;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 12px;
    margin: -8px -4px 16px;
    background: rgba(255,0,85,0.08);
    border: 1px solid rgba(255,0,85,0.2);
    border-radius: 10px;
    scrollbar-width: none;
}
.pv-arena-ticker::-webkit-scrollbar { display: none; }
.pv-ticker-item {
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}
.pv-ticker-item strong { color: var(--accent-neon); }

/* Belt glow */
.belt-holder-glow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 999px;
    animation: pv-belt-glow 2.4s ease infinite;
}
@keyframes pv-belt-glow {
    0%,100% { box-shadow: 0 0 0 rgba(255,215,0,0); }
    50% { box-shadow: 0 0 18px rgba(255,215,0,0.35); }
}

/* Spectator vote bar */
.pv-spectator-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    width: 100%;
}
.pv-spectator-label { font-size: 10px; color: var(--text-muted); }
.pv-spectator-track {
    display: flex;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
}
.pv-spectator-challenger { background: linear-gradient(90deg, #00f0ff, #00aa88); }
.pv-spectator-opponent { background: linear-gradient(90deg, #ff0055, #aa0044); }

/* Knockout bracket */
.pv-bracket-wrap { margin: 20px 0; }
.pv-bracket-title { font-size: 16px; margin: 0 0 12px; }
.pv-bracket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}
.pv-bracket-round {
    padding: 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
}
.pv-bracket-round h5 { margin: 0 0 8px; font-size: 11px; color: var(--accent-cyan); text-transform: uppercase; }
.pv-bracket-match {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 6px;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 11px;
}
.pv-bracket-match:last-child { border-bottom: none; }
.pv-bracket-match span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-bracket-match strong { color: var(--accent-neon); font-size: 12px; }

/* Admin tips chart */
.pv-admin-tips-chart { margin-top: 8px; }
.pv-admin-tips-chart h5 { margin: 0 0 10px; font-size: 13px; }
.pv-tips-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 100px;
}
.pv-tips-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 100%;
    justify-content: flex-end;
}
.pv-tips-bar {
    width: 100%;
    max-width: 32px;
    min-height: 4px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(to top, var(--accent-cyan), var(--accent-neon));
}
.pv-tips-bar-col span { font-size: 9px; color: var(--text-muted); }

/* DQ clickable links */
.dq-detail-list a {
    color: var(--accent-cyan);
    text-decoration: none;
}
.dq-detail-list a:hover { text-decoration: underline; }

/* Offline banner */
.pv-offline-banner {
    position: fixed;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 9990;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255,120,0,0.92);
    color: #000;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    display: none;
}
.pv-offline-banner.is-visible { display: block; }

/* Pull to refresh */
.pv-ptr-indicator {
    text-align: center;
    padding: 8px;
    font-size: 12px;
    color: var(--text-muted);
    transform: translateY(-100%);
    opacity: 0;
    transition: opacity 0.2s;
}
.pv-ptr-indicator.is-active { opacity: 1; }

/* Mobile bottom sheet team profile */
@media (max-width: 640px) {
    .team-profile-modal-overlay.pv-bottom-sheet {
        align-items: flex-end !important;
        padding: 0 !important;
    }
    .team-profile-modal-overlay.pv-bottom-sheet .team-profile-modal {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 78vh !important;
        border-radius: 20px 20px 0 0 !important;
        margin: 0 !important;
    }
    .team-profile-modal-overlay.pv-bottom-sheet::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: rgba(255,255,255,0.25);
        border-radius: 999px;
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 3;
    }
}

/* Public league page */
.public-league-page { background: var(--bg-main, #0a1020); color: #fff; min-height: 100vh; }
.public-league-main { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }
.public-league-header { text-align: center; margin-bottom: 28px; }
.public-league-header h1 { margin: 12px 0 4px; }
.public-league-code code { color: var(--accent-cyan); }
.public-league-matches { list-style: none; padding: 0; margin: 0; }
.public-league-matches li {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 13px;
}

/* Z-index audit */
.team-profile-modal-overlay { z-index: 2147483000 !important; }
#victoryOverlay, .versus-overlay { z-index: 2147482000 !important; }
.pv-offline-banner { z-index: 2147481000 !important; }
.toast-container, .app-toast-wrap { z-index: 2147480500 !important; }

@media (prefers-reduced-motion: reduce) {
    .league-hero-panel.pv-new-result-flash,
    .match-card.bet-saved-success,
    .belt-holder-glow,
    .pv-hero-countdown.is-live { animation: none !important; }
}

/* Player statistics modal — see player-stats.css (global) */
