/* =====================================================
   OpenMatchDay v5 — Mobile-First Stylesheet
   Design: Dark theme default, gold accent, card-based UI
   Fonts: Montserrat (headings) + Inter (body)
   Breakpoints: 480px (sm), 768px (md), 1024px (lg), 1200px (xl)
   ===================================================== */

/* ─── CSS Variables ──────────────────────────────────── */

:root {
    --nav-height: 60px;
    --toolbar-height: 48px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 4px;
    --shadow: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.3);
    --transition: 0.2s ease;
    --container: 1100px;
    --accent: #F5A623;
    --accent-hover: #e6950f;
    --accent-rgb: 245, 166, 35;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
}

[data-theme="dark"] {
    --bg: #0f0b1e;
    --bg-card: #1a1530;
    --bg-card-hover: #221d3a;
    --bg-nav: rgba(15, 11, 30, 0.95);
    --bg-input: #1e1838;
    --text: #f0edf7;
    --text-muted: #b0a9c4;
    --text-dim: #7a7490;
    --border: #2d2747;
    --border-hover: #3d3757;
    --accent-text: var(--accent);
    --success-text: var(--success);
    --warning-text: var(--warning);
}

[data-theme="light"] {
    --bg: #f5f5f8;
    --bg-card: #ffffff;
    --bg-card-hover: #fafafe;
    --bg-nav: rgba(255, 255, 255, 0.95);
    --bg-input: #f0f0f5;
    --text: #1a1a2e;
    --text-muted: #5c5670;
    --text-dim: #8a84a0;
    --border: #e0dde8;
    --border-hover: #d0cdd8;
    --accent-text: #b07800;
    --success-text: #16803a;
    --warning-text: #b45309;
}

/* ─── Reset & Base ───────────────────────────────────── */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

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

a {
    color: var(--accent-text);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

img { max-width: 100%; height: auto; display: block; }
table { border-collapse: collapse; width: 100%; }

/* ─── Accessibility ──────────────────────────────────── */

.skip-nav {
    position: absolute;
    left: -10000px;
    top: 0;
    padding: 12px 24px;
    background: var(--accent);
    color: #000;
    font-weight: 600;
    z-index: 9999;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.skip-nav:focus {
    left: 50%;
    transform: translateX(-50%);
}

/* Focus indicators */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ─── Container ──────────────────────────────────────── */

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .container { padding: 0 24px; }
}

/* ─── Announcement Bar ───────────────────────────────── */

.announcement-bar {
    background: var(--accent);
    color: #000;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 0;
    text-align: center;
    position: relative;
    z-index: 1001;
}
.announcement-bar .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.announcement-close {
    background: none;
    border: none;
    color: #000;
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    font-size: 1rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Navbar ─────────────────────────────────────────── */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.nav-brand:hover { color: var(--accent); }
.nav-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* Hamburger */
.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
}
.hamburger {
    width: 24px;
    height: 2px;
    background: var(--text);
    position: relative;
    transition: var(--transition);
}
.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--text);
    left: 0;
    transition: var(--transition);
}
.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

/* Hamburger active state */
.nav-toggle[aria-expanded="true"] .hamburger { background: transparent; }
.nav-toggle[aria-expanded="true"] .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}
.nav-toggle[aria-expanded="true"] .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
}

/* Mobile Menu */
.nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1001;
}
.nav-menu.open {
    transform: translateX(0);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    min-height: 48px;
}
.nav-link:hover,
.nav-link.active {
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}
.nav-link i { width: 20px; text-align: center; font-size: 1rem; }

.nav-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Desktop Nav */
@media (min-width: 1024px) {
    .nav-toggle { display: none; }

    .nav-menu {
        position: static;
        transform: none;
        flex-direction: row;
        background: none;
        padding: 0;
        gap: 2px;
        overflow: visible;
        align-items: center;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 0.85rem;
        min-height: auto;
        border-radius: var(--radius-xs);
    }
    .nav-link i { display: none; }
    .nav-link span { display: inline; }

    .nav-actions {
        margin-top: 0;
        padding-top: 0;
        border: none;
        margin-left: 8px;
    }
}

