/*
 * TopTipper CSS Design System (Vanilla CSS)
 * Colors: Athletic Blue (#2563eb), Pitch Turf Green (#10b981), Scoreboard Gold (#f59e0b)
 */

/* Light & Dark Theme Tokens */
:root {
    /* Color Palette Defaults (Dark Mode Default) */
    --bg-canvas: #0b1120;
    --bg-card: #131d36;
    --bg-card-subtle: #182442;
    --bg-elevated: #1e2e54;
    
    /* Text Colors */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --text-inverse: #0f172a;

    /* Borders & Dividers */
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-border-focus: #2563eb;
    --glass-shadow: rgba(0, 0, 0, 0.35);

    /* Brand & Accent Colors (Stadium Authentic) */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.25);
    
    --accent-green: #10b981;
    --accent-green-bg: rgba(16, 185, 129, 0.12);
    
    --accent-gold: #f59e0b;
    --accent-gold-bg: rgba(245, 158, 11, 0.12);
    
    --accent-red: #ef4444;
    --accent-red-bg: rgba(239, 68, 68, 0.12);
    
    /* Typography */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2.5rem;

    /* Sharp, Modern Radii - NO Pill Radii */
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-smooth: 0.25s ease-in-out;
}

:root[data-theme="light"] {
    --bg-canvas: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-subtle: #f1f5f9;
    --bg-elevated: #e2e8f0;

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    --text-inverse: #ffffff;

    --glass-border: #e2e8f0;
    --glass-border-focus: #2563eb;
    --glass-shadow: rgba(15, 23, 42, 0.06);

    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.15);

    --accent-green: #059669;
    --accent-green-bg: rgba(5, 150, 105, 0.1);

    --accent-gold: #d97706;
    --accent-gold-bg: rgba(217, 119, 6, 0.1);

    --accent-red: #dc2626;
    --accent-red-bg: rgba(220, 38, 38, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Skip to Main Content Link */
.skip-link {
    position: absolute;
    top: -999px;
    left: 1rem;
    background: var(--primary);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    z-index: 100000;
    font-weight: 600;
    text-decoration: none;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 1rem;
    outline: 3px solid var(--accent-gold);
}

/* Scroll Progress Bar */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent-green));
    width: 0%;
    z-index: 10000;
    transition: width 0.1s linear;
}

/* Headings & Links */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.015em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Scaffolding */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    width: 100%;
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
}

.grid-sidebar {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-lg);
}

/* Header & Navigation */
header.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: var(--spacing-sm) 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo:hover {
    text-decoration: none;
}

.logo-accent {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

nav.site-nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--text-main);
    background: var(--bg-card-subtle);
    text-decoration: none;
}

.nav-links a.active {
    color: var(--primary);
    background: var(--primary-bg, rgba(37, 99, 235, 0.1));
    font-weight: 600;
}

/* Theme Switcher Button */
.theme-toggle-btn {
    background: var(--bg-card-subtle);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.theme-toggle-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--primary);
}

/* Hamburger Menu Toggle */
.menu-toggle {
    display: none;
    background: var(--bg-card-subtle);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-size: 1.25rem;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* Buttons (No Pill Shapes!) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    gap: 0.4rem;
    text-align: center;
    text-decoration: none;
    line-height: 1.3;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #ffffff;
}

.btn-secondary {
    background: var(--bg-card-subtle);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
    border-color: var(--text-muted);
    color: var(--text-main);
}

.btn-success {
    background: var(--accent-green);
    color: #ffffff;
    border-color: var(--accent-green);
}

.btn-danger {
    background: var(--accent-red);
    color: #ffffff;
    border-color: var(--accent-red);
}

.btn-danger:hover {
    background: #dc2626;
    color: #ffffff;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.85rem 1.75rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.btn-copy {
    position: relative;
    cursor: pointer;
}

.btn-loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.btn-loading::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 6px;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-accent {
    background: var(--accent-gold);
    color: #0b1120;
    border-color: var(--accent-gold);
}

.btn-accent:hover {
    background: #d97706;
    color: #ffffff;
}

/* Cards & Surfaces */
.card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: 0 4px 12px 0 var(--glass-shadow);
    margin-bottom: var(--spacing-lg);
    transition: border-color var(--transition-fast);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.18);
}

:root[data-theme="light"] .card:hover {
    border-color: #cbd5e1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--glass-border);
}

.card-body {
    padding: 0;
}

.card-footer {
    padding-top: var(--spacing-sm);
    margin-top: var(--spacing-md);
    border-top: 1px solid var(--glass-border);
}

/* Metric & Stat Cards */
.stat-card {
    text-align: left;
    padding: var(--spacing-md) var(--spacing-lg);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.15;
    margin: 0.25rem 0;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Badges & Status Indicators (Sharp 2px-4px corners, Zero Pill) */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-heading);
    border-radius: var(--radius-xs);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1.2;
}

