/* ==========================================================================
   League theme. ALL branding lives here: change the variables below to
   re-skin the site. (The bracket PNG uses the same colours, see
   brackets/render.py, so update both together.)
   ========================================================================== */
:root {
  --bg: #0e0f14;
  --surface: #161821;
  --surface-2: #1f2230;
  --border: #272a38;
  --text: #e8e8f0;
  --muted: #8a8ea0;
  --accent: #e8b04a;        /* brass / amber */
  --accent-ink: #1a1408;
  --good: #4fbf7f;
  --warn: #e0a03a;
  --bad: #e05a5a;
  --info: #5a9be0;
  --discord: #5865f2;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* our display rules must never un-hide things */
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); }
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .75rem; font-weight: 650; }
h1 { font-size: 1.75rem; letter-spacing: -.01em; }
h2 { font-size: 1rem; }
h3 { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 1.25rem; }
p { margin: 0 0 .75rem; }
code { background: var(--surface-2); padding: .15em .45em; border-radius: 6px; color: var(--accent); }
img { max-width: 100%; }

.container { max-width: 1240px; margin: 0 auto; padding: 28px 20px 48px; }
.container.wide { max-width: none; }
.container.narrow-page { max-width: 640px; }
.muted { color: var(--muted); } .small { font-size: .85em; } .center { text-align: center; }
.inline { display: inline; } .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.center-row { justify-content: center; }
.stack > * + * { margin-top: 24px; }
.grid.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.grid.three { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .grid.three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .grid.three > :last-child { grid-column: 1 / -1; } }
@media (max-width: 700px) { .grid.three { grid-template-columns: 1fr; } }
.grid.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .grid.split { grid-template-columns: 1fr; } }
.grid > .card { margin-bottom: 0; }
.grid { margin-bottom: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.page-head h1 { margin: 0; }
.sub { color: var(--muted); margin: -.4rem 0 1.5rem; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 28px; padding: 0 20px; height: 60px;
  background: rgba(14, 15, 20, .85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand { min-width: 0; flex-shrink: 1; }
.brand img { flex-shrink: 0; }
.event-switch select { max-width: 220px; padding: 4px 8px; font-size: .85rem; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
@media (max-width: 760px) { .brand-name { max-width: 34vw; } .nav-end { flex-shrink: 0; } .menu > summary { max-width: 46vw; overflow: hidden; } }
@media (max-width: 420px) { .brand-name { display: none; } }
.nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav a { color: var(--muted); padding: 6px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover, .nav a.on { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-end { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.nav-toggle, .nav-burger { display: none; }
@media (max-width: 760px) {
  .topbar { gap: 12px; }
  .nav-burger { display: block; cursor: pointer; font-size: 1.3rem; color: var(--muted); order: 3; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--surface); padding: 8px 12px; border-bottom: 1px solid var(--border); }
  .nav-toggle:checked ~ .nav { display: flex; }
}
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px;
  color: var(--muted); position: relative; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn svg { width: 20px; height: 20px; }
.badge { position: absolute; top: 2px; right: 0; background: var(--bad); color: #fff; border-radius: 999px;
  font-size: .65rem; line-height: 16px; min-width: 16px; padding: 0 4px; font-weight: 700; text-align: center; }

/* Account menu (a <details> dropdown, no JavaScript needed) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  border-radius: 999px; border: 1px solid var(--border); color: var(--text); font-weight: 500; font-size: .9rem; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: var(--surface-2); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem;
  object-fit: cover; flex-shrink: 0; vertical-align: middle; }
.avatar.sm { width: 22px; height: 22px; font-size: .68rem; margin-right: 4px; }
.menu-list { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 6px; box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px;
  color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); text-decoration: none; }
.menu-list hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }

/* Cards, buttons, forms */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 24px; }
.card > h2:first-child { margin-bottom: 1rem; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.card.narrow { max-width: 420px; margin: 48px auto; padding: 28px; }
.card.staff { border-color: rgba(224, 160, 58, .45); }
.btn, button.btn, summary.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 9px 16px;
  font-weight: 600; cursor: pointer; font-size: .92rem; font-family: inherit; line-height: 1.2; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid rgba(224, 90, 90, .5); }
.btn.danger:hover { background: rgba(224, 90, 90, .1); }
.btn.discord { background: var(--discord); color: #fff; }
.btn.block { display: flex; width: 100%; }
.btn.small { padding: 5px 11px; font-size: .82rem; }
.btn svg { width: 18px; height: 18px; }
.linkish { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font: inherit; }
.danger-text { color: var(--bad); }
summary.btn { list-style: none; } summary::-webkit-details-marker { display: none; }
.inline-details { display: inline-block; }
form label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: .85rem; font-weight: 500; }
input, select, textarea { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 11px; font: inherit; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type=text], input[type=email], input[type=url], input[type=password], textarea, form .field select { width: 100%; }
.card.narrow input:not([type=checkbox]) { width: 100%; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.help { display: block; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.errorlist { color: var(--bad); list-style: none; padding: 0; margin: 4px 0; font-size: .85rem; }
.player-form ul { list-style: none; padding: 0; columns: 2; } .player-form li label { display: inline; color: var(--text); }
/* Hero checkboxes: Django renders them as nested divs */
.player-form div[id$="heroes"] { columns: 3 150px; column-gap: 16px; }
.player-form div[id$="heroes"] label { display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px 0; color: var(--text); font-weight: 400; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .8rem; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* Collapsible sections */
details.fold { border-top: 1px solid var(--border); }
details.fold > summary { cursor: pointer; list-style: none; padding: 14px 0; color: var(--muted); font-weight: 500;
  display: flex; justify-content: space-between; }
details.fold > summary::after { content: "+"; }
details.fold[open] > summary::after { content: "−"; }
details.fold > summary:hover { color: var(--text); }
details.fold > div { padding-bottom: 16px; }
details.fold-card > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.fold-card > summary h2 { margin: 0; }
details.fold-card > summary::after { content: "+"; color: var(--muted); }
details.fold-card[open] > summary { margin-bottom: 4px; }
details.fold-card[open] > summary::after { content: "−"; }
.mt { margin-top: 16px; } .grow { flex: 1; min-width: 200px; } .push-right { margin-left: auto; }
[id] { scroll-margin-top: 76px; } /* #anchor jumps land below the sticky top bar */

/* Settings-style rows */
.setting { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; flex-wrap: wrap; }
.setting + .setting { border-top: 1px solid var(--border); }
.setting h2 { margin: 0 0 2px; }
.setting p { margin: 0; }

/* Messages and banners */
.messages { max-width: 1240px; margin: 16px auto 0; padding: 0 20px; width: 100%; }
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; background: var(--surface-2); border-left: 3px solid var(--info); }
.msg.success { border-color: var(--good); } .msg.error { border-color: var(--bad); } .msg.warning { border-color: var(--warn); }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: rgba(232, 176, 74, .08); border: 1px solid rgba(232, 176, 74, .35); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 24px; }
.banner.champion { font-size: 1.05rem; justify-content: flex-start; }

/* Status pills */
.status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .7rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; vertical-align: middle; }
.s-approved, .s-confirmed, .s-active, .s-registration { color: var(--good); background: rgba(79, 191, 127, .12); }
.s-pending, .s-awaiting_confirmation, .s-waitlisted, .s-draft { color: var(--warn); background: rgba(224, 160, 58, .12); }
.s-disputed, .s-denied, .s-disqualified, .s-dq, .s-disbanded, .s-forfeit { color: var(--bad); background: rgba(224, 90, 90, .12); }
.s-overridden { color: var(--info); background: rgba(90, 155, 224, .12); }
.live { background: var(--bad); color: #fff; padding: 2px 8px; border-radius: 4px; font-weight: 700; font-size: .7rem; letter-spacing: .04em; }

/* Teams and matches */
.chip { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.chip img { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; }
.chip.won { font-weight: 700; color: var(--accent); }
.tag { font-size: .72em; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; font-weight: 600; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.team-grid > div { padding: 8px 0; border-bottom: 1px solid var(--border); }
.team-grid.tiles { gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.team-grid.tiles > div { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.team-grid.tiles > div:hover { border-color: var(--accent); }
.team-grid.tiles .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.nowrap { white-space: nowrap; }

/* Home: the event header with numbers, and the running-events list */
.event-head { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 20px 24px; margin-bottom: 20px;
  background: linear-gradient(120deg, rgba(224, 160, 58, .12), var(--surface) 55%); border: 1px solid var(--border); border-radius: var(--radius); }
.event-head h1 { margin: 0; font-size: 1.9rem; }
.event-head .eyebrow { margin: 0 0 2px; color: var(--accent); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.event-head .eh-title { flex: 1 1 260px; min-width: 0; }
.event-head .eh-title p { margin: 0; }
.stat-tiles { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-tiles > div { min-width: 92px; padding: 8px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.stat-tiles b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.stat-tiles b small { font-size: .7em; color: var(--muted); font-weight: 500; }
.stat-tiles span { color: var(--muted); font-size: .75rem; }
@media (max-width: 560px) { .stat-tiles { width: 100%; flex-wrap: nowrap; } .stat-tiles > div { flex: 1; min-width: 0; padding: 8px 10px; } }
.event-list a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 8px; margin: 0 -8px;
  border-radius: 8px; color: var(--text); }
.event-list a + a { border-top: 1px solid var(--border); border-radius: 0; }
.event-list a:hover { background: var(--surface-2); text-decoration: none; border-radius: 8px; }
.event-list a.on { box-shadow: inset 3px 0 0 var(--accent); }
.event-list .el-meta { color: var(--muted); font-size: .78rem; } .event-list .status { white-space: nowrap; flex-shrink: 0; }
.team-head { display: flex; gap: 20px; align-items: center; margin-bottom: 28px; }
.team-head h1 { margin-bottom: 4px; }
.team-head p { margin: 0; }
.logo-lg { width: 88px; height: 88px; object-fit: cover; border-radius: var(--radius); }
.stats { display: flex; gap: 28px; margin-top: 10px; }
.stats b { display: block; font-size: 1.3rem; }
.stats span { color: var(--muted); font-size: .8rem; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; padding: 0 8px 8px; }
.table td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--border); }
.list-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.list-item:first-of-type { border-top: 0; }
.match-row { display: grid; grid-template-columns: 1fr 56px 1fr; gap: 2px 12px; align-items: center; padding: 9px 8px;
  margin: 0 -8px; border-radius: 8px; color: var(--text); }
.match-row + .match-row { border-top: 1px solid var(--border); border-radius: 0; }
.match-row:hover { background: var(--surface-2); text-decoration: none; border-radius: 8px; }
.match-row strong { text-align: center; font-variant-numeric: tabular-nums; }
.match-row .vs { color: var(--muted); font-weight: 400; font-size: .85rem; }
.match-row .mr-meta { grid-column: 1 / -1; font-size: .75rem; color: var(--muted); text-align: center; }
.match-row .mr-a { text-align: right; } .match-row .mr-a, .match-row .mr-b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; margin: 8px 0 12px; font-size: 1.3rem; }
.scoreboard .side:first-child { text-align: right; } .scoreboard .score { font-size: 2.4rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.scoreboard .score { white-space: nowrap; }
@media (max-width: 560px) {
  .scoreboard { gap: 12px; font-size: 1rem; } .scoreboard .score { font-size: 1.8rem; }
  .scoreboard .chip { flex-direction: column; gap: 2px; }
}
.match-meta { text-align: center; color: var(--muted); margin-bottom: 32px; }
.gallery { display: flex; flex-wrap: wrap; gap: 12px; } .gallery figure { margin: 0; width: 220px; }
.gallery img { width: 220px; height: 124px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.unread a { font-weight: 600; color: var(--text); }
.unread::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: middle; }
.hero { text-align: center; padding: 40px 0 36px; } .hero h1 { font-size: 2.6rem; margin-bottom: .5rem; }
.lead { font-size: 1.05rem; color: var(--muted); }
.empty { color: var(--muted); padding: 8px 0; margin: 0; }

/* Bracket */
.bracket-scroll { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 16px; }
.bracket-zoom { transform-origin: 0 0; }
.side-title { margin-top: 20px; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.side-title:first-child { margin-top: 0; }
.bracket { display: flex; gap: 28px; align-items: stretch; }
.round { display: flex; flex-direction: column; min-width: 200px; }
.round-title { color: var(--accent); font-size: .75rem; font-weight: 600; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .05em; }
.round-matches { display: flex; flex-direction: column; justify-content: space-around; flex: 1; gap: 10px; }
.bm { display: block; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); position: relative; font-size: .85rem; }
.bm:hover { border-color: var(--accent); text-decoration: none; }
.bm.is-bye { opacity: .35; } .bm.on-stream { border-color: var(--bad); }
.bm.s-awaiting_confirmation { border-color: var(--warn); } .bm.s-disputed { border-color: var(--bad); }
.bm-id { position: absolute; top: -9px; right: 6px; font-size: .65rem; color: var(--muted); background: var(--surface); padding: 0 4px; }
.bm-team { display: flex; justify-content: space-between; padding: 5px 10px; gap: 8px; }
.bm-team + .bm-team { border-top: 1px solid var(--border); }
.bm-team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.bm-team.won { color: var(--accent); font-weight: 700; } .bm-team.empty { color: var(--muted); }

.footer { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: .8rem;
  padding: 24px 16px; border-top: 1px solid var(--border); }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }
.prose { max-width: 75ch; }

/* Inbox */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tabs a { color: var(--muted); padding: 8px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.count { display: inline-block; background: var(--bad); color: #fff; border-radius: 999px; font-size: .7rem; line-height: 16px;
  min-width: 16px; padding: 0 5px; text-align: center; font-weight: 700; }
.convo { display: flex; align-items: center; gap: 12px; padding: 12px 8px; margin: 0 -8px; border-radius: 8px; color: var(--text); }
.convo + .convo { border-top: 1px solid var(--border); }
.convo:hover { background: var(--surface-2); text-decoration: none; }
.convo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.convo-main .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo-side { white-space: nowrap; }
.unread-row strong { color: var(--accent); }
.messages-list { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 80%; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; align-self: flex-start; }
.bubble.mine { align-self: flex-end; background: rgba(232, 176, 74, .12); }
.bubble .small { margin-top: 4px; }
.invite-box { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }

/* Team hub and chat */
.hub-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .hub-grid { grid-template-columns: 1fr; } }
.chat-card { display: flex; flex-direction: column; }
.chat-log { height: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 4px; }
.chat-log:has(.chat-line) .chat-empty { display: none; }
.chat-line { display: flex; gap: 10px; align-items: flex-start; }
.chat-body { min-width: 0; overflow-wrap: anywhere; }
.chat-meta { font-size: .85rem; }
.chat-del { margin-left: 6px; visibility: hidden; color: var(--bad); font-size: .8em; }
.chat-line:hover .chat-del { visibility: visible; }
.chat-form { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; }
.chat-compose textarea { flex: 1; resize: vertical; min-height: 40px; }
.logo-sm { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; vertical-align: middle; }

/* Free agency and player cards */
.fa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.fa-card { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.fa-card p { margin: 0; }
.fa-top { display: flex; align-items: center; gap: 10px; color: var(--text); }
.fa-top:hover { text-decoration: none; }
.fa-actions { margin-top: auto; }
.hero-tags .tag { display: inline-block; margin: 0 2px 4px 0; font-size: .75rem; padding: 1px 6px; }
.player-head { display: flex; gap: 16px; align-items: center; margin-bottom: 24px; }
.player-head h1 { margin: 0 0 4px; }
.player-head p { margin: 0; }
.avatar.lg { width: 72px; height: 72px; font-size: 1.6rem; }
/* Hero picker (site.js turns the hero multi-select into this) */
.hero-search-wrap { position: relative; }
.hero-search { width: 100%; }
.hero-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 8; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 4px; box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 2px; }
.hero-option { text-align: left; padding: 7px 10px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; cursor: pointer; }
.hero-option.on, .hero-option:hover { background: var(--surface-2); color: var(--accent); }
.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hero-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; font-size: .85rem;
  background: rgba(232, 176, 74, .12); border: 1px solid rgba(232, 176, 74, .4); color: var(--text); }
.hero-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 4px; border-radius: 50%; }
.hero-chip button:hover { color: var(--bad); }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); margin-top: 4px; }
label.check.disabled { color: var(--muted); opacity: .55; cursor: not-allowed; }

/* "Make a team / join free agency" banner, fixed to the bottom of the window */
.bottom-banner { position: sticky; bottom: 0; z-index: 9; display: flex; align-items: center; justify-content: center;
  gap: 12px 20px; flex-wrap: wrap; padding: 12px 20px; background: var(--surface); border-top: 1px solid rgba(232, 176, 74, .45);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .35); }
.bottom-banner .muted { color: var(--muted); }

/* Chat attachments: the + menu, video clips, link embeds and BuildLocker cards */
.attach-menu { position: relative; }
.attach-btn { list-style: none; cursor: pointer; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 1.5rem; font-weight: 400; line-height: 1; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.attach-btn::-webkit-details-marker { display: none; }
.attach-menu[open] .attach-btn { border-color: var(--accent); color: var(--accent); }
.attach-list { position: absolute; bottom: 48px; left: 0; z-index: 5; width: 260px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px; box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.attach-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; background: none; border: 0;
  color: var(--text); font: inherit; cursor: pointer; margin: 0; }
.attach-item:hover { background: var(--surface-2); }
.attach-item .chat-time { display: block; }
.attach-tip { padding: 6px 10px 4px; margin: 0; border-top: 1px solid var(--border); }
.chat-attachments { display: flex; gap: 8px; margin-bottom: 8px; }
.attach-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 6px 4px 12px; font-size: .85rem; }
.attach-chip input { width: 230px; padding: 4px 8px; }
.chat-image { display: block; max-width: min(100%, 420px); max-height: 360px; border-radius: 8px; margin-top: 6px; object-fit: contain; }
.chat-video { display: block; max-width: min(100%, 420px); max-height: 320px; border-radius: 8px; margin-top: 6px; background: #000; }
.chat-embed iframe { display: block; width: min(100%, 420px); aspect-ratio: 16 / 9; border: 0; border-radius: 8px; margin-top: 6px; }
.build-card { display: flex; align-items: center; gap: 12px; margin-top: 6px; max-width: 420px; padding: 10px 12px; border-radius: 10px;
  background: rgba(232, 176, 74, .08); border: 1px solid rgba(232, 176, 74, .4); color: var(--text); }
.build-card:hover { text-decoration: none; border-color: var(--accent); }
.build-icon { font-size: 1.4rem; color: var(--accent); }
.build-open { margin-left: auto; color: var(--accent); font-weight: 600; font-size: .85rem; white-space: nowrap; }
.chat-time { color: var(--muted); font-size: .78rem; }
.mention { color: var(--hub-accent, var(--accent)); font-weight: 600; background: color-mix(in srgb, var(--hub-accent, var(--accent)) 14%, transparent);
  border-radius: 4px; padding: 0 3px; }
.chat-line.mentions-me .chat-body { box-shadow: inset 3px 0 0 var(--hub-accent, var(--accent)); }
.chat-form { position: relative; }
.mention-list { position: absolute; bottom: calc(100% - 4px); left: 48px; z-index: 6; min-width: 220px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 4px; box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.mention-item { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 6px 10px; border: 0; border-radius: 6px;
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.mention-item.on, .mention-item:hover { background: var(--surface-2); }
.sound-menu { position: relative; }
.sound-menu > summary { list-style: none; cursor: pointer; }
.sound-menu > summary::-webkit-details-marker { display: none; }
.sound-panel { position: absolute; right: 0; top: 40px; z-index: 7; width: 260px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 4px 14px 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.sound-panel select, .sound-panel input[type=range] { width: 100%; }
.sound-panel label.check { margin: 6px 0 0; }

/* Team hub theme (captain-customisable). Values come in as CSS variables on .hub-theme. */
.hub-page { padding: 0; }
.hub-theme { --hub-panel: #161821; --hub-panel-alpha: 85%; --hub-text: #e8e8f0; --hub-accent: #e8b04a; --hub-dim: .55;
  min-height: calc(100vh - 60px); color: var(--hub-text); }
.hub-theme.has-bg { position: relative; isolation: isolate; overflow: hidden; }
.hub-theme.has-bg::before { content: ""; position: absolute; inset: 0; z-index: -2;
  background: var(--hub-bg) var(--hub-x, 50%) var(--hub-y, 50%) / cover no-repeat;
  transform: scale(calc(var(--hub-zoom, 100) / 100)); transform-origin: var(--hub-x, 50%) var(--hub-y, 50%); }
.hub-theme.has-bg::after { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(0, 0, 0, var(--hub-dim)); pointer-events: none; }
.hub-theme .hub-panel { background: color-mix(in srgb, var(--hub-panel) var(--hub-panel-alpha), transparent);
  border-color: color-mix(in srgb, var(--hub-text) 14%, transparent); color: var(--hub-text); backdrop-filter: blur(6px); }
.hub-theme .hub-panel h2, .hub-theme .chat-meta strong, .hub-theme .list-item, .hub-theme .match-row { color: var(--hub-text); }
.hub-theme .chat-time, .hub-theme .hub-panel .empty, .hub-theme .match-row .mr-meta { color: color-mix(in srgb, var(--hub-text) 60%, transparent); }
.hub-theme .list-item, .hub-theme .match-row + .match-row, .hub-theme .chat-form { border-color: color-mix(in srgb, var(--hub-text) 12%, transparent); }
.hub-theme .hub-send { background: var(--hub-accent); color: #111; }
.hub-theme .chat-text a { color: var(--hub-accent); }
.hub-theme .build-card { border-color: color-mix(in srgb, var(--hub-accent) 50%, transparent); background: color-mix(in srgb, var(--hub-accent) 10%, transparent); }
.hub-theme .build-icon, .hub-theme .build-open { color: var(--hub-accent); }
.hub-theme .page-head h1, .hub-theme .sub { color: var(--hub-text); text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.hub-motto { font-size: 1.15rem; font-weight: 700; color: var(--hub-accent); padding: 10px 16px; margin: -8px 0 24px;
  border-left: 3px solid var(--hub-accent); background: color-mix(in srgb, var(--hub-panel) var(--hub-panel-alpha), transparent); border-radius: 0 8px 8px 0; }
/* Message styles */
.hub-bubbles-rounded .chat-body, .hub-bubbles-square .chat-body { padding: 8px 12px; background: color-mix(in srgb, var(--hub-text) 7%, transparent); }
.hub-bubbles-rounded .chat-body { border-radius: 12px; }
.hub-bubbles-square .chat-body { border-radius: 3px; border-left: 3px solid color-mix(in srgb, var(--hub-text) 25%, transparent); }
.hub-bubbles-rounded .chat-line.mine .chat-body, .hub-bubbles-square .chat-line.mine .chat-body { background: color-mix(in srgb, var(--hub-accent) 20%, transparent); }
.hub-bubbles-square .chat-line.mine .chat-body { border-left-color: var(--hub-accent); }
.hub-bubbles-plain .chat-line.mine .chat-meta strong { color: var(--hub-accent); }
.hub-no-avatars .chat-line > .avatar { display: none; }
/* Fonts and sizes */
.hub-font-rajdhani { font-family: "Rajdhani", var(--font); }
.hub-font-exo { font-family: "Exo 2", var(--font); }
.hub-font-orbitron { font-family: "Orbitron", var(--font); }
.hub-font-serif { font-family: Georgia, "Times New Roman", serif; }
.hub-font-mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.hub-font-pixel { font-family: "Press Start 2P", var(--font); }
.hub-font-bebas { font-family: "Bebas Neue", var(--font); letter-spacing: .03em; }
.hub-font-pixel .chat-log, .hub-font-pixel .hub-motto { line-height: 1.9; font-size: .78em; }
.hub-size-small .chat-log { font-size: 13px; }
.hub-size-medium .chat-log { font-size: 15px; }
.hub-size-large .chat-log { font-size: 17.5px; }

/* Customize hub page */
.style-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .style-grid { grid-template-columns: 1fr; } }
.style-form h2 { margin-bottom: 4px; }
.style-form input[type=range] { width: 100%; }
.style-form output { color: var(--text); margin-left: 6px; }
.color-row { display: flex; gap: 12px; flex-wrap: wrap; }
.color-row label { display: flex; flex-direction: column; gap: 6px; }
.color-row input[type=color] { width: 64px; height: 36px; padding: 2px; cursor: pointer; }
.style-preview-wrap { position: sticky; top: 76px; }
#hub-preview { min-height: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.hub-preview-inner { padding: 20px; }
.hub-preview-inner .hub-motto { margin-top: 0; }
.hub-preview-inner .card { margin-bottom: 0; }
.preview-log { height: 300px; }
.bg-dialog { width: min(720px, calc(100vw - 32px)); background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: 0 24px 64px rgba(0, 0, 0, .6); }
.bg-dialog::backdrop { background: rgba(0, 0, 0, .65); }
.bg-dialog input[type=range] { width: 100%; }
.bg-frame { min-height: 0; aspect-ratio: 16 / 9; border-radius: 10px; border: 1px solid var(--border); display: flex;
  align-items: center; justify-content: center; margin: 12px 0 4px; }
.bg-frame-panel { width: 55%; padding: 14px 16px; border-radius: 10px; display: flex; flex-direction: column; gap: 4px;
  background: color-mix(in srgb, var(--hub-panel) var(--hub-panel-alpha), transparent); color: var(--hub-text); font-size: .85rem; }

/* Edit team page */
.edit-tabs { position: sticky; top: 60px; z-index: 5; background: var(--bg); }
.edit-tabs ~ .card[id] { scroll-margin-top: 120px; } /* land below the top bar and these tabs */
.tab-panel-hidden { display: none !important; }
.details-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 640px) { .details-grid { grid-template-columns: 1fr; } }
.details-logo label { margin-top: 12px; }
.details-logo input[type=file] { width: 100%; }
.logo-empty { display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--muted); font-weight: 700; }
.two-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.card.setting { display: flex; padding: 20px; }

.role-select { padding: 4px 8px; font-size: .85rem; }
@media (max-width: 560px) { .chat-card { padding: 14px; } .chat-log { height: 60vh; } }

/* Match room: hero draft + match chat. Hidden King is amber, Archmother is blue. */
:root { --hk: #e8b04a; --am: #5b9cf0; }
.room-cta { align-items: center; }
.room-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 960px) { .room-grid { grid-template-columns: 1fr; } }
.room-grid .card { margin-bottom: 20px; }
.room-chat .chat-log { height: 520px; }
.room-chat .chat-compose input { flex: 1; }
.draft-top { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; }
.draft-team { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.draft-team.am { text-align: right; align-items: flex-end; }
.draft-team .side-name { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.draft-team.hk .side-name { color: var(--hk); } .draft-team.am .side-name { color: var(--am); }
.draft-team.hk.on { border-color: var(--hk); box-shadow: 0 0 0 1px var(--hk); }
.draft-team.am.on { border-color: var(--am); box-shadow: 0 0 0 1px var(--am); }
.draft-team .grace { color: var(--muted); font-size: .75rem; }
.draft-clock { text-align: center; min-width: 140px; }
.draft-clock .turn { display: block; color: var(--muted); font-size: .8rem; text-transform: capitalize; }
.draft-clock b { display: block; font-size: 2.4rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.draft-clock b.in-grace { color: var(--bad); }
.draft-clock .clock-sub { color: var(--muted); font-size: .75rem; }
.draft-step { margin-top: 16px; }
.ready-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 12px; }
.ready { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .85rem; }
.ready.yes { color: var(--good); background: rgba(79, 191, 127, .12); }
.draft-warn { color: var(--bad); }
.draft-error { color: var(--bad); min-height: 1.2em; margin-top: 6px; }
.btn.side-hk { background: var(--hk); } .btn.side-am { background: var(--am); color: #0b1424; }
.your-turn { margin: 14px 0 0; padding: 8px 12px; border-radius: 8px; background: rgba(232, 176, 74, .14); color: var(--accent); font-weight: 600; }
.lineups { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.lineup { padding: 10px; border-radius: 10px; border: 1px solid var(--border); }
.lineup.hk { border-top: 3px solid var(--hk); } .lineup.am { border-top: 3px solid var(--am); }
.lineup .picks { display: flex; gap: 6px; flex-wrap: wrap; min-height: 84px; }
.lineup figure { margin: 0; width: 64px; text-align: center; }
.lineup figure img { width: 64px; height: 64px; object-fit: cover; object-position: top; border-radius: 8px; }
.lineup figcaption { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lineup .bans { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ban-chip { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; color: var(--muted); text-decoration: line-through; }
.ban-chip img { width: 22px; height: 22px; border-radius: 4px; object-fit: cover; object-position: top; filter: grayscale(1); opacity: .7; }
.draft-order { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 14px 0 0; }
.slot { display: flex; flex-direction: column; min-width: 78px; padding: 5px 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: .72rem; }
.slot.hk { border-left: 3px solid var(--hk); } .slot.am { border-left: 3px solid var(--am); }
.slot.ban .slot-label::before { content: "⊘ "; }
.slot.pickban .slot-label::before { content: "✕ "; } .slot.pickban { border-style: dashed; }
.lineup figure.removed img { filter: grayscale(1); opacity: .35; } .lineup figure.removed figcaption { text-decoration: line-through; color: var(--bad); }
.slot .slot-label { color: var(--muted); font-weight: 600; }
.slot .slot-hero { color: var(--text); }
.slot .slot-note { color: var(--bad); }
.slot.now { outline: 2px solid var(--accent); }
.slot.done { opacity: .75; }
.staff-reset { margin-top: 12px; text-align: right; }
.hero-pool .card-head input { max-width: 220px; }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.hero-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: .72rem; cursor: pointer; }
.hero-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: top; border-radius: 6px; }
.hero-tile .hero-initials { width: 100%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 6px; background: var(--surface); font-weight: 700; font-size: 1.2rem; }
.hero-tile span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hero-pool.my-turn .hero-tile:not(:disabled):hover { border-color: var(--accent); }
.hero-tile:disabled { cursor: default; }
.hero-tile.gone { opacity: .25; filter: grayscale(1); }
.hero-tile.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.lock-bar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--border); background: var(--surface); }
@media (max-width: 560px) { .lineups { grid-template-columns: 1fr; } .draft-clock { min-width: 90px; } .draft-clock b { font-size: 1.8rem; } }