/* ─── Page Sections ──────────────────────────────────── */

.section {
    padding: 32px 0;
}
.section-title {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title i {
    color: var(--accent);
}

@media (min-width: 768px) {
    .section { padding: 48px 0; }
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.75rem; }
}

/* ─── Cards ──────────────────────────────────────────── */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all var(--transition);
}
.card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* ─── Buttons ────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1;
    min-height: 48px;
    min-width: 48px;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}
.btn-primary:hover {
    background: var(--accent-hover);
    color: #000;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: transparent;
    color: var(--accent-text);
    border: 2px solid var(--accent);
}
.btn-outline:hover {
    background: var(--accent);
    color: #000;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
    min-height: 44px;
}
.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
}
.btn-block { width: 100%; }

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ─── Forms ──────────────────────────────────────────── */

.form-group {
    margin-bottom: 20px;
}
.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}
.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}
.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--text);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    min-height: 48px;
    appearance: none;
    -webkit-appearance: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}
.form-input::placeholder { color: var(--text-dim); }

.form-textarea {
    min-height: 120px;
    resize: vertical;
}
.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239b95ad' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
    cursor: pointer;
}

.form-row {
    display: grid;
    gap: 16px;
}
@media (min-width: 768px) {
    .form-row { grid-template-columns: 1fr 1fr; }
    .form-row.three-col { grid-template-columns: 1fr 1fr 1fr; }
}

/* ─── Alerts ─────────────────────────────────────────── */

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: rgba(34,197,94,0.15); color: var(--success-text); border: 1px solid rgba(34,197,94,0.3); }
.alert-danger  { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.alert-warning { background: rgba(245,158,11,0.15); color: var(--warning-text); border: 1px solid rgba(245,158,11,0.3); }
.alert-info    { background: rgba(59,130,246,0.15); color: var(--info); border: 1px solid rgba(59,130,246,0.3); }

/* ─── Badges ─────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 100px;
}
.badge-live {
    background: var(--danger);
    color: #fff;
    animation: live-pulse 2s infinite;
}
.badge-finished { background: var(--success); color: #fff; }
.badge-upcoming { background: var(--border-hover); color: var(--text); }

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ─── Hero Section ───────────────────────────────────── */

.hero {
    text-align: center;
    padding: 40px 0;
    position: relative;
}
.hero-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 16px;
    border: 3px solid var(--accent);
}
.hero h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 12px;
}
.hero-description {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 24px;
    line-height: 1.7;
}
.hero-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.hero-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.hero-info-item i { color: var(--accent); }
.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}
.hero-banner {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-top: 32px;
}

@media (min-width: 768px) {
    .hero { padding: 60px 0; }
    .hero h1 { font-size: 2.75rem; }
    .hero-logo { width: 120px; height: 120px; }
}

/* ─── Countdown ──────────────────────────────────────── */

.countdown {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}
.countdown-item {
    text-align: center;
    min-width: 60px;
}
.countdown-number {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    display: block;
}
.countdown-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* ─── Match Cards ────────────────────────────────────── */

.match-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 8px;
    transition: all var(--transition);
    text-decoration: none;
    color: var(--text);
    position: relative;
    overflow: hidden;
}
.match-card:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.match-card.match-live {
    border-color: var(--danger);
    box-shadow: 0 0 0 1px var(--danger);
}

.match-card-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}

.match-team {
    display: flex;
    align-items: center;
    gap: 10px;
}
.match-home { justify-content: flex-end; text-align: right; }
.match-away { justify-content: flex-start; text-align: left; }

.team-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.match-num {
    font-size: 0.65rem;
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.match-vs {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
}

.match-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 60px;
}

