/* ---------- Drawer ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 20; animation: fade .15s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100%); z-index: 21;
  background: var(--bg-2); border-left: 1px solid var(--line); overflow-y: auto;
  padding: calc(14px + var(--safe-top)) 18px calc(48px + var(--safe-bottom));
  animation: slide .2s ease-out;
}
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 8px; margin: calc(-1 * var(--safe-top)) 0 14px; position: sticky; top: calc(-14px - var(--safe-top)); padding: calc(10px + var(--safe-top)) 0 10px; background: var(--bg-2); z-index: 2; }
.drawer-head h2 { margin: 0; font-size: 16px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.block-title { margin: 22px 0 10px; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.block-title .meta { font-weight: 400; }

.scoreboard {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--panel)), var(--panel));
  border: 1px solid var(--line); border-radius: 16px; padding: 18px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; text-align: center;
}
.sb-team { display: grid; justify-items: center; gap: 8px; min-width: 0; }
.sb-team .tn { font-weight: 800; font-size: 16px; overflow-wrap: anywhere; }
.sb-team.link { cursor: pointer; }
.sb-team.link:hover .tn { color: var(--accent); }
.sb-score { font-size: 36px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sb-meta { grid-column: 1 / -1; color: var(--muted); font-size: 12px; display: flex; gap: 6px 14px; justify-content: center; flex-wrap: wrap; }

.maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.map-card { position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); min-height: 92px; background: var(--panel); }
.map-card .bgimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.map-card .shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--panel) 92%, transparent)); }
.map-card .content { position: relative; padding: 10px 12px; }
.map-card .mname { font-weight: 800; margin-bottom: 6px; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.map-card .mrow { display: flex; align-items: center; gap: 8px; height: 22px; }
.map-card .mrow .s { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.map-card .mrow.w .s { color: var(--win); }

.vetoes { margin: 0; padding: 0; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.vetoes li { padding: 8px 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.vetoes li:first-child { border-top: 0; }
.vetoes .n { color: var(--muted); width: 18px; }

.lineups { display: grid; gap: 10px; }
.lineup { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.lineup-head { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 10px; }
.players-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.pcard { text-align: center; cursor: pointer; border-radius: 10px; padding: 6px 2px; }
.pcard:hover { background: var(--panel-2); }
.pcard img.photo { width: 100%; max-width: 84px; aspect-ratio: 1; object-fit: cover; object-position: top; border-radius: 10px; margin: 0 auto 6px; background: var(--panel-3); }
.pcard .pn { font-weight: 700; font-size: 12px; display: flex; gap: 4px; align-items: center; justify-content: center; overflow: hidden; }
.pcard .pn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .ps { color: var(--muted); font-size: 11px; }

table { width: 100%; border-collapse: collapse; background: var(--panel); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
th, td { padding: 8px 10px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--panel-2); cursor: pointer; user-select: none; }
tbody tr { border-top: 1px solid var(--line); }
.pos { color: var(--win); }
.neg { color: var(--lose); }

.profile-head { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); position: relative; overflow: hidden; }
.profile-head .glow { position: absolute; inset: 0; opacity: .25; pointer-events: none; }
.profile-head > * { position: relative; }
.profile-head h3 { margin: 0 0 4px; font-size: 22px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.badge { font-size: 12px; padding: 3px 9px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); }
.badge b { color: var(--accent); }
.player-photo { width: 120px; height: 120px; object-fit: cover; object-position: top; border-radius: 14px; background: var(--panel-3); }

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.kv div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.kv span { display: block; color: var(--muted); font-size: 11px; }
.kv b { font-size: 14px; }

.bars { display: grid; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 48px; gap: 10px; align-items: center; font-size: 13px; }
.bar-track { height: 8px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.bar-track > i { display: block; height: 100%; border-radius: 99px; }

.radar-wrap { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 16px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.radar text { font-size: 10px; fill: var(--muted); font-family: inherit; }
.medal { font-weight: 700; }
.medal.gold { color: var(--gold); } .medal.silver { color: var(--silver); } .medal.bronze { color: var(--bronze); }

.mini-match { display: grid; grid-template-columns: 74px 1fr auto 1fr; gap: 8px; align-items: center; padding: 9px 12px; border-top: 1px solid var(--line); cursor: pointer; }
.mini-match:first-child { border-top: 0; }
.mini-match:hover { background: var(--panel-2); }
.mini-match .t { display: flex; align-items: center; gap: 7px; min-width: 0; }
.mini-match .t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-match .t.r { justify-content: flex-end; text-align: right; }
.mini-match .sc { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 46px; text-align: center; }

/* Event detail */
.event-head { overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
.event-head .banner { display: block; width: 100%; aspect-ratio: 16 / 5; object-fit: cover; background: var(--panel-3); }
.event-head .body { padding: 14px 16px 16px; display: grid; gap: 10px; }
.event-head .title { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.event-head h3 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.event-head .kv { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.event-head .ev-logo { width: 48px; height: 48px; object-fit: contain; }
.tag.live { color: var(--live); border-color: var(--live); font-weight: 700; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.att-team { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; padding: 10px; }
.att-team .logo-md { width: 36px; height: 36px; }
.att-team .tn { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-team .rk { font-size: 11px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.att-team .rk b { color: var(--text); }
.att-team .why { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prize-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--line); }
.prize-row:first-child { border-top: 0; }
.prize-row[data-href] { cursor: pointer; }
.prize-row[data-href]:hover { background: var(--panel-2); }
.prize-row .pl { font-weight: 800; font-variant-numeric: tabular-nums; }
.prize-row .pt { display: flex; align-items: center; gap: 8px; min-width: 0; }
.prize-row .pt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prize-row .pm { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.prize-row .pm small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.pool-map { position: relative; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-3); aspect-ratio: 16 / 10; }
.pool-map img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pool-map span { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px; font-weight: 800; font-size: 13px; color: #fff; background: linear-gradient(180deg, transparent, rgba(0,0,0,.75)); }
/* Favourites & notifications */
.row.fav { box-shadow: inset 3px 0 0 var(--star); }
.fav-star { color: var(--star); }
.star-btn { background: none; border: 0; color: var(--muted); font-size: 17px; cursor: pointer; padding: 0 4px; line-height: 1; }
.star-btn:hover { color: var(--star); }
.star-btn[aria-pressed="true"] { color: var(--star); }
.chip.fav-btn[aria-pressed="true"] { background: var(--star); border-color: var(--star); color: #111; }
.notify-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 12px 10px; display: grid; }
.switch-row { display: flex; gap: 10px; align-items: center; padding: 7px 0; cursor: pointer; }
.switch-row.sub { padding-left: 26px; }
.switch-row input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.switch-row input:disabled + span { color: var(--muted); }
.notify-foot { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.fav-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); cursor: pointer; }
.fav-row:first-child { border-top: 0; }
.fav-row:hover { background: var(--panel-2); }
.fav-row .fn { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.brackets { display: grid; gap: 10px; }
.bracket { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 12px; min-width: 0; }
.bracket-name { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.bracket-cols { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.bracket-col { flex: 1 0 190px; display: flex; flex-direction: column; gap: 6px; }
.bracket-col h4 { margin: 0; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.bracket-slots { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 8px; }
.bslot { border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); overflow: hidden; }
.bslot[data-href] { cursor: pointer; }
.bslot[data-href]:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.bt { display: grid; grid-template-columns: 18px 1fr auto; gap: 7px; align-items: center; padding: 5px 8px; font-size: 13px; }
.bt + .bt { border-top: 1px solid var(--line); }
.bt .bn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt .ph { color: var(--muted); font-style: italic; }
.bt .bs { font-variant-numeric: tabular-nums; }
.bt.w { font-weight: 700; } .bt.w .bs { color: var(--win); }
.bt.l { color: var(--muted); }
.bmeta { font-size: 11px; color: var(--muted); padding: 3px 8px; background: var(--panel-2); border-top: 1px solid var(--line); }
.formats { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.formats div { display: grid; grid-template-columns: 130px 1fr; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); }
.formats div:first-child { border-top: 0; }
.formats dt { color: var(--muted); font-size: 12px; }
.formats dd { margin: 0; white-space: pre-line; }
