/* ── Theme Variables ── */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-elevated: #22222e;
    --bg-hover: #2a2a38;

    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;

    --accent-primary: #6366f1;
    --accent-primary-glow: rgba(99, 102, 241, 0.3);
    --accent-secondary: #818cf8;

    --team-color: #6366f1;
    --team-color-rgb: 99, 102, 241;

    --tier-bronze: #cd7f32;
    --tier-bronze-bg: rgba(205, 127, 50, 0.15);
    --tier-silver: #c0c0c0;
    --tier-silver-bg: rgba(192, 192, 192, 0.15);
    --tier-gold: #ffd700;
    --tier-gold-bg: rgba(255, 215, 0, 0.15);

    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.15);
    --warning: #f59e0b;
    --error: #ef4444;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);

    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --nav-height: 72px;
    --container-max: 1600px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
}

/* ── Reset ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; }


/* ═══════════════════════════════════════════
   AMBIENT BACKGROUND
   ═══════════════════════════════════════════ */

.ambient-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    transition: opacity 1s ease;
    background:
        radial-gradient(ellipse 120% 100% at 50% -30%, rgba(var(--team-color-rgb), 0.35) 0%, transparent 60%),
        radial-gradient(ellipse 100% 80% at 80% 10%, rgba(var(--team-color-rgb), 0.2) 0%, transparent 50%),
        radial-gradient(ellipse 80% 70% at 20% 90%, rgba(var(--team-color-rgb), 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 50% at 0% 50%, rgba(var(--team-color-rgb), 0.1) 0%, transparent 40%);
}

/* Color transitions happen via CSS variable changes */
:root {
    transition: --team-color 0.8s ease, --team-color-rgb 0.8s ease;
}


/* ═══════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
}

.nav-container {
    max-width: var(--container-max);
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.nav-logo { flex-shrink: 0; }

.nav-logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.nav-link i { font-size: 14px; }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}


/* ── Buttons ── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-secondary);
    box-shadow: 0 0 20px var(--accent-primary-glow);
}

.btn-ghost {
    color: var(--text-secondary);
    padding: 10px;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.btn-full { width: 100%; }


/* ── Mobile Menu ── */

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-menu {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px 24px;
    z-index: 999;
    transform: translateY(-100%);
    opacity: 0;
    transition: all var(--transition-base);
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.mobile-nav-links a:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}


/* ═══════════════════════════════════════════
   MAIN CONTENT & PAGE HEADER
   ═══════════════════════════════════════════ */

.main-content {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: calc(var(--nav-height) + 40px) 24px 60px;
    position: relative;
    z-index: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 48px;
}

.header-logo { flex-shrink: 0; }

.header-logo-img {
    max-width: 560px;
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-lg);
}

.header-content { text-align: right; }

.title-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.page-title {
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-top: 8px;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-pill i { color: var(--accent-primary); }

.stat-pill.live {
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.3);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.section-header { margin-bottom: 24px; }

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.section-header h2 i {
    color: var(--accent-primary);
    font-size: 18px;
}


/* ═══════════════════════════════════════════
   LEADERBOARD
   ═══════════════════════════════════════════ */

.leaderboard-section { margin-bottom: 56px; }

.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.leaderboard-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* Left rank stripe */
.leaderboard-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.leaderboard-card.rank-1::before { background: var(--tier-gold); }
.leaderboard-card.rank-2::before { background: var(--tier-silver); }
.leaderboard-card.rank-3::before { background: var(--tier-bronze); }
.leaderboard-card:not(.rank-1):not(.rank-2):not(.rank-3)::before { background: var(--border-medium); }

.leaderboard-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
    transform: translateY(-2px);
}

.leaderboard-card.active {
    border-color: var(--team-color);
    box-shadow: 0 0 24px rgba(var(--team-color-rgb), 0.2);
}

.leaderboard-card.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--team-color);
}