.badge-primary {
    background: var(--primary-glow);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.35);
}

.badge-accent {
    background: var(--accent-gold-bg);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-secondary {
    background: var(--bg-card-subtle);
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

.badge-success {
    background: var(--accent-green-bg);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-danger {
    background: var(--accent-red-bg);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-warning {
    background: var(--accent-gold-bg);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-info {
    background: rgba(2, 132, 199, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.badge-winners {
    background: var(--accent-green-bg);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-margins {
    background: var(--primary-glow);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.35);
}

.badge-scores {
    background: var(--accent-gold-bg);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Flash Messages */
.flash-message {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.flash-info {
    background: var(--primary-bg, rgba(37, 99, 235, 0.12));
    border: 1px solid var(--primary);
    color: var(--text-main);
}

.flash-warning {
    background: var(--accent-gold-bg);
    border: 1px solid var(--accent-gold);
    color: var(--text-main);
}

.flash-danger, .flash-error {
    background: var(--accent-red-bg);
    border: 1px solid var(--accent-red);
    color: var(--text-main);
}

.flash-success {
    background: var(--accent-green-bg);
    border: 1px solid var(--accent-green);
    color: var(--text-main);
}

/* Form Styles & Validation */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg-card-subtle);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.form-control.is-invalid {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 1px var(--accent-red);
}

.invalid-feedback {
    display: block;
    font-size: 0.8rem;
    color: var(--accent-red);
    margin-top: 0.25rem;
}

.pw-field-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.pw-field-wrapper input {
    padding-right: 2.5rem;
}

.pw-toggle-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pw-toggle-btn:hover {
    color: var(--text-main);
}

/* Grids */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-sidebar { grid-template-columns: 2fr 1fr; }

/* Data Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    margin-bottom: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

.table, table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.table th, table.data-table th {
    background: var(--bg-card-subtle);
    padding: 0.75rem 1rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-dim);
    border-bottom: 1px solid var(--glass-border);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table td, table.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    vertical-align: middle;
}

.table tbody tr:hover, table.data-table tbody tr:hover {
    background: var(--bg-card-subtle);
}

.table tr.highlight-row, table.data-table tr.highlight-row {
    background: var(--primary-bg, rgba(37, 99, 235, 0.12));
    font-weight: 600;
}

/* Tipping Form Elements */
.tipping-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.tipping-row {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    text-align: center;
}

.team-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.team-container.home-team { justify-content: flex-end; }
.team-container.away-team { justify-content: flex-start; }

.team-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.tipping-options {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
}

.tipping-option-btn {
    padding: 0.45rem 0.85rem;
    background: var(--bg-card-subtle);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 700;
    transition: var(--transition-fast);
}

.tipping-option-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--primary);
}

.tipping-option-btn.selected {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.margin-input, .score-input {
    width: 55px;
    text-align: center;
    background: var(--bg-card-subtle);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    padding: 0.35rem;
    border-radius: var(--radius-sm);
}

.margin-input:focus, .score-input:focus {
    border-color: var(--primary);
    outline: none;
}

/* Breadcrumb Component */
.breadcrumb {
    margin-bottom: var(--spacing-md);
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumb li + li::before {
    content: "/";
    color: var(--text-dim);
    margin-right: 0.5rem;
}

.breadcrumb a {
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb li[aria-current="page"] {
    color: var(--text-main);
    font-weight: 600;
}

/* Expandable FAQ Accordion */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-summary {
    padding: var(--spacing-md) var(--spacing-lg);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    user-select: none;
}

.faq-summary::-webkit-details-marker {
    display: none;
}

.faq-summary:hover {
    background: var(--bg-card-subtle);
}

.faq-icon {
    font-size: 1.25rem;
    color: var(--primary);
    font-weight: 700;
    transition: transform var(--transition-fast);
}

.faq-item[open] .faq-icon {
    transform: rotate(45deg);
}

.faq-content {
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-lg);
    border-top: 1px solid var(--glass-border);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.faq-content ul {
    margin-left: 1.25rem;
    margin-top: 0.5rem;
}

.faq-content li {
    margin-bottom: 0.35rem;
}

/* Legal & Error Page Scaffolds */
.legal-container {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: var(--spacing-xl);
}

.page-header {
    margin-bottom: var(--spacing-lg);
}

.page-title {
    font-size: 2.2rem;
    margin-bottom: 0.25rem;
}

.legal-card {
    line-height: 1.75;
}

.legal-section {
    margin-bottom: var(--spacing-lg);
}

.legal-section h2 {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: var(--spacing-xs);
}

.legal-section ul {
    margin-left: 1.25rem;
    margin-top: 0.5rem;
}

.legal-section li {
    margin-bottom: 0.4rem;
}

.error-container {
    max-width: 600px;
    margin: var(--spacing-xl) auto;
    text-align: center;
}

.error-card {
    padding: var(--spacing-xl);
}

.error-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: var(--primary-bg);
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

.error-badge-danger {
    background: var(--accent-red-bg);
    color: var(--accent-red);
    border-color: var(--accent-red);
}

.error-title {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.error-subtitle {
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-lg);
}

.search-form-inline {
    display: flex;
    gap: var(--spacing-xs);
    max-width: 360px;
    margin: var(--spacing-sm) auto 0;
}

/* Floating Utilities (Back to Top & Feedback) */
.floating-actions {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 999;
}

.floating-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--glass-shadow);
    transition: var(--transition-fast);
}

.floating-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--primary);
    color: var(--primary);
}

#btn-back-to-top {
    display: none;
}

/* Main & Footer */
main.site-main {
    flex: 1;
    padding: var(--spacing-lg) 0 var(--spacing-xl);
}

footer.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--glass-border);
    padding: var(--spacing-lg) 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    text-align: center;
}

.footer-links {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--primary);
}

/* Mobile Responsive Overrides */
@media (max-width: 900px) {
    .grid-sidebar { grid-template-columns: 1fr; }
    .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .menu-toggle { display: block; }
    nav.site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--glass-border);
        flex-direction: column;
        padding: var(--spacing-md);
        box-shadow: 0 8px 24px var(--glass-shadow);
    }
    nav.site-nav.mobile-open { display: flex; }
    .nav-links { flex-direction: column; width: 100%; }
    .nav-links li, .nav-links a { width: 100%; text-align: center; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .tipping-row { grid-template-columns: 1fr; gap: var(--spacing-sm); }
    .team-container.home-team, .team-container.away-team { justify-content: center; }
    .floating-actions { bottom: 1rem; right: 1rem; }
}

