:root {
    --bg: #06110c;
    --bg-deep: #020604;
    --panel: rgba(12, 30, 21, 0.88);
    --panel-strong: rgba(16, 43, 29, 0.96);
    --panel-soft: rgba(32, 74, 47, 0.62);
    --line: rgba(147, 255, 187, 0.16);
    --line-strong: rgba(255, 209, 102, 0.34);
    --text: #f2fff6;
    --muted: #a9bbaf;
    --green: #42f08a;
    --green-dark: #129a4a;
    --gold: #ffd166;
    --gold-deep: #c4932d;
    --red: #ff6b6b;
    --blue: #55d6ff;
    --bronze: #d68b4a;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.28);
    --radius-lg: 30px;
    --radius-md: 20px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 12% 0%, rgba(66, 240, 138, 0.22), transparent 32rem),
        radial-gradient(circle at 88% 10%, rgba(255, 209, 102, 0.14), transparent 30rem),
        linear-gradient(135deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%) 0 0/42px 42px,
        linear-gradient(180deg, var(--bg), var(--bg-deep));
    background-attachment: fixed;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent 49.7%, rgba(255, 255, 255, 0.035) 50%, transparent 50.3%),
        radial-gradient(circle at 50% 12rem, transparent 0 5.5rem, rgba(255, 255, 255, 0.035) 5.6rem 5.75rem, transparent 5.85rem);
    opacity: .36;
    mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
}

button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px clamp(14px, 4vw, 44px);
    background: rgba(3, 12, 7, 0.78);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 38px rgba(0, 0, 0, .22);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--green);
    font-size: 1.02rem;
    font-weight: 950;
    letter-spacing: .02em;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.nav a:not(.btn) {
    color: var(--muted);
    padding: 9px 12px;
    border-radius: 999px;
    transition: .18s ease;
}

.nav a:not(.btn):hover {
    color: var(--text);
    background: rgba(255, 255, 255, .07);
}

.user-chip {
    padding: 9px 13px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(66, 240, 138, .16), rgba(255, 209, 102, .08));
    border: 1px solid var(--line);
    color: #dfffe9;
    font-weight: 800;
}

.hero {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 26px;
    padding: clamp(22px, 5vw, 38px);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(66, 240, 138, .20), rgba(255, 209, 102, .10) 45%, rgba(9, 26, 17, .96)),
        var(--panel-strong);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.hero::after {
    content: '';
    position: absolute;
    right: -70px;
    bottom: -90px;
    width: 260px;
    height: 260px;
    border: 24px solid rgba(255, 255, 255, .045);
    border-radius: 50%;
}

.hero > * { position: relative; z-index: 1; }
.hero h1 { margin: 0 0 10px; font-size: clamp(2.1rem, 6vw, 4.6rem); line-height: .94; letter-spacing: -.06em; }
.hero p { margin: 0; color: var(--muted); max-width: 720px; font-size: 1.02rem; }

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .18em;
    color: var(--gold) !important;
    font-weight: 950;
    font-size: .78rem;
    margin-bottom: 12px !important;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .075);
    color: var(--text);
    padding: 11px 17px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 900;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.btn:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .12); box-shadow: var(--shadow-soft); }
.btn-primary { background: linear-gradient(135deg, var(--green), #8df6b6 48%, var(--gold)); color: #04150b; border: 0; box-shadow: 0 12px 30px rgba(66, 240, 138, .22); }
.btn-small { min-height: 34px; padding: 7px 11px; font-size: .88rem; }
.btn-danger { background: rgba(255, 107, 107, .16); color: #ffdada; }

.match-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(305px, 1fr)); gap: 20px; }
.match-card, .panel, .login-card, .stat-card, .action-card {
    background: linear-gradient(180deg, rgba(21, 50, 34, .92), rgba(9, 23, 16, .92));
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: var(--shadow-soft);
}

.match-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 14px;
    padding: 22px;
}