.rank-badge {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.rank-1 .rank-badge { background: var(--tier-gold-bg); color: var(--tier-gold); }
.rank-2 .rank-badge { background: var(--tier-silver-bg); color: var(--tier-silver); }
.rank-3 .rank-badge { background: var(--tier-bronze-bg); color: var(--tier-bronze); }
.leaderboard-card:not(.rank-1):not(.rank-2):not(.rank-3) .rank-badge {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.team-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    object-fit: cover;
    object-position: center;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.team-info {
    flex: 1;
    min-width: 0;
}

.team-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.team-name-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* If no winner pill injected, team-name still truncates normally */
.team-name:not(:has(.winner-crown)) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.team-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.team-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.team-stats .value {
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.team-points {
    text-align: right;
    flex-shrink: 0;
}

.points-value {
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-mono);
    line-height: 1;
    margin-bottom: 4px;
}

.points-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}


/* ═══════════════════════════════════════════
   TEAM INFO DISPLAY
   
   .team-info-display        → bare wrapper (NO styling)
   .team-info-display-inner  → the visible styled card
   ═══════════════════════════════════════════ */

.teams-section { margin-bottom: 48px; }

/* Wrapper — completely unstyled, just spacing */
.team-info-display {
    margin-bottom: 32px;
}

/* Placeholder when no team is selected */
.team-info-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    color: var(--text-muted);
}

.team-info-placeholder i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
    display: block;
}

.team-info-placeholder p { font-size: 16px; }

/* The actual team card - container stays fixed */
.team-info-display-inner {
    display: flex;
    gap: 32px;
    padding: 28px;
    background: rgba(var(--team-color-rgb), 0.08);
    border: 1px solid rgba(var(--team-color-rgb), 0.2);
    border-left: 4px solid var(--team-color);
    border-radius: var(--radius-xl);
    align-items: center;
    overflow: hidden;
    position: relative;
    transition: background 0.8s ease,
                border-color 0.8s ease,
                box-shadow 0.6s ease;
    min-height: 200px;
}

/* Content wrapper that slides */
.team-info-content {
    display: flex;
    gap: 32px;
    align-items: center;
    width: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
}

/* Slide out to top */
.team-info-display.switching-out .team-info-content {
    transform: translateY(-30px);
    opacity: 0;
}

/* Start position for new content coming in */
.team-info-display.switching-in .team-info-content {
    transform: translateY(30px);
    opacity: 0;
}

/* Add glow effect based on team color */
.team-info-display-inner {
    box-shadow: 0 4px 24px rgba(var(--team-color-rgb), 0.1);
}

/* Team image — supports wide/rectangular logos up to ~2:1 */
.team-info-image { flex-shrink: 0; }

.team-info-image img {
    max-width: 340px;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
}

.team-info-image-placeholder {
    width: 200px;
    height: 200px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    font-weight: 700;
}

.team-info-details {
    flex: 1;
    min-width: 0;
}

.team-info-name {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Larger winner pill for team progress card */
.winner-crown-lg {
    font-size: 11px;
    padding: 4px 12px;
    gap: 5px;
}

/* Winner variant of the big team info card */
.team-info-display-inner.team-info-winner {
    border-color: rgba(255, 215, 0, 0.35);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.03) 100%);
    box-shadow: 0 4px 24px rgba(255, 215, 0, 0.12), 0 0 30px rgba(255, 215, 0, 0.06);
    border-left-color: #ffd700;
}

.team-info-stats {
    display: flex;
    gap: 32px;
    margin-top: 20px;
}

.team-info-stat { text-align: center; }

.team-info-stat-value {
    font-size: 36px;
    font-weight: 700;
    font-family: var(--font-mono);
    line-height: 1;
    color: var(--text-primary);
}

.team-info-stat-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 6px;
}

.team-info-progress { margin-top: 24px; }

.team-info-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
}

.team-info-progress-label span:first-child { color: var(--text-secondary); }

.team-info-progress-label span:last-child {
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-mono);
}

.team-info-progress-bar {
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: 100px;
    overflow: hidden;
}

.team-info-progress-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ═══════════════════════════════════════════
   TILES CONTAINER & TOOLBAR
   ═══════════════════════════════════════════ */

/* Hidden by default. JS adds .active when a team is selected */
.tiles-container {
    display: none;
}

.tiles-container.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.tiles-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.tiles-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

.tiles-toggle-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
}

.tiles-toggle-btn i { font-size: 12px; }


/* ═══════════════════════════════════════════
   TILES GRID — 5 columns on desktop
   Smooth transition between expanded/collapsed
   ═══════════════════════════════════════════ */

.tiles-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    transition: gap 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed grid - same columns, tighter gaps */
.tiles-grid.collapsed {
    gap: 12px;
}


/* ═══════════════════════════════════════════
   TILE CARDS
   Team color tinting when team is selected
   ═══════════════════════════════════════════ */

