:root {
    --bg: #0b1220;
    --bg-soft: #111b2e;
    --surface: #16233a;
    --surface-2: #1d2d47;
    --border: #24344f;
    --text: #e8eefc;
    --muted: #93a4c1;
    --primary: #22c55e;
    --primary-dark: #16a34a;
    --accent: #f59e0b;
    --danger: #ef4444;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --max: 1200px;
    --font: "Segoe UI", "Tahoma", "Noto Naskh Arabic", "Arial", sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: radial-gradient(circle at top, #142038 0%, var(--bg) 45%) fixed;
    color: var(--text);
    font-family: var(--font);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }

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

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 18, 32, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 64px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
}

.brand .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 12px var(--primary);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }

.main-nav a {
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--text);
    background: var(--surface-2);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    transition: 0.2s;
}
.icon-btn:hover { background: var(--surface-2); }

.menu-toggle { display: none; }

/* Search bar */
.search-bar {
    display: none;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}
.search-bar.open { display: block; }

.search-form {
    display: flex;
    gap: 8px;
}

.search-form input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    outline: none;
}
.search-form input:focus { border-color: var(--primary); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 999px;
    border: none;
    background: var(--primary);
    color: #04210f;
    font-weight: 800;
    font-size: 14px;
    transition: 0.2s;
}
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { background: var(--surface-2); }
.btn-block { width: 100%; }

/* Layout */
.page { padding: 26px 0 60px; }

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 30px 0 16px;
}
.section-head h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-head h2::before {
    content: "";
    width: 6px;
    height: 22px;
    border-radius: 6px;
    background: var(--primary);
    display: inline-block;
}
.section-head .more { color: var(--muted); font-size: 14px; font-weight: 700; }
.section-head .more:hover { color: var(--primary); }

.grid {
    display: grid;
    gap: 16px;
}
.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-6 { grid-template-columns: repeat(6, 1fr); }

/* Cards */
.card {
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
    transform: translateY(-3px);
    border-color: #33507a;
    box-shadow: var(--shadow);
}

.news-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.news-card .thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--surface-2);
}
.news-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s;
}
.news-card:hover .thumb img { transform: scale(1.05); }

.news-card .body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.news-card h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card .meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.14);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.play-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 10, 20, 0.25);
}
.play-badge span {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(11, 18, 32, 0.7);
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
}

/* Hero */
.hero-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 16px;
}
.hero-main {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 340px;
    display: flex;
    align-items: flex-end;
    background: var(--surface-2);
}
.hero-main img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-main::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(4, 9, 18, 0.95), rgba(4, 9, 18, 0.1) 60%);
}
.hero-main .hero-body {
    position: relative;
    z-index: 2;
    padding: 22px;
}
.hero-main h1 {
    margin: 8px 0 0;
    font-size: 26px;
    line-height: 1.45;
    font-weight: 800;
}
.hero-side {
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    gap: 12px;
}
.hero-side .mini {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    overflow: hidden;
}
.hero-side .mini img {
    width: 96px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.hero-side .mini h3 {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Teams / leagues chips */
.chip-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}
.chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    transition: 0.2s;
}
.chip:hover { border-color: var(--primary); transform: translateY(-2px); }
.chip img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}
.chip span {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Reels */
.reel-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.reel {
    position: relative;
    aspect-ratio: 9 / 14;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-2);
}
.reel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s;
}
.reel:hover img { transform: scale(1.06); }
.reel .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(4, 9, 18, 0.9), transparent 55%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    gap: 6px;
}
.reel .overlay h3 {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.reel .views { font-size: 12px; color: var(--muted); }

/* Page header */
.page-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    margin-bottom: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.page-head img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: var(--surface-2);
    border-radius: 12px;
    padding: 6px;
}
.page-head h1 { margin: 0; font-size: 24px; }
.page-head .sub { color: var(--muted); font-size: 13px; }

/* Tabs */
.tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 18px;
}
.tabs a {
    padding: 9px 18px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
}
.tabs a.active, .tabs a:hover { background: var(--primary); color: #04210f; border-color: var(--primary); }

/* Tables */
.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
table.data {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}
table.data th, table.data td {
    padding: 11px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
table.data th {
    background: var(--surface-2);
    color: var(--muted);
    font-weight: 700;
    font-size: 13px;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: rgba(34, 197, 94, 0.05); }
table.data .team-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right;
    font-weight: 700;
    white-space: nowrap;
}
table.data .team-cell img { width: 26px; height: 26px; object-fit: contain; }
table.data .pos { font-weight: 800; color: var(--muted); }
table.data .points { font-weight: 800; color: var(--primary); }

/* Matches */
.match-group {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}
.match-group-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.match-group-head img { width: 30px; height: 30px; object-fit: contain; }
.match-group-head h2 { margin: 0; font-size: 16px; }

.match-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.match-row:last-child { border-bottom: none; }
.match-team {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 14px;
}
.match-team.away { justify-content: flex-end; text-align: left; }
.match-team img { width: 34px; height: 34px; object-fit: contain; }
.match-center { text-align: center; min-width: 120px; }
.match-score {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2px;
}
.match-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(34, 197, 94, 0.14);
    color: var(--primary);
}
.match-status.live { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }
.match-time { font-size: 13px; color: var(--muted); }

