/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Arsenal brand colors */
:root {
    --afc-blue: #063672;
    --afc-red: #EF0107;
    --afc-dark-red: #DB0007;
    --afc-gold: #9C824A;
    --gold-light: #e4bd69;
    --spurs-blue: #132257;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: #ebe8e3;
    background-image:
        repeating-linear-gradient(
            135deg,
            transparent,
            transparent 40px,
            rgba(0, 0, 0, 0.01) 40px,
            rgba(0, 0, 0, 0.01) 89px
        );
    color: #1a1a1a;
}

/* Heading typography */
h1, h2, h3 {
    font-family: 'Barlow Condensed', system-ui, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Page fade-in */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Main layout */
.page-wrapper {
    animation: fadeIn 0.4s ease-out;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
    text-align: center;
    overflow-x: auto;
}

/* Header */
.site-header {
    padding-top: 4rem;
    text-align: center;
}

.site-title {
    font-weight: 700;
    font-size: 1.875rem;
}

/* Site footer — jack wilshere toggle */
.site-footer {
    padding: 3rem 0;
    display: flex;
    justify-content: center;
}

/* Toggle switch */
.toggle-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.toggle-slider {
    width: 2.75rem;
    height: 1.5rem;
    margin-left: 0.5rem;
    background-color: var(--afc-blue);
    border-radius: 9999px;
    position: relative;
    transition: background-color 0.2s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.25rem;
    height: 1.25rem;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    transition: transform 0.2s;
}

.toggle-input:checked + .toggle-slider {
    background-color: var(--afc-gold);
}

.toggle-input:checked + .toggle-slider::after {
    transform: translateX(1.25rem);
}

/* Content area */
.content-area {
    padding-top: 6rem;
}

.content-area h3 {
    font-size: 1.25rem;
}

.predicted-date {
    padding-top: 0.5em;
}

.section-gap {
    padding-top: 4rem;
}

/* Fixtures grid */
.fixtures-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    align-items: start;
    padding-top: 4rem;
    padding-bottom: 1rem;
}

/* Fixture tables */
.fixture-table {
    table-layout: auto;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.12);
    border-radius: 1.5rem;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.fixture-table th {
    padding: 0.75rem 1rem;
}

.fixture-table .team-header-afc {
    font-family: 'Barlow Condensed', system-ui, sans-serif;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background-color: var(--afc-red);
    color: white;
    border-radius: 1.5rem 1.5rem 0 0;
}

.fixture-table .team-header-spurs {
    font-family: 'Barlow Condensed', system-ui, sans-serif;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background-color: var(--spurs-blue);
    color: white;
    border-radius: 1.5rem 1.5rem 0 0;
}

.fixture-table .section-header {
    font-family: 'Barlow Condensed', system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: #d1d5db;
    color: #374151;
}

/* add padding between completed fixtures row and row above */
.fixture-table thead + tbody + thead::before {
    content: '';
    display: table-row;
    height: 1.6rem;
}


/* Fixture result colors (used by JS) */
.fixture-table tr {
    transition: filter 0.15s;
}

.fixture-table tbody tr:hover {
    filter: brightness(1.1);
}

.fixture-table tbody td {
    padding: 0.5rem 1rem;
}

/* Fixture row layout */
.fix-teams {
    display: block;
    font-family: 'Barlow Condensed', system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
}

.fix-score {
    font-weight: 700;
    font-size: 1.3rem;
    padding: 0 0.25rem;
}