.tile-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.6s ease,
                border-color 0.6s ease,
                transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

/* Team color tint on all tiles when team selected */
.tiles-container.active .tile-card {
    background: linear-gradient(
        135deg,
        rgba(var(--team-color-rgb), 0.06) 0%,
        var(--bg-secondary) 100%
    );
    border-color: rgba(var(--team-color-rgb), 0.15);
}

.tile-card:hover {
    border-color: rgba(var(--team-color-rgb), 0.4);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* Completed tile - green accent */
.tile-card.tile-complete {
    border-color: rgba(34, 197, 94, 0.5);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(34, 197, 94, 0.04) 100%);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.12), inset 0 0 30px rgba(34, 197, 94, 0.04);
}

.tile-card.tile-complete:hover {
    border-color: rgba(34, 197, 94, 0.7);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 24px rgba(34, 197, 94, 0.2);
}

/* Completed badge — shown in both expanded and collapsed views */
.tile-complete-badge {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    color: var(--success);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.tile-complete-badge i {
    font-size: 10px;
}

.tile-card.tile-complete .tile-complete-badge {
    display: inline-flex;
}

/* In-progress tile - stronger team color */
.tile-card.tile-progress {
    border-color: rgba(var(--team-color-rgb), 0.35);
    background: linear-gradient(
        135deg,
        rgba(var(--team-color-rgb), 0.1) 0%,
        rgba(var(--team-color-rgb), 0.03) 100%
    );
}


/* ═══════════════════════════════════════════
   TILE EXPAND/COLLAPSE ANIMATIONS
   Smooth height morphing with scale effects
   ═══════════════════════════════════════════ */

.tile-expanded {
    display: grid;
    grid-template-rows: 1fr;
    opacity: 1;
    transform: scale(1);
    transition: grid-template-rows 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease,
                transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tile-expanded > * {
    overflow: hidden;
}

.tiles-grid.collapsed .tile-expanded {
    grid-template-rows: 0fr;
    opacity: 0;
    transform: scale(0.95);
}

.tile-collapsed {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transform: scale(0.95);
    transition: grid-template-rows 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease 0.1s,
                transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s;
}

.tile-collapsed > * {
    overflow: hidden;
}

.tiles-grid.collapsed .tile-collapsed {
    grid-template-rows: 1fr;
    opacity: 1;
    transform: scale(1);
}

/* Inner wrapper for collapsed content */
.tile-collapsed-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px 12px;
    gap: 8px;
    min-height: 0;
}

/* Inner wrapper for expanded content */
.tile-expanded-inner {
    min-height: 0;
}

.tile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px 12px;
    text-align: center;
}

.tile-icon {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-lg);
    object-fit: contain;
    flex-shrink: 0;
    background: rgba(26, 26, 36, 0.5);
    padding: 6px;
    image-rendering: pixelated;
}

.tile-title h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

/* Points + tiers line under title */
.tile-header-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 2px;
}

.tile-header-meta .meta-pts {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 18px;
    line-height: 1;
}

.tile-header-meta .meta-label {
    font-size: 11px;
    color: var(--text-muted);
}

.tile-header-meta .meta-sep {
    color: var(--border-medium);
}


/* ── COLLAPSED VIEW — compact cards, same icon size ── */

/* Same icon size as expanded view */
.tile-icon-sm {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-lg);
    object-fit: contain;
    background: rgba(26, 26, 36, 0.5);
    padding: 6px;
    image-rendering: pixelated;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tile-card:hover .tile-icon-sm {
    transform: scale(1.05);
}

.tile-collapsed-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
    width: 100%;
}

.tile-collapsed-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
}

/* Meta line */
.tile-collapsed-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.tile-collapsed-meta .meta-pts {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
}

.tile-collapsed-meta .meta-label {
    font-size: 11px;
    color: var(--text-muted);
}

.tile-collapsed-meta .meta-sep {
    color: var(--border-medium);
}

.tile-collapsed-check {
    color: var(--success);
    font-size: 14px;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: none;
}

/* Hide old check on complete tiles, show badge instead */
.tile-card.tile-complete .tile-collapsed-check {
    display: none;
}

/* Ensure tile-card is positioned for absolute children */
.tile-card {
    position: relative;
}


