/* ═══════════════════════════════════════════════════
   CLUB WORLD CUP TRACKER — style.css
   Theme: Pitch Night
   Fonts: Barlow Condensed (headings) · DM Sans (body)
═══════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────── */

:root {
    --bg:           #070d07;
    --app-bg:       rgba(6, 11, 6, 0.72);
    --surface:      rgba(255, 255, 255, 0.055);
    --surface-hover:rgba(255, 255, 255, 0.09);
    --border:       rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    --green:        #2ecc71;
    --green-dim:    rgba(46, 204, 113, 0.12);
    --gold:         #f5c518;
    --gold-dim:     rgba(245, 197, 24, 0.12);
    --text:         #e4ede4;
    --muted:        #5a7060;
    --radius-xl:    24px;
    --radius-lg:    18px;
    --radius-md:    12px;
    --radius-sm:    8px;
    --transition:   0.25s ease;
}

/* ── Reset ──────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Base ───────────────────────────────────────── */

html {
    height: 100%;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Animated background ────────────────────────── */

.bg-pitch {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Subtle pitch grid lines */
.pitch-lines {
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 120px,
            rgba(255,255,255,0.013) 120px,
            rgba(255,255,255,0.013) 121px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 90px,
            rgba(255,255,255,0.013) 90px,
            rgba(255,255,255,0.013) 91px
        );
}

/* Vignette — keeps focus on the centre column */
.bg-pitch::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 70% 80% at 50% 50%,
        transparent 30%,
        rgba(7, 13, 7, 0.7) 100%
    );
}

/* ── Floating balls ─────────────────────────────── */

.ball {
    position: absolute;
    font-size: 36px;
    opacity: 0;
    filter: blur(0.5px);
    animation: kickArc linear infinite;
    will-change: transform, opacity;
}

/* Each ball starts at a different bottom-left/right origin
   and arcs across on a different timeline */

.b1 {
    bottom: -60px;
    left: 5%;
    font-size: 28px;
    animation-duration: 22s;
    animation-delay: 0s;
    --dx: 55vw;
    --dy: -75vh;
}
.b2 {
    bottom: -60px;
    left: 15%;
    font-size: 44px;
    animation-duration: 30s;
    animation-delay: -10s;
    --dx: 70vw;
    --dy: -85vh;
}
.b3 {
    bottom: -60px;
    left: 60%;
    font-size: 24px;
    animation-duration: 18s;
    animation-delay: -5s;
    --dx: -45vw;
    --dy: -70vh;
}
.b4 {
    bottom: -60px;
    left: 80%;
    font-size: 38px;
    animation-duration: 26s;
    animation-delay: -17s;
    --dx: -60vw;
    --dy: -80vh;
}
.b5 {
    bottom: -60px;
    left: 40%;
    font-size: 32px;
    animation-duration: 34s;
    animation-delay: -8s;
    --dx: 30vw;
    --dy: -90vh;
}

@keyframes kickArc {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    8% {
        opacity: 0.065;
    }
    85% {
        opacity: 0.065;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) rotate(540deg);
        opacity: 0;
    }
}

/* ── App container ──────────────────────────────── */

#app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 32px 20px 60px;
    background: var(--app-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

@media (min-width: 768px) {

    #app {
        max-width: 1200px;
        margin: 0 auto;
        padding: 40px 48px 60px;
    }

    #clubGrid {
        grid-template-columns: repeat(6, 1fr);
    }

    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 600px;
    }

    .players-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

}

/* ── Hero ───────────────────────────────────────── */

.hero {
    text-align: center;
    padding: 24px 0 32px;
}

.hero-badge {
    display: inline-block;
    font-family: 'DM Sans', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--green);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 999px;
    padding: 5px 14px;
    margin-bottom: 18px;
}

.hero h1 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 3.8rem;
    font-weight: 800;
    line-height: 0.95;
    text-transform: uppercase;
    letter-spacing: -1px;
    color: var(--text);
    margin-bottom: 14px;
}

.hero p {
    color: var(--muted);
    font-size: 0.9rem;
}

/* ── Search ─────────────────────────────────────── */

.search-container {
    margin-bottom: 36px;
}

#clubSearch {
    width: 100%;
    padding: 14px 20px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    outline: none;
    transition: border-color var(--transition), background var(--transition);
}

#clubSearch::placeholder {
    color: var(--muted);
}

#clubSearch:focus {
    border-color: var(--border-hover);
    background: var(--surface-hover);
}

/* ── Section headings ───────────────────────────── */

/* Used in HTML (Popular Clubs) */
.section-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--muted);
    margin-bottom: 16px;
}

/* Generated by JS inside the dashboard */
.section-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold);
    margin: 32px 0 14px;
}

/* ── Club grid ──────────────────────────────────── */

#clubGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

/* ── Club card ──────────────────────────────────── */

.club-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition:
        transform var(--transition),
        background var(--transition),
        border-color var(--transition);
    min-height: 72px;
}

.club-card h3 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.club-card:hover {
    transform: translateY(-3px);
    background: var(--surface-hover);
    border-color: var(--border-hover);
}

/* ── Dashboard ──────────────────────────────────── */

#dashboard {
    margin-top: 8px;
}

#dashboard h2 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    margin-bottom: 20px;
}

/* ── Summary strip ──────────────────────────────── */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 0 0 8px;
}

.summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.summary-number {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--gold);
    line-height: 1;
}

.summary-label {
    margin-top: 6px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 10px;
    font-weight: 600;
}

/* ── Fixture & result cards ─────────────────────── */

.fixture-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.fixture-teams {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

.fixture-date {
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 500;
}

.fixture-players {
    font-size: 0.85rem;
    color: #a8c4ac;
    line-height: 1.6;
}

.scorer-divider {
    margin: 0 8px;
    color: var(--muted);
    opacity: 0.5;
}

/* ── Notify button ──────────────────────────────── */

.notify-btn {
    align-self: flex-start;
    padding: 7px 16px;
    border: 1px solid rgba(46, 204, 113, 0.25);
    border-radius: 999px;
    background: var(--green-dim);
    color: var(--green);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}

.notify-btn:hover {
    background: rgba(46, 204, 113, 0.22);
    border-color: rgba(46, 204, 113, 0.5);
}

/* ── Player cards ───────────────────────────────── */

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.player-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition:
        transform var(--transition),
        background var(--transition),
        border-color var(--transition);
}

.player-card:hover {
    transform: translateY(-3px);
    background: var(--surface-hover);
    border-color: var(--border-hover);
}

.player-card h3 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.player-card p {
    font-size: 0.82rem;
    color: var(--muted);
}

/* ── Responsive ─────────────────────────────────── */

@media (max-width: 420px) {

    .hero h1 {
        font-size: 3rem;
    }

    #clubGrid {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .players-grid {
        grid-template-columns: 1fr;
    }

}