.fix-date {
    display: block;
    font-size: 0.8rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-win {
    background-color: #319a60;
    color: #e8f0ec;
}

.result-draw {
    background-color: #c5c9cf;
    color: #3a3a3a;
}

.result-loss {
    background-color: #d63a3a;
    color: #f0e8e8;
}

.result-upcoming {
    background-color: white;
}

.result-upcoming:nth-child(even) {
    background-color: #f3f4f6;
}

.result-postponed {
    background-color: #f0d87a;
    color: #4a3c10;
}

/* North London Derby highlight */
.nld td {
    font-weight: 700;
    border-left: 18px solid var(--gold-light);
}

/* Round bottom corners on last row */
.fixture-table tbody:last-child tr:last-child td {
    padding-bottom: 1rem;
}

.fixture-table tbody:last-child tr:last-child td:first-child {
    border-bottom-left-radius: 1.5rem;
}

.fixture-table tbody:last-child tr:last-child td:last-child {
    border-bottom-right-radius: 1.5rem;
}

/* NLD count */
.nld-count {
    font-size: 1.8rem;
    font-weight: 700;
}

.bold {
    font-weight: 700;
}

/* Sparkline chart */
.sparkline-container {
    max-width: 550px;
    margin: 0 auto;
    padding: 1.5rem;
    background-color: #ebe8e3;
    border-radius: 1.5rem;
}

.sparkline-container h2 {
    margin-bottom: 0.5rem;
}

#sparkline {
    width: 100%;
    height: auto;
    display: block;
}

.sparkline-label {
    font-family: 'Barlow Condensed', system-ui, sans-serif;
    font-size: 11px;
    fill: #9ca3af;
}

/* Form guide (inside points-gap-remaining) */
.form-dots {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.50rem;
}

.points-gap-remaining-col.right .form-dots {
    justify-content: flex-end;
}

.form-dot {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 0.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Barlow Condensed', system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
}

.form-dot.win { background-color: #319a60; }
.form-dot.draw { background-color: #c5c9cf; color: #3a3a3a; }
.form-dot.loss { background-color: #d63a3a; }

/* Points gap bar */
.points-gap {
    max-width: 500px;
    margin: 0 auto;
}

.points-gap-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-family: 'Barlow Condensed', system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.points-gap-team.afc {
    color: var(--afc-red);
}

.points-gap-team.spurs {
    color: var(--spurs-blue);
}

.points-gap-diff {
    font-size: 1.75rem;
    color: #374151;
}

.points-gap-track {
    height: 0.8rem;
    background-color: var(--spurs-blue);
    border-radius: 9999px;
    overflow: hidden;
}

.points-gap-fill.afc {
    height: 100%;
    background-color: var(--afc-red);
    border-radius: 9999px;
    transition: width 0.6s ease-out;
}

.points-gap-remaining {
    display: flex;
    justify-content: space-between;
    margin-top: 0.4rem;
    font-family: 'Barlow Condensed', system-ui, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
}

.points-gap-remaining-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.points-gap-remaining-col.right {
    align-items: flex-end;
}

/* Wave text animation — remove this block to undo */
.wave-text {
    font-family: 'Barlow Condensed', system-ui, sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wave-text span {
    display: inline-block;
    animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Rainbow text for St. Totteringham's Day */
.rainbow-text {
    background: linear-gradient(
        90deg,
        var(--afc-blue), var(--afc-dark-red), var(--afc-red), var(--afc-gold),
        var(--afc-blue), var(--afc-dark-red), var(--afc-red), var(--afc-gold)
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbowShift 3s linear infinite;
    font-size: 2.5rem;
}

@keyframes rainbowShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* Henry knee slide */
.henry-slide {
    position: fixed;
    bottom: 10%;
    left: -300px;
    height: 200px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
}

.henry-slide.sliding {
    animation: kneeSlide 1.8s ease-out forwards;
    animation-delay: 2s;
}

@keyframes kneeSlide {
    0% {
        left: -300px;
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    85% {
        opacity: 1;
    }
    100% {
        left: 110vw;
        opacity: 0;
    }
}

/* Mobile / responsive */
@media (max-width: 768px) {
    /* page-wrapper padding inherited from base rule */

    .site-header {
        padding-top: 2rem;
    }

    .site-title {
        font-size: 2.5rem;
    }

    .content-area {
        padding-top: 3rem;
    }

    .section-gap {
        padding-top: 2rem;
    }

    .fixtures-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .fixture-table {
        width: 100%;
    }

    .toggle-slider {
        width: 2rem;
        height: 1.125rem;
    }

    .toggle-slider::after {
        width: 0.875rem;
        height: 0.875rem;
    }

    .toggle-input:checked + .toggle-slider::after {
        transform: translateX(0.875rem);
    }
}