.match-score {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
}
.match-time {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.match-type-tag {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--accent);
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 0 0 var(--radius-sm) 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Team Logo ──────────────────────────────────────── */

.team-logo-sm { width: 32px; height: 32px; }
.team-logo-md { width: 48px; height: 48px; }
.team-logo-lg { width: 64px; height: 64px; }
.team-logo-xl { width: 80px; height: 80px; }

.team-logo-img {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.team-logo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-input);
    border: 2px solid var(--border);
    color: var(--text-muted);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    flex-shrink: 0;
}

/* ─── Standings Table ────────────────────────────────── */

.standings-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.standings-table table {
    min-width: 500px;
}

.standings-table th,
.standings-table td {
    padding: 12px 10px;
    text-align: center;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.standings-table th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-card);
    position: sticky;
    top: 0;
}

.standings-table td:first-child,
.standings-table th:first-child {
    text-align: center;
    width: 40px;
}

.standings-table .team-cell {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.standings-table .points-cell {
    font-weight: 800;
    color: var(--accent);
    font-family: 'Montserrat', sans-serif;
}

.standings-table tr:hover td {
    background: var(--bg-card-hover);
}

/* Qualify indicator */
.standings-table tr.qualifies td:first-child {
    border-left: 3px solid var(--success);
}

/* ─── Grid Layouts ───────────────────────────────────── */

.grid {
    display: grid;
    gap: 16px;
}
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
.stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

@media (min-width: 768px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ─── Stat Cards ─────────────────────────────────────── */

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}
.stat-number {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    display: block;
}
.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Team Grid (showcase) ───────────────────────────── */

.team-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.team-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
}
.team-grid-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: var(--text);
}
.team-grid-item .team-name {
    font-size: 0.85rem;
    text-align: center;
}

@media (min-width: 480px) {
    .team-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
    .team-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1024px) {
    .team-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ─── Primary Sponsor Banner ─────────────────────────── */

.sponsor-banner {
    text-align: center;
    padding: 24px;
    margin: 24px 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.sponsor-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: block;
}
.sponsor-logo {
    max-height: 60px;
    max-width: 200px;
    margin: 0 auto;
    filter: brightness(0) invert(1);
    opacity: 0.8;
    transition: opacity var(--transition);
}
[data-theme="light"] .sponsor-logo { filter: none; }
.sponsor-logo:hover { opacity: 1; }
.sponsor-name {
    font-weight: 600;
    font-size: 1.1rem;
}

/* ─── Footer ─────────────────────────────────────────── */

.site-footer {
    margin-top: auto;
    padding: 32px 0 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.footer-sponsor {
    margin-bottom: 24px;
}
.footer-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.footer-tournament {
    margin-bottom: 12px;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
}
.footer-links a {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.footer-links a:hover { color: var(--accent); }
.footer-copyright {
    font-size: 0.75rem;
    color: var(--text-dim);
}
.footer-copyright a { color: var(--accent); }

/* ─── Admin Toolbar ──────────────────────────────────── */

.admin-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-nav);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(12px);
}
.toolbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    max-width: var(--container);
    margin: 0 auto;
    height: var(--toolbar-height);
}
.toolbar-user {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: none;
}
.toolbar-actions {
    display: flex;
    gap: 4px;
}
.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    min-height: 44px;
    text-decoration: none;
}
.toolbar-btn:hover {
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}
.toolbar-label { display: none; }
.toolbar-toggle {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .toolbar-user { display: flex; align-items: center; gap: 6px; }
    .toolbar-label { display: inline; }
}

/* Add bottom padding when toolbar visible */
body:has(.admin-toolbar) {
    padding-bottom: var(--toolbar-height);
}

/* ─── Toast Notifications ────────────────────────────── */

