body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;margin:0;background:linear-gradient(180deg,#f7f9ff 0%,#f6f7fb 45%,#f5f5f7 100%);}
a{color:#0b57d0;text-decoration:none}
.container{max-width:1100px;margin:0 auto;padding:18px}

/* Top navigation */
.nav{background:#0b1220;color:#fff;position:sticky;top:0;z-index:50;box-shadow:0 6px 18px rgba(0,0,0,.12)}
.nav-inner{display:flex;gap:14px;align-items:center;flex-wrap:wrap}
.nav a{color:#fff;opacity:.9}
.nav a:hover{opacity:1;text-decoration:underline}
.brand{font-weight:700;letter-spacing:.3px}
.spacer{flex:1}

/* Admin navigation (separate row under main nav) */
.admin-bar{background:#0b1220;border-top:1px solid rgba(255,255,255,.08);border-bottom:1px solid rgba(255,255,255,.08)}
.admin-bar-inner{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding-top:10px;padding-bottom:10px}

.card{background:#fff;border-radius:14px;padding:14px;box-shadow:0 2px 12px rgba(0,0,0,.06);margin:12px 0}
.card h2,.card h3{margin:0 0 10px 0}
.table{width:100%;border-collapse:collapse}
.table th,.table td{padding:10px;border-bottom:1px solid #eee;text-align:left;vertical-align:middle}
.table tr:hover td{background:#fafbff}

.badge{display:inline-block;padding:2px 8px;border-radius:999px;background:#eef2ff}
.badge.ok{background:#dcfce7}
.badge.status-scheduled{background:#eef2ff}
.badge.status-finished{background:#dcfce7}
.badge.status-locked{background:#ffedd5}

.btn{display:inline-flex;align-items:center;justify-content: flex-start;gap:6px;padding:8px 12px;border-radius:10px;background:#111827;color:#fff;border:0;cursor:pointer;text-decoration:none}
.btn.secondary{background:#334155}
.btn.danger{background:#b91c1c}
.btn.btn-ghost{background:transparent;border:1px solid rgba(255,255,255,.18);color:#e5e7eb;font-weight:600}
.btn.btn-ghost:hover{border-color: rgba(255,255,255,.32)}

/* Smaller, icon-style buttons */
.btn-sm{padding:6px 10px;border-radius:10px;font-size:13px}
.btn-icon{padding:6px 8px;border-radius:10px;min-width:34px}
.btn-icon svg{width:16px;height:16px;display:block}

.input,select,textarea{padding:8px;border:1px solid #d1d5db;border-radius:10px;width:100%;box-sizing:border-box}
.grid{display:grid;gap:12px}
.grid.cols2{grid-template-columns:1fr 1fr}
.grid.cols3{grid-template-columns:1fr 1fr 1fr}
.grid.cols4{grid-template-columns:1fr 1fr 1fr auto}
.grid.cols5{grid-template-columns:1fr 1fr 1fr 1fr auto}
.small{opacity:.75;font-size:.92em}
.hr{height:1px;background:#e5e7eb;margin:12px 0}
.flag{display:inline-block;min-width:1.4em}
.flagimg{width:22px;height:16px;object-fit:cover;border-radius:3px;vertical-align:middle;display:inline-block;margin-right:6px;border:1px solid #e5e7eb;background:#f3f4f6}

/* Match list alignment */
.match-cell{display:grid;grid-template-columns:1fr 26px 28px 26px 1fr;align-items:center;gap:10px;max-width:520px;margin:0 auto}
.match-cell .home{text-align:right;font-weight:500}
.match-cell .away{text-align:left;font-weight:500}
.match-cell .vs{text-align:center;opacity:.65;font-size:.92em}
.match-cell .flagimg{margin-right:0}

/* Keep admin match rows neat on one line */
.table.compact .match-cell .home,
.table.compact .match-cell .away{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Bigger match header (e.g., All predictions page) */
.match-cell.big{max-width:760px;grid-template-columns:1fr 44px 60px 44px 1fr;gap:16px}
.match-cell.big .home,.match-cell.big .away{font-size:22px;font-weight:600;letter-spacing:.01em}
.match-cell.big .vs{font-size:18px;opacity:.55}
.match-cell.big .flagimg{width:44px;height:32px;border-radius:8px;border-width:1px}

/* Tables */
.num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.center{text-align:center}
.table-wrap{width:100%;overflow-x:auto}

/* Sortable column headers */
.sort-link{color:#111827;text-decoration:none}
.sort-link:hover{text-decoration:underline}
.sort-ind{opacity:.55;font-size:.9em;margin-left:4px}

/* Admin matches: filters + actions + bulk */
.admin-filter{align-items:end}
.filter-top{align-items:flex-start}
.admin-filter-actions{min-width:220px}
.admin-actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
.bulk-bar{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin:12px 0;padding:10px;border:1px dashed #e5e7eb;border-radius:14px;background:#fbfcff}
.bulk-bar .bulk-item{min-width:220px}

/* Group standings */
.standings td{vertical-align:middle}
.standings th.num,.standings td.num{text-align:right}
.rank-col{font-variant-numeric:tabular-nums}
.kickoff-head{white-space:nowrap}
.kickoff-head .kick-label{font-weight:600}
.kickoff-head .tz-small{font-weight:400;font-size:12px;opacity:.75;margin-left:4px}
.kickoff-cell{white-space:nowrap}
.team-link{display:inline-flex;align-items:center;gap:8px}
.team-tile{display:flex;gap:10px;align-items:center;padding:10px 12px;border:1px solid #eef0f6;border-radius:14px;background:#fbfcff}
.team-tile:hover{border-color:#dbe4ff;box-shadow:0 10px 24px rgba(12,42,102,.10)}
.bracket{display:flex;gap:26px;overflow:auto;padding:10px}
.round{min-width:240px}
.matchbox{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:10px;margin:10px 0}
.matchbox .t{display:flex;justify-content:space-between}

@media (max-width: 720px){
  .grid.cols2,.grid.cols3,.grid.cols4,.grid.cols5{grid-template-columns:1fr}
  .container{padding:14px}
  .table th,.table td{padding:10px 8px}
  .admin-filter-actions{min-width:auto}
  .admin-actions{justify-content:flex-start}
  .match-cell{max-width:100%}
}



/* Toasts */
.toast-wrap{position:fixed;top:16px;right:16px;display:flex;flex-direction:column;gap:10px;z-index:9999}
.toast{min-width:260px;max-width:420px;background:#fff;border-radius:14px;padding:12px 12px;box-shadow:0 10px 30px rgba(0,0,0,.12);display:flex;align-items:flex-start;gap:10px;transform:translateY(-8px);opacity:0;transition:all .18s ease;border:1px solid rgba(15,23,42,.08)}
.toast.show{transform:translateY(0);opacity:1}
.toast-dot{width:10px;height:10px;border-radius:999px;margin-top:4px;background:#64748b;flex:0 0 auto}
.toast-msg{font-size:14px;line-height:1.35;color:#0f172a;flex:1}
.toast-x{border:0;background:transparent;font-size:18px;line-height:1;color:#64748b;cursor:pointer;padding:0 6px}
.toast-success .toast-dot{background:#16a34a}
.toast-info .toast-dot{background:#2563eb}
.toast-warning .toast-dot{background:#f59e0b}
.toast-error .toast-dot{background:#dc2626}

/* Home layout */
.home-welcome{padding:18px}
.home-welcome-row{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap}
.home-me{min-width:220px;text-align:right}
.home-me-big{font-size:34px;font-weight:500;line-height:1;margin:2px 0 2px 0}
.home-section{margin-top:18px}
.home-section-title{display:flex;align-items:baseline;justify-content:space-between;margin:0 0 10px 0;gap:12px;flex-wrap:wrap}

.match-banner{background:#fff;border:1px solid rgba(15,23,42,.08);border-radius:16px;padding:14px 16px;box-shadow:0 8px 22px rgba(15,23,42,.06);margin-bottom:12px}
.match-banner-compact{padding:12px 14px}
.match-banner-top{display:flex;align-items:center;gap:10px;justify-content:space-between;flex-wrap:wrap;margin-bottom:10px}
.match-banner-row{display:flex;align-items:center;justify-content:space-between;gap:16px}
.mb-team{font-weight:500;letter-spacing:.2px;font-size:34px;line-height:1.1;white-space:nowrap}
.match-banner-compact .mb-team{font-size:28px}
.mb-left{flex:1;text-align:right}
.mb-right{flex:1;text-align:left}
.mb-flag{width:78px;display:flex;justify-content:center;align-items:center}
.flag-lg{width:74px;height:48px;border-radius:10px;object-fit:cover;box-shadow:0 10px 16px rgba(0,0,0,.12)}
.mb-center{min-width:180px;text-align:center}
.mb-time{font-size:34px;font-weight:500;letter-spacing:.2px}
.mb-score{font-size:36px;font-weight:700;letter-spacing:.2px}
.match-banner-compact .mb-score{font-size:30px}
.mb-sub{margin-top:6px}
.match-banner-actions{margin-top:10px;text-align:center}

.home-upcoming-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;direction:ltr}
.upcoming-card{padding:14px}
.up-row{display:flex;align-items:center;gap:10px;justify-content:space-between}
.flag-md{width:34px;height:22px;border-radius:6px;object-fit:cover;box-shadow:0 6px 10px rgba(0,0,0,.10)}
.up-name{flex:1;font-weight:500}
.up-mid{min-width:180px;text-align:center}
.up-open{margin-top:8px;display:inline-flex;align-items:center;justify-content:center}
.up-countdown{font-weight:500;font-size:18px;letter-spacing:.2px}
.up-top{opacity:.85;margin-bottom:6px}

/* Make banners usable on small screens */
@media (max-width: 860px){
  .home-upcoming-grid{grid-template-columns:1fr}
  .mb-team{font-size:24px}
  .mb-center{min-width:140px}
  .mb-time,.mb-score{font-size:26px}
  .flag-lg{width:58px;height:38px}
  .mb-flag{width:60px}
}
@media (max-width: 520px){
  .match-banner-row{gap:10px}
  .mb-team{font-size:18px;white-space:normal}
  .mb-left{text-align:left}
  .mb-right{text-align:right}
  .mb-center{min-width:120px}
  .up-mid{min-width:140px}
  .toast-wrap{left:12px;right:12px}
  .toast{min-width:auto;max-width:none}
}

/* Admin settings helpers */
.hint{font-size:12px;opacity:.75;margin-top:6px}

/* Home featured match (hero) */
.match-hero{
  border:1px solid #e5e7eb;
  border-radius:16px;
  padding:16px;
  background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.04);
}
.hero-row{
  display:grid;
  grid-template-columns: 1fr auto 220px auto 1fr;
  align-items:center;
  gap:18px;
  padding:14px 0 6px 0;
}
.hero-team{
  font-weight:500;
  letter-spacing:.2px;
  font-size:34px;
}
.hero-left{text-align:right}
.hero-right{text-align:left}
.flag-hero{
  width:84px;
  height:auto;
  border-radius:10px;
  box-shadow:0 2px 10px rgba(0,0,0,.08);
}
.hero-center{text-align:center}
.hero-time{font-size:44px;font-weight:500;letter-spacing:.4px}
.hero-score{font-size:44px;font-weight:700}
.hero-sub{opacity:.75;margin-top:6px}
@media (max-width: 900px){
  .hero-row{grid-template-columns: 1fr auto 180px auto 1fr}
  .hero-team{font-size:24px}
  .hero-time,.hero-score{font-size:32px}
  .flag-hero{width:64px}
}
@media (max-width: 600px){
  .hero-row{grid-template-columns: 1fr auto 140px auto 1fr; gap:10px}
  .hero-team{font-size:18px}
  .flag-hero{width:52px}
}


.flagmini{width:20px;height:14px;vertical-align:middle;border-radius:2px;box-shadow:0 0 0 1px rgba(0,0,0,.08);margin-right:6px;}

/* Compact / wide tables (leaderboard, predictions) */
.table.compact{font-size:12.5px}
.table.compact th,.table.compact td{padding:8px 8px}
.table.compact th{white-space:nowrap}
.table.compact td{white-space:nowrap}

/* Leaderboard helpers */
.lb-user a{font-weight:500;color:#0f172a}
.lb-user a:hover{text-decoration:underline}
.lb-total{font-weight:700}

/* Match header in tables (flag + name aligned) */
.teamcell{display:inline-flex;align-items:center;gap:8px}
.teamcell .flagmini{margin-right:0}


/* ---- Stats widgets ---- */
.stats-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:12px}
.stat{border:1px solid rgba(15,23,42,.1);border-radius:12px;padding:10px 12px;background:rgba(255,255,255,.7)}
.stat-k{font-size:12px;opacity:.75;margin-bottom:4px}
.stat-v{font-size:18px;font-weight:700}
.stat-wide{grid-column:1/-1}
.spark{opacity:.9}
.userchip{color:#e5e7eb;text-decoration:none;padding:6px 10px;border-radius:999px;background:rgba(255,255,255,.12)}
.userchip:hover{background:rgba(255,255,255,.18)}

/* hover rows for dense tables */
.table tr:hover td{background:rgba(2,132,199,.06)}

/* details summary styling */
.summary{cursor:pointer;list-style:none}
summary::-webkit-details-marker{display:none}

/* ---- Dark mode ---- */
html[data-theme="dark"] body{background:#0b1220;color:#e5e7eb}
html[data-theme="dark"] .card{background:#0f172a;border-color:rgba(148,163,184,.18)}
html[data-theme="dark"] .nav{background:#0b1220;border-bottom:1px solid rgba(148,163,184,.18)}
html[data-theme="dark"] .admin-bar{background:#0f172a;border-bottom:1px solid rgba(148,163,184,.18)}
html[data-theme="dark"] a{color:#93c5fd}
html[data-theme="dark"] .table th{background:rgba(148,163,184,.12)}
html[data-theme="dark"] .table td, html[data-theme="dark"] .table th{border-bottom:1px solid rgba(148,163,184,.14)}
html[data-theme="dark"] .input, html[data-theme="dark"] .select{background:#0b1220;border-color:rgba(148,163,184,.22);color:#e5e7eb}
html[data-theme="dark"] .stat{background:rgba(148,163,184,.08);border-color:rgba(148,163,184,.18)}
html[data-theme="dark"] .table tr:hover td{background:rgba(59,130,246,.12)}

@media (max-width:720px){
  .stats-grid{grid-template-columns:1fr}
}


/* Ads */
.ad{ margin:14px 0; padding:12px; border:1px solid var(--border); border-radius:14px; background:var(--card); box-shadow: var(--shadow-sm); text-align:center; }
.ad img{ max-width:100%; height:auto; border-radius:12px; display:block; margin:0 auto; }
.ad .ad-text{ text-align:left; }
.ad .ad-title{ font-weight:700; margin-bottom:6px; }
.ad .ad-body{ opacity:.9; margin-bottom:10px; }
.ad.ad-global-footer{ margin-top:18px; }


/* --- Admin forms --- */
.admin-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:18px 0 12px}
.ad-form{padding:14px}
.form-section{border:1px solid rgba(148,163,184,.25); border-radius:16px; padding:14px; margin-bottom:12px; background: rgba(255,255,255,.02)}
.section-title{font-weight:700;margin-bottom:10px}
.form-row label{display:block;font-size:.92rem;opacity:.9;margin-bottom:6px}
.form-row input,.form-row select,.form-row textarea{width:100%;padding:10px 12px;border-radius:12px;border:1px solid rgba(148,163,184,.35);background:transparent;color:inherit}
.form-row textarea{min-height:78px}
.form-grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width:720px){.form-grid2{grid-template-columns:1fr}}
.form-hint{font-size:.85rem;opacity:.75;margin-top:6px}
.ad-preview{margin-top:12px}
.ad-preview img{max-width:100%;border-radius:14px;border:1px solid rgba(148,163,184,.25);display:block}

/* --- Ads --- */
.ad-image-wrap.ad-fullwidth img{width:100%;max-width:100%;height:auto}
.ad-image-wrap.ad-fullwidth{margin:0}


/* --- Ads + Admin UI refinements (v30) --- */
.ad-stack{display:flex;flex-direction:column;gap:12px}
.ad-slot{margin:10px auto}
.ad.ad-global-top,.ad.ad-global-footer{padding:0}
.ad-image{display:block;max-width:100%;height:auto;margin:0 auto;border-radius:12px}
.ad-image-fullwidth{width:100%}

/* Reduce extra whitespace around global top ad (banner) */
.ad-slot.ad-slot-global-top{margin-top:12px;margin-bottom:12px}
.ad-slot.ad-slot-global-top .ad{margin:0}
.ad-slot.ad-slot-global-top img{margin:0 auto}

/* Admin ad form layout */
.ad-form .form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}
.ad-form .form-row{display:flex;flex-direction:column;gap:6px}
.ad-form .form-row input[type="text"],
.ad-form .form-row input[type="url"],
.ad-form .form-row input[type="date"],
.ad-form .form-row select,
.ad-form .form-row textarea{width:100%;box-sizing:border-box}
.ad-form .form-row select{min-height:44px;padding:10px 12px;line-height:1.2}
.ad-form .form-row.checkbox-row{grid-column:1 / -1}
.checkbox-inline{display:flex;align-items:center;gap:10px}
.checkbox-inline span{font-weight:500}

/* Date input icon spacing */
.ad-form input[type="date"]{padding-right:12px}

/* --- Dark mode (enable) --- */
html[data-theme="dark"]{background:#0b1220;color:#e5e7eb}
html[data-theme="dark"] body{background:#0b1220;color:#e5e7eb}
html[data-theme="dark"] .nav{background:#0b1220;border-bottom:1px solid rgba(255,255,255,0.08)}
html[data-theme="dark"] a{color:#c7d2fe}
html[data-theme="dark"] .card{background:#101a33;border:1px solid rgba(255,255,255,0.08);box-shadow:none}
html[data-theme="dark"] .table{background:transparent}
html[data-theme="dark"] th{color:#e5e7eb}
html[data-theme="dark"] td{color:#e5e7eb}
html[data-theme="dark"] .muted{color:rgba(229,231,235,0.7)}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{
  background:#0f1a30;color:#e5e7eb;border:1px solid rgba(255,255,255,0.14)
}
html[data-theme="dark"] .btn{background:#1f2a44;border:1px solid rgba(255,255,255,0.12)}
html[data-theme="dark"] .btn.primary{background:#2b3a5f}


/* --- Ads admin UI polish (v31) --- */
.form-row.fullspan{grid-template-columns:1fr;}
.checkbox-inline{display:flex;align-items:center;gap:10px;justify-content:flex-start;}
.checkbox-inline input[type="checkbox"]{margin:0;flex:0 0 auto;}
/* Make admin form sections breathe a bit */
.form-section{padding:14px 16px;}
.form-section + .form-section{margin-top:16px;}
/* Reduce global ad slot vertical whitespace */
.ad-slot{margin:6px auto;}
.ad-slot.ad-global-top{margin-top:6px;margin-bottom:8px;}
/* Dark mode: ensure navbar button stays visible */
html[data-theme="dark"] #theme-toggle{border-color:rgba(255,255,255,.2);}

/* Support chat */
.support-topbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.support-chat{display:flex;flex-direction:column;gap:10px}
.support-msg{max-width:78%;padding:10px 12px;border-radius:14px;background:#f5f5f7;border:1px solid #eee}
.support-msg.in{align-self:flex-start}
.support-msg.out{align-self:flex-end;background:#eef2ff;border-color:#e0e7ff}
.support-meta{display:flex;gap:10px;align-items:center;justify-content:space-between;margin-top:6px}
.support-img-link{display:inline-block}
.support-img{display:block;max-width:320px;max-height:320px;width:auto;height:auto;border-radius:12px;margin-top:8px;cursor:zoom-in}
.kv{display:flex;gap:10px;align-items:center;flex-wrap:wrap}


/* ---------- Bracket tree (symmetric single-elimination) ---------- */
.bracket-tree{
  --unit: 20px;
  --line: #cbd5e1;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 18px;
}

.bracket-tree-inner{
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 220px;
  gap: 26px;
  padding: 10px 10px 24px 10px;
  width: max-content;
  min-height: calc((var(--rows) + 1) * var(--unit) + 76px);
}

.bracket-lines{
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 1;
}

.roundcol{
  position: relative;
  display: grid;
  grid-template-rows: auto repeat(var(--rows), var(--unit));
  align-content: start;
  z-index: 2;
  min-height: calc((var(--rows) + 1) * var(--unit));
}

.centercol{
  grid-auto-columns: 220px;
}

.roundtitle{
  position: sticky;
  top: 0;
  background: #f9fafb;
  padding: 6px 8px;
  border-radius: 10px;
  font-weight: 800;
  margin-bottom: 10px;
  z-index: 3;
}

.bracket-match{
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px 9px;
  height: 100%;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}

.bracket-match:hover{
  border-color: #cbd5e1;
  box-shadow: 0 8px 26px rgba(0,0,0,.07);
}

.bracket-match.final{
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

.bracket-match .t{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
}


.bracket-match.placeholder{
  opacity: .75;
}

.matchmeta{
  font-size: 11px;
  line-height: 1.2;
  color: #6b7280;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teamline{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.team{
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score{
  flex: 0 0 auto;
  font-weight: 800;
  min-width: 18px;
  text-align: right;
}

.thirdplace{
  margin-top: 14px;
}


/* ---------- FIFA-like bracket tree ---------- */
.bracket-tree{
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 18px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.bracket-tree::-webkit-scrollbar{height:0}

.bracket-tree-inner{
  --unit: 18px;
  --colw: 250px;
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--colw);
  column-gap: 22px;
  align-items: start;
  padding: 6px 12px 18px 12px;
  min-height: calc((var(--rows) + 1) * var(--unit));
  width: max-content;
}

.roundcol{
  display: grid;
  grid-template-rows: auto repeat(var(--rows), var(--unit));
  align-content: start;
}

.roundtitle{
  font-size: 13px;
  font-weight: 800;
  margin: 2px 0 10px 2px;
  color: #0f172a;
}

.center-title{ text-align:center; }

.bracket-lines{
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.bracket-match{
  position: relative;
  z-index: 2;
  display: block;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px 10px;
  text-decoration: none;
  color: inherit;
  min-height: 90px;
}

.bracket-match:hover{
  border-color: #cbd5e1;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

.matchhead{
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 4px;
}

.matchmeta-line{
  padding-right: 18px;
  font-size: 11px;
  line-height: 1.2;
  color: #6b7280;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teamname{
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score{
  font-weight: 800;
  min-width: 16px;
  text-align: right;
}



.scoreblock{
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 46px;
  column-gap: 4px;
  justify-items: end;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.scoreblock .s90{
  font-weight: 400 !important;
  opacity: .55;
  font-size: 12px;
}
.scoreblock .sfinal{
  color: #111827;
  font-weight: 800 !important;
  font-size: 13px;
}
.scoreblock.single .s90{
  opacity: 0;
}

.penbadge{
  pointer-events: none;
  position: absolute;
  top: 8px;
  right: 9px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #374151;
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
}

/* --- pretty tooltip for penalty matches (bracket) --- */
.bracket-tip{
  position: fixed;
  z-index: 9999;
  max-width: 320px;
  background: #fff;
  border: 1px solid rgba(17,24,39,.10);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 14px 34px rgba(0,0,0,.14);
  color: #111827;
  font-size: 12.5px;
  line-height: 1.25;
  pointer-events: none;
}
.bracket-tip .tipmeta{
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 6px;
  font-weight: 600;
}
.bracket-tip .tiptitle{
  font-weight: 900;
  margin-bottom: 6px;
  letter-spacing: .2px;
}
.bracket-tip .tiprow{
  display: flex;
  align-items: center;
  gap: 10px;
}
.bracket-tip .tname{
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.bracket-tip .tname.right{
  text-align: right;
}
.bracket-tip .tscore{
  flex: 0 0 auto;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: .3px;
}
.bracket-tip .dash{
  opacity: .55;
  margin: 0 4px;
}
.bracket-tip .tipsub{
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.bracket-tip .badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid rgba(17,24,39,.08);
  font-size: 11px;
  font-weight: 800;
  color: #111827;
}


/* Sticky horizontal scrollbar for bracket */
.bracket-scrollbar-sticky{
  position: sticky;
  bottom: 10px;
  margin-top: 8px;
  padding: 10px 0 6px 0;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
  z-index: 20;
}

.bracket-scrollbar{
  overflow-x: auto;
  overflow-y: hidden;
  height: 14px;
}

.bracket-scrollbar-spacer{height:1px}

/* --- tweak: reduce match card height (bottom) --- */
.bracket-match{
  min-height: 0 !important;
  padding-bottom: 15px !important;
}

/* --- tweak: make match cards not stretch to grid cell height --- */
.bracket-match{
  align-self: start !important;
  height: auto !important;
}