.day-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 18px;
}
.day-strip a {
    flex-shrink: 0;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    text-align: center;
}
.day-strip a.active, .day-strip a:hover { background: var(--primary); color: #04210f; border-color: var(--primary); }

/* Article */
.article {
    max-width: 860px;
    margin: 0 auto;
}
.article-head h1 {
    font-size: 30px;
    line-height: 1.5;
    margin: 12px 0;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 18px;
}
.article-image {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 22px;
    background: var(--surface-2);
}
.article-image img { width: 100%; max-height: 480px; object-fit: cover; }
.article-content {
    font-size: 18px;
    line-height: 2;
    color: #dbe5f7;
}
.article-content p { margin: 0 0 18px; }
.article-content a { color: var(--primary); text-decoration: underline; }
.article-content img { border-radius: var(--radius-sm); margin: 16px 0; }
.article-content h2, .article-content h3 { color: var(--text); }

/* Video */
.video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    margin-bottom: 20px;
}
.video-frame iframe { width: 100%; height: 100%; border: 0; }

/* Album */
.album-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.album-grid a {
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--surface-2);
}
.album-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.album-grid a:hover img { transform: scale(1.05); }

/* Player */
.player-card {
    display: flex;
    gap: 24px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 22px;
}
.player-card img {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface-2);
    border: 3px solid var(--primary);
}
.player-card h1 { margin: 0 0 6px; font-size: 28px; }
.info-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 20px;
}
.info-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--muted);
}
.info-list li span { color: var(--text); font-weight: 700; }

/* Empty state */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}
.empty h3 { color: var(--text); margin: 0 0 8px; }

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    padding: 26px 0;
    margin-top: 30px;
    color: var(--muted);
    font-size: 13px;
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--primary); }

/* Forms / auth */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0 0 6px; font-size: 24px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

.field { margin-bottom: 16px; }
.field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--muted);
}
.field input, .field select {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
    font-size: 14px;
    outline: none;
}
.field input:focus, .field select:focus { border-color: var(--primary); }
.field .error { color: #fca5a5; font-size: 12px; margin-top: 5px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.checkbox input { width: auto; }

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
}
.alert-success { background: rgba(34, 197, 94, 0.12); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.3); }
.alert-error { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Installer */
.install-wrap { max-width: 760px; margin: 40px auto; padding: 0 16px; }
.install-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    margin-bottom: 18px;
}
.install-card h1 { margin: 0 0 4px; font-size: 26px; }
.install-card h2 { margin: 0 0 14px; font-size: 18px; }
.req-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.req-list li:last-child { border-bottom: none; }
.req-ok { color: var(--primary); font-weight: 800; }
.req-bad { color: #fca5a5; font-weight: 800; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.db-block.is-hidden { display: none; }
.db-test { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.db-test .hint { margin-top: 0; }
.db-test .hint.ok { color: var(--primary); font-weight: 700; }
.db-test .hint.bad { color: #fca5a5; font-weight: 700; }

/* Admin */
.admin-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 26px;
}
.admin-top h1 { margin: 0; font-size: 24px; }
.admin-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 24px;
    text-align: center;
    color: var(--muted);
}
.admin-panel h2 { color: var(--text); margin: 0 0 8px; }
.inline-form { display: inline; }

/* Responsive */
@media (max-width: 1000px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
    .grid-6 { grid-template-columns: repeat(4, 1fr); }
    .reel-grid { grid-template-columns: repeat(3, 1fr); }
    .chip-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 760px) {
    .header-inner { height: 58px; gap: 10px; }
    .brand { font-size: 19px; }
    .main-nav {
        position: fixed;
        inset: 58px 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--bg-soft);
        border-bottom: 1px solid var(--border);
        padding: 10px;
        gap: 2px;
        max-height: calc(100vh - 58px);
        overflow-y: auto;
        transform: translateY(-120%);
        transition: transform 0.25s;
        z-index: 40;
    }
    .main-nav.open { transform: translateY(0); }
    .main-nav a { padding: 12px 14px; border-radius: var(--radius-sm); }
    .menu-toggle { display: inline-flex; }
    .header-actions .hide-mobile { display: none; }

    .hero-grid { grid-template-columns: 1fr; }
    .hero-main { min-height: 260px; }
    .hero-main h1 { font-size: 20px; }
    .hero-side { grid-template-rows: none; grid-template-columns: 1fr; }
    .hero-side .mini:nth-child(n+3) { display: none; }

    .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: repeat(2, 1fr); }
    .reel-grid { grid-template-columns: repeat(2, 1fr); }
    .chip-grid { grid-template-columns: repeat(3, 1fr); }
    .album-grid { grid-template-columns: repeat(2, 1fr); }
    .info-list { grid-template-columns: 1fr; }
    .player-card { flex-direction: column; text-align: center; }
    .article-head h1 { font-size: 23px; }
    .article-content { font-size: 16px; }
    .form-row { grid-template-columns: 1fr; }
    .match-team { font-size: 13px; gap: 6px; }
    .match-team img { width: 28px; height: 28px; }
    .match-row { grid-template-columns: 1fr auto 1fr; padding: 12px 10px; gap: 6px; }
    .match-center { min-width: 84px; }
}

