/* GOAT Gaming Center — shared styles (public site, bracket map, admin)
 * Display: Changa · Body: IBM Plex Sans Arabic · Brand: GOAT blue + red on ink black
 */
:root {
  --bg: #05080f;
  --surface: #0b1220;
  --surface-2: #111a2d;
  --surface-3: #18233b;
  --border: #19243a;
  --border-strong: #273652;
  --text: #f3f6fc;
  --muted: #8f9cb5;
  --dim: #5f6c86;

  --blue: #1e90ff;
  --blue-strong: #1474d6;
  --blue-soft: rgba(30, 144, 255, .14);
  --blue-glow: rgba(30, 144, 255, .45);
  --red: #f02d3a;
  --red-strong: #cf1f2b;
  --red-soft: rgba(240, 45, 58, .14);
  --gold: #ffc23d;
  --gold-soft: rgba(255, 194, 61, .14);
  --green: #22c482;
  --green-soft: rgba(34, 196, 130, .14);
  --amber: #ffaa2b;
  --amber-soft: rgba(255, 170, 43, .14);
  --grad: linear-gradient(110deg, var(--red) 0%, var(--blue) 100%);

  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --focus: 0 0 0 3px rgba(30, 144, 255, .55);
  --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --display: "Changa", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55vw 45vh at 100% 0%, rgba(30, 144, 255, .16), transparent 70%),
    radial-gradient(45vw 40vh at 0% 8%, rgba(240, 45, 58, .11), transparent 70%);
}
img { max-width: 100%; display: block; }
a { color: var(--blue); }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }
[hidden] { display: none !important; }
::selection { background: rgba(30, 144, 255, .35); }

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding-inline: 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.ltr { direction: ltr; text-align: right; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(5, 8, 15, .86);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.brand img { width: 44px; height: 44px; border-radius: 50%; background: #fff; flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, .08); }
.brand b { display: block; font-family: var(--display); font-size: 18px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.3; }
.topbar .spacer { flex: 1; }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a { color: var(--muted); text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 10px; }
.nav-links a:hover { color: var(--text); background: var(--surface); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--surface-2); color: var(--text);
  font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), box-shadow .2s var(--ease), transform .1s var(--ease);
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn-primary:hover { background: var(--blue-strong); box-shadow: 0 8px 24px -8px var(--blue-glow); }
.btn-red { background: var(--red); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn-red:hover { background: var(--red-strong); }
.btn-ghost { background: transparent; border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: #34476c; }
.btn-danger-ghost { background: transparent; border-color: rgba(240, 45, 58, .45); color: #ff8088; }
.btn-danger-ghost:hover { background: var(--red-soft); }
.btn-green { background: var(--green); color: #04150d; }
.btn-green:hover { background: #1daa70; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 18px; }
.btn-block { width: 100%; }
.icon-btn { width: 44px; padding: 0; }

/* ---------- hero ---------- */
.hero { position: relative; padding-block: 48px 40px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(70% 80% at 30% 40%, #000 0%, transparent 75%);
  mask-image: radial-gradient(70% 80% at 30% 40%, #000 0%, transparent 75%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 24px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px;
  border: 1px solid var(--border-strong); border-radius: 999px; background: rgba(11, 18, 32, .8);
  font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--muted);
}
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.hero h1 { margin: 18px 0 0; font-size: clamp(40px, 7.4vw, 76px); line-height: 1.08; font-weight: 800; }
.hero h1 .hl { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { margin: 16px 0 0; max-width: 520px; color: var(--muted); font-size: 18px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 28px; margin: 32px 0 0; padding: 0; list-style: none; }
.hero-stats li { display: grid; }
.hero-stats b { font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1.1; }
.hero-stats span { color: var(--muted); font-size: 14px; }
.hero-art { position: relative; display: grid; place-items: center; }
.hero-art img { width: min(100%, 500px); filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .5)); }

/* ---------- how it works ---------- */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 8px 0 0; padding: 0; list-style: none; }
.how li { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.how .num { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; font-family: var(--display); font-weight: 800; font-size: 20px; color: #fff; background: var(--grad); }
.how h3 { margin: 0; font-size: 18px; }
.how p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- sections ---------- */
.section { padding-block: 40px 24px; scroll-margin-top: 70px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 28px; font-weight: 700; line-height: 1.2; }
.section-head h2::after { content: ""; display: block; width: 44px; height: 4px; margin-top: 8px; border-radius: 4px; background: var(--grad); }
.section-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.t-card { display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; transition: border-color .2s var(--ease); }
.t-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); }
.t-card:hover { border-color: var(--border-strong); }
.t-top { display: flex; gap: 14px; align-items: flex-start; }
.date-badge { flex: none; width: 66px; padding: 8px 0 6px; border-radius: 14px; text-align: center; background: var(--surface-2); border: 1px solid var(--border-strong); }
.date-badge b { display: block; font-family: var(--display); font-size: 28px; font-weight: 800; line-height: 1; }
.date-badge span { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.2; }
.date-badge.tbd b { font-size: 20px; color: var(--muted); }
.t-heading { min-width: 0; flex: 1; }
.t-card h3 { margin: 4px 0 0; font-size: 21px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.t-when { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-family: var(--display); font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border-strong); line-height: 1.7; }
.chip-blue { background: var(--blue-soft); color: #74b9ff; border-color: transparent; }
.chip-red { background: var(--red-soft); color: #ff8088; border-color: transparent; }
.chip-green { background: var(--green-soft); color: #58dda5; border-color: transparent; }
.chip-amber { background: var(--amber-soft); color: #ffc46b; border-color: transparent; }
.chip-gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.facts div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; }
.facts dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-family: var(--display); font-weight: 700; font-size: 17px; overflow-wrap: anywhere; line-height: 1.35; }
.facts dd.prize { color: var(--gold); }
.facts .wide { grid-column: 1 / -1; }
.t-notes { margin: 6px 0 0; color: var(--muted); font-size: 14px; white-space: pre-line; }
details summary { cursor: pointer; font-weight: 600; color: var(--muted); font-size: 14px; }
details summary:hover { color: var(--text); }

.seats { display: grid; gap: 6px; }
.seats-row { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; color: var(--muted); }
.seats-row b { font-family: var(--display); color: var(--text); }
.bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width .5s var(--ease); }
.bar.warn i { background: var(--amber); }
.bar.full i { background: var(--red); }
.t-actions { display: flex; gap: 8px; }
.t-actions .btn { flex: 1; }

/* bracket list cards (public) */
.bk-card { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--text); transition: border-color .2s var(--ease); }
.bk-card:hover { border-color: var(--blue); }
.bk-card h3 { margin: 0; font-size: 19px; line-height: 1.3; }
.bk-card .champ-line { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--gold-soft); color: var(--gold); font-family: var(--display); font-weight: 700; }
.bk-card .champ-line svg { width: 22px; height: 22px; flex: none; }
.bk-card .live-line { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 14px; }
.bk-card .go { font-family: var(--display); font-weight: 600; color: #74b9ff; }

/* ---------- empty / loading ---------- */
.empty { text-align: center; padding: 40px 20px; }
.empty h3 { margin: 0 0 6px; font-size: 21px; }
.empty p { margin: 0 auto 16px; color: var(--muted); max-width: 460px; }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: var(--radius); min-height: 280px; border: 1px solid var(--border); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .field .label { font-weight: 600; font-size: 14px; }
.field .hint { font-size: 13px; color: var(--muted); }
.req { color: var(--red); }
.input {
  width: 100%; min-height: 48px; padding: 10px 12px;
  background: #070c17; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 16px; transition: border-color .15s var(--ease);
}
textarea.input { min-height: 96px; resize: vertical; }
.input::placeholder { color: var(--dim); }
.input:focus { border-color: var(--blue); box-shadow: var(--focus); outline: none; }
.input[aria-invalid="true"] { border-color: var(--red); }
.field-error { color: #ff8088; font-size: 13px; font-weight: 600; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset.pay { border: 0; padding: 0; margin: 0 0 4px; min-width: 0; }
fieldset.pay legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: 14px; }

.pay-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-option { position: relative; }
.pay-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pay-option span {
  display: grid; gap: 2px; padding: 14px; border: 2px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #070c17; cursor: pointer; min-height: 86px;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.pay-option b { font-family: var(--display); font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.pay-option small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.pay-option input:checked + span { border-color: var(--blue); background: var(--blue-soft); }
.pay-option input:focus-visible + span { box-shadow: var(--focus); }

.cliq-box { margin-top: 12px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--border-strong); }
.cliq-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.cliq-line:last-of-type { border-bottom: 0; }
.cliq-line span { color: var(--muted); font-size: 14px; }
.cliq-line b { font-family: var(--display); font-size: 18px; overflow-wrap: anywhere; }
#cliqAlias { direction: ltr; unicode-bidi: isolate; }
.upload {
  position: relative; display: grid; place-items: center; gap: 6px; text-align: center;
  padding: 20px; border: 2px dashed var(--border-strong); border-radius: var(--radius-sm); cursor: pointer;
  background: #070c17; color: var(--muted); font-weight: 600;
  transition: border-color .15s var(--ease);
}
.upload:hover, .upload:focus-within { border-color: var(--blue); }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload svg { width: 28px; height: 28px; color: var(--blue); }
.upload-preview { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #070c17; }
.upload-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.upload-preview div { flex: 1; min-width: 0; font-size: 14px; }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.alert a { color: inherit; }
.alert-error { background: var(--red-soft); color: #ffa3a9; border: 1px solid rgba(240, 45, 58, .35); }
.alert-info { background: var(--blue-soft); color: #a8d2ff; border: 1px solid rgba(30, 144, 255, .3); }
.alert-warn { background: var(--amber-soft); color: #ffd48a; border: 1px solid rgba(255, 170, 43, .35); }
.switch { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--blue); }

/* ---------- dialog ---------- */
dialog.sheet {
  width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px);
  padding: 0; border: 1px solid var(--border-strong); border-radius: 20px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  overflow: hidden;
}
dialog.sheet::backdrop { background: rgba(2, 4, 10, .76); }
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheet-in .22s var(--ease); }
dialog.sheet > form, dialog.sheet > #regDone, dialog.sheet > .sheet-inner { display: flex; flex-direction: column; min-height: 0; flex: 1; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px); } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.sheet-head h2 { margin: 0; font-size: 20px; font-weight: 700; flex: 1; min-width: 0; }
.sheet-body { padding: 16px; overflow-y: auto; }
.sheet-foot { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface); }
.sheet-foot .btn { flex: 1; }
.close-btn { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; background: var(--surface-2); }
.close-btn svg { width: 18px; height: 18px; }

.sheet-body.success { text-align: center; padding: 22px 16px; }
.success .tick { width: 68px; height: 68px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); }
.success .tick svg { width: 36px; height: 36px; }
.success h3 { margin: 0 0 4px; font-size: 24px; }
.reg-no { display: inline-block; margin: 12px 0; padding: 8px 20px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border-strong); font-family: var(--display); font-size: 26px; font-weight: 800; direction: ltr; }

/* ---------- toast ---------- */
.toasts { position: fixed; inset-inline: 16px; bottom: 16px; z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; max-width: 420px; width: 100%; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface-3); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-weight: 600; font-size: 14px; animation: sheet-in .2s var(--ease); }
.toast.ok { border-inline-start: 4px solid var(--green); }
.toast.bad { border-inline-start: 4px solid var(--red); }

/* ---------- footer ---------- */
.footer { margin-top: 32px; border-top: 1px solid var(--border); padding: 28px 0 36px; color: var(--muted); font-size: 14px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.footer a { color: var(--muted); text-decoration: none; font-weight: 600; }
.footer a:hover { color: var(--text); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ================= bracket map ================= */
.bk-page { padding-block: 28px 48px; }
.bk-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.bk-head h1 { margin: 6px 0 2px; font-size: clamp(26px, 5vw, 40px); line-height: 1.15; font-weight: 800; }
.live { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--muted); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(240, 45, 58, .6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(240, 45, 58, 0); } 100% { box-shadow: 0 0 0 0 rgba(240, 45, 58, 0); } }
.champ-banner { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 16px; border-radius: var(--radius); background: linear-gradient(110deg, rgba(255, 194, 61, .16), rgba(255, 194, 61, .04)); border: 1px solid rgba(255, 194, 61, .4); }
.champ-banner svg { width: 40px; height: 40px; color: var(--gold); flex: none; }
.champ-banner span { color: var(--muted); font-size: 14px; font-weight: 600; }
.champ-banner b { display: block; font-family: var(--display); font-size: 26px; font-weight: 800; color: var(--gold); line-height: 1.2; }
.bk-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 12px; color: var(--muted); font-size: 13px; font-weight: 600; }
.bk-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bk-legend i { width: 12px; height: 12px; border-radius: 3px; }
.bk-wrap { border: 1px solid var(--border); border-radius: var(--radius); background: rgba(11, 18, 32, .65); }
.bk-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.bk-tools .icon-btn { width: 36px; font-size: 20px; }
.bk-zoom-val { min-width: 48px; text-align: center; font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--muted); }
.bk-count { margin-inline-start: auto; color: var(--muted); font-size: 13px; font-weight: 600; }
.bk-direct { flex: none; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 18px; color: #ffc46b; background: var(--amber-soft); }
.bk-scroll { overflow: auto; max-height: 78vh; padding: 16px; overscroll-behavior: contain; }
.bk-scroll:focus-visible { box-shadow: inset var(--focus); }
.bk-canvas { position: relative; margin-inline: auto; }
.bk-lines { position: absolute; inset: 0; overflow: visible; }
.bk-lines path { fill: none; stroke: var(--border-strong); stroke-width: 2; }
.bk-lines path.lit { stroke: var(--blue); stroke-width: 2.5; filter: drop-shadow(0 0 4px rgba(30, 144, 255, .55)); }
.bk-round-title { position: absolute; top: 0; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--muted); direction: rtl; }
.bk-champ-title { background: var(--gold-soft); border-color: rgba(255, 194, 61, .35); }
.bk-match {
  position: absolute; direction: rtl; border-radius: 12px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
  animation: bk-in .45s var(--ease) both; animation-delay: var(--d, 0ms);
}
.bk-canvas.no-anim .bk-match, .bk-canvas.no-anim .bk-champ { animation: none; }
@keyframes bk-in { from { opacity: 0; transform: translateX(12px); } }
.bk-match.is-live { border-color: rgba(30, 144, 255, .7); box-shadow: 0 0 0 3px rgba(30, 144, 255, .14), 0 6px 16px rgba(0, 0, 0, .25); }
.bk-match.is-final { border-color: rgba(255, 194, 61, .55); }
.bk-match.is-clickable { cursor: pointer; transition: border-color .15s var(--ease), transform .15s var(--ease); }
.bk-match.is-clickable:hover { border-color: var(--blue); transform: translateY(-1px); }
.bk-match.is-clickable:focus-visible { box-shadow: var(--focus); }
.bk-side { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; position: relative; }
.bk-side + .bk-side { border-top: 1px solid var(--border); }
.bk-name { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.bk-name small { display: inline; margin-inline-start: 6px; color: var(--dim); font-size: 12px; font-weight: 500; }
.bk-score { flex: none; min-width: 26px; height: 26px; padding: 0 6px; display: grid; place-items: center; border-radius: 7px; background: var(--surface-3); font-family: var(--display); font-size: 15px; font-weight: 800; }
.bk-side.is-win { background: linear-gradient(270deg, rgba(30, 144, 255, .22), rgba(30, 144, 255, .04)); }
.bk-side.is-win::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--blue); }
.bk-side.is-win .bk-name { color: #fff; font-weight: 700; }
.bk-side.is-win .bk-score { background: var(--blue); color: #fff; }
.bk-side.is-lose .bk-name { color: var(--dim); text-decoration: line-through; text-decoration-color: rgba(240, 45, 58, .7); }
.bk-side.is-lose .bk-score { color: var(--dim); }
.bk-side.is-bye .bk-name, .bk-side.is-tbd .bk-name { color: var(--dim); font-weight: 500; font-size: 13px; }
.bk-side.is-bye { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 255, 255, .025) 6px 12px); }
.bk-champ {
  position: absolute; direction: rtl; display: grid; place-items: center; align-content: center; gap: 2px; text-align: center;
  border-radius: 16px; border: 1px dashed var(--border-strong); background: var(--surface-2); padding: 12px;
  animation: bk-in .5s var(--ease) both; animation-delay: .3s;
}
.bk-champ.has-champ { border: 1px solid rgba(255, 194, 61, .6); background: radial-gradient(120% 90% at 50% 0%, rgba(255, 194, 61, .22), var(--surface-2) 70%); box-shadow: 0 0 40px -10px rgba(255, 194, 61, .5); }
.bk-trophy svg { width: 44px; height: 44px; color: var(--dim); }
.bk-champ.has-champ .bk-trophy svg { color: var(--gold); }
.bk-champ-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.bk-champ-name { font-family: var(--display); font-size: 22px; font-weight: 800; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-champ.has-champ .bk-champ-name { color: var(--gold); }
.bk-page:fullscreen { background: var(--bg); padding: 24px; overflow: auto; }
.bk-page:fullscreen .bk-scroll { max-height: calc(100vh - 220px); }

/* draw animation */
.draw-reel { display: grid; place-items: center; gap: 10px; padding: 40px 16px; text-align: center; }
.draw-reel b { font-family: var(--display); font-size: clamp(26px, 6vw, 40px); font-weight: 800; min-height: 1.3em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ================= admin ================= */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(400px, 100%); padding: 30px 22px; text-align: center; }
.login .field { text-align: right; }
.login-logo { width: 96px; height: 96px; margin: 0 auto 12px; border-radius: 50%; background: #fff; }
.login h1 { margin: 0; font-size: 28px; }

.tabs { display: flex; gap: 4px; align-items: center; }
.tab { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-family: var(--display); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); background: var(--surface); }
.tab[aria-current="page"] { color: var(--text); background: var(--surface-2); }

.admin-main { padding-block: 24px 64px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.back-link { display: inline-block; margin-bottom: 12px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.back-link:hover { color: var(--text); }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-head h2 { margin: 6px 0 2px; font-size: 28px; line-height: 1.25; }
.card-title { margin: 0 0 12px; font-size: 18px; }
.t-card.is-closed { opacity: .75; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.stat b { display: block; font-family: var(--display); font-size: 28px; font-weight: 800; line-height: 1.15; text-align: right; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-warn { border-color: rgba(255, 170, 43, .5); }
.stat-warn b { color: #ffc46b; }

.seg { display: inline-flex; gap: 4px; padding: 4px; margin: 4px 0 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.seg button { min-height: 40px; padding: 0 18px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-family: var(--display); font-weight: 600; font-size: 15px; cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--blue); color: #fff; }

.walkin { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 10px; align-items: start; }
.walkin .field { margin-bottom: 0; }

.list-card { padding: 0; overflow: hidden; }
.list-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.list-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.input-sm { min-height: 36px; padding: 6px 10px; font-size: 14px; width: 200px; }
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.filters::-webkit-scrollbar { display: none; }
.filter { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--muted); font-family: var(--display); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.filter span { font-size: 12px; background: var(--surface-2); border-radius: 999px; padding: 0 7px; }
.filter[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.filter[aria-pressed="true"] span { background: rgba(255, 255, 255, .2); }

.reg { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 14px; border-bottom: 1px solid var(--border); }
.reg:last-child { border-bottom: 0; }
.reg.is-rejected { opacity: .55; }
.reg-num { min-width: 44px; height: 32px; padding: 0 6px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--muted); }
.reg-body { min-width: 0; }
.reg-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.reg-top h4 { margin: 0; font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.reg-meta { display: flex; flex-wrap: wrap; gap: 2px 8px; margin-top: 4px; color: var(--muted); font-size: 13px; }
.reg-meta a { color: #74b9ff; text-decoration: none; font-weight: 600; }
.reg-note { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; color: var(--muted); white-space: pre-line; }
.reg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.thumb-btn { display: grid; gap: 4px; justify-items: center; padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 600; cursor: zoom-in; }
.thumb-btn.no-shot { cursor: default; width: 72px; height: 72px; place-content: center; border: 1px dashed var(--border-strong); border-radius: 10px; }
.thumb { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; object-position: top; border: 1px solid var(--border-strong); background: #070c17; }
.thumb-btn:hover .thumb { border-color: var(--blue); }

.danger-zone { margin-top: 24px; display: flex; justify-content: flex-start; }
.settings-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.lightbox { width: min(720px, calc(100% - 24px)); }
.lightbox .sheet-body { display: grid; place-items: center; background: #03050a; }
.lightbox img { max-height: 70vh; width: auto; border-radius: 8px; }
.confirm { width: min(420px, calc(100% - 24px)); }
.pick-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ================= responsive ================= */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .hero-art img { width: min(78%, 360px); }
  .how { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .walkin { grid-template-columns: 1fr 1fr; }
  .walkin .walkin-btn .label { display: none; }
  .walkin .walkin-btn { grid-column: 1 / -1; }
  .walkin .walkin-btn .btn { width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .input-sm { width: 100%; }
  .list-actions { width: 100%; }
  .list-actions .input-sm { flex: 1 1 160px; }
  .nav-links { display: none; }
}
@media (max-width: 640px) {
  .admin .topbar .wrap { flex-wrap: wrap; padding-block: 8px 6px; min-height: 0; }
  .admin .topbar .spacer { display: none; }
  .admin .tabs { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .reg { grid-template-columns: 1fr auto; }
  .reg-num { display: none; }
  .confirm, .lightbox { height: auto; max-height: 100dvh; }
}
@media (max-width: 520px) {
  .hero { padding-block: 24px 28px; }
  .hero-lead { font-size: 16px; }
  .hero-cta .btn { flex: 1; }
  .hero-stats { gap: 20px; }
  .hero-stats b { font-size: 28px; }
  .grid { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .brand small { display: none; }
  .section-head h2 { font-size: 24px; }
  dialog.sheet { width: 100%; max-width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; border: 0; }
  dialog.sheet.confirm { height: auto; margin: auto 0 0; border-radius: 20px 20px 0 0; border-top: 1px solid var(--border-strong); }
  .bk-scroll { padding: 12px; max-height: 72vh; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