.toast-container {
    position: fixed;
    top: calc(var(--nav-height) + 12px);
    right: 12px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: calc(100vw - 24px);
    width: 360px;
}
.toast {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast-success { background: var(--success); color: #fff; }
.toast-error   { background: var(--danger); color: #fff; }
.toast-warning { background: var(--warning); color: #000; }
.toast-info    { background: var(--info); color: #fff; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Animations ─────────────────────────────────────── */

@keyframes goalFlash {
    0%, 100% { background: var(--bg-card); }
    50% { background: rgba(var(--accent-rgb), 0.2); }
}

.goal-flash {
    animation: goalFlash 0.5s ease 3;
}

/* ─── Live Feed ──────────────────────────────────────── */

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.feed-item {
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}
.feed-item.pinned {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.05);
}
.feed-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 4px;
}
.feed-type-goal { border-left: 3px solid var(--success); }
.feed-type-card { border-left: 3px solid var(--warning); }
.feed-type-status { border-left: 3px solid var(--info); }

/* ─── Admin Layout ───────────────────────────────────── */

.admin-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}
.admin-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.admin-title {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-title i { color: var(--accent); }

.admin-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}
.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    text-decoration: none;
    min-height: 48px;
}
.admin-nav-item:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.admin-nav-item i {
    color: var(--accent);
    width: 20px;
    text-align: center;
}

@media (min-width: 480px) {
    .admin-nav { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
    .admin-nav { grid-template-columns: repeat(4, 1fr); }
}

/* ─── Tables (generic) ───────────────────────────────── */

.data-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.data-table table {
    min-width: 600px;
}
.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}
.data-table th {
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}
.data-table tr:hover td {
    background: var(--bg-card-hover);
}
.data-table .actions {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

/* ─── Login Page ─────────────────────────────────────── */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
}
.login-logo {
    text-align: center;
    margin-bottom: 24px;
}
.login-logo img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 12px;
}
.login-logo h1 {
    font-size: 1.5rem;
}
.login-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-dim);
    font-size: 0.8rem;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--border);
}

/* ─── Wizard ─────────────────────────────────────────── */

.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    position: relative;
    counter-reset: step;
}
.wizard-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
    z-index: 0;
}
.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
    flex: 1;
}
.wizard-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.wizard-step.active .wizard-step-number {
    border-color: var(--accent);
    background: var(--accent);
    color: #000;
}
.wizard-step.completed .wizard-step-number {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}
.wizard-step-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    display: none;
}
.wizard-step.active .wizard-step-label { color: var(--accent); }

@media (min-width: 480px) {
    .wizard-step-label { display: block; }
}

/* ─── Filter Tabs ────────────────────────────────────── */

.filter-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}
.filter-tab {
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
    min-height: 44px;
    text-decoration: none;
}
.filter-tab:hover,
.filter-tab.active {
    color: #000;
    background: var(--accent);
    border-color: var(--accent);
}

/* ─── Print ──────────────────────────────────────────── */

