:root {
    --bg-color: #050505;
    --bg-contrast: #ffffff;
    --text-primary: #ffffff;
    --text-inverse: #050505;
    --text-muted: #888888;

    --accent: #2e5cff;
    /* International Klein Blue style */
    --accent-secondary: #ccfd3d;
    /* Acid Lime for highlights */

    --border: rgba(255, 255, 255, 0.15);

    /* Editorial Layout Variables */
    --container-width: 1400px;
    --header-height: 80px;

    --nav-bg: rgba(5, 5, 5, 0.85);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

[data-theme="light"] {
    --bg-color: #ffffff;
    --bg-contrast: #050505;
    --text-primary: #111111;
    --text-inverse: #ffffff;
    --text-muted: #666666;
    --border: rgba(0, 0, 0, 0.1);

    --accent: #1a4fd6;
    /* Darker blue for light mode */
    --accent-secondary: #7cb518;
    /* Darker green for light mode readability */

    --nav-bg: rgba(255, 255, 255, 0.85);
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-primary);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(15deg);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Top Bar (Sticky) --- */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    z-index: 1100;
    border-bottom: 1px solid var(--border);
}

/* --- Top Live Games Container --- */
#live-games-top-container {
    margin-top: 0;
    /* Space handled by quick-nav margin-bottom or conditional below */
    margin-bottom: 40px;
    padding: 0 40px;
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* If quick-nav is empty/hidden, live games needs to clear the header */
#quick-nav-container:empty+#live-games-top-container {
    margin-top: calc(var(--header-height) + 10px);
}

#live-games-top-container:empty {
    display: none;
}

#live-games-top-container .card {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
}

#live-games-top-container .card-table {
    background: transparent;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

#live-games-top-container .card-table th {
    padding-top: 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

#live-games-top-container h2 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px !important;
    font-weight: 700;
}

.live-indicator-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: rgba(46, 92, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(46, 92, 255, 0.2);
}

.live-indicator-text {
    color: #2e5cff;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px dashed rgba(46, 92, 255, 0.8);
    padding-bottom: 1px;
    transition: border-bottom-color 0.2s ease, border-bottom-style 0.2s ease;
}

.live-pill-link:hover .live-indicator-text {
    border-bottom-color: #2e5cff;
    border-bottom-style: solid;
}

/* --- Logo & Header Text --- */
.logo {
    /* Flex alignment for logo image + text column */
    display: flex;
    align-items: center;
    gap: 15px;
    white-space: nowrap;
    text-decoration: none;
}

.header-logo {
    height: 3rem;
    width: auto;
    object-fit: contain;
}

.logo-text-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1;
}

.logo-main {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: -1px;
    color: var(--text-primary);
    text-transform: uppercase;
}

.logo-sub {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Mobile Logo Optimization */
@media (max-width: 768px) {
    .logo-sub {
        display: block;
        /* Restore sub-headline */
        font-size: 0.65rem;
        /* Original mobile size */
        letter-spacing: 1px;
    }

    /* Small screens: Hide logo image to save space for text + icons */
    @media (max-width: 425px) {
        .header-logo {
            display: none;
        }

        .logo-text-col {
            display: flex;
            /* Ensure text remains visible */
        }
    }

    /* Very small screens: Hide theme toggle to save even more space */
    @media (max-width: 380px) {
        .theme-toggle {
            display: none;
        }
    }

    .logo-main {
        font-size: 1.4rem;
        /* Restore original size */
    }

    .header-logo {
        height: 2.5rem;
    }

    .logo {
        gap: 8px;
    }

    /* Reduce header padding to prevent overflow */
    .top-bar {
        padding: 0 10px;
        /* Very tight padding */
        height: 70px;
        /* Standardize height */
    }

    /* Adjust main nav padding to match new header height */
    .main-nav-overlay {
        padding-top: 70px;
    }

    /* Tighter actions on mobile */
    .header-actions {
        gap: 2px;
        /* Extremely tight gap */
    }

    .icon-link,
    .theme-toggle,
    .mobile-menu-toggle {
        padding: 8px;
    }

    .instagram-icon {
        width: 20px;
        height: 20px;
    }
}

/* Hamburger Toggle */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100;
    padding: 10px;
}

