/* assets/css/main.css */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* ── Variables ───────────────────────────────────────────────────────── */
:root {
    --bg:       #0d1117;
    --surface:  #161b22;
    --surface2: #1c2128;
    --border:   #30363d;
    --text:     #e6edf3;
    --muted:    #8b949e;
    --green:    #0a7a3e;
    --green2:   #0d9b4e;
    --gold:     #f5c400;
    --red:      #da3633;
    --radius:   6px;
    --font-head: 'Bebas Neue', sans-serif;
    --font-body: 'Barlow', sans-serif;
}

/* ── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Top bar ─────────────────────────────────────────────────────────── */
.topbar {
    background: #000;
    border-bottom: 3px solid var(--green);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-logo {
    font-family: var(--font-head);
    font-size: 1.6rem;
    letter-spacing: 3px;
    color: var(--gold);
    white-space: nowrap;
    flex-shrink: 0;
}
.topbar-logo span { color: var(--green2); }
.topbar-nav {
    display: flex;
    gap: .15rem;
    margin-left: auto;
    flex-wrap: wrap;
    align-items: center;
}
.topbar-nav a {
    color: var(--muted);
    padding: .35rem .85rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    transition: color .15s, background .15s;
    white-space: nowrap;
}
.topbar-nav a:hover,
.topbar-nav a.active {
    color: var(--text);
    background: rgba(255,255,255,.07);
    text-decoration: none;
}
.topbar-nav a.nav-admin { color: #f87171; }

/* ── Layout ──────────────────────────────────────────────────────────── */
main { flex: 1; }
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    width: 100%;
}

/* ── Page title ──────────────────────────────────────────────────────── */
.page-title {
    font-family: var(--font-head);
    font-size: 2.2rem;
    letter-spacing: 2px;
    color: var(--gold);
    margin-bottom: 1.25rem;
    line-height: 1;
}
.page-title span { color: var(--green2); }

/* ── Cards ───────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-head {
    background: linear-gradient(135deg, var(--green) 0%, #054525 100%);
    padding: .55rem 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    min-height: 38px;
}
.card-head h2,
.card-head h3 {
    font-family: var(--font-head);
    font-size: 1.1rem;
    letter-spacing: 1.5px;
    color: #fff;
}
.card-head .badge {
    margin-left: auto;
    background: var(--gold);
    color: #000;
    font-weight: 700;
    font-size: .68rem;
    padding: .15rem .5rem;
    border-radius: 20px;
    white-space: nowrap;
}
.card-body { padding: 1rem; }
.card-footer {
    padding: .5rem 1rem;
    border-top: 1px solid var(--border);
    font-size: .75rem;
    color: var(--muted);
}

/* ── Tables ──────────────────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl thead th {
    background: rgba(255,255,255,.03);
    padding: .45rem .8rem;
    text-align: left;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.tbl thead th.c { text-align: center; }
.tbl td {
    padding: .5rem .8rem;
    border-bottom: 1px solid rgba(255,255,255,.04);
    vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: rgba(255,255,255,.025); }

/* Row accents for top positions */
.tbl .row-1 td:first-child { border-left: 3px solid var(--gold); }
.tbl .row-2 td:first-child { border-left: 3px solid var(--green2); }

.tbl .c { text-align: center; }
.tbl .pts { font-weight: 700; color: var(--gold); text-align: center; }
.tbl .gd-pos { color: var(--green2); }
.tbl .gd-neg { color: var(--red); }
.tbl .muted  { color: var(--muted); font-size: .82rem; }
.tbl .score  {
    font-family: var(--font-head);
    font-size: 1.15rem;
    text-align: center;
    color: var(--gold);
    white-space: nowrap;
}
.tbl .unplayed { color: var(--muted); text-align: center; font-size: .85rem; }

/* ── Tags ────────────────────────────────────────────────────────────── */
.tag {
    display: inline-block;
    padding: .18rem .52rem;
    border-radius: 20px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    white-space: nowrap;
}
.tag-g  { background: rgba(13,155,78,.2);  color: var(--green2); }
.tag-ko { background: rgba(245,196,0,.15); color: var(--gold); }
.tag-ok { background: rgba(13,155,78,.2);  color: #6ee7b7; }
.tag-dim{ background: rgba(139,148,158,.12); color: var(--muted); }
.tag-admin { background: var(--red); color: #fff; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .5rem 1.1rem;
    border-radius: var(--radius);
    border: none;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: .4px;
    text-transform: uppercase;
    cursor: pointer;
    transition: filter .15s, transform .1s;
    text-decoration: none;
}
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn-green  { background: var(--green);  color: #fff; }
.btn-gold   { background: var(--gold);   color: #000; }
.btn-red    { background: var(--red);    color: #fff; }
.btn-ghost  { background: transparent;   color: var(--text); border: 1px solid var(--border); }
.btn-sm     { padding: .3rem .7rem; font-size: .75rem; }
.btn-full   { width: 100%; }
.btn-group  { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ── Forms ───────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .85rem; }
.field label {
    font-size: .78rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.field input,
.field select {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .5rem .8rem;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: .9rem;
    transition: border-color .15s;
    width: 100%;
}
.field input:focus,
.field select:focus { outline: none; border-color: var(--green2); }
.field input.score-box {
    width: 64px;
    text-align: center;
    font-family: var(--font-head);
    font-size: 1.2rem;
}

/* ── Alerts ──────────────────────────────────────────────────────────── */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .88rem;
}
.alert-ok  { background: rgba(13,155,78,.15);  border: 1px solid var(--green2); color: #6ee7b7; }
.alert-err { background: rgba(218,54,51,.15);  border: 1px solid var(--red);    color: #fca5a5; }
.alert-inf { background: rgba(245,196,0,.1);   border: 1px solid var(--gold);   color: var(--gold); }

/* ── Grid ────────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }

/* ── Stat tile ───────────────────────────────────────────────────────── */
.stat-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}
.stat-tile .ico  { font-size: 1.6rem; margin-bottom: .3rem; }
.stat-tile .val  { font-family: var(--font-head); font-size: 2rem; color: var(--gold); line-height: 1; }
.stat-tile .lbl  { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: .25rem; }

/* ── Score entry row ─────────────────────────────────────────────────── */
.match-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .9rem;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.match-row:last-child { border-bottom: none; }
.match-row .num  { color: var(--muted); font-size: .72rem; width: 28px; flex-shrink: 0; }
.match-row .team { flex: 1; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-row .team.away { text-align: right; }
.match-row .sep  { color: var(--muted); font-family: var(--font-head); font-size: 1.2rem; flex-shrink: 0; }
.match-row .done { flex-shrink: 0; }

/* ── Match card (knockout) ───────────────────────────────────────────── */
.ko-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: .5rem;
}
.ko-card .ko-head {
    padding: .35rem .8rem;
    font-size: .72rem;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
}
.ko-card .ko-body { padding: .6rem .9rem; }
.ko-card .ko-team {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .25rem 0;
}
.ko-card .ko-team .name { font-size: .9rem; }
.ko-card .ko-team .score {
    font-family: var(--font-head);
    font-size: 1.35rem;
    color: var(--gold);
    min-width: 1.4rem;
    text-align: center;
}
.ko-card .ko-sep { height: 1px; background: var(--border); margin: .2rem 0; }
.ko-card.w-top .ko-team:first-of-type .name { color: var(--gold); font-weight: 700; }
.ko-card.w-bot .ko-team:last-of-type  .name { color: var(--gold); font-weight: 700; }

/* ── Footer ──────────────────────────────────────────────────────────── */
footer {
    text-align: center;
    padding: 1rem;
    font-size: .75rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* ── Login page ──────────────────────────────────────────────────────── */
.login-wrap {
    max-width: 360px;
    width: 100%;
    padding: 1rem;
    margin: auto;
}
.login-logo {
    font-family: var(--font-head);
    font-size: 2.4rem;
    letter-spacing: 3px;
    color: var(--gold);
    text-align: center;
}
.login-logo span { color: var(--green2); }
.login-sub {
    text-align: center;
    color: var(--muted);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.75rem;
}

/* ── Modal ───────────────────────────────────────────────────────────── */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.72);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 420px;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .topbar { gap: .75rem; }
    .topbar-logo { font-size: 1.25rem; }
    .topbar-nav a { padding: .3rem .5rem; font-size: .72rem; }
    .page-title { font-size: 1.6rem; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