/* ═══════════════════════════════════════════
   TIER ROWS
   Background fill = progress indicator.
   No separate <progress> bar element needed.
   ═══════════════════════════════════════════ */

.tile-tiers {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid var(--border-subtle);
}

.tier-row {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid transparent;
    background: rgba(26, 26, 36, 0.4);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tier-row:hover {
    border-color: rgba(var(--team-color-rgb), 0.4);
    background: rgba(var(--team-color-rgb), 0.08);
}

/* Old hover hint — removed, now using inline eye icon in tier-item-count */
.tier-row-hover-hint {
    display: none;
}

.tier-row:hover .tier-row-hover-hint {
    display: none;
}

/* The colored fill layer — width driven by --tier-progress CSS var */
.tier-bg-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--tier-progress, 0%);
    z-index: 0;
    border-radius: var(--radius-md);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.tier-bg-fill.bronze { background: rgba(205, 127, 50, 0.25); }
.tier-bg-fill.silver { background: rgba(192, 192, 192, 0.22); }
.tier-bg-fill.gold   { background: rgba(255, 215, 0, 0.22); }

/* Complete tier → 100% green */
.tier-row.tier-complete .tier-bg-fill {
    width: 100%;
    background: rgba(34, 197, 94, 0.18);
}

.tier-row.tier-complete {
    border-color: rgba(34, 197, 94, 0.3);
}

.tier-row.tier-progress {
    border-color: rgba(var(--team-color-rgb), 0.2);
}

/* Content layer sits above the fill */
.tier-row-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
}

/* Tier badge (T1/T2/T3) */
.tier-badge {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.tier-badge.tier-1 { background: var(--tier-bronze-bg); color: var(--tier-bronze); }
.tier-badge.tier-2 { background: var(--tier-silver-bg); color: var(--tier-silver); }
.tier-badge.tier-3 { background: var(--tier-gold-bg); color: var(--tier-gold); }

/* Tier items area */
.tier-content {
    flex: 1;
    min-width: 0;
}

.tier-items {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tier-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tier-item-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
    opacity: 0.6;
    image-rendering: pixelated;
}

.tier-item.item-complete .tier-item-icon { opacity: 1; }

.tier-item-info {
    flex: 1;
    min-width: 0;
}

.tier-item-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    color: var(--text-secondary);
}

.tier-item.item-complete .tier-item-name { color: var(--text-primary); }

.tier-item-count {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 32px;
    text-align: right;
}

/* Eye icon hidden by default via width:0 + overflow */
.tier-count-eye {
    width: 0;
    overflow: hidden;
    opacity: 0;
    font-size: 12px;
    display: inline-block;
}

/* On hover: hide count text, show eye */
.tier-row:hover .tier-item-count {
    font-size: 0;
}

.tier-row:hover .tier-item-count .tier-count-eye {
    width: auto;
    overflow: visible;
    opacity: 1;
    font-size: 12px;
    color: var(--text-secondary);
}

.tier-item.item-complete .tier-item-count { color: var(--success); }

/* Tier status column (right side) */
.tier-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 50px;
    justify-content: flex-end;
    padding-right: 20px;
}

.tier-status i {
    color: var(--success);
    font-size: 14px;
}

.tier-count {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.tier-row.tier-complete .tier-count {
    color: var(--success);
}

.tier-row.tier-progress .tier-count {
    color: var(--text-secondary);
}


/* ═══════════════════════════════════════════
   LOADING & ERROR STATES
   ═══════════════════════════════════════════ */

.loading-state,
.error-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    color: var(--text-muted);
    font-size: 16px;
}

.loading-state i { font-size: 24px; color: var(--accent-primary); }
.error-state i { font-size: 24px; color: var(--error); }
.error-state a { color: var(--accent-primary); text-decoration: underline; }


/* ═══════════════════════════════════════════
   LOGIN MODAL
   ═══════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8); 
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal {
    width: 100%;
    max-width: 420px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 32px;
    position: relative;
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    transition: opacity 200ms ease, transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity; 
}

.modal-overlay.active .modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.modal-header {
    text-align: center;
    margin-bottom: 28px;
}

.modal-header h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    padding: 14px 16px;
    font-size: 15px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.form-group input::placeholder { color: var(--text-muted); }

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}


/* ── Team Select Dropdown ── */

.team-select-wrapper { position: relative; }

.team-select-btn {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-family: var(--font-sans);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition-fast);
    text-align: left;
}

