:root {
    --bg: #07150f;
    --bg-2: #0d2419;
    --panel: #102a1d;
    --panel-2: #163525;
    --line: rgba(214, 232, 180, 0.12);
    --text: #f4f7ef;
    --muted: #b7c7b0;
    --green: #3ddc84;
    --green-2: #1ea85a;
    --gold: #f0c14b;
    --danger: #ef6b6b;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    --radius: 22px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top right, rgba(61, 220, 132, 0.18), transparent 28%),
        radial-gradient(circle at 10% 80%, rgba(240, 193, 75, 0.12), transparent 24%),
        var(--bg);
    color: var(--text);
    font-family: "DM Sans", sans-serif;
}

body {
    background-image:
        linear-gradient(transparent 31px, rgba(255,255,255,0.015) 32px),
        linear-gradient(90deg, transparent 31px, rgba(255,255,255,0.015) 32px);
    background-size: 32px 32px, 32px 32px;
}

a { color: inherit; text-decoration: none; }

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(16px);
    background: rgba(7, 21, 15, 0.82);
    border-bottom: 1px solid var(--line);
}

.topbar-inner,
.hero,
.hero-actions,
.form-actions,
.row-actions,
.team-cell,
.match-score,
.match-meta {
    display: flex;
    align-items: center;
}

.topbar-inner {
    justify-content: space-between;
    gap: 16px;
    min-height: 76px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(180deg, #1ea85a, #0b3d2e);
    box-shadow: 0 8px 20px rgba(30, 168, 90, 0.35);
}

.nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.nav a {
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
}

.nav a.is-active,
.nav a:hover {
    background: rgba(61, 220, 132, 0.14);
    color: var(--text);
}

.page { padding: 28px 0 72px; }

.hero {
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.hero h1,
.panel h2,
.empty h2 {
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 0.04em;
    margin: 0;
}

.hero h1 { font-size: clamp(42px, 6vw, 72px); line-height: 0.9; }

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 12px;
    color: var(--gold);
    font-weight: 700;
}

.lead, .legend, .footer p, .empty p {
    color: var(--muted);
    line-height: 1.55;
}

.hero-actions, .form-actions { gap: 10px; flex-wrap: wrap; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    padding: 12px 18px;
    font: inherit;
    font-weight: 700;
    color: var(--text);
    background: var(--panel-2);
}

.btn-primary {
    background: linear-gradient(180deg, #3ddc84, #1ea85a);
    color: #062013;
    box-shadow: 0 10px 24px rgba(61, 220, 132, 0.28);
}

.btn-ghost { border: 1px solid var(--line); background: transparent; }
.btn-danger { background: rgba(239, 107, 107, 0.16); color: #ffd4d4; }
.btn-tiny { padding: 6px 10px; font-size: 12px; border-radius: 10px; }

.stats-grid,
.layout-2 {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.stats-grid { grid-template-columns: repeat(4, 1fr); }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.layout-2 { grid-template-columns: 0.95fr 1.05fr; }
.login-panel { max-width: 420px; }
.dash-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.dash-card {
    display: grid;
    gap: 8px;
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(22, 53, 37, 0.92), rgba(16, 42, 29, 0.96));
    box-shadow: var(--shadow);
}
.dash-card span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.leader-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scorers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.scorers-grid h3 {
    margin: 0 0 6px;
    font-size: 16px;
}
.hint, .scorers-line {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 10px;
    line-height: 1.45;
}
.scorer-rows { display: grid; gap: 8px; margin-bottom: 10px; }
.scorer-row { display: grid; grid-template-columns: 1fr 90px 40px; gap: 8px; align-items: center; }

.panel,
.stat-card,
.alert {
    background: linear-gradient(180deg, rgba(22, 53, 37, 0.92), rgba(16, 42, 29, 0.96));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-card, .panel, .empty { padding: 22px; }
.stat-card span, .stat-card small { color: var(--muted); }
.stat-card strong { display: block; font-size: 28px; margin-top: 8px; }

.table-wrap { overflow-x: auto; }

.standings {
    width: 100%;
    border-collapse: collapse;
}

.standings th,
.standings td {
    text-align: center;
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
}

.standings th {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.standings td:nth-child(2),
.standings th:nth-child(2) { text-align: left; }

.standings tr.is-leader { background: rgba(240, 193, 75, 0.08); }
.col-pts { font-weight: 800; color: var(--gold); font-size: 18px; }

.pos {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    font-weight: 700;
}

.pos-1 { background: #f0c14b; color: #2a2108; }
.pos-2 { background: #cfd8dc; color: #263238; }
.pos-3 { background: #ce8946; color: #2a1608; }

.team-cell { gap: 10px; }
.team-cell small, .match-meta { color: var(--muted); font-size: 12px; display: block; }
.club-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
}

.positive { color: var(--green); font-weight: 700; }
.negative { color: var(--danger); font-weight: 700; }
.legend { margin: 16px 0 0; font-size: 14px; }

.form, .form label { display: grid; gap: 8px; }
.form { gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input, select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #0b1d14;
    color: var(--text);
    font: inherit;
}

input[type="color"] { min-height: 48px; padding: 6px; }

.score-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.7fr auto 0.7fr 1.4fr;
    gap: 10px;
    align-items: end;
}

.score-x {
    text-align: center;
    padding-bottom: 12px;
    font-family: "Bebas Neue", sans-serif;
    font-size: 28px;
    color: var(--gold);
}

.team-list, .match-list, .rules {
    list-style: none;
    margin: 0;
    padding: 0;
}

.team-list li,
.match-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.match-list li { align-items: flex-start; flex-direction: column; }
.match-score { width: 100%; justify-content: space-between; gap: 12px; font-weight: 600; }
.match-team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.match-team-away { justify-content: flex-end; }
.row-actions { gap: 8px; }
.count {
    display: inline-flex;
    min-width: 26px;
    height: 26px;
    margin-left: 8px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: rgba(61, 220, 132, 0.16);
    font-size: 13px;
}

.rules { display: grid; gap: 10px; margin-bottom: 18px; color: var(--muted); }
.empty { text-align: center; }
.empty.compact { padding: 8px 0; }

.alert { padding: 14px 16px; margin-bottom: 18px; }
.alert-ok { border-color: rgba(61, 220, 132, 0.4); }
.alert-erro { border-color: rgba(239, 107, 107, 0.5); background: rgba(239, 107, 107, 0.12); }

.footer {
    border-top: 1px solid var(--line);
    padding: 22px 0 32px;
}

@media (max-width: 860px) {
    .topbar-inner, .hero { flex-direction: column; align-items: flex-start; }
    .stats-grid, .stats-3, .layout-2, .score-grid, .dash-actions, .scorers-grid { grid-template-columns: 1fr; }
    .score-x { display: none; }
    .match-score { flex-wrap: wrap; }
}