.bar {
    width: 30px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Toggle Animation State */
body.menu-open .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

body.menu-open .bar:nth-child(2) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* --- Header Actions --- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.instagram-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    display: block;
}

.icon-link {
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
}

.icon-link:hover {
    transform: scale(1.15);
}

/* --- Navigation Overlay --- */
.main-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    padding-top: var(--header-height);
}

body.menu-open .main-nav-overlay {
    opacity: 1;
    pointer-events: all;
}

.nav-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 2rem;
    /* Huge menu items */
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.3s ease;
}

.nav-btn:hover,
.nav-btn.active {
    color: var(--text-primary);
}

/* --- Quick Nav Container (New) --- */
#quick-nav-container {
    margin-top: var(--header-height);
    background-color: var(--bg-color);
    padding: 10px 0;
    z-index: 1000;
    position: relative;
    /* border-bottom removal for cleaner transition to content */
}

#quick-nav-container:empty {
    display: none;
    margin-top: 0;
    padding: 0;
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    min-height: 70vh;
    background-image: url('netz.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    /* margin-top: var(--header-height); REMOVED */
}

@media (max-width: 768px) {
    .hero-section {
        background-position: center bottom;
        /* Focus on the action, avoid text in image */
    }
}

.hero-overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px;
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid var(--border);
}

[data-theme="light"] .hero-overlay {
    background: rgba(255, 255, 255, 0.85);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 8rem;
    /* Massive Editorial Type */
    line-height: 0.9;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: var(--text-primary);
    letter-spacing: -3px;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 300;
    max-width: 600px;
    margin-bottom: 40px;
}

.hero-countdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.countdown-label {
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--accent);
    font-weight: 600;
}

.countdown-timer {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.countdown-match {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.hero-action-btn {
    font-size: 1.4rem;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.hero-action-btn:hover {
    transform: scale(1.15);
}

/* --- Content Wrapper --- */
#content-area {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 20px 40px 100px;
    flex: 1;
}

/* Remove 'Hero' when not on landing page */
body.hide-hero .hero-section {
    display: none;
}

body.hide-hero #content-area {
    padding-top: calc(var(--header-height) + 20px);
}


/* --- Editorial Cards --- */
.card {
    padding: 10px 0;
    margin-bottom: 0;
    /* Continuous flow */
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.card h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: -1px;
    color: var(--accent);
    /* Pop of color for headers */
}

/* --- Sub Navigation (Pills) --- */
.sub-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    /* Removed border-bottom for cleaner look */
}

.sub-nav-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 18px;
    border-radius: 50px;
    /* Pill shape */
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.sub-nav-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.sub-nav-btn.active {
    background: var(--text-primary);
    color: var(--bg-color);
    /* High contrast */
    border-color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* --- Mobile Sub-Nav Optimization --- */
@media (max-width: 768px) {
    .sub-nav {
        /* Switch to wrapping layout (Chips Cloud) */
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        margin-bottom: 20px;
        padding-bottom: 0;

        /* Reset scrolling properties */
        overflow-x: visible;
        mask-image: none;
        -webkit-mask-image: none;
        scroll-snap-type: none;
    }

    .sub-nav-btn {
        flex: 0 0 auto;
        padding: 10px 16px;
        /* Slightly larger touch target */
        font-size: 0.85rem;
    }
}

.archive-btn {
    background: var(--accent);
    border: none;
    color: #ffffff;
    padding: 14px 40px;
    /* Wider */
    border-radius: 50px;
    /* Pill */
    font-size: 1rem;
    font-weight: 600;
    /* text-transform: uppercase; REMOVED */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);

    margin-top: 40px;
    margin-bottom: 60px;

    /* Centering */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;

    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}