.team-select-btn:hover { border-color: var(--border-medium); }

.team-select-btn:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.team-select-btn .team-select-placeholder { color: var(--text-muted); }

.team-select-btn .team-select-selected {
    display: flex;
    align-items: center;
    gap: 12px;
}

.team-select-btn .team-select-selected img {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.team-select-btn i {
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.team-select-btn.open i { transform: rotate(180deg); }

.team-select-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    max-height: 280px;
    overflow-y: auto;
    display: none;
}

.team-select-dropdown.show {
    display: block;
    animation: dropdownFade 0.2s ease-out;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.team-select-option {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-subtle);
}

.team-select-option:last-child { border-bottom: none; }
.team-select-option:hover { background: var(--bg-hover); }
.team-select-option.selected { background: rgba(99, 102, 241, 0.15); }

.team-select-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-tertiary);
}

.team-select-option span { font-weight: 500; }


/* ═══════════════════════════════════════════
   TIER DETAIL MODAL
   ═══════════════════════════════════════════ */

.modal-tier-detail {
    max-width: 480px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tier-modal-content {
    overflow-y: auto;
    flex: 1;
}

.tier-modal-loading,
.tier-modal-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 48px 24px;
    color: var(--text-muted);
    text-align: center;
}

.tier-modal-loading i,
.tier-modal-error i {
    font-size: 32px;
}

.tier-modal-error i {
    color: var(--error);
}

.tier-modal-header {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 20px;
}

.tier-modal-tile-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tier-modal-tile-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    object-fit: contain;
    background: var(--bg-tertiary);
    padding: 4px;
    image-rendering: pixelated;
}

.tier-modal-title h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.tier-modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tier-modal-badge i {
    color: var(--success);
}

.tier-modal-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tier-modal-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: all var(--transition-fast);
}

.tier-modal-item.complete {
    background: var(--success-bg);
    border-color: rgba(34, 197, 94, 0.3);
}

.tier-modal-item-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tier-modal-item-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: var(--bg-elevated);
    flex-shrink: 0;
    image-rendering: pixelated;
}

.tier-modal-item-icon-placeholder {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.tier-modal-item-info {
    flex: 1;
    min-width: 0;
}

.tier-modal-item-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.tier-modal-item-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tier-modal-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-elevated);
    border-radius: 100px;
    overflow: hidden;
}

.tier-modal-progress-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.4s ease;
    background: var(--accent-primary);
}

.tier-modal-item.complete .tier-modal-progress-fill {
    background: var(--success);
}

.tier-modal-item-count {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.tier-modal-item.complete .tier-modal-item-count {
    color: var(--success);
}

.tier-modal-item-check {
    color: var(--success);
    font-size: 18px;
    flex-shrink: 0;
}

.tier-modal-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}

.tier-modal-contributors-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.tier-modal-contributors-label i {
    color: var(--accent-primary);
}

.tier-modal-contributors-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.contributor-tag {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}


/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */

.footer {
    border-top: 1px solid var(--border-subtle);
    padding: 32px 24px;
    text-align: center;
}

.footer-content p {
    color: var(--text-muted);
    font-size: 13px;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ═══════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════ */

@media (max-width: 1600px) {
    .tiles-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .leaderboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tiles-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tile-icon,
    .tile-icon-sm {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 1024px) {
    .team-info-display-inner {
        text-align: center;
    }
    
    .team-info-content {
        flex-direction: column;
    }

    .team-info-stats {
        justify-content: center;
    }

    .team-info-image img {
        max-width: 260px;
        max-height: 160px;
    }

    .team-info-image-placeholder {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 900px) {
    .tiles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tile-icon,
    .tile-icon-sm {
        width: 72px;
        height: 72px;
    }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: flex; }
    .mobile-menu { display: block; }
    .login-btn-desktop { display: none !important; }

    .page-header {
        flex-direction: column;
        align-items: center;
    }

    .header-content { text-align: center; }

    .title-row {
        justify-content: center;
        flex-wrap: wrap;
    }

    .leaderboard-grid {
        grid-template-columns: 1fr;
    }

    .leaderboard-card { flex-wrap: wrap; }

    .team-points {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--border-subtle);
    }

    .team-points .points-label { order: -1; }

    .team-info-display-inner {
        padding: 20px;
        gap: 20px;
    }

    .team-info-name { font-size: 24px; }
    .team-info-stat-value { font-size: 28px; }

    .tile-icon,
    .tile-icon-sm {
        width: 64px;
        height: 64px;
    }

    .tile-header {
        padding: 12px 10px 10px;
    }

    .tile-title h4 { font-size: 14px; }
    .tile-collapsed-name { font-size: 13px; }

    .tier-row-content {
        padding: 6px 8px;
        gap: 6px;
    }

    .tier-badge {
        width: 24px;
        height: 24px;
        font-size: 9px;
    }

    .tier-item-icon {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding-left: 16px;
        padding-right: 16px;
    }

    .header-logo-img { max-width: 100%; }

    .tiles-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .tile-icon,
    .tile-icon-sm {
        width: 72px;
        height: 72px;
    }

    .team-info-stats { gap: 20px; }
    .team-info-stat-value { font-size: 24px; }
}


/* ═══════════════════════════════════════════
   WINNER LEADERBOARD CARD
   ═══════════════════════════════════════════ */

.leaderboard-card.winner-card {
    border-color: rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.03) 100%);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.1);
}