.match-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--green), var(--gold));
}

.match-card::after {
    content: '';
    position: absolute;
    right: -46px;
    bottom: -46px;
    width: 150px;
    height: 150px;
    border: 17px solid rgba(255, 255, 255, .038);
    border-radius: 50%;
}

.match-card > * { position: relative; z-index: 1; }
.match-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.stage, .group { display: inline-flex; margin: 0 7px 7px 0; color: var(--muted); font-size: .84rem; font-weight: 800; }
.group { color: var(--green); }
.match-card h2 { margin: 0; font-size: clamp(1.35rem, 3vw, 1.7rem); line-height: 1.12; letter-spacing: -.03em; }
.match-card h2 span { color: var(--gold); }
.match-time { color: var(--muted); }
.countdown { color: var(--gold); font-variant-numeric: tabular-nums; letter-spacing: .08em; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 14px currentColor; }
.badge-scheduled { background: rgba(85, 214, 255, .14); color: #b9efff; }
.badge-live { background: rgba(255, 209, 102, .18); color: var(--gold); }
.badge-finished { background: rgba(66, 240, 138, .16); color: var(--green); }

.prediction-form { display: grid; gap: 12px; }
.prediction-form label { color: var(--muted); font-weight: 900; }
.score-inputs { display: flex; align-items: center; gap: 10px; font-size: 1.35rem; font-weight: 950; color: var(--gold); }

input, select {
    width: 100%;
    padding: 12px 13px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, .26);
    color: var(--text);
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input:focus, select:focus { border-color: rgba(66, 240, 138, .56); box-shadow: 0 0 0 4px rgba(66, 240, 138, .11); background: rgba(0, 0, 0, .34); }
.score-inputs input { width: 82px; min-height: 52px; text-align: center; font-size: 1.28rem; font-weight: 950; }

.locked-box, .result-box {
    padding: 13px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--line);
}
.result-box { background: linear-gradient(135deg, rgba(255, 209, 102, .15), rgba(66, 240, 138, .08)); }
.points { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; padding: 3px 8px; color: #06150b; background: var(--green); border-radius: 999px; font-weight: 950; margin-left: 8px; }

.alert { padding: 14px 16px; border-radius: 18px; margin-bottom: 18px; border: 1px solid var(--line); box-shadow: var(--shadow-soft); }
.alert-success { background: rgba(66, 240, 138, .14); }
.alert-error { background: rgba(255, 107, 107, .15); color: #ffdede; }


.score-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: -10px 0 20px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--text);
    background: rgba(255, 255, 255, .055);
    font-size: .9rem;
    font-weight: 850;
}

.legend-item::before {
    content: '';
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--muted);
}

.legend-3::before { background: var(--green); box-shadow: 0 0 16px rgba(66, 240, 138, .7); }
.legend-2::before { background: var(--gold); }
.legend-1::before { background: var(--blue); }
.legend-0::before { background: rgba(255, 255, 255, .28); }

.table-wrap {
    overflow-x: auto;
    background: rgba(4, 14, 9, .72);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.data-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 760px; }