.archive-btn:hover {
    background: var(--accent-secondary);
    color: #000000;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}



/* --- Minimalist Tables --- */
.table-container {
    overflow-x: auto;
    margin-bottom: 40px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
    /* Mono for data could strictly be better, but Inter is fine */
}

th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 20px 10px;
    border-bottom: 1px solid var(--border);
    letter-spacing: 1px;
}

td {
    padding: 20px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 1rem;
}

.highlight-row td {
    font-weight: 700;
}

.highlight-text {
    font-weight: 700;
    color: inherit;
}

.win {
    color: var(--text-primary);
}

/* Keep it clean white */
.loss {
    color: var(--text-muted);
}

/* Stylistic choice */
.draw {
    color: var(--text-muted);
}

/* --- Desktop Columns & Layout --- */
.col-league {
    width: 12%;
}

.col-home {
    width: 28%;
    text-align: right;
}

.col-away {
    width: 28%;
    text-align: left;
}

/* Separator between Home and Away on Desktop */
@media (min-width: 769px) {
    .col-home::after {
        content: " —";
        color: var(--text-muted);
        margin-left: 5px;
        margin-right: 5px;
    }
}

/* --- Status Indicators & Links --- */
.live-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #2e5cff;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 0 rgba(46, 92, 255, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 92, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(46, 92, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(46, 92, 255, 0);
    }
}

.pdf-link {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent);
    transition: all 0.2s ease;
}

.pdf-link:hover {
    color: var(--accent-secondary);
    border-bottom-color: var(--accent-secondary);
}

.team-link,
.team-link:visited,
.team-link:active,
.team-link:link {
    text-decoration: none;
    color: inherit !important;
    transition: all 0.2s ease;
}