.winner-crown {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 100px;
    font-size: 9px;
    font-weight: 700;
    color: #ffd700;
    font-family: var(--font-mono);
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: crownPulse 3s ease-in-out infinite;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Remove the old margin-top hack */
.leaderboard-card.winner-card .team-points {
    margin-top: 0;
}

.winner-crown i {
    font-size: 11px;
    animation: crownBounce 2s ease-in-out infinite;
}

@keyframes crownPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 215, 0, 0.2); }
    50% { box-shadow: 0 0 16px rgba(255, 215, 0, 0.4); }
}

@keyframes crownBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}


/* ═══════════════════════════════════════════
   WINNER CELEBRATION MODAL
   ═══════════════════════════════════════════ */

.winner-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: background 0.4s ease, opacity 0.3s ease;
    pointer-events: none;
}

.winner-modal-overlay.active {
    background: rgba(0, 0, 0, 0.8);
    opacity: 1;
    pointer-events: all;
}

.winner-modal-overlay.closing {
    opacity: 0;
    pointer-events: none;
}

#confetti-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10001;
}

.winner-modal {
    position: relative;
    z-index: 10002;
}

.winner-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 40px 36px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: var(--radius-xl);
    max-width: 480px;
    width: calc(100vw - 48px);
    box-shadow:
        0 0 60px rgba(255, 215, 0, 0.15),
        0 24px 64px rgba(0, 0, 0, 0.6);
    transform: scale(0.8) translateY(40px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.winner-modal-overlay.active .winner-modal-content {
    transform: scale(1) translateY(0);
}

.winner-modal-overlay.closing .winner-modal-content {
    transform: scale(0.9) translateY(20px);
}

.winner-trophy-glow {
    position: relative;
    margin-bottom: 20px;
}

.winner-trophy-glow i {
    font-size: 64px;
    color: #ffd700;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
    animation: trophyFloat 3s ease-in-out infinite;
}

@keyframes trophyFloat {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-8px) rotate(3deg); }
}

.winner-title {
    font-size: 28px;
    font-weight: 800;
    color: #ffd700;
    margin-bottom: 24px;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    letter-spacing: -0.02em;
}

.winner-team-showcase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.winner-team-logo-frame {
    width: 100%;
    max-width: 280px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 0 0 3px rgba(var(--winner-rgb), 0.4),
        0 0 50px rgba(var(--winner-rgb), 0.25),
        0 16px 48px rgba(0, 0, 0, 0.5);
}

.winner-team-logo {
    width: 100%;
    height: auto;
    display: block;
}

.winner-team-name {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.winner-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    padding: 16px 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.winner-stat {
    text-align: center;
    min-width: 64px;
}

.winner-stat-value {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.winner-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.winner-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.winner-close-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.winner-close-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: rgba(255, 215, 0, 0.3);
}

@media (max-width: 480px) {
    .winner-modal-content {
        padding: 36px 24px 28px;
    }
    .winner-trophy-glow i {
        font-size: 48px;
    }
    .winner-title {
        font-size: 22px;
    }
    .winner-team-name {
        font-size: 20px;
    }
    .winner-stats {
        gap: 16px;
        padding: 12px 16px;
    }
    .winner-stat-value {
        font-size: 20px;
    }
}