@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Montserrat:wght@700;800;900&display=swap');

:root {
    --bg-dark: #05070a;
    --card-bg: rgba(17, 25, 40, 0.75);
    --glass-border: rgba(255, 255, 255, 0.125);
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --gold-bright: #fbbf24;
    --gold-glow: rgba(251, 191, 36, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 4rem 1rem;
    overflow-x: hidden;
    position: relative;
}

/* Cosmic Background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(6, 182, 212, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 1) 0%, #05070a 100%);
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    gap: 4rem;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glassmorphism Card */
.premium-frame {
    background: var(--card-bg);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    overflow: hidden;
    position: relative;
}

.premium-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: 0.5s;
    pointer-events: none;
}

.premium-frame:hover::before {
    left: 100%;
}

/* Header */
.frame-header {
    padding: 3rem;
    background: linear-gradient(to right, rgba(59, 130, 246, 0.1), transparent);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 2rem;
}

.title-icon-container {
    width: 72px;
    height: 72px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(259, 130, 246, 0.3);
}

.title-icon-container img {
    width: 40px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.frame-header h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

/* Table Design */
.table-body {
    padding: 1.5rem;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
}

thead th {
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

thead th:first-child {
    text-align: left;
}

tbody tr {
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition-fast);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.005);
}

td {
    padding: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
}

td:first-child {
    border-left: 1px solid transparent;
    border-radius: 16px 0 0 16px;
    text-align: left;
}

td:last-child {
    border-right: 1px solid transparent;
    border-radius: 0 16px 16px 0;
}

/* Leader Row Special */
tr.leader-row {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.02));
    border: 1px solid rgba(251, 191, 36, 0.3);
}

tr.leader-row td {
    color: var(--gold-bright);
}

/* Player Column */
.player-col {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.avatar-circle {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    padding: 2px;
    background: var(--glass-border);
    position: relative;
}

.avatar-circle.avatar-rank-gold {
    background: linear-gradient(45deg, #fbbf24, #f59e0b);
    box-shadow: 0 0 15px var(--gold-glow);
}

.avatar-circle img {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    object-fit: cover;
}

.player-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.golden-crown {
    color: var(--gold-bright);
    filter: drop-shadow(0 0 5px var(--gold-glow));
}

.badge-leader {
    background: var(--gold-bright);
    color: #000;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

/* Stats Styling */
.max-val {
    color: var(--gold-bright);
    text-shadow: 0 0 10px var(--gold-glow);
}

.max-val-assists {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

/* Classification Section */
.classification-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.classification-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
}

.classification-title h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: linear-gradient(to right, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.title-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--glass-border), transparent);
    border-radius: 2px;
}

.classification-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    align-items: flex-end;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.2);
}

.stat-card-header {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 2rem;
}

.stat-card.champion {
    border-color: rgba(251, 191, 36, 0.3);
    padding: 3.5rem 2rem;
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.1) 0%, var(--card-bg) 100%);
}

.stat-card.champion .stat-card-header {
    color: var(--gold-bright);
}