.team-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* --- Filter UI --- */
.filter-select {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 8px 32px 8px 16px;
    border-radius: 4px;
    /* Editorial blocky style */
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23888888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.filter-select option {
    background: var(--bg-color);
    color: var(--text-primary);
}

.filter-select:hover {
    border-color: var(--accent);
}

.filter-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

/* --- Ghost Posts Grid --- */
.ghost-posts-teaser-grid {
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 600px) {
    .ghost-posts-teaser-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .ghost-posts-teaser-grid {
        /* Enforce 3 columns on desktop to prevent single items from stretching */
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .filter-wrapper {
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }
}

/* --- Training Calendar --- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    /* Full weekday spread on desktop */
    gap: 1px;
    background: var(--border);
    /* Grid lines trick */
    border: 1px solid var(--border);
}

.calendar-day {
    background: var(--bg-color);
    padding: 30px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.day-header {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.time-slot {
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 15px;
    font-weight: 600;
}

/* --- Mobile Breakpoints --- */
@media (max-width: 1024px) {
    .calendar-grid {
        grid-template-columns: 1fr;
    }

    .calendar-day {
        min-height: auto;
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .top-bar {
        padding: 0 20px;
    }

    .hero-section {
        padding-left: 20px;
        padding-right: 20px;
        min-height: 50vh;
    }

    #quick-nav-container {
        padding-top: 25px;
        /* Breathing room from sticky header */
    }

    /* Fix header on mobile */
    .logo {
        font-size: 1.2rem;
        gap: 10px;
    }

    .header-logo {
        height: 2rem;
    }

    .hero-overlay {
        padding: 30px 20px;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .countdown-timer {
        font-size: 2rem;
    }

    #content-area {
        padding: 20px 20px 80px;
    }

    .nav-btn {
        font-size: 1.8rem;
    }

    /* Slightly smaller for mobile menu */

    /* Tables: Strict single line rows or scrolling */
    /* --- Mobile Table Card Layout --- */
    /* --- Mobile Table Card Layout (Only for .card-table) --- */
    .table-container {
        overflow-x: auto;
        /* Allow scroll by default for non-card tables */
        -webkit-overflow-scrolling: touch;
    }

    /* Apply Card Layout ONLY to .card-table */
    .card-table,
    .card-table thead,
    .card-table tbody,
    .card-table th,
    .card-table td,
    .card-table tr {
        display: block;
    }

    .card-table thead {
        display: none;
    }

    .card-table tbody tr {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border);
        border-radius: 8px;
        margin-bottom: 20px;
        padding: 15px;
        position: relative;
        display: grid;
        grid-template-areas:
            /* Status | Date | Meta (Time/Result) */
            "status date meta"
            "league league league"
            "home home home"
            "away away away"
            "result result actions";
        grid-template-columns: auto 1fr auto;
        gap: 8px;
        align-items: center;
    }

    /* Cell Resets for Cards */
    .card-table td {
        padding: 0;
        border: none;
        font-size: 0.95rem;
        text-align: left !important;
        /* Force left align generally */
    }

    /* Specific Cell placements */

    /* Date */
    .col-date {
        grid-area: date;
        font-size: 0.9rem;
        color: var(--text-muted);
        padding-left: 10px;
    }

    /* Time (Generic Meta) */
    .col-time {
        grid-area: meta;
        text-align: right !important;
        font-weight: 600;
        color: var(--accent);
    }

    /* Status Icon - Inside Card */
    .col-status {
        grid-area: status;
        position: static;
        width: auto !important;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* League */
    .col-league {
        grid-area: league;
        font-size: 0.8em;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: var(--text-muted);
        margin-bottom: 5px;
        white-space: normal;
        /* Allow wrap */
        width: 100%;
        /* Reset desktop width */
    }

    /* Teams (Home & Away) - Stacked */
    .col-home {
        grid-area: home;
        font-size: 1.2rem;
        line-height: 1.4;
        display: block;
        width: 100%;
        /* Reset desktop width */
    }

    .col-away {
        grid-area: away;
        font-size: 1.2rem;
        line-height: 1.4;
        display: block;
        width: 100%;
        /* Reset desktop width */
    }

    /* Result */
    .col-result {
        grid-area: result;
        align-self: end;
        font-size: 1.1rem;
        font-weight: 700;
        padding-top: 10px;
    }

    /* Special Case: Last Results table moves Result to Meta (top right) */
    .last-results-table .col-result {
        grid-area: meta;
        text-align: right !important;
        align-self: start;
        padding-top: 0;
    }

    /* Actions */
    .col-actions {
        grid-area: actions;
        justify-self: end;
        align-self: end;
        white-space: nowrap;
        padding-top: 5px;
        width: auto !important;
        display: flex;
        justify-content: flex-end;
        gap: 5px;
    }

    /* Improve action buttons touch targets */
    .calendar-export-btn {
        padding: 12px;
        font-size: 1.2rem;
        margin-left: 10px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 50%;
        width: 48px;
        /* Large touch target */
        height: 48px;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .card h2 {
        font-size: 1.75rem;
    }

    /* --- Standard Tables on Mobile (Rankings) --- */
    .standings-table {
        min-width: 600px;
        /* Force scroll */
    }

    .standings-table th,
    .standings-table td {
        white-space: nowrap;
        padding: 12px 8px;
    }

    /* Sticky First Column (Rank) */
    .standings-table th:first-child,
    .standings-table td:first-child {
        position: sticky;
        left: 0;
        background: var(--bg-color);
        z-index: 2;
        border-right: 1px solid var(--border);
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    }
}

/* --- Form Check & Calendar Utilities --- */
.form-check {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}

.form-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.form-dot.win {
    background: #4caf50;
}

.form-dot.loss {
    background: #f44336;
}

.form-dot.draw {
    background: #ff9800;
}

.calendar-export-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.calendar-export-btn:hover {
    background: var(--border);
}

.info-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    display: block;
}

/* --- Venue Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    /* toggled via JS */
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.maps-btn {
    display: inline-block;
    background: var(--accent);
    color: var(--text-inverse);
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 15px;
    transition: background 0.2s ease;
}

.maps-btn:hover {
    background: var(--text-primary);
}

/* --- Hero Hiding for Subpages --- */
body.hide-hero #hero {
    display: none;
}

body.hide-hero #content-area {
    padding-top: calc(var(--header-height) + 20px);
}

/* Footer */
.site-footer {
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--border);
    padding: 30px 20px;
    margin-top: 40px;
    text-align: center;
}

