:root {
    --primary: #38003c;
    --primary-2: #56115a;
    --secondary: #00ff85;
    --accent: #e90052;
    --bg: #f4f6fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #667085;
    --border: #e4e7ec;
    --success: #067647;
    --danger: #d92d20;
    --warning: #f79009;
    --shadow: 0 12px 32px rgba(16, 24, 40, 0.08);
    --radius: 18px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Inter, Segoe UI, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    text-decoration: none;
    color: inherit;
}

.wrap {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}

.container {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--primary);
    color: white;
    box-shadow: 0 6px 20px rgba(0,0,0,.18);
}

.header-row,
.nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
    color: #fff;
}

.brand-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: var(--secondary);
    color: var(--primary);
}

.main-nav,
.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.main-nav a,
.nav a {
    color: #fff;
    font-weight: 700;
    opacity: .92;
}

.main-nav a.active,
.main-nav a:hover,
.nav a.active,
.nav a:hover {
    color: var(--secondary);
    opacity: 1;
}

.admin-mini {
    font-size: .92rem;
    color: rgba(255,255,255,.9);
}

.page-shell {
    padding: 28px 0 46px;
}

.season-bar {
    padding: 14px 0;
}

.season-select-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: white;
    border-radius: 26px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 26px;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: clamp(2rem, 4vw, 3rem);
}

.hero p {
    margin: 0;
    color: rgba(255,255,255,.85);
}

.hero-row,
.split,
.form-row,
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.live-pill {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    background: rgba(255,255,255,.12);
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 800;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--secondary);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%,100% { opacity: 1; }
    50% { opacity: .45; }
}

.card,
.match-card,
.award-card,
.team-card,
.player-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 20px;
}

.card h1,
.card h2,
.card h3 {
    margin-top: 0;
}

.grid {
    display: grid;
    gap: 22px;
}

.grid.cols-2,
.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cards-3,
.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stack {
    display: grid;
    gap: 16px;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: .88rem;
}

.mb-0 {
    margin-bottom: 0;
}

.match-list {
    display: grid;
    gap: 18px;
}

.match-card {
    display: block;
    border-radius: 20px;
    transition: .2s transform, .2s box-shadow;
}

.match-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(16,24,40,.12);
}

.match-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.pill {
    display: inline-block;
    border-radius: 999px;
    padding: 5px 10px;
    background: #f2f4f7;
    font-size: .78rem;
    font-weight: 800;
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.badge.live {
    background: var(--accent);
    color: white;
}

.badge.ht,
.badge.halftime {
    background: var(--warning);
    color: white;
}

.badge.ft {
    background: #344054;
    color: white;
}

.badge.scheduled {
    background: var(--secondary);
    color: var(--primary);
}

.teams-faceoff {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: center;
    margin-top: 18px;
}

.team-box {
    text-align: center;
}

.team-mark {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto 8px;
    background: #f8fafc;
    border: 1px solid var(--border);
    overflow: hidden;
    font-size: 2rem;
    font-weight: 800;
}

.team-mark img,
.team-logo-lg img,
.team-logo-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-logo-lg {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    font-size: 2rem;
}

.team-logo-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid var(--border);
    display: inline-grid;
    place-items: center;
    font-size: 1rem;
}

.team-name {
    font-weight: 800;
}

.score-big,
.match-score {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    color: var(--primary);
    text-align: center;
}

.kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.kv {
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
}

.kv .k {
    color: var(--muted);
    font-size: .85rem;
}

.kv .v {
    margin-top: 6px;
    font-weight: 900;
    font-size: 1.25rem;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

th {
    background: var(--primary);
    color: white;
    font-size: .92rem;
}

tr:nth-child(even) td {
    background: #fbfcfe;
}

.stats-center {
    text-align: center;
}

.points {
    font-weight: 900;
    color: var(--primary);
}

.team-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: white;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

button,
.button,
.stat-tab,
.pager a,
.pager span,
input[type=submit] {
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 900;
    background: var(--primary);
    color: white;
    text-decoration: none;
    display: inline-block;
}

button.secondary,
.button.secondary,
.stat-tab.secondary {
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
}

button.success,
.button.success {
    background: var(--success);
}

button.danger,
.button.danger {
    background: var(--danger);
}

.flash {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    font-weight: 800;
}

.flash.success,
.flash-success {
    background: #ecfdf3;
    color: #027a48;
}

.flash.error,
.flash-error {
    background: #fef3f2;
    color: #b42318;
}

.admin-layout,
.admin-grid {
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 22px;
}

.tab-sidebar {
    display: grid;
    gap: 10px;
    position: sticky;
    top: 88px;
    align-self: start;
}

.tab-btn,
.sidebar .tab-link {
    width: 100%;
    text-align: left;
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: 12px;
    padding: 12px;
    text-decoration: none;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.player-chip,
.event-item,
.fixture-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    background: white;
}

.list-clean {
    display: grid;
    gap: 10px;
}

.list-links a {
    display: block;
    padding: 12px 14px;
    background: #fff;
    margin-bottom: 10px;
    border-radius: 12px;
    text-decoration: none;
    color: #222;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    display: inline-block;
    margin-right: 8px;
}

.login-card {
    max-width: 520px;
    margin: 0 auto;
}

.site-footer {
    margin-top: 36px;
    padding: 10px 0 40px;
    background: transparent;
}

.footer-awards {
    margin-bottom: 20px;
}

.award-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.award-card img,
.player-photo {
    width: 100%;
    max-width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    background: #eee;
}

.award-card-footer {
    min-height: 150px;
}

.filters,
.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.disabled-link {
    pointer-events: none;
    opacity: .5;
}

@media (max-width: 980px) {
    .grid.cols-2,
    .admin-layout,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .tab-sidebar {
        position: static;
        grid-template-columns: repeat(auto-fit, minmax(160px,1fr));
    }
}

@media (max-width: 800px) {
    .grid-2,
    .grid-3,
    .award-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .nav-row,
    .header-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .teams-faceoff {
        grid-template-columns: 1fr;
    }

    .score-big {
        order: -1;
    }
}