.stat-winner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-val-huge {
    font-family: 'Montserrat', sans-serif;
    font-size: 5rem;
    font-weight: 900;
    line-height: 1;
    margin-top: 1rem;
    background: linear-gradient(180deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.champion .stat-val-huge {
    background: linear-gradient(180deg, #fbbf24, #d97706);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-player-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    max-width: 100%;
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.2;
    padding: 0 0.5rem;
}

/* Animations */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.floating-crown {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    animation: float 4s infinite ease-in-out;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    body {
        padding: 1rem 0.5rem;
    }

    .container {
        gap: 1.5rem;
    }

    .frame-header {
        padding: 1rem 1rem;
        flex-direction: row;
        text-align: left;
        gap: 0.8rem;
    }

    .frame-header h2 {
        font-size: 1.3rem;
    }

    .title-icon-container {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .title-icon-container i {
        font-size: 1.1rem !important;
    }

    .table-body {
        padding: 0.5rem;
        overflow-x: hidden;
    }

    table {
        min-width: 100%;
        width: 100%;
        table-layout: fixed;
        border-spacing: 0 0.4rem;
    }

    thead th {
        padding: 0.4rem 0.2rem;
        font-size: 0.5rem;
        letter-spacing: 0.02em;
    }

    thead th:first-child {
        width: 40%;
    }

    thead th:nth-child(2),
    thead th:nth-child(3),
    thead th:nth-child(4) {
        width: 20%;
    }

    td {
        padding: 0.6rem 0.2rem;
        font-size: 0.8rem;
    }

    .player-col {
        gap: 0.5rem;
    }

    .avatar-circle {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .avatar-circle img {
        border-radius: 6px;
    }

    .player-info-stack {
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
        min-width: 0;
    }

    .player-name {
        font-size: 0.72rem;
        flex-wrap: nowrap;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .golden-crown {
        font-size: 0.75rem;
    }

    .badge-leader {
        font-size: 0.45rem;
        padding: 2px 5px;
        border-radius: 4px;
        display: inline-block;
        width: fit-content;
    }

    /* Cards de classificação mobile - layout 3 colunas com campeão no centro elevado */
    .classification-grid {
        display: grid;
        grid-template-columns: 1fr 1.3fr 1fr;
        gap: 0.6rem;
        align-items: flex-end;
        padding: 0 0.25rem;
    }

    .classification-container {
        gap: 1rem;
    }

    .classification-title {
        gap: 0.8rem;
    }

    .classification-title h3 {
        font-size: 1rem;
        letter-spacing: 0.05em;
    }

    .title-line {
        height: 1px;
    }

    .stat-winner-container {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    /* Reordenar os cards: Assistências | Campeão | Gols */
    .stat-card.card-assists {
        order: 1;
    }

    .stat-card.champion {
        order: 2;
    }

    .stat-card.card-goals {
        order: 3;
    }

    .stat-card {
        padding: 1.2rem 0.5rem;
        min-height: auto;
        border-radius: 18px;
    }

    .stat-card.champion {
        padding: 1.5rem 0.6rem 1.8rem;
        border-radius: 20px;
        margin-bottom: 0;
    }

    .stat-card-header {
        font-size: 0.55rem;
        margin-bottom: 0.8rem;
        letter-spacing: 0.1em;
    }

    .stat-val-huge {
        font-size: 2.5rem;
        margin-top: 0.5rem;
    }

    .champion .stat-val-huge {
        font-size: 3.5rem;
    }

    .stat-player-name {
        font-size: 0.65rem;
        word-wrap: break-word;
        max-width: 100%;
        margin-top: 0.3rem;
        line-height: 1.1;
    }

    .floating-crown {
        font-size: 1.8rem;
        margin-bottom: 0.3rem;
    }

    .stat-card .avatar-circle {
        width: 45px !important;
        height: 45px !important;
        margin-bottom: 0.6rem !important;
        border-radius: 12px !important;
    }

    .stat-card .avatar-circle img {
        border-radius: 10px !important;
    }

    .stat-card.champion .avatar-circle {
        width: 75px !important;
        height: 75px !important;
        border-radius: 18px !important;
        margin-bottom: 0.8rem !important;
    }

    .stat-card.champion .avatar-circle img {
        border-radius: 16px !important;
    }

    .stat-winner-container {
        padding: 0;
    }
}

/* Sponsors Section */
.sponsors-section {
    margin-top: 2rem;
    text-align: center;
    padding-bottom: 2rem;
}

.sponsors-section h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: 0.2rem;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.sponsors-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.sponsors-grid img {
    max-width: 150px;
    height: auto;
    filter: brightness(0.9) contrast(1.1);
    transition: var(--transition-fast);
}

.sponsors-grid img:hover {
    filter: brightness(1) contrast(1.2);
    transform: scale(1.05);
}

@media (max-width: 900px) {
    .sponsors-section h3 {
        font-size: 0.8rem;
        letter-spacing: 0.1rem;
    }

    .sponsors-grid img {
        max-width: 100px;
    }
}

/* PWA Install Button */
.install-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    display: none;
    /* Hidden by default, shown by JS */
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.4);
    z-index: 1000;
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.install-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.6);
}

.install-btn i {
    font-size: 1.1rem;
}

@media (max-width: 900px) {
    .install-btn {
        bottom: 1.5rem;
        right: 1.5rem;
        padding: 0.8rem 1.2rem;
        font-size: 0.8rem;
    }
}