/* ------------------------------------------------------------
   EGNC Black Ball Hunters — V.1.1  "Pool-ball colours"
   Every accent is a ball: 1 yellow, 2 blue, 3 red, 4 purple,
   5 orange, 6 green, 7 maroon, 8 black — on table felt.
------------------------------------------------------------ */
:root {
  --bg: #FFF8EC;
  --surface: #FFFFFF;
  --surface-2: #F7F1E4;
  --ink: #15172B;
  --ink-2: #3A3D55;
  --ink-3: #55586E;
  --line: #E9E1CF;
  --felt: #0F5A3C;
  --felt-2: #187A52;
  --b1: #F5B700;  /* yellow */
  --b2: #1F5FD1;  /* blue   */
  --b3: #E03A2F;  /* red    */
  --b4: #6A3FB5;  /* purple */
  --b5: #F07A16;  /* orange */
  --b6: #12804F;  /* green  */
  --b7: #8E2236;  /* maroon */
  --b8: #15172B;  /* black  */
  --red-soft: #FDE3DF;  --red-ink: #B42318;
  --green-soft: #DDF3E6; --green-ink: #0F5A3C;
  --blue-soft: #EAF0FD;
  --purple-soft: #EFE9FA;
  --orange-soft: #FFE6CF; --orange-ink: #9A4A00;
  --yellow-soft: #FFF1C2; --yellow-ink: #7A5A00;
  --shadow: 0 8px 24px rgba(21, 23, 43, .08);
  --shadow-lg: 0 16px 40px rgba(21, 23, 43, .16);
  --radius: 16px;
  --link: #1F5FD1;
  --display: "Shippori Mincho B1", "Hiragino Mincho ProN", Georgia, serif;
  --body: "Zen Kaku Gothic New", "Hiragino Sans", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0E1020; --surface: #181B30; --surface-2: #20243D; --ink: #F3F1EA; --ink-2: #C9CADB; --ink-3: #9EA0B8; --line: #2C3050;
  --red-soft: #3A1D22; --red-ink: #FF8A7E; --green-soft: #12301F; --green-ink: #6EE0A3; --blue-soft: #1A2547;
  --purple-soft: #2A2145; --orange-soft: #3A2615; --orange-ink: #FFB46E; --yellow-soft: #3A3010; --yellow-ink: #FFD866;
  --shadow: 0 8px 24px rgba(0, 0, 0, .35); --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
  --link: #8DB0FF;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.6; transition: background .3s, color .3s; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--b3); }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 4.4vw, 46px); }
h2 { font-size: 26px; }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
code { background: var(--surface-2); padding: 2px 8px; border-radius: 8px; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.main { padding-top: 36px; padding-bottom: 80px; min-height: 70vh; }

/* ---------- header ---------- */
.site-head { background: var(--felt); color: #fff; position: sticky; top: 0; z-index: 40; }
.head-row { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand:hover { color: #fff; }
.seal { width: 40px; height: 40px; border-radius: 50%; background: var(--b3); color: #fff; display: grid; place-items: center;
  font-family: var(--display); font-size: 21px; font-weight: 800; box-shadow: inset -4px -5px 0 rgba(0,0,0,.18); flex: none; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 20px; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { padding: 9px 14px; text-decoration: none; color: #fff; border-radius: 99px; font-weight: 700; font-size: 15px; }
.nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav a.on { background: var(--b1); color: var(--b8); }
.nav a.quiet { color: #BFE3D0; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: rgba(255,255,255,.22); }
.stripe { display: grid; grid-template-columns: repeat(8, 1fr); height: 6px; }
.stripe i:nth-child(1) { background: var(--b1); } .stripe i:nth-child(2) { background: var(--b2); }
.stripe i:nth-child(3) { background: var(--b3); } .stripe i:nth-child(4) { background: var(--b4); }
.stripe i:nth-child(5) { background: var(--b5); } .stripe i:nth-child(6) { background: var(--b6); }
.stripe i:nth-child(7) { background: var(--b7); } .stripe i:nth-child(8) { background: #000; }
.nav-toggle, .nav-btn { display: none; }
@media (max-width: 860px) {
  .nav-btn { display: grid; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 68px; background: var(--felt); flex-direction: column; align-items: stretch; padding: 8px 20px 16px; }
  .nav-toggle:checked ~ .nav { display: flex; }
  .head-row { position: relative; }
}

/* ---------- hero bands ---------- */
.band { color: #fff; }
.band-felt { background: radial-gradient(circle at 78% 35%, var(--felt-2) 0%, var(--felt) 60%); }
.band-yellow { background: linear-gradient(90deg, var(--b1), #FFD25E); color: var(--b8); }
.band-purple { background: radial-gradient(circle at 85% 20%, #8A63D2 0%, var(--b4) 55%); }
.band-ink { background: var(--b8); }
.band-inner { padding: 48px 20px 56px; display: flex; flex-wrap: wrap; gap: 32px; align-items: center; }
.band h1 { margin: 10px 0 12px; }
.band .lead { font-size: 18px; opacity: .9; max-width: 50ch; }
.hl { color: var(--b1); }
.pill { display: inline-flex; align-items: center; gap: 8px; border-radius: 99px; padding: 5px 14px; font-size: 13px; font-weight: 700; background: rgba(255,255,255,.14); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #3DDC84; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.hero-balls { position: relative; flex: 1 1 300px; height: 240px; }
.hero-balls .ball { position: absolute; }
.overlap { margin-top: -34px; position: relative; z-index: 2; }

/* ---------- balls ---------- */
.ball { --c: var(--b8); width: 40px; height: 40px; border-radius: 50%; background: var(--c); display: inline-grid; place-items: center; flex: none;
  box-shadow: inset -5px -6px 0 rgba(0,0,0,.18); }
.ball b { width: 46%; height: 46%; border-radius: 50%; background: #fff; color: #15172B; display: grid; place-items: center; font-size: .42em; font-weight: 900; line-height: 1; font-size: 13px; }
.ball.stripe9 { background: linear-gradient(#fff 0 22%, var(--b1) 22% 78%, #fff 78%); }
.ball.lg { width: 110px; height: 110px; box-shadow: inset -12px -14px 0 rgba(0,0,0,.22), 0 18px 30px rgba(0,0,0,.3); }
.ball.lg b { font-size: 26px; }
.ball.md { width: 84px; height: 84px; box-shadow: inset -9px -10px 0 rgba(0,0,0,.2), 0 12px 22px rgba(0,0,0,.28); }
.band-ink .ball.md { box-shadow: inset -9px -10px 0 rgba(0,0,0,.25), 0 0 0 4px rgba(255,255,255,.18); }
.ball.md b { font-size: 20px; }
.ball.sm { width: 28px; height: 28px; } .ball.sm b { font-size: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #fff; flex: none; font-size: 15px; }
.av-1 { background: var(--b1); color: #15172B; } .av-2 { background: var(--b2); } .av-3 { background: var(--b3); } .av-4 { background: var(--b4); }
.av-5 { background: var(--b5); } .av-6 { background: var(--b6); } .av-7 { background: var(--b7); } .av-0 { background: #8A8DA3; }

/* ---------- layout blocks ---------- */
.section { margin-top: 52px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.eyebrow { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--b3); font-weight: 900; margin-bottom: 6px; }
.band .eyebrow { color: var(--b1); }
.card { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

.stat { background: var(--surface); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); border-top: 6px solid var(--c, var(--b2)); }
.stat b { display: block; font-size: 34px; font-weight: 900; line-height: 1.1; color: var(--c, var(--b2)); font-variant-numeric: tabular-nums; }
.stat span { font-size: 14px; color: var(--ink-3); font-weight: 700; }

/* tournament cards */
.t-card { display: flex; flex-direction: column; background: var(--surface); border-radius: 18px; overflow: hidden; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; }
.t-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: var(--ink); }
.t-band { display: flex; align-items: center; gap: 12px; padding: 13px 20px; font-weight: 900; font-size: 14px; letter-spacing: .04em; color: #fff; }
.t-band.g-8ball { background: var(--b8); } .t-band.g-9ball { background: var(--b1); color: #15172B; } .t-band.g-sg3 { background: var(--b3); }
:root[data-theme="dark"] .t-band.g-8ball { background: #000; }
.t-band .ball { width: 32px; height: 32px; background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.25); }
.t-band .ball b { width: 100%; height: 100%; font-size: 15px; }
.t-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.t-body h3 { margin: 0; font-size: 21px; }
.t-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; font-size: 14px; color: var(--ink-3); }
.meter { display: flex; align-items: center; gap: 10px; }
.meter .track { flex: 1; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.meter .track i { display: block; height: 100%; border-radius: 99px; background: var(--b2); width: 0; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.meter span { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.countdown { font-size: 13px; font-weight: 700; color: var(--ink-3); }

.badge, .tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 900; padding: 4px 11px; border-radius: 99px; line-height: 1.4; }
.badge-registration { background: var(--red-soft); color: var(--red-ink); }
.badge-ongoing { background: var(--green-soft); color: var(--green-ink); }
.badge-completed { background: var(--surface-2); color: var(--ink-2); }
.tag { background: var(--surface); color: var(--ink); border: 2px solid var(--line); font-weight: 700; }
.tag-8ball { border-color: var(--b8); } .tag-9ball { border-color: var(--b1); } .tag-sg3 { border-color: var(--b3); }
:root[data-theme="dark"] .tag-8ball { border-color: #fff; }
.f-round_robin { background: var(--b2); color: #fff; } .f-knockout { background: var(--b3); color: #fff; }
.f-king_table { background: var(--b4); color: #fff; } .f-three_elim { background: var(--b5); color: #fff; } .f-manual { background: var(--ink-3); color: #fff; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 99px;
  border: 2px solid var(--ink); background: var(--ink); color: var(--bg); font: 800 15px var(--body); cursor: pointer; text-decoration: none; transition: transform .12s, filter .12s; }
.btn:hover { color: var(--bg); filter: brightness(1.15); }
.btn:active { transform: scale(.97); }
.btn-shu, .btn-red { background: var(--b3); border-color: var(--b3); color: #fff; }
.btn-shu:hover, .btn-red:hover { color: #fff; }
.btn-yellow { background: var(--b1); border-color: var(--b1); color: #15172B; }
.btn-yellow:hover { color: #15172B; }
.btn-blue { background: var(--b2); border-color: var(--b2); color: #fff; } .btn-blue:hover { color: #fff; }
.btn-purple { background: var(--b4); border-color: var(--b4); color: #fff; } .btn-purple:hover { color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); }
.btn-white { background: transparent; border-color: #fff; color: #fff; } .btn-white:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn-danger { background: transparent; color: var(--b3); border-color: var(--b3); }
.btn-danger:hover { background: var(--red-soft); color: var(--b3); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

form.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 800; font-size: 14px; }
.field .hint { font-size: 13px; color: var(--ink-3); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface);
  font: 16px var(--body); color: var(--ink); }
textarea { min-height: 96px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--b2); outline-offset: 2px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .row-2 { grid-template-columns: 1fr; } }
fieldset { border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 0; }
legend { font-weight: 800; font-size: 14px; padding: 0 6px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.choice input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--b3); }
.choice small { display: block; color: var(--ink-3); }

/* picker cards (admin) */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.pick { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 16px; background: var(--surface);
  border: 3px solid var(--line); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.pick:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick small { color: var(--ink-3); line-height: 1.45; }
.pick:has(input:checked) { border-color: var(--c); background: var(--c); color: #fff; box-shadow: var(--shadow-lg); }
.pick:has(input:checked) small { color: rgba(255,255,255,.9); }
.pick.c-9ball:has(input:checked) { color: #15172B; } .pick.c-9ball:has(input:checked) small { color: #3A3D55; }
.pick:has(input:focus-visible) { outline: 3px solid var(--b2); outline-offset: 2px; }
.pick[aria-disabled="true"] { display: none; }
.c-8ball { --c: var(--b8); } .c-9ball { --c: var(--b1); } .c-sg3 { --c: var(--b3); }
.c-round_robin { --c: var(--b2); } .c-knockout { --c: var(--b3); } .c-king_table { --c: var(--b4); } .c-three_elim { --c: var(--b5); }
:root[data-theme="dark"] .c-8ball { --c: #000; }

.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 46px; height: 46px; border-radius: 50%; border: 0; font-size: 24px; font-weight: 900; cursor: pointer; background: var(--surface-2); color: var(--ink); }
.stepper button.plus { background: var(--b3); color: #fff; }
.stepper output { font-size: 38px; font-weight: 900; color: var(--b3); min-width: 44px; text-align: center; }

.preview { position: sticky; top: 96px; border-radius: 20px; padding: 22px; color: #fff; background: var(--c, var(--b3)); box-shadow: var(--shadow-lg); transition: background .3s; }
.preview .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preview .nums div { background: rgba(255,255,255,.16); border-radius: 12px; padding: 10px; }
.preview .nums b { display: block; font-size: 28px; font-weight: 900; line-height: 1.1; }
.preview .nums span { font-size: 12px; font-weight: 700; }
.preview .dots { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.preview .dots span { width: 24px; height: 24px; border-radius: 50%; background: #fff; color: #15172B; display: grid; place-items: center; font-size: 10px; font-weight: 900; }

.flash { padding: 14px 18px; border-radius: 14px; margin-bottom: 20px; font-weight: 700; display: flex; gap: 10px; align-items: center; }
.flash-ok { background: var(--green-soft); color: var(--green-ink); }
.flash-err { background: var(--red-soft); color: var(--red-ink); }

/* ---------- tables ---------- */
.table-box { overflow-x: auto; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 900; background: var(--surface-2); }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]::after { content: " ↕"; opacity: .4; }
th[data-dir="asc"]::after { content: " ↑"; opacity: 1; } th[data-dir="desc"]::after { content: " ↓"; opacity: 1; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.lead td { font-weight: 900; }
.rank { font-weight: 900; width: 46px; }
.rank .ball { width: 30px; height: 30px; } .rank .ball b { font-size: 11px; }
.winbar { display: inline-block; width: 80px; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; vertical-align: middle; margin-right: 8px; }
.winbar i { display: block; height: 100%; background: var(--b6); }

/* ---------- matches ---------- */
.round { margin-bottom: 26px; }
.round-head { display: inline-block; font-weight: 900; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--b2); border-radius: 99px; padding: 6px 14px; margin-bottom: 14px; }
.round:nth-child(3n+2) .round-head { background: var(--b4); } .round:nth-child(3n+3) .round-head { background: var(--b3); }
.match { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: var(--surface); border-radius: 14px; padding: 10px 12px;
  margin-bottom: 12px; box-shadow: var(--shadow); border: 3px solid transparent; transition: border-color .15s, transform .15s; }
.match.trace { border-color: var(--b1); }
.match.editing { border-color: var(--b2); }
.match .sides { display: grid; gap: 2px; }
.side { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 4px 6px; border-radius: 8px; transition: background .15s; }
.side .who { display: flex; align-items: center; gap: 8px; }
.side .pdot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.side.trace { background: var(--yellow-soft); }
.side .score { font-weight: 900; font-size: 20px; min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.side.win { font-weight: 900; } .side.win .score { color: var(--b3); }
.side.lose { color: var(--ink-3); }
.match.bye { opacity: .6; }
.score-form { grid-column: 1 / -1; border-top: 2px dashed var(--line); padding-top: 14px; margin-top: 4px; }
.score-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 12px; }
.score-pad { border-radius: 14px; padding: 14px; color: #fff; display: grid; gap: 8px; }
.score-pad:nth-child(1) { background: var(--b2); } .score-pad:nth-child(2) { background: var(--b3); } .score-pad:nth-child(3) { background: var(--b5); }
.score-pad label { font-weight: 900; font-size: 16px; }
.score-pad .win-btn { background: rgba(255,255,255,.2); border: 0; color: #fff; border-radius: 99px; padding: 4px 12px; font: 700 12px var(--body); cursor: pointer; justify-self: start; }
.score-pad .pad-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.score-pad .pad-row button { width: 44px; height: 44px; min-width: 44px; border-radius: 50%; border: 0; font-size: 24px; font-weight: 900; cursor: pointer; background: rgba(255,255,255,.25); color: #fff; flex: none; }
.score-pad .pad-row button.plus { background: #fff; color: #15172B; }
.score-pad input[type=number] { background: transparent; border: 0; color: #fff; font-size: 40px; font-weight: 900; text-align: center; padding: 0; min-height: 0; width: 100%; min-width: 0; flex: 1;
  -moz-appearance: textfield; }
.score-pad input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }

.bracket { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 22px; overflow-x: auto; padding-bottom: 8px; }
.bracket .round { display: flex; flex-direction: column; margin: 0; }
.bracket .round-body { flex: 1; display: flex; flex-direction: column; justify-content: space-around; }
.bracket .round-head { align-self: flex-start; }

.champion { display: flex; gap: 18px; align-items: center; background: var(--b8); color: #fff; border-radius: 18px; padding: 20px 24px; margin-bottom: 26px; flex-wrap: wrap; }
:root[data-theme="dark"] .champion { background: #000; }
.champion .seal { width: 60px; height: 60px; font-size: 28px; background: var(--b1); color: #15172B; }
.champion small { display: block; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--b1); font-weight: 900; }
.champion b { font-family: var(--display); font-size: 30px; display: block; line-height: 1.2; }

.queue { display: flex; gap: 8px; flex-wrap: wrap; }
.queue span { background: var(--surface); box-shadow: var(--shadow); border-radius: 99px; padding: 5px 14px 5px 6px; font-size: 14px; font-weight: 700; display: inline-flex; gap: 8px; align-items: center; }

.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.info-grid div { border-radius: 12px; padding: 10px 12px; }
.info-grid small { display: block; font-size: 11.5px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.info-grid div:nth-child(1) { background: var(--blue-soft); } .info-grid div:nth-child(1) small { color: var(--b2); }
.info-grid div:nth-child(2) { background: var(--red-soft); } .info-grid div:nth-child(2) small { color: var(--red-ink); }
.info-grid div:nth-child(3) { background: var(--purple-soft); } .info-grid div:nth-child(3) small { color: var(--b4); }
.info-grid div:nth-child(4) { background: var(--orange-soft); } .info-grid div:nth-child(4) small { color: var(--orange-ink); }
.info-grid div:nth-child(5) { background: var(--green-soft); } .info-grid div:nth-child(5) small { color: var(--green-ink); }
.info-grid div:nth-child(6) { background: var(--yellow-soft); } .info-grid div:nth-child(6) small { color: var(--yellow-ink); }
:root[data-theme="dark"] .info-grid div:nth-child(1) small, :root[data-theme="dark"] .info-grid div:nth-child(3) small { color: #A9C1FF; }

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.feed li { display: flex; gap: 10px; align-items: flex-start; }
.feed .pdot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; flex: none; }

/* ---------- scoreboard overlay ---------- */
.board { position: fixed; inset: 0; z-index: 100; background: var(--b8); color: #fff; display: flex; flex-direction: column; }
.board-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; gap: 12px; }
.board-halves { flex: 1; display: grid; grid-template-columns: repeat(var(--n, 2), 1fr); }
.board-half { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 16px; text-align: center; }
.board-half:nth-child(1) { background: var(--b2); } .board-half:nth-child(2) { background: var(--b3); } .board-half:nth-child(3) { background: var(--b5); }
.board-half .bname { font-size: clamp(20px, 3.5vw, 32px); font-weight: 900; }
.board-half .bnum { width: min(56vw, 260px); aspect-ratio: 1; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff;
  font: 900 clamp(80px, 18vw, 150px)/1 var(--body); cursor: pointer; }
.board-half .bnum:active { transform: scale(.96); }
.board-half .bundo { min-height: 40px; padding: 0 16px; border-radius: 99px; border: 0; background: rgba(0,0,0,.25); color: #fff; font: 700 14px var(--body); cursor: pointer; }
.board-win { display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px; background: var(--b1); color: #15172B; font-size: 20px; font-weight: 900; }
@media (max-width: 640px) { .board-halves { grid-template-columns: 1fr; } .board-half .bnum { width: 140px; font-size: 80px; } }

/* ---------- confetti, toast, modal ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.confetti i { position: absolute; top: -20px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: .2; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px); background: var(--b8); color: #fff; padding: 12px 20px; border-radius: 99px;
  font-weight: 700; z-index: 150; transition: transform .3s, opacity .3s; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
dialog.modal { border: 0; border-radius: 20px; padding: 26px; width: min(480px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); border-top: 8px solid var(--b1); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(21,23,43,.55); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- fundraise ---------- */
.progress { position: relative; height: 18px; background: rgba(255,255,255,.2); border-radius: 99px; }
.card .progress, .progress.light { background: var(--surface-2); }
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--b1), var(--b5)); width: 0; transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.progress .mark { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 900; border: 3px solid #fff; background: var(--b4); color: #fff; transition: background .3s; }
.progress .mark.hit { background: var(--b1); color: #15172B; }
.fund-big { font-size: clamp(36px, 5vw, 48px); font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut circle.seg { transition: stroke-width .15s; cursor: pointer; }
.legend { display: grid; gap: 10px; font-size: 15px; }
.legend span.key { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 8px; vertical-align: -2px; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; align-items: end; height: 180px; }
.bars button { background: transparent; border: 0; font: inherit; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; padding: 0; }
.bars button i { width: 100%; max-width: 60px; border-radius: 10px 10px 4px 4px; height: 6px; transition: height 1s cubic-bezier(.2,.8,.2,1), opacity .2s; }
.bars button.dim i { opacity: .3; }
.bars button small { font-weight: 700; color: var(--ink-3); }
.bars button b { font-size: 13px; }
.gift { display: flex; align-items: center; gap: 14px; background: var(--surface); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow); flex-wrap: wrap; }
.gift .what { min-width: 150px; text-align: right; margin-left: auto; }
.k-cash { background: var(--green-soft); color: var(--green-ink); } .k-item { background: var(--orange-soft); color: var(--orange-ink); }
.k-pending { background: var(--yellow-soft); color: var(--yellow-ink); }

.empty { padding: 36px; text-align: center; color: var(--ink-3); border: 2px dashed var(--line); border-radius: var(--radius); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a, .tabs button { min-height: 42px; display: inline-flex; align-items: center; padding: 0 18px; border: 2px solid var(--ink); border-radius: 99px; text-decoration: none; color: var(--ink);
  font: 700 15px var(--body); background: var(--surface); cursor: pointer; }
.tabs a.on, .tabs button.on, .tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.tabs .t-8ball { border-color: var(--b8); } .tabs .t-9ball { border-color: var(--b1); } .tabs .t-sg3 { border-color: var(--b3); }
.tabs .t-9ball[aria-pressed="true"] { background: var(--b1); color: #15172B; } .tabs .t-sg3[aria-pressed="true"] { background: var(--b3); color: #fff; }
.searchbox { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 2px solid var(--line); border-radius: 99px; padding: 0 16px; min-height: 46px; min-width: min(280px, 100%); }
.searchbox input { border: 0; background: transparent; min-height: 0; padding: 8px 0; outline: none; }
.searchbox:focus-within { border-color: var(--b2); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.split > * { min-width: 0; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 15px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; }
.h2h { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; text-align: center; }
.h2h .big { font-size: 56px; font-weight: 900; line-height: 1; }

/* ---------- footer ---------- */
.site-foot { background: var(--b8); color: #B9BBD0; font-size: 14px; }
:root[data-theme="dark"] .site-foot { background: #070812; }
.foot-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 26px; padding-bottom: 32px; }
[data-pid].trace { background: var(--yellow-soft); }
.pick .ball { box-shadow: 0 0 0 3px #fff; }
.h2h .avatar { margin: 0 auto; width: 56px; height: 56px; font-size: 20px; }
/* Black Ball Hunters mark: the 8-ball seal */
.brand .seal { background: #15172B; box-shadow: inset -4px -5px 0 rgba(0,0,0,.4), 0 0 0 2px rgba(255,255,255,.55); }
@media (max-width: 520px) { .brand-name { font-size: 16px; line-height: 1.15; max-width: 150px; } }

/* =========================================================
   Live scoreboard (live.php)
   ========================================================= */
.nav a[href$="live.php"]::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3DDC84; margin-right: 7px; vertical-align: 1px; animation: pulse 1.4s infinite; }
.live-band { background: radial-gradient(circle at 85% 30%, #2A2F5A 0%, var(--b8) 60%); }
.live-kpis { display: grid; grid-template-columns: repeat(3, minmax(90px, 1fr)); gap: 10px; }
.live-kpis div { background: rgba(255,255,255,.08); border-radius: 14px; padding: 12px 16px; }
.live-kpis b { display: block; font-size: 34px; font-weight: 900; line-height: 1.05; color: var(--b1); }
.live-kpis span { font-size: 13px; color: #B9BBD0; font-weight: 700; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 18px; margin-top: 18px; }
.empty .ball { margin: 0 auto; }

.lc { --s0: var(--b2); --s1: var(--b3); --s2: var(--b5); background: var(--surface); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  border: 3px solid transparent; transition: border-color .3s, box-shadow .3s; }
.lc.is-live { border-color: rgba(61,220,132,.55); }
.lc.flash { animation: lcflash 1s ease-out; }
@keyframes lcflash { 0% { box-shadow: 0 0 0 6px rgba(245,183,0,.75), var(--shadow); } 100% { box-shadow: var(--shadow); } }
.lc-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: #fff; background: var(--b8); }
.lc-top.g-9ball { background: var(--b1); color: #15172B; } .lc-top.g-sg3 { background: var(--b3); }
.lc-top .ball { background: #fff; box-shadow: none; } .lc-top .ball b { width: 100%; height: 100%; font-size: 12px; }
.lc-title { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.lc-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-title small { opacity: .85; font-size: 12.5px; font-weight: 700; }
.lc-time { font-weight: 900; font-variant-numeric: tabular-nums; background: rgba(255,255,255,.16); border-radius: 99px; padding: 3px 10px; font-size: 13px; }
.lc-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 900; letter-spacing: .08em; background: #15172B; color: #fff; padding: 4px 10px; border-radius: 99px; }
.lc-state i { width: 8px; height: 8px; border-radius: 50%; background: #3DDC84; animation: pulse 1.2s infinite; }
.lc-state.next { background: rgba(255,255,255,.2); }
.lc-top.g-9ball .lc-state.next { background: rgba(21,23,43,.15); color: #15172B; }
.lc-badges { padding: 10px 16px 0; }
.lc-badge { display: inline-block; font-weight: 900; font-size: 13px; letter-spacing: .06em; padding: 5px 12px; border-radius: 99px; }
.lc-badge.point { background: var(--orange-soft); color: var(--orange-ink); animation: pulse 1.6s infinite; }
.lc-badge.hill { background: var(--b3); color: #fff; animation: pulse 1s infinite; }
.lc-badge.win { background: var(--b1); color: #15172B; }
.lc-seats { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 10px; padding: 14px 16px 6px; }
.lc-seat { border-radius: 16px; padding: 12px; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; position: relative; transition: transform .2s; }
.lc-seat.s0 { background: var(--s0); } .lc-seat.s1 { background: var(--s1); } .lc-seat.s2 { background: var(--s2); }
.lc-seat.lead { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,.18); }
.lc-seat.won::after { content: "★"; position: absolute; top: 6px; right: 10px; color: var(--b1); font-size: 20px; }
.lc-name { font-weight: 900; font-size: 16px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-score { font-size: 64px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.bump { animation: bump .45s cubic-bezier(.3,1.6,.5,1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.lc-pips { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; min-height: 10px; }
.lc-pips i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.28); }
.lc-pips i.on { background: #fff; }
.lc-ctl { display: flex; gap: 6px; margin-top: 8px; width: 100%; }
.lc-ctl button { min-height: 44px; border-radius: 12px; border: 0; font: 900 15px var(--body); cursor: pointer; background: rgba(0,0,0,.22); color: #fff; width: 44px; flex: none; }
.lc-ctl button.plus { flex: 1; background: #fff; color: #15172B; }
.lc-ctl button:active { transform: scale(.95); }
.lc-momentum { display: flex; height: 8px; margin: 8px 16px 0; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.lc-momentum i { transition: flex .6s; } .lc-momentum i.s0 { background: var(--b2); } .lc-momentum i.s1 { background: var(--b3); } .lc-momentum i.s2 { background: var(--b5); }
.lc-momentum i.none { background: var(--surface-2); }
.lc-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px 0; font-size: 13px; color: var(--ink-3); }
.lc-dots { display: flex; gap: 3px; flex-wrap: wrap; align-items: center; }
.lc-dots i { width: 9px; height: 9px; border-radius: 50%; } .lc-dots i.s0 { background: var(--b2); } .lc-dots i.s1 { background: var(--b3); } .lc-dots i.s2 { background: var(--b5); }
.lc-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 14px 16px 16px; margin-top: auto; }
.lc-foot a { margin-left: auto; }

.live-focus { position: fixed; inset: 0; z-index: 120; background: var(--b8); color: #fff; display: flex; flex-direction: column; }
.lf-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; flex-wrap: wrap; font-size: 18px; }
.lf-badge { text-align: center; padding-bottom: 10px; } .lf-badge .lc-badge { font-size: 18px; padding: 8px 18px; }
.lf-halves { flex: 1; display: grid; grid-template-columns: repeat(var(--n, 2), 1fr); }
.lf-half { border: 0; color: #fff; font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: pointer; position: relative; }
.lf-half[disabled] { cursor: default; }
.lf-half.s0 { background: var(--b2); } .lf-half.s1 { background: var(--b3); } .lf-half.s2 { background: var(--b5); }
.lf-half:not([disabled]):active { filter: brightness(1.12); }
.lf-half.won { box-shadow: inset 0 0 0 10px var(--b1); }
.lf-name { font-size: clamp(22px, 4vw, 44px); font-weight: 900; }
.lf-num { font-size: clamp(120px, 26vw, 340px); font-weight: 900; line-height: .9; font-variant-numeric: tabular-nums; }
.lf-hint { font-size: 14px; opacity: .8; }
@media (max-width: 640px) { .lf-halves { grid-template-columns: 1fr; } .lc-score { font-size: 52px; } }

body { display: flex; flex-direction: column; min-height: 100vh; }
body > .main { flex: 1; width: 100%; }
