:root {
  --navy: #1b2559; --navy2: #263274; --bg: #eef1f6; --card: #fff; --ink: #1d2433; --muted: #6b7486; --line: #e3e7ef;
  --green: #1f9d55; --amber: #d98a00; --red: #d64545; --blue: #2f6fe0; --gold: #c99a2e;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--ink); padding-bottom: 72px; }
a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3 { color: var(--navy); margin: 0 0 .6em; line-height: 1.2; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
small, .muted { color: var(--muted); }

.top { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 12px; padding: 10px 16px; position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.05rem; min-width: 0; }
.brand img { width: 32px; height: 32px; border-radius: 50%; background: #fff; object-fit: contain; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-dot { width: 32px; height: 32px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.comp-switch select { background: var(--navy2); color: #fff; border: 1px solid #4a57a0; border-radius: 8px; padding: 5px 8px; max-width: 220px; }
.user { margin-left: auto; display: flex; gap: 14px; flex-wrap: wrap; }
.user a { color: #dfe5ff; font-size: .92rem; }
.user a:hover { color: #fff; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; background: var(--navy); display: flex; z-index: 10; border-radius: 16px 16px 0 0; padding: 4px; }
.tabs a { flex: 1; color: #c9d0f0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; font-size: .78rem; border-radius: 12px; text-align: center; }
.tabs a.on { background: #0f1740; color: #fff; }
.ic { width: 22px; height: 22px; display: inline-block; background: currentColor; -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }
.ic-home { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' d='M3 11l9-7 9 7v9a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.ic-table { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' d='M4 20V10m6 10V4m6 16v-7m4 7H2'/%3E%3C/svg%3E"); }
.ic-ball { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 7l4 3-1.5 5h-5L8 10z'/%3E%3C/svg%3E"); }
.ic-trophy { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' d='M7 4h10v5a5 5 0 0 1-10 0zM7 6H4a3 3 0 0 0 3 4m10-4h3a3 3 0 0 1-3 4M12 14v4m-4 2h8'/%3E%3C/svg%3E"); }

main { max-width: 1180px; margin: 0 auto; padding: 18px 16px; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 10px 16px 24px; }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; background: #e6f6ec; color: #135c32; }
.flash.err { background: #fde8e8; color: #8a1c1c; }
.flash.warn { background: #fff4dc; color: #7a4d00; }

.card { background: var(--card); border-radius: 14px; box-shadow: 0 1px 3px rgba(20, 30, 60, .08); padding: 16px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

.hero { display: flex; align-items: center; gap: 16px; }
.hero .logo { width: 84px; height: 84px; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.chip { background: var(--card); border-radius: 12px; padding: 8px 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06); font-size: .85rem; }
.chip b { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

.logo { border-radius: 50%; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; vertical-align: middle; }
.logo-ini { display: inline-grid; place-items: center; font-weight: 700; color: var(--navy); background: #e6e9f5; }
.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.teams a { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink); font-size: .88rem; text-align: center; padding: 6px; border-radius: 12px; }
.teams a:hover { background: #f4f6fb; }
.teams .logo { width: 72px; height: 72px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { color: var(--navy); font-size: .74rem; text-transform: uppercase; text-align: center; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 7px 4px; text-align: center; border-bottom: 1px solid var(--line); }
.tbl td.t, .tbl th.t { text-align: left; }
.tbl td.t a { color: var(--ink); display: flex; align-items: center; gap: 8px; }
.tbl .pos { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: var(--navy); color: #fff; font-weight: 700; }
.tbl .pos.q { background: var(--green); }
.tbl b.pts { font-size: .95rem; }
.scroll-x { overflow-x: auto; }
.form span { display: inline-block; width: 16px; height: 16px; border-radius: 4px; color: #fff; font-size: .62rem; line-height: 16px; margin: 0 1px; }
.form .V { background: var(--green); } .form .E { background: #9aa3b5; } .form .D { background: var(--red); }

.round-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.round-nav select { padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.matches { display: grid; gap: 10px; }
.match { display: block; background: var(--card); border-radius: 14px; padding: 10px 12px; color: var(--ink); box-shadow: 0 1px 3px rgba(20,30,60,.08); }
.match:hover { box-shadow: 0 2px 8px rgba(20,30,60,.16); }
.match-top { text-align: center; font-size: .7rem; color: var(--muted); letter-spacing: .05em; }
.match-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.side { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: .84rem; min-width: 0; }
.side span { overflow-wrap: anywhere; }
.mid { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 96px; }
.score { font-size: 1.7rem; font-weight: 800; color: var(--navy); letter-spacing: .04em; }
.vs { font-size: 1.2rem; color: var(--muted); }
.badge { font-size: .66rem; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: #e7eaf2; color: #4d5670; white-space: nowrap; }
.badge.green { background: #dff3e7; color: #17733f; } .badge.amber { background: #fff1d6; color: #8a5a00; }
.badge.red { background: #fde1e1; color: #a12626; } .badge.blue { background: #e1ebff; color: #1f4fae; }

.big-match .match-row .logo { width: 84px; height: 84px; }
.big-match .score { font-size: 2.6rem; }
.big-match .side { font-size: 1rem; font-weight: 600; }

form.stack { display: grid; gap: 10px; max-width: 520px; }
label { font-size: .85rem; color: var(--muted); display: grid; gap: 4px; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #cfd5e2; border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 140px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--navy); color: #fff; border: 0; border-radius: 10px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--navy2); }
.btn.green { background: var(--green); } .btn.red { background: var(--red); } .btn.amber { background: var(--amber); }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid #cfd5e2; }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn.big { padding: 14px 22px; font-size: 1.1rem; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.note { background: #f4f6fb; border-radius: 10px; padding: 10px 12px; font-size: .9rem; }
.note.warn { background: #fff4dc; }
.note.ok { background: #e6f6ec; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 700; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .n { width: 26px; text-align: center; font-weight: 700; color: var(--muted); }
.list .grow { flex: 1; min-width: 0; }
.list .num { font-weight: 800; color: var(--navy); font-size: 1.1rem; }

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.shots figure { margin: 0; background: #0e1430; border-radius: 10px; overflow: hidden; }
.shots img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.shots figcaption { color: #dfe5ff; font-size: .78rem; padding: 6px 8px; }
.events td { text-align: left; }
.poll-opt { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.bar { flex: 1; height: 8px; background: #e7eaf2; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue); }
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-nav a { background: #fff; padding: 7px 12px; border-radius: 10px; color: var(--navy); font-weight: 600; font-size: .9rem; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.admin-nav a.on { background: var(--navy); color: #fff; }
code { background: #eef1f6; padding: 1px 5px; border-radius: 4px; }

@media (min-width: 861px) {
  body { padding-bottom: 0; }
  .tabs { position: sticky; top: 52px; border-radius: 0; justify-content: center; gap: 4px; }
  .tabs a { flex: 0 1 200px; flex-direction: row; justify-content: center; gap: 8px; font-size: .9rem; }
  .ic { width: 18px; height: 18px; }
}