/* Broadcast-Quality Sports UI Components */
.club-crest {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.85rem;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 2px 6px var(--glass-shadow);
}
.crest-ars { background: #dc2626; border: 2px solid #ef4444; }
.crest-che { background: #1d4ed8; border: 2px solid #3b82f6; }
.crest-mci { background: #0284c7; border: 2px solid #38bdf8; }
.crest-liv { background: #b91c1c; border: 2px solid #dc2626; }
.crest-new { background: #18181b; border: 2px solid #52525b; }
.crest-whu { background: #7c2d12; border: 2px solid #9a3412; }
.crest-tot { background: #0f172a; border: 2px solid #cbd5e1; color: #f8fafc; }
.crest-mun { background: #991b1b; border: 2px solid #ef4444; }
.crest-generic { background: var(--primary); border: 2px solid var(--primary-hover); }

.form-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-xs);
    font-size: 0.7rem;
    font-weight: 800;
    font-family: var(--font-mono);
}
.form-w { background: var(--accent-green-bg); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.4); }
.form-d { background: var(--accent-gold-bg); color: var(--accent-gold); border: 1px solid rgba(245, 158, 11, 0.4); }
.form-l { background: var(--accent-red-bg); color: var(--accent-red); border: 1px solid rgba(239, 68, 68, 0.4); }

.match-fixture-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    transition: border-color var(--transition-fast);
}
.match-fixture-card:hover {
    border-color: rgba(37, 99, 235, 0.4);
}
.match-fixture-card.is-banker {
    border-left: 4px solid var(--accent-gold);
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.04) 0%, var(--bg-card) 100%);
}
.match-fixture-card.is-joker {
    border-left: 4px solid var(--primary);
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.04) 0%, var(--bg-card) 100%);
}

.consensus-bar {
    display: flex;
    height: 8px;
    border-radius: var(--radius-xs);
    overflow: hidden;
    margin: 0.75rem 0;
    background: var(--bg-canvas);
}
.consensus-home { background: var(--primary); }
.consensus-draw { background: var(--accent-gold); }
.consensus-away { background: var(--accent-red); }

.score-input {
    width: 52px;
    height: 44px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 800;
    font-family: var(--font-mono);
    background: var(--bg-canvas);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    border-radius: var(--radius-sm);
}
.score-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.team-choice-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem;
    background: var(--bg-card-subtle);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-main);
    width: 100%;
}
.team-choice-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--text-dim);
}
.team-choice-btn.selected {
    background: var(--primary-glow);
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

/* Pagination controls & SVG size constraints */
.pagination-wrapper {
    margin-top: var(--spacing-lg);
}

nav[role="navigation"] svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    max-width: 20px !important;
    max-height: 20px !important;
    display: inline-block;
    vertical-align: middle;
}

.w-5 {
    width: 1.25rem !important;
}

.h-5 {
    height: 1.25rem !important;
}