@media (max-width: 420px) {
    .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
    .chip-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Load more */
.load-more-wrap { display: flex; justify-content: center; margin: 26px 0 10px; }
.load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    padding: 12px 26px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    transition: opacity 0.2s;
}
.load-more:hover { opacity: 0.88; }

/* Match details */
.match-hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 18px;
    margin-bottom: 22px;
    text-align: center;
}
.match-league { display: inline-block; margin-bottom: 16px; color: var(--primary); font-weight: 800; font-size: 14px; }
.match-hero-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; }
.match-hero-team { display: flex; flex-direction: column; align-items: center; gap: 10px; font-weight: 800; }
.match-hero-team img { width: 84px; height: 84px; object-fit: contain; }
.match-hero-center { min-width: 130px; }
.match-hero-score { font-size: 38px; font-weight: 900; letter-spacing: 2px; }
.match-status { margin-top: 6px; color: var(--primary); font-weight: 800; font-size: 14px; }
.match-date { margin-top: 6px; color: var(--muted); font-size: 13px; }
.match-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.match-meta div { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.match-meta span { color: var(--muted); }
.match-meta strong { font-size: 14px; }

.h2h-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; text-align: center; }
.h2h-total { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.h2h-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.h2h-grid div { display: flex; flex-direction: column; gap: 4px; }
.h2h-grid strong { font-size: 26px; color: var(--primary); }
.h2h-grid span { color: var(--muted); font-size: 13px; }

.recent-row { display: grid; grid-template-columns: 1.2fr 1fr auto 1fr; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.recent-row:last-child { border-bottom: none; }
.recent-row strong { color: var(--primary); font-size: 16px; }
.recent-date { display: flex; flex-direction: column; color: var(--muted); font-size: 12px; }
.recent-date span { color: var(--text); font-size: 11px; }

.lineup-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 22px; }
.lineup-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.lineup-team { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.lineup-team img { width: 40px; height: 40px; object-fit: contain; }
.lineup-label { color: var(--muted); font-size: 12px; font-weight: 800; margin: 12px 0 8px; }
.lineup-player { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.lineup-player img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.lineup-number { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 800; }

.event-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.event-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; }
.event-item.away { flex-direction: row-reverse; text-align: left; }
.event-minute { min-width: 42px; color: var(--muted); font-weight: 800; }
.event-type { padding: 3px 8px; border-radius: 999px; background: var(--surface-2); font-size: 11px; font-weight: 800; white-space: nowrap; }
.event-type.goal, .event-type.penalty { background: rgba(34, 197, 94, 0.18); color: var(--primary); }
.event-type.yellow { background: rgba(250, 204, 21, 0.2); color: #facc15; }
.event-type.red { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.event-type.sub { background: rgba(59, 130, 246, 0.18); color: #60a5fa; }
.event-body { display: flex; flex-direction: column; gap: 2px; }
.event-body span { color: var(--muted); font-size: 12px; }

.stats-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 22px; }
.stat-row { display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; gap: 10px; margin-bottom: 12px; font-weight: 800; font-size: 13px; }
.stat-row > span:first-child { text-align: left; }
.stat-row > span:nth-child(3) { text-align: right; }
.stat-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.stat-bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.stat-label { grid-column: 1 / -1; text-align: center; color: var(--muted); font-weight: 600; font-size: 12px; margin-top: -6px; }

/* Team / player extras */
.player-head-body { flex: 1; }
.club-badge { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 700; }
.club-badge img { width: 22px !important; height: 22px !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; }
.player-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.player-tags span { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; }

.stats-block { margin-bottom: 18px; }
.stats-block h3 { margin: 0 0 8px; font-size: 15px; color: var(--muted); }

.trophy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 22px; }
.trophy-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.trophy-title { font-weight: 800; margin-bottom: 4px; }
.trophy-item small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.trophy-meta { display: flex; gap: 8px; font-size: 12px; color: var(--muted); }
.trophy-meta .medal { color: #facc15; font-weight: 800; }

.transfer-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.transfer-item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.transfer-item > img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.transfer-main { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.transfer-main a { font-weight: 800; }
.transfer-main span, .transfer-main small { color: var(--muted); font-size: 12px; }
.transfer-clubs { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.transfer-clubs .arrow { color: var(--muted); }
.transfer-details { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12px; }
.transfer-badge { padding: 4px 10px; border-radius: 999px; background: rgba(34, 197, 94, 0.16); color: var(--primary); font-size: 12px; font-weight: 800; white-space: nowrap; }
.transfer-badge.out { background: rgba(239, 68, 68, 0.16); color: #ef4444; }

.reel-frame { aspect-ratio: 9 / 16; max-width: 460px; margin-inline: auto; }
.reel-frame video { width: 100%; height: 100%; object-fit: contain; background: #000; }

@media (max-width: 700px) {
    .lineup-grid { grid-template-columns: 1fr; }
    .trophy-grid { grid-template-columns: 1fr; }
    .recent-row { grid-template-columns: 1fr auto 1fr; }
    .recent-date { grid-column: 1 / -1; }
    .match-hero-team img { width: 62px; height: 62px; }
    .match-hero-score { font-size: 30px; }
}

/* League teams carousel */
.league-teams {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 2px 14px;
    margin-bottom: 14px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}
.league-teams::-webkit-scrollbar { height: 6px; }
.league-teams::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.league-team {
    flex: 0 0 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    text-align: center;
    scroll-snap-align: start;
}
.league-team img { width: 48px; height: 48px; object-fit: contain; }
.league-team span { font-size: 12px; font-weight: 700; line-height: 1.3; }

/* League fixtures */
.fixtures-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 6px 0 12px;
}
.fixtures-head h2 { margin: 0; font-size: 18px; }
.week-filter { display: flex; align-items: center; gap: 8px; }
.week-filter label { color: var(--muted); font-size: 13px; font-weight: 700; }
.week-filter select {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font: inherit;
    font-weight: 700;
}
.week-filter button {
    background: var(--primary);
    color: #04110b;
    border: 0;
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font: inherit;
    font-weight: 800;
}
.fixture-group { margin-bottom: 18px; }
.fixture-group h3 {
    margin: 0 0 8px;
    padding: 8px 12px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 13px;
}
.fixture-row {
    display: grid;
    grid-template-columns: 1fr 110px 1fr;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}
.fixture-team { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; min-width: 0; }
.fixture-team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fixture-team.home { justify-content: flex-end; text-align: right; }
.fixture-team.away { justify-content: flex-start; }
.fixture-team img { width: 34px; height: 34px; object-fit: contain; flex: 0 0 auto; }
.fixture-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}
.fixture-center strong { font-size: 15px; letter-spacing: 1px; }
.fixture-status { color: var(--muted); font-size: 11px; font-weight: 700; }
.fixture-row.Finished .fixture-center strong { color: var(--primary); }

@media (max-width: 700px) {
    .fixture-row { grid-template-columns: 1fr 88px 1fr; padding: 8px; }
    .fixture-team { font-size: 12px; gap: 6px; }
    .fixture-team img { width: 28px; height: 28px; }
    .league-team { flex-basis: 80px; }
}

/* Admin app connection */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}
.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 18px;
}
.admin-grid .admin-card { margin-bottom: 0; }
.admin-card h2 {
    margin: 0 0 10px;
    font-size: 18px;
    color: var(--text);
}
.admin-card p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}
.copy-field {
    display: flex;
    align-items: center;
    gap: 8px;
}
.copy-field input {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
    font-size: 14px;
    outline: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.copy-field input:focus { border-color: var(--primary); }
.key-box {
    display: block;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    letter-spacing: 1px;
    word-break: break-all;
    user-select: all;
}
.code-block {
    margin: 12px 0 0;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    text-align: left;
}
.endpoint-table code {
    color: var(--primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    white-space: nowrap;
}
.endpoint-table td:first-child {
    color: var(--muted);
    font-weight: 800;
    font-size: 12px;
}
.btn-danger {
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.28); color: #fff; }
.setup-steps {
    margin: 0;
    padding-inline-start: 22px;
    color: var(--muted);
    font-size: 14px;
}
.setup-steps li { margin-bottom: 8px; }
.setup-steps code {
    color: var(--primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
}

@media (max-width: 760px) {
    .admin-grid { grid-template-columns: 1fr; }
    .copy-field { flex-wrap: wrap; }
}
