:root {
  --navy: #0e2d55;
  --navy-2: #163d6e;
  --ink: #14213a;
  --muted: #5d6b82;
  --line: #dfe4ec;
  --bg: #f3f5f9;
  --card: #fff;
  --accent: #f2c230;
  --accent-ink: #3a2c00;
  --live: #e0413a;
  --ok: #1d8a4f;
  --radius: 12px;
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; font-size: 15px; }
a { color: var(--navy-2); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- thanh trên ---------- */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar .in { max-width: 1100px; margin: auto; display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.topbar .logo { width: 34px; height: 34px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; flex: none; overflow: hidden; }
.topbar .logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.topbar .ttl { flex: 1; min-width: 0; }
.topbar .ttl b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.topbar .ttl small { opacity: .7; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.topbar a.btn-ghost { color: #fff; border: 1px solid rgba(255,255,255,.35); padding: 6px 12px; border-radius: 8px; text-decoration: none; font-size: 13px; white-space: nowrap; }

/* ---------- hero ---------- */
.hero { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 22px 16px 26px; background-size: cover; background-position: center; }
.hero .in { max-width: 1100px; margin: auto; }
.hero .kicker { color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { font-size: clamp(24px, 4.6vw, 40px); margin: 6px 0 4px; }
.hero .sub { opacity: .85; margin-bottom: 10px; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; opacity: .9; }
.hero .search { display: flex; gap: 8px; margin: 16px 0 14px; max-width: 560px; }
.hero .search input { flex: 1; border: 0; border-radius: 10px; padding: 12px 14px; color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 560px; }
.stats div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: 10px 12px; }
.stats b { font-size: 22px; display: block; }
.stats span { font-size: 12px; opacity: .8; }
.countdown { display: inline-flex; gap: 8px; margin-top: 12px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.countdown .u { background: rgba(255,255,255,.12); border-radius: 8px; padding: 4px 8px; text-align: center; min-width: 46px; }
.countdown .u b { display: block; font-size: 18px; }

/* ---------- tab ---------- */
.tabs { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 54px; z-index: 15; }
.tabs .in { max-width: 1100px; margin: auto; display: flex; overflow-x: auto; scrollbar-width: none; }
.tabs .in::-webkit-scrollbar { display: none; }
.tabs a { padding: 13px 14px; white-space: nowrap; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 3px solid transparent; }
.tabs a.on { color: var(--navy); border-color: var(--accent); }

main { max-width: 1100px; margin: auto; padding: 16px; }
.note { color: var(--muted); font-size: 13px; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #eef1f6; color: var(--muted); white-space: nowrap; }
.pill.live { background: #fde8e7; color: var(--live); font-weight: 600; }
.pill.done { background: #e4f4ea; color: var(--ok); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); display: inline-block; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.sec-h { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; }
.sec-h h2 { font-size: 18px; margin: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.empty { background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); }
.grid { display: grid; gap: 10px; }
@media (min-width: 760px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }

/* ---------- thẻ trận ---------- */
.match { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); display: flex; gap: 12px; padding: 12px; align-items: center; }
.match.hl { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(242,194,48,.35); }
.match .court { flex: none; width: 52px; text-align: center; background: var(--navy); color: #fff; border-radius: 10px; padding: 6px 0; }
.match .court small { display: block; font-size: 10px; letter-spacing: .08em; opacity: .75; }
.match .court b { font-size: 20px; }
.match .court .tm { font-size: 11px; opacity: .85; }
.match .body { flex: 1; min-width: 0; }
.match .lbl { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.match .row { display: flex; align-items: center; gap: 8px; }
.match .row .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.match .row .n small { color: var(--muted); font-size: 11px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match .row.w .n { font-weight: 700; }
.match .row .g { display: flex; gap: 4px; }
.match .row .g span { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; background: #f1f3f7; border-radius: 6px; padding: 1px 4px; font-size: 14px; }
.match .row .g span.win { background: var(--navy); color: #fff; }
.match .row .g span.cur { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.match .row .tbd { color: var(--muted); font-style: italic; }
.match .side { flex: none; text-align: right; }

/* ---------- bảng xếp hạng ---------- */
table { width: 100%; border-collapse: collapse; background: #fff; }
.tbl { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; overflow-x: auto; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
th { background: #f6f8fb; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: center; font-variant-numeric: tabular-nums; }
tr.q td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
tr:last-child td { border-bottom: 0; }

/* ---------- nhánh đấu ---------- */
.bracket { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.bracket .col { min-width: 230px; display: flex; flex-direction: column; justify-content: space-around; gap: 10px; }
.bracket .col h4 { text-align: center; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.bm { background: #fff; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; overflow: hidden; }
.bm .r { display: flex; justify-content: space-between; gap: 6px; padding: 6px 10px; }
.bm .r + .r { border-top: 1px solid var(--line); }
.bm .r.w { font-weight: 700; background: #f4f8ff; }
.bm .r .tbd { color: var(--muted); font-style: italic; }
.bm .meta { font-size: 11px; color: var(--muted); padding: 4px 10px; background: #f8f9fb; border-top: 1px solid var(--line); }

/* ---------- vinh danh ---------- */
.podium { display: grid; gap: 10px; }
@media (min-width: 760px) { .podium { grid-template-columns: repeat(3, 1fr); } }
.podium .p { border-radius: var(--radius); padding: 16px; color: #fff; }
.podium .p1 { background: linear-gradient(135deg, #b8860b, #e8bf3b); }
.podium .p2 { background: linear-gradient(135deg, #6b7686, #a9b2bf); }
.podium .p3 { background: linear-gradient(135deg, #8a5a2b, #c48a50); }
.podium .p small { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; opacity: .9; }
.podium .p b { display: block; font-size: 17px; margin: 4px 0; }

/* ---------- form ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 4px; }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=time], input[type=datetime-local], input[type=password], input[type=search], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #cdd5e1; border-radius: 9px; background: #fff;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(14,45,85,.25); border-color: var(--navy-2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 9px; padding: 10px 16px; font-weight: 600; cursor: pointer; background: var(--navy); color: #fff; text-decoration: none; }
.btn.acc { background: var(--accent); color: var(--accent-ink); }
.btn.line { background: #fff; color: var(--navy); border: 1px solid #cdd5e1; }
.btn.red { background: #fff; color: var(--live); border: 1px solid #f1c3c0; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row2 { display: grid; gap: 0 12px; }
@media (min-width: 640px) { .row2 { grid-template-columns: 1fr 1fr; } .row3 { grid-template-columns: 1fr 1fr 1fr; } }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.req { color: var(--live); }
.hp { position: absolute; left: -9999px; }
.prose h3 { font-size: 17px; margin-top: 18px; color: var(--navy); }
.prose h4 { font-size: 15px; margin-top: 14px; }
.prose ul, .prose ol { padding-left: 20px; }
.prose p { margin: 6px 0; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chips button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 12px; cursor: pointer; font-size: 13px; }
.chips button.on { background: var(--navy); color: #fff; border-color: var(--navy); }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 120px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; transition: transform .25s; z-index: 99; max-width: 90vw; }
#toast.show { transform: translate(-50%, 0); }
#toast.err { background: var(--live); }
#toast.ok { background: var(--ok); }
.updated { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 30px 16px; }
.hidden { display: none !important; }
td.num { white-space: nowrap; }
.pane .note { min-height: 34px; }