.footer-content {
    max-width: var(--container-width);
    margin: 0 auto;
}

.footer-content p {
    color: var(--text-muted);
    font-size: 0.9em;
    margin: 0 0 15px 0;
}

.footer-links {
    margin-top: 20px;
}

.footer-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.footer-nav-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-nav-col a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.2s ease;
}

.footer-nav-col a:hover {
    color: var(--accent);
}

.footer-separator {
    display: none;
}

@media (max-width: 768px) {
    .site-footer {
        padding: 25px 15px;
    }

    .footer-content p {
        font-size: 0.85em;
    }

    .footer-links {
        font-size: 0.85em;
    }
}

/* Games header - force column layout */
/* Games header - force column layout (V2) */
.games-header-v2 {
    display: flex !important;
    flex-direction: column !important;
    /* Force vertical stacking */
    gap: 15px !important;
    width: 100% !important;
    margin-bottom: 20px !important;
    align-items: flex-start !important;
    /* Align left */
}

/* Specific class for the title to ensure it takes full width */
.games-title {
    width: 100% !important;
    display: block !important;
    white-space: nowrap !important;
    /* Prevent wrapping words */
    margin: 0 0 15px 0 !important;
    font-size: 1.75rem;
    /* Ensure consistent size */
    line-height: 1.2;
}



.games-header-v2 .filter-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    justify-content: space-between;
    /* Space out filters if they wrap */
}

/* --- Team Roster Table & Navigation --- */
.pill-nav {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.pill-nav .sub-nav-btn {
    font-size: 0.85rem;
    padding: 6px 16px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    cursor: pointer;
}

.pill-nav .sub-nav-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.pill-nav .sub-nav-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Standings Table (for Roster) */
.standings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.95rem;
}

.standings-table th {
    text-align: left;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.standings-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.standings-table tr:last-child td {
    border-bottom: none;
}

.standings-table tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

/* Zebra Striping - Dark Mode (Default) */
.standings-table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.08);
}

/* Zebra Striping - Light Mode */
[data-theme="light"] .standings-table tbody tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.08);
}

/* Status Column */
.standings-table td:nth-child(5) {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.85rem;
}

/* Mobile Optimizations for Roster Table */
@media (max-width: 768px) {

    .standings-table th,
    .standings-table td {
        padding: 10px 8px;
        font-size: 0.9rem;
    }

    .standings-table th:nth-child(4),
    /* 'A' column */
    .standings-table td:nth-child(4) {
        text-align: center;
    }
}

/* TTR Calculator Specific Styles */

/* Ensure seamless integration */
/* body { min-height: 100vh; display: flex; flex-direction: column; } */
/* Note: body style commented out to avoid conflict with main layout if not needed, but ensuring flex col is usually fine. Main site might already have it. */

#content-area {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 20px 40px 100px;
    flex: 1;
}

.ttr-wrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

/* TTR Page Title - Scoped or Shared? */
/* .page-title and .page-subtitle are used in JS, ensuring they look good */
.page-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 10px;
    color: var(--text-primary);
    text-align: center;
}

.page-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.calculator-grid {
    display: grid;
    gap: 30px;
}

.calculation-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 12px;
}

[data-theme="light"] .calculation-card {
    background: rgba(0, 0, 0, 0.03);
}

.calculation-card h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--accent);
}

/* Form Styles */
.form-grid {
    display: grid;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ttr-input {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 16px;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    border-radius: 6px;
    width: 100%;
    outline: none;
    transition: all 0.2s ease;
}

.ttr-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(46, 92, 255, 0.2);
}

