/* ─── DivinitySports — Mobile-First Dark Theme ─────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800;900&display=swap');

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

:root {
    --bg:          #0b1120;
    --card:        #111b2e;
    --border:      #1e2a3a;
    --teal:        #5ce0d2;
    --blue:        #1A6CDB;
    --gold:        #D4A017;
    --green:       #6EE46E;
    --red:         #E8430A;
    --purple:      #9B30FF;
    --text:        #e2e8f0;
    --text-muted:  #8a9ab0;
    --text-dim:    #5a7a9a;
}

html, body {
    height: 100%;
    background: #060a14;
    font-family: 'DM Sans', -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: var(--text);
}

::-webkit-scrollbar { width: 0; height: 0; }

/* ─── App Shell ───────────────────────────────────────────────────── */

.app-shell {
    max-width: 390px;
    margin: 0 auto;
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.app-header {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-logo {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--teal), var(--blue));
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}

.app-title { font-size: 15px; font-weight: 800; color: #fff; line-height: 1.2; }
.app-subtitle { font-size: 10px; color: var(--text-dim); font-weight: 500; }

.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 16px;
}

/* ─── Bottom Navigation ───────────────────────────────────────────── */

.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 20px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: #4a5568;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.bottom-nav a.active { color: var(--teal); }

.bottom-nav svg { width: 22px; height: 22px; }

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

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 10px;
}

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

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

.hero {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    border-radius: 16px;
    padding: 24px 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.hero-bg-icon {
    position: absolute;
    top: -30px; right: -20px;
    font-size: 100px;
    opacity: 0.07;
}

.hero-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--teal);
    font-weight: 700;
    margin-bottom: 6px;
}

.hero-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 4px;
}

.hero-subtitle {
    font-size: 13px;
    color: #8899aa;
    margin-bottom: 16px;
}

/* ─── Stat Boxes ──────────────────────────────────────────────────── */

.stats-row {
    display: flex;
    gap: 12px;
}

.stat-box {
    background: rgba(92,224,210,0.12);
    border-radius: 10px;
    padding: 10px 14px;
    flex: 1;
    text-align: center;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--teal);
}

.stat-label {
    font-size: 10px;
    color: #7a8a9a;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ─── Section Headers ─────────────────────────────────────────────── */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.section-link {
    font-size: 12px;
    color: var(--teal);
    text-decoration: none;
    font-weight: 600;
}

.section-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

/* ─── Match Card ──────────────────────────────────────────────────── */

.match-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: block;
    text-decoration: none;
    color: inherit;
}

.match-meta {
    font-size: 10px;
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.match-team {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.match-team.right {
    justify-content: flex-end;
    text-align: right;
}

.match-team-logo { font-size: 18px; }
.match-team-code { font-size: 13px; font-weight: 700; }
.match-team-score { font-size: 14px; font-weight: 800; }
.match-vs { font-size: 11px; color: #4a5568; font-weight: 800; padding: 0 8px; }
.match-result { font-size: 11px; color: var(--green); font-weight: 600; margin-top: 8px; }
.winner { color: var(--teal); }
.loser { color: #556; }

/* ─── Team Grid ───────────────────────────────────────────────────── */

.team-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.team-card {
    border-radius: 12px;
    padding: 14px;
    text-decoration: none;
    color: inherit;
    display: block;
}

.team-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.team-card-name { font-size: 13px; font-weight: 700; color: var(--text); }
.team-card-motto { font-size: 11px; color: var(--text-dim); font-style: italic; }

/* ─── Sport Selector ──────────────────────────────────────────────── */

.sport-selector {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 20px;
}

.sport-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    min-width: 76px;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    color: inherit;
}

.sport-btn.active {
    border: 1.5px solid var(--teal);
    background: rgba(92,224,210,0.06);
}

.sport-btn:not(.active) { opacity: 0.85; }
.sport-btn-icon { font-size: 22px; }
.sport-btn-name { font-size: 10px; font-weight: 700; letter-spacing: 0.3px; }
.sport-btn.active .sport-btn-name { color: var(--teal); }
.sport-btn:not(.active) .sport-btn-name { color: var(--text-muted); }
.sport-btn-soon { font-size: 8px; color: #5a6a7e; font-weight: 600; }

/* ─── Champion Banner ─────────────────────────────────────────────── */

.champion-banner {
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.champion-trophy { font-size: 40px; }
.champion-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--gold); font-weight: 700; }
.champion-name { font-size: 17px; font-weight: 800; color: #fff; margin-top: 2px; }
.champion-note { font-size: 12px; color: #8899aa; margin-top: 2px; }

/* ─── Coach Card ──────────────────────────────────────────────────── */

.coach-avatar {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(14,159,90,0.2), rgba(26,108,219,0.2));
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 800; color: var(--teal);
    flex-shrink: 0;
}

.coach-rating { color: var(--gold); }

.cert-badge {
    font-size: 9px;
    color: var(--teal);
    background: rgba(92,224,210,0.07);
    border: 1px solid rgba(92,224,210,0.2);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-block;
    margin: 2px 3px 2px 0;
}

.batch-badge {
    font-size: 9px;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-block;
    margin: 2px 3px 2px 0;
}

.batch-open { background: rgba(14,159,90,0.1); color: var(--green); border: 1px solid rgba(14,159,90,0.2); }
.batch-full { background: rgba(232,67,10,0.1); color: var(--red); border: 1px solid rgba(232,67,10,0.2); }

/* ─── Capacity Bar ────────────────────────────────────────────────── */

.capacity-bar-bg {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.capacity-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--teal), var(--blue));
}

.capacity-bar-fill.full { background: var(--red); }

/* ─── Points Table ────────────────────────────────────────────────── */

.standings-table {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 20px;
}

.standings-header, .standings-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    padding: 10px 14px;
    align-items: center;
}

.standings-header {
    font-size: 10px;
    color: #4a5568;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border);
}

.standings-row { border-bottom: 1px solid #1a2435; }
.standings-row:last-child { border-bottom: none; }
.standings-row.qualified { background: rgba(92,224,210,0.03); }

/* ─── Filter Chips ────────────────────────────────────────────────── */

.filter-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin-bottom: 16px;
    padding-bottom: 4px;
}

.filter-chip {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    text-decoration: none;
    background: var(--border);
    color: #7a8a9a;
}

.filter-chip.active {
    background: var(--teal);
    color: var(--bg);
}

/* ─── Back Button ─────────────────────────────────────────────────── */

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--teal);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    margin-bottom: 12px;
    font-family: inherit;
    text-decoration: none;
}

/* ─── Utilities ───────────────────────────────────────────────────── */

.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mt-10 { margin-top: 10px; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fs-10 { font-size: 10px; }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fs-15 { font-size: 15px; }
.fs-18 { font-size: 18px; }
.fs-20 { font-size: 20px; }
.fs-22 { font-size: 22px; }
.color-teal { color: var(--teal); }
.color-gold { color: var(--gold); }
.color-green { color: var(--green); }
.color-red { color: var(--red); }
.color-muted { color: var(--text-muted); }
.color-dim { color: var(--text-dim); }
.color-white { color: #fff; }

/* ─── Horizontal Scroll Cards ─────────────────────────────────────── */
.h-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.h-scroll > * { flex-shrink: 0; }

/* ─── Toast ───────────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--blue), var(--teal));
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(92,224,210,0.3);
    z-index: 1000;
    animation: fadeInUp 0.3s ease;
    display: none;
}

.toast.show { display: block; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