@media print {
    .navbar, .admin-toolbar, .toast-container, .announcement-bar,
    .nav-toggle, .skip-nav, .filter-tabs, .hero-buttons { display: none !important; }
    body { background: #fff !important; color: #000 !important; padding: 0; font-size: 11pt; }
    .section { padding: 12px 0; }
    .container { max-width: 100%; padding: 0 10mm; }
    .card { border: 1px solid #ccc; box-shadow: none; background: #fff; padding: 12px; break-inside: avoid; }
    .match-card { break-inside: avoid; border: 1px solid #ccc; margin-bottom: 4px; padding: 8px 12px; }
    .match-score { color: #000; font-size: 1.2rem; }
    .match-type-tag { background: #eee; color: #000; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .standings-table table { min-width: auto; }
    .standings-table th { background: #f0f0f0; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .standings-table tr.qualifies td:first-child { border-left: 3px solid #22c55e; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .badge { border: 1px solid #ccc; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .team-logo-placeholder { border: 1px solid #ccc; background: #f0f0f0; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    a { color: #000; text-decoration: none; }
    h1 { font-size: 18pt; }
    h2 { font-size: 14pt; }
    h3 { font-size: 12pt; }
    .section-title i { display: none; }
    .footer-copyright { font-size: 8pt; }
    @page { size: A4; margin: 15mm; }
}

/* ─── Utility Classes ────────────────────────────────── */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }

.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ─── Playoff Bracket ───────────────────────────────── */

.bracket-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
@media (min-width: 768px) {
    .bracket-container {
        flex-direction: row;
        align-items: flex-start;
        gap: 0;
    }
}

.bracket-seeds {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bracket-seed {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    min-height: 48px;
}
.bracket-seed .seed-pos {
    font-weight: 800;
    font-family: 'Montserrat', sans-serif;
    color: var(--accent);
    min-width: 24px;
    text-align: center;
}
.bracket-seed .seed-name { font-weight: 600; flex: 1; }
.bracket-seed .seed-pts {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
}
.bracket-seed.dimmed { opacity: 0.45; }

.bracket-connectors {
    display: none;
    flex: 0 0 80px;
    align-self: stretch;
}
@media (min-width: 768px) {
    .bracket-connectors { display: flex; align-items: center; justify-content: center; }
}

.bracket-finals {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bracket-final-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
}
.bracket-final-card.bracket-a-final { border-color: var(--accent); }

.bracket-final-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    color: var(--text-muted);
}
.bracket-final-card.bracket-a-final .bracket-final-title { color: var(--accent); }

.bracket-final-team {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}
.bracket-final-team.bracket-winner {
    background: rgba(var(--accent-rgb), 0.12);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
}
.bracket-final-score {
    margin-left: auto;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
}
.bracket-final-vs {
    text-align: center;
    color: var(--text-dim);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 4px 0;
}
.bracket-tbd {
    color: var(--text-dim);
    font-style: italic;
    padding: 10px 12px;
}

/* Full bracket (QF → SF → Final) */
.bracket-full {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
@media (min-width: 768px) {
    .bracket-full {
        flex-direction: row;
        align-items: flex-start;
        gap: 0;
    }
}
.bracket-round {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.bracket-round-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}
.bracket-match {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
}
.bracket-match-team {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    font-size: 0.85rem;
    border-radius: var(--radius-xs);
}
.bracket-match-team.winner {
    background: rgba(var(--accent-rgb), 0.1);
    font-weight: 700;
}
.bracket-match-team .score {
    margin-left: auto;
    font-weight: 800;
    font-family: 'Montserrat', sans-serif;
    color: var(--accent);
}
.bracket-match-vs {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px;
}
.bracket-connector-col {
    display: none;
    flex: 0 0 40px;
}
@media (min-width: 768px) {
    .bracket-connector-col { display: block; }
}

/* ─── Admin Button Labels ───────────────────────────── */

.btn-icon-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn .btn-text,
.btn-icon-label .btn-text {
    display: none;
}
@media (min-width: 768px) {
    .btn .btn-text,
    .btn-icon-label .btn-text { display: inline; }
}

/* ─── Inline Form Validation ────────────────────────── */

.form-input:invalid:not(:placeholder-shown),
.form-select:invalid:not(:placeholder-shown) {
    border-color: var(--danger);
}
.form-input:valid:not(:placeholder-shown) {
    border-color: var(--success);
}
.form-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ─── Quill Editor ──────────────────────────────────── */

.ql-toolbar.ql-snow {
    border-color: var(--border) !important;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
    background: var(--bg-input);
}
.ql-container.ql-snow {
    border-color: var(--border) !important;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
    background: var(--bg-input);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--text);
    min-height: 150px;
}
.ql-editor { min-height: 150px; }
.ql-editor.ql-blank::before { color: var(--text-dim); font-style: italic; }
.ql-snow .ql-stroke { stroke: var(--text-muted) !important; }
.ql-snow .ql-fill { fill: var(--text-muted) !important; }
.ql-snow .ql-picker-label { color: var(--text-muted) !important; }
.html-help-note {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ─── Position separator ────────────────────────────── */

.position-separator {
    border: none;
    border-top: 1px dashed var(--border);
    margin: 4px 0;
}

/* ─── Standings — remove horizontal scroll on desktop ─ */

@media (min-width: 768px) {
    .standings-table table { min-width: auto; }
}

/* ─── Accent text utility ───────────────────────────── */

.text-accent { color: var(--accent-text); }