.data-table th, .data-table td { padding: 15px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-table th { position: sticky; top: 0; z-index: 1; color: var(--gold); background: rgba(11, 32, 21, .98); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .16s ease, transform .16s ease; }
.data-table tbody tr:hover td { background: rgba(255, 255, 255, .04); }

.leaderboard-table td:nth-child(2) { font-weight: 950; }
.place { font-size: 1.5rem; font-weight: 950; }
.place-1 td { background: linear-gradient(90deg, rgba(255, 209, 102, .20), rgba(255, 209, 102, .05)); box-shadow: inset 4px 0 0 var(--gold); }
.place-2 td { background: linear-gradient(90deg, rgba(210, 222, 232, .15), rgba(210, 222, 232, .04)); box-shadow: inset 4px 0 0 #d2dee8; }
.place-3 td { background: linear-gradient(90deg, rgba(214, 139, 74, .15), rgba(214, 139, 74, .04)); box-shadow: inset 4px 0 0 var(--bronze); }

.prediction-cell { text-align: center !important; min-width: 116px; border-left: 1px solid rgba(255, 255, 255, .035); }
.points-3 { background: linear-gradient(135deg, rgba(66, 240, 138, .42), rgba(255, 209, 102, .16)) !important; box-shadow: inset 0 0 0 1px rgba(66, 240, 138, .44), 0 0 24px rgba(66, 240, 138, .10); color: #f7fff9; }
.points-2 { background: rgba(255, 209, 102, .20) !important; box-shadow: inset 0 0 0 1px rgba(255, 209, 102, .24); }
.points-1 { background: rgba(85, 214, 255, .12) !important; }
.points-0 { background: rgba(255, 255, 255, .025) !important; color: rgba(242, 255, 246, .56); }
.points-0 .points { background: rgba(255, 255, 255, .14); color: rgba(242, 255, 246, .76); }
.status-text { color: var(--gold); font-size: .88rem; font-weight: 850; }
.muted { color: var(--muted); }

.panel { padding: 22px; margin-bottom: 20px; }
.panel h2 { margin: 0 0 16px; letter-spacing: -.03em; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 15px; align-items: end; }
.admin-form label, .stack-form label { display: grid; gap: 8px; color: var(--muted); font-weight: 850; }

.stats-grid, .action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 17px; margin-bottom: 22px; }
.stat-card { position: relative; overflow: hidden; padding: 24px; }
.stat-card::after { content: ''; position: absolute; right: -20px; top: -30px; width: 92px; height: 92px; border-radius: 50%; background: rgba(255, 209, 102, .08); }
.stat-card span { display: block; color: var(--green); font-size: 2.55rem; line-height: 1; font-weight: 950; }
.stat-card p { margin: 8px 0 0; color: var(--muted); font-weight: 800; }
.action-card { padding: 22px; font-weight: 950; color: var(--text); transition: .18s ease; }
.action-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form { margin: 0; }

.login-body { display: grid; place-items: center; padding: 22px; }
.login-shell { width: min(460px, 100%); }
.login-card { position: relative; overflow: hidden; padding: clamp(28px, 7vw, 40px); text-align: center; }
.login-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--green), var(--gold)); }
.login-card h1 { margin: 0 0 10px; font-size: clamp(2rem, 8vw, 3rem); line-height: .95; letter-spacing: -.06em; }
.login-card p { color: var(--muted); }
.login-ball { font-size: 3.2rem; filter: drop-shadow(0 12px 26px rgba(66, 240, 138, .28)); }
.stack-form { display: grid; gap: 15px; margin: 24px 0 6px; text-align: left; }

@media (max-width: 820px) {
    .topbar, .hero { align-items: stretch; flex-direction: column; }
    .topbar { position: static; }
    .nav { justify-content: flex-start; }
    .hero { border-radius: 24px; }
    .match-grid { grid-template-columns: 1fr; }
    .btn { width: 100%; }
    .nav .btn { width: auto; }
    .score-inputs input { flex: 1; width: 100%; }
}

@media (max-width: 560px) {
    .container { width: min(100% - 22px, 1200px); padding-top: 18px; }
    .topbar { padding: 13px 11px; }
    .brand { width: 100%; }
    .nav { gap: 7px; }
    .nav a:not(.btn), .user-chip { padding: 8px 10px; font-size: .9rem; }
    .hero, .match-card, .panel, .login-card { padding: 18px; border-radius: 22px; }
    .hero h1 { font-size: 2.15rem; }
    .match-card-head { flex-direction: column; }
    .table-wrap { border-radius: 18px; margin-inline: -2px; }
    .data-table { min-width: 680px; font-size: .92rem; }
    .data-table th, .data-table td { padding: 12px 13px; }
    .stats-grid, .action-grid { grid-template-columns: 1fr; }
}