/* Checkbox Styles */
/* Post Grid Layouts */
.ghost-posts-grid,
.ghost-posts-teaser-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    width: 100%;
}

@media (min-width: 600px) {

    .ghost-posts-grid,
    .ghost-posts-teaser-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {

    .ghost-posts-grid,
    .ghost-posts-teaser-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.custom-checkbox input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

.custom-checkbox input:checked+.checkmark {
    background-color: var(--accent);
    border-color: var(--accent);
}

.custom-checkbox input:checked+.checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.label-text {
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Opponent List Styles */
#opponents-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.empty-state-text {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-style: italic;
    border: 1px dashed var(--border);
    border-radius: 8px;
}

.opponent-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    /* Input | Toggle | Remove */
    gap: 10px;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.opponent-row:hover {
    border-color: var(--border);
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* .row-input {
    min-width: 120px; Removed for better mobile control 
} */

.toggle-group {
    display: flex;
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.result-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.result-toggle.win.active {
    background: var(--accent-secondary);
    /* Success Green */
    color: #000000;
}

.result-toggle.lose.active {
    background: #ff4757;
    /* Error Red */
    color: white;
}

/* Mobile Layout Fixes for TTR Calculator */
@media (max-width: 480px) {
    .opponent-row {
        display: flex;
        /* Switch to Flexbox for better control */
        flex-wrap: nowrap;
        /* FORCE single line */
        align-items: center;
        gap: 8px;
        padding: 5px;
    }

    .ttr-input.row-input {
        min-width: 0;
        flex: 1;
        /* Take remaining space */
        width: auto;
        padding: 8px;
        /* Slightly smaller padding */
        font-size: 1rem;
    }

    .toggle-group {
        flex-shrink: 0;
        /* Don't shrink buttons */
    }

    .result-toggle {
        padding: 6px 8px;
        /* Compact buttons */
        font-size: 0.75rem;
    }

    .remove-opponent {
        flex-shrink: 0;
        padding: 4px;
    }
}

/* .ttr-input.row-input {
    min-width: 120px; REMOVED to allow flex/grid control
} */

/* ... toggle-group styles ... */

.remove-opponent {
    background: transparent;
    border: none;
    color: var(--text-muted);
    /* font-size: 1.2rem; REMOVED */
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-opponent svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    transition: stroke 0.2s ease;
}

.remove-opponent:hover {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
}

.remove-opponent:hover svg {
    stroke: #ff4757;
}

.youth-bonus-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Buttons */
.btn-secondary {
    background: transparent;
    border: 1px dashed var(--border);
    color: var(--text-muted);
    padding: 12px 20px;
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(46, 92, 255, 0.05);
}

.archive-btn {
    /* Extending main button style but ensuring it's prominent here */
    margin-top: 0;
    /* Override default margin */
    font-size: 1.2rem;
    padding: 16px;
    width: auto;
    display: inline-block;
}

.ttr-wrapper .archive-btn {
    width: 100%;
}

/* Result Section */
.result-section {
    margin-top: 40px;
}

.result-box {
    margin-top: 30px;
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hidden {
    display: none;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.result-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
    padding-top: 10px;
}

.result-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mono-value {
    font-family: 'Roboto Mono', monospace;
    /* Fallback if not loaded, standard mono */
    font-weight: 600;
    font-size: 1.1rem;
}


/* --- Ghost CMS Styles (Restored) --- */

/* Post Grid placement and specific spacing if needed */
.ghost-posts-teaser-grid {
    margin-top: 20px;
}

/* Pagination Control */
.ghost-pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.result-row.highlight .mono-value {
    color: var(--accent);
    font-size: 1.3rem;
}

.result-row.final .mono-value {
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 800;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .page-title {
        font-size: 2rem;
    }

    .opponent-row {
        grid-template-columns: 1fr auto;
        gap: 5px;
    }

    .row-input {
        min-width: 80px;
    }

    .result-toggle {
        padding: 6px 8px;
        font-size: 0.75rem;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /* Slightly darker */
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-color);
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 16px;
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(30px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-content.modal-wide {
    max-width: 1000px;
    padding: 30px 20px;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 5px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Adjust Result Styles for Modal */
.result-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* --- Mobile Fixes for Overflow --- */
@media (max-width: 600px) {
    #content-area {
        padding-left: 10px;
        padding-right: 10px;
        /* Reduce from 15px */
    }

    .calculation-card {
        padding: 20px 10px;
        /* Reduce from 15px horizontal */
    }

    .view-container {
        width: 100%;
        /* removed overflow-x: hidden to allow scroll if absolutely necessary */
    }
}

/* Extra small devices */
@media (max-width: 420px) {
    .opponent-row {
        gap: 4px;
        padding: 0 12px 0 0;
        /* Add right padding to clear scrollbar/edge */
    }

    .result-toggle {
        padding: 4px 5px;
        /* Tighter padding */
        font-size: 0.7rem;
        /* Smaller font */
    }

    .remove-opponent {
        padding: 8px;
        /* Larger touch target */
        margin-right: -4px;
        /* Align visually while keeping touch area */
    }

    .ttr-input.row-input {
        padding: 12px 16px;
        /* Match standard .ttr-input padding */
        font-size: 1rem;
        width: 100%;
        /* Default to full width */
        max-width: 200px;
        /* User requested 200px max */
        flex: 1 1 auto;
        /* Allow grow up to max-width, allow shrink if needed */
        min-width: 60px;
        /* Prevent shrinking too much */
    }
}

/* Live Score Table */
.live-score-wrapper {
    width: 100%;
    margin-top: 20px;
}

.live-score-table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: block;
    background: rgba(255, 255, 255, 0.02);
}

.live-score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    table-layout: auto;
}

.live-score-table th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-weight: 700;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.live-score-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

.live-score-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.live-score-table tr:last-child td {
    border-bottom: none;
}

.live-score-table tr.total-row {
    background: rgba(46, 92, 255, 0.1) !important;
    font-weight: bold;
}

.score-cell {
    text-align: center !important;
    width: 45px;
    min-width: 45px;
    padding: 10px 4px !important;
}

.score-cell-sets {
    width: 65px;
    min-width: 65px;
    font-weight: 700;
    text-align: center !important;
}

/* Modal Close Button Refinement */
.modal-close-btn {
    position: sticky;
    top: 0;
    float: right;
    margin-top: -10px;
    margin-right: -10px;
    background: var(--bg-color);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-close-btn:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.1);
}

/* Desktop sizing refinement */
.modal-content.modal-wide {
    max-width: 1000px;
    width: 95%;
    padding: 30px 40px;
}

/* Card Layout (Mobile) */
.live-score-cards-container {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.live-score-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
}

.card-match-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.match-nr {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.match-total {
    font-weight: 700;
    color: var(--accent);
    font-size: 1rem;
}

.card-players {
    margin-bottom: 10px;
}

.player-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.player-name {
    font-weight: 500;
    font-size: 0.95rem;
}

.card-sets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.set-pill {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 38px;
}

.set-pill span {
    color: var(--text-muted);
    font-size: 0.6rem;
    margin-bottom: 2px;
}

.total-card {
    background: rgba(46, 92, 255, 0.1);
    border-color: var(--accent);
}

@media (max-width: 768px) {
    .modal-content.modal-wide {
        padding: 60px 12px 20px;
        width: 98%;
        max-height: 85vh;
        overflow-y: auto;
    }

    .modal-close-btn {
        top: 10px;
        right: 10px;
        position: fixed;
    }

    .live-score-table-container {
        display: none;
    }

    .live-score-cards-container {
        display: flex;
    }
}

/* Loading Spinner Refinement - No more animation */
.loading-spinner {
    display: inline-block;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    width: 100%;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}