:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --success: #16a34a;
    --error: #dc2626;
    --info: #0ea5e9;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Nav */
.nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.nav-brand {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.brand-icon { font-size: 1.5rem; }
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    font-size: .9rem;
    transition: color .15s;
}
.nav-links a:hover { color: var(--primary); }
.nav-user {
    color: var(--text-muted);
    font-size: .85rem;
    padding-left: .5rem;
    border-left: 1px solid var(--border);
}

/* Main */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
    width: 100%;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.card-title {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Grid */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }
.btn-danger { background: var(--error); color: #fff; }
.btn-sm { padding: .35rem .8rem; font-size: .8rem; }
.btn-block { width: 100%; justify-content: center; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-weight: 600;
    font-size: .85rem;
    margin-bottom: .3rem;
    color: var(--text);
}
.form-control {
    width: 100%;
    padding: .6rem .8rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: .9rem;
    transition: border-color .15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
select.form-control { appearance: auto; }
textarea.form-control { min-height: 100px; resize: vertical; }

/* Flash messages */
.flash-container {
    max-width: 1200px;
    margin: 1rem auto 0;
    padding: 0 1.5rem;
}
.flash {
    padding: .75rem 1rem;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 500;
    margin-bottom: .5rem;
}
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-info { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }

/* Tables */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
th, td {
    padding: .6rem .8rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    font-weight: 700;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--text-light);
    background: #f1f5f9;
}
tr:hover td { background: #f8fafc; }

/* Standings */
.standings-row-win { color: var(--success); font-weight: 600; }
.standings-row-loss { color: var(--error); }

/* Stats */
.stat-box {
    text-align: center;
    padding: 1rem;
}
.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}
.stat-label {
    font-size: .75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: .05em;
}

/* Score display */
.score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
}
.score-team {
    text-align: center;
    flex: 1;
}
.score-team-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: .5rem;
}
.score-number {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary);
}
.score-vs {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-muted);
}
.score-final {
    text-align: center;
    font-size: .8rem;
    text-transform: uppercase;
    color: var(--success);
    font-weight: 700;
    letter-spacing: .1em;
}

/* Photo gallery */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .75rem;
}
.photo-card {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
}
.photo-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.photo-card .caption {
    padding: .5rem .75rem;
    font-size: .8rem;
    color: var(--text-light);
}

/* Marketplace */
.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow .15s;
}
.product-card:hover { box-shadow: var(--shadow-lg); }
.product-card img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    padding: .5rem;
    background: #fafafa;
}
.product-info {
    padding: .75rem;
}
.product-title {
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--success);
    margin-top: .25rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: .15rem .6rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.badge-scheduled { background: var(--primary-light); color: var(--primary-dark); }
.badge-final { background: #dcfce7; color: #166534; }
.badge-cancelled { background: #fef2f2; color: #991b1b; }

/* Recap */
.recap-box {
    background: linear-gradient(135deg, #eff6ff, #fefce8);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1rem;
    line-height: 1.7;
    font-size: .95rem;
}
.recap-box h3 {
    font-size: .9rem;
    color: var(--primary);
    margin-bottom: .5rem;
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-title {
    font-size: 1.6rem;
    font-weight: 800;
}
.page-subtitle {
    color: var(--text-light);
    font-size: .9rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state-text { font-size: 1rem; }

/* Announcements */
.announcement {
    border-left: 3px solid var(--accent);
    padding: .75rem 1rem;
    margin-bottom: .75rem;
    background: #fffbeb;
    border-radius: 0 8px 8px 0;
}
.announcement.pinned { border-left-color: var(--primary); background: var(--primary-light); }
.announcement-title { font-weight: 700; font-size: .95rem; }
.announcement-meta { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }

/* Filter bar */
.filter-bar {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.filter-chip {
    padding: .4rem .9rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid var(--border);
    color: var(--text-light);
    transition: all .15s;
}
.filter-chip:hover, .filter-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 1.5rem;
    font-size: .8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links { gap: .75rem; }
    .score-display { gap: 1rem; padding: 1rem; }
    .score-number { font-size: 2rem; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
