:root {
  --canvas: #0a0a0a;
  --surface: #161616;
  --surface-hi: #1e1e1e;
  --line: rgba(212, 175, 55, 0.22);
  --line-soft: rgba(212, 175, 55, 0.09);
  --accent: #d4af37;
  --glow: #e8c65a;
  --dim: #8c7326;
  --wash: rgba(212, 175, 55, 0.12);
  --ivory: #f5f1e8;
  --warm: #9c968a;
  --muted: #66625a;
  --ok: #7fbf7f;
  --ok-wash: rgba(127, 191, 127, 0.12);
  --bad: #c96a5b;
  --bad-wash: rgba(201, 106, 91, 0.12);
  --radius: 14px;
  --radius-s: 8px;
  --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Figtree', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--ivory);
  font-family: var(--font-body); font-size: 16px; line-height: 1.5; min-height: 100vh;
  /* floodlight: a soft gold glow from the top of every page */
  background: radial-gradient(ellipse 80% 340px at 50% -60px, rgba(212, 175, 55, 0.14), transparent 70%) no-repeat, var(--canvas);
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0; letter-spacing: -0.01em; line-height: 1.15; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--glow); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(10, 10, 10, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-soft); }
.topbar-in { max-width: 1040px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 20px; }
.wordmark { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.14em; color: var(--accent); font-size: 1rem; white-space: nowrap; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nav a, .nav button { background: none; border: 0; padding: 8px 12px; border-radius: 999px; color: var(--warm); cursor: pointer; font-size: 0.95rem; position: relative; }
.nav a:hover, .nav button:hover { color: var(--ivory); }
.nav a[aria-current='page'] { color: var(--accent); background: var(--wash); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--accent); color: #111; font-size: 0.72rem; font-weight: 700; line-height: 18px; text-align: center; }
.page { max-width: 1040px; margin: 0 auto; padding: 24px 16px 96px; }
.narrow { max-width: 560px; margin: 0 auto; }
.stack > * + * { margin-top: 16px; }
.stack-s > * + * { margin-top: 8px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--warm); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.mt { margin-top: 24px; }
.sync { text-align: center; font-size: 0.78rem; color: var(--warm); padding: 0 16px 28px; }
.sync b { color: var(--accent); font-weight: 600; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px; }
.card.gold { border-color: var(--line); }
.card.flat { padding: 0; overflow: hidden; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section-head h2 { font-size: 1.15rem; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--warm); }
.kv span:last-child { text-align: right; font-weight: 500; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-soft); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-soft); }
.stat { background: var(--surface); padding: 14px 12px; }
.stat b { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--ivory); line-height: 1.1; }
.stat span { color: var(--warm); font-size: 0.82rem; }
.banner { padding: 14px 16px; border-radius: var(--radius-s); background: var(--surface-hi); color: var(--warm); border: 1px dashed var(--line); }
.banner.ok { background: var(--ok-wash); color: var(--ok); border: 1px solid transparent; }
.banner.bad { background: var(--bad-wash); color: var(--bad); border: 1px solid transparent; }
.empty { text-align: center; padding: 36px 16px; }
.empty h3 { margin-bottom: 6px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--accent); background: var(--accent); color: #141414; font-weight: 700; padding: 11px 20px; border-radius: 999px; cursor: pointer; min-height: 44px; text-align: center; transition: background 0.15s, transform 0.05s; }
.btn:hover { background: var(--glow); color: #141414; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--wash); color: var(--glow); }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: var(--bad-wash); }
.btn.small { min-height: 34px; padding: 6px 14px; font-size: 0.9rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.field { display: block; }
.field > span { display: block; font-size: 0.85rem; color: var(--warm); margin-bottom: 5px; }
.input, select.input, textarea.input { width: 100%; background: var(--surface-hi); border: 1px solid var(--line-soft); border-radius: var(--radius-s); padding: 11px 13px; min-height: 44px; color: var(--ivory); }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--wash); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.seg { display: flex; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 999px; padding: 3px; gap: 2px; overflow-x: auto; }
.seg a, .seg button { flex: 1; text-align: center; padding: 9px 14px; border-radius: 999px; background: none; border: 0; color: var(--warm); cursor: pointer; white-space: nowrap; font-size: 0.95rem; }
.seg [aria-selected='true'] { background: var(--accent); color: #141414; font-weight: 700; }
.switch { position: relative; display: inline-block; vertical-align: middle; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: var(--surface-hi); border: 1px solid var(--line); border-radius: 999px; transition: background 0.15s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--warm); transition: transform 0.15s, background 0.15s; }
.switch input:checked + i { background: var(--wash); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); background: var(--accent); }
.switch input:focus-visible + i { outline: 2px solid var(--glow); outline-offset: 2px; }

.pill { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface-hi); color: var(--warm); white-space: nowrap; }
.pill.gold { background: var(--wash); color: var(--accent); }
.pill.ok { background: var(--ok-wash); color: var(--ok); }
.pill.bad { background: var(--bad-wash); color: var(--bad); }

/* ---------- tournament card ---------- */
.tcard { display: flex; flex-direction: column; gap: 12px; }
.tcard h3 { font-size: 1.2rem; }
.tcard .meta { display: grid; gap: 4px; color: var(--warm); font-size: 0.92rem; }
.meter { height: 4px; background: var(--surface-hi); border-radius: 2px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }

/* ---------- auth ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line-soft); background: radial-gradient(ellipse 65% 85% at 50% -10%, rgba(212, 175, 55, 0.40), rgba(120, 90, 15, 0.16) 48%, transparent 75%), radial-gradient(ellipse 90% 40% at 50% 110%, rgba(212, 175, 55, 0.10), transparent 70%), #080808; }
.hero svg.court { position: absolute; right: -40px; top: -20px; width: min(560px, 90vw); opacity: 0.3; pointer-events: none; }
.hero .inner { position: relative; padding: 52px 16px 28px; max-width: 560px; margin: 0 auto; }
.hero h1 { margin: 10px 0 8px; }
.auth { max-width: 560px; margin: 0 auto; padding: 24px 16px 80px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.tbl th { text-align: right; color: var(--warm); font-weight: 500; padding: 9px 8px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.tbl td { text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th:nth-child(2), .tbl td:nth-child(2) { text-align: left; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.me td { background: var(--wash); }
.tbl td.pts { color: var(--accent); font-weight: 700; }
.tbl .pos { width: 28px; color: var(--warm); }
.tbl .team { text-align: left; font-weight: 500; }

/* ---------- matches ---------- */
.match { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 12px 14px; }
.match + .match { border-top: 1px solid var(--line-soft); }
.match .side { min-width: 0; font-weight: 500; }
.match .side.away { text-align: right; }
.match .side.win { color: var(--accent); }
.match .score { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; min-width: 64px; text-align: center; }
.match .info { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--warm); font-size: 0.84rem; }
.match.mine { background: var(--wash); }
.editor { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: end; padding-top: 6px; border-top: 1px dashed var(--line-soft); }
.editor label { font-size: 0.78rem; color: var(--warm); display: block; }
.editor .input { min-height: 38px; padding: 6px 10px; }
.editor .num { width: 64px; text-align: center; }

/* ---------- bracket: drawn like court lines ---------- */
.bracket-wrap { overflow-x: auto; padding-bottom: 8px; }
.bracket { display: flex; min-width: max-content; align-items: stretch; }
.round { display: flex; flex-direction: column; justify-content: space-around; margin-left: 14px; gap: 14px; }
.round:first-child { margin-left: 0; }
.round > h4 { font-size: 0.85rem; color: var(--warm); font-weight: 600; padding-bottom: 2px; }
.round .ties { display: flex; flex-direction: column; justify-content: space-around; flex: 1; gap: 14px; }
.pair { position: relative; display: flex; flex-direction: column; gap: 12px; padding-right: 26px; }
.pair::before { content: ''; position: absolute; right: 0; top: 25%; bottom: 25%; width: 13px; border: 1px solid var(--line); border-left: 0; }
.pair::after { content: ''; position: absolute; right: -14px; top: 50%; width: 27px; border-top: 1px solid var(--line); }
.tie { width: 214px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-s); overflow: hidden; }
.tie.mine { border-color: var(--accent); }
.tie .t { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; font-size: 0.9rem; }
.tie .t + .t { border-top: 1px solid var(--line-soft); }
.tie .t.win { color: var(--accent); font-weight: 700; }
.tie .t.tbd { color: var(--muted); font-style: italic; }
.tie .t b { font-variant-numeric: tabular-nums; }
.tie .foot { padding: 5px 10px; font-size: 0.74rem; color: var(--warm); background: var(--surface-hi); }
.round.final .tie { border-color: var(--line); }

/* ---------- gallery ---------- */
.photos { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.photo { background: var(--surface); border-radius: var(--radius-s); overflow: hidden; border: 1px solid var(--line-soft); display: block; }
.photo img { width: 100%; height: 150px; object-fit: cover; display: block; background: var(--surface-hi); }
.photo div { padding: 8px 10px; font-size: 0.85rem; color: var(--warm); }

/* ---------- alerts ---------- */
.alert { display: grid; grid-template-columns: 8px 1fr auto; gap: 12px; padding: 14px 16px; }
.alert + .alert { border-top: 1px solid var(--line-soft); }
.alert .dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; margin-top: 7px; }
.alert.unread .dot { background: var(--accent); }
.alert .when { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.alert b { display: block; }

/* ---------- misc ---------- */
.avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--wash); color: var(--accent); font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; border: 1px solid var(--line); flex: none; }
.pick { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; width: 100%; background: none; border: 0; text-align: left; }
.pick + .pick { border-top: 1px solid var(--line-soft); }
.pick[aria-pressed='true'] { background: var(--wash); }
.pick .radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.pick[aria-pressed='true'] .radio { border-color: var(--accent); background: radial-gradient(var(--accent) 45%, transparent 50%); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--surface-hi); border: 1px solid var(--line); color: var(--ivory); padding: 12px 18px; border-radius: 999px; z-index: 50; max-width: calc(100vw - 32px); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5); }
.toast.bad { border-color: var(--bad); color: var(--bad); }
.toast.in { animation: toast-in 0.18s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.loading { display: grid; place-items: center; min-height: 40vh; color: var(--warm); }
.steps { counter-reset: s; padding-left: 0; list-style: none; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--wash); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; }
code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; background: var(--surface-hi); padding: 2px 6px; border-radius: 4px; word-break: break-all; }

/* ---------- v2: live, status, choices, dashboard ---------- */
.pill.live { background: rgba(231, 76, 60, 0.16); color: #ff8a7a; display: inline-flex; align-items: center; gap: 6px; }
.blink { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff6b5a; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.match.is-live { background: rgba(255, 107, 90, 0.07); box-shadow: inset 3px 0 0 #ff6b5a; }
.match.is-live .score { color: var(--glow); font-size: 1.45rem; }
.live-note { display: flex; align-items: center; gap: 8px; }
.pill.gold { background: var(--wash); color: var(--accent); }
.btn.gold { background: var(--glow); border-color: var(--glow); }
.editor .btns { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; width: 100%; margin-top: 4px; }
.editor .full { flex: 1 1 100%; }

fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field > legend { display: block; font-size: 0.85rem; color: var(--warm); margin-bottom: 8px; padding: 0; }
.choice { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--line-soft); border-radius: 999px; background: var(--surface-hi); cursor: pointer; min-height: 44px; }
.choice input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--wash); }
.side-pick, .type-pick { display: flex; flex-wrap: wrap; gap: 10px; }
.side-pick > legend, .type-pick > legend { width: 100%; }
.choice.big { border-radius: var(--radius); flex: 1 1 240px; align-items: flex-start; padding: 14px 16px; }
.choice.big small { display: block; color: var(--warm); font-size: 0.84rem; margin-top: 2px; }
.choice.big input { margin-top: 3px; }
.input.ro { display: flex; align-items: center; color: var(--warm); }
[data-type='AMERICANO'] .only-gs, [data-type='GROUP_STAGE'] .only-am, [data-type='OPEN'] .only-am, [data-type=''] .only-gs, [data-type=''] .only-am { display: none !important; }
.only-open { display: none; }
[data-type='OPEN'] .only-open { display: block; }
[data-type='OPEN'] .not-open { display: none !important; }
.chips { margin: 4px 0; }
.partner-hint { margin-top: 6px; }
.legend { color: var(--warm); font-size: 0.8rem; padding: 10px 14px 12px; }
.pad { padding: 14px 16px 6px; }
.mt-s { margin-top: 18px; margin-bottom: 8px; }
.demo-note { padding: 12px 14px; }

.dmatch { display: block; color: inherit; }
.dmatch:hover { border-color: var(--line); color: inherit; }
.dmatch.is-live { border-color: #ff6b5a; box-shadow: 0 0 0 1px rgba(255, 107, 90, 0.25); }
.dm-score { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin: 12px 0; font-weight: 600; }
.dm-score b { font-family: var(--font-display); font-size: 1.7rem; color: var(--accent); }
.dm-score span:last-child { text-align: right; }
.dm-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--warm); font-size: 0.88rem; }
.dm-meta b { color: var(--ivory); font-weight: 600; margin-right: 4px; }
@media (max-width: 640px) {
  .dm-score { grid-template-columns: 1fr; text-align: center; }
  .dm-score span:last-child { text-align: center; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .topbar-in { flex-wrap: wrap; gap: 6px 12px; }
  .nav { margin-left: 0; width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .nav a, .nav button { padding: 7px 10px; white-space: nowrap; }
  .form-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .match { grid-template-columns: 1fr; text-align: center; }
  .match .side.away { text-align: center; }
  .match .info { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

select.input.open-list { background-image: none; padding-right: 13px; height: auto; }
select.input.open-list option { padding: 8px 6px; }

/* ---- v4: profile popup, name links, WhatsApp ---- */
.linklike { background: none; border: 0; padding: 0; margin: 0; font: inherit; font-weight: inherit; color: var(--accent); cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.linklike:hover, .linklike:focus-visible { color: var(--glow); text-decoration-color: currentColor; }
.chip-btn { background: var(--wash); color: var(--accent); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 0.85rem; cursor: pointer; }
.chip-btn:hover, .chip-btn:focus-visible { border-color: var(--accent); color: var(--glow); }
.profile-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.modal-open { overflow: hidden; }
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.72); display: flex; align-items: flex-end; justify-content: center; padding: 0; overflow-y: auto; }
.modal { position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 0 0; padding: 22px 18px 28px; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6); }
.modal h2 { margin: 0 0 4px; }
.modal-x { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--wash); color: var(--ivory); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.modal .row { padding-right: 44px; }
.btn.wa { background: #25d366; border-color: #25d366; color: #06210f; font-weight: 700; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn.wa:hover { background: #3be07b; }
.btn.wa[disabled] { opacity: 0.5; cursor: not-allowed; }
@media (min-width: 640px) { .modal-back { align-items: center; padding: 24px; } .modal { border-radius: 18px; } }

/* ---------- v5: pictures, draws, achievements ---------- */
.avatar.has-img { padding: 0; overflow: hidden; background: var(--surface-hi); }
.avatar.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.big { width: 64px; height: 64px; }
.tbanner { position: relative; width: 100%; height: 150px; overflow: hidden; border-radius: var(--radius-s); background: #0b0b0b; }
.tbanner .timg { display: block; width: 100%; height: 100%; object-fit: cover; }
.tbanner::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg, rgba(8, 8, 8, 0.88), rgba(8, 8, 8, 0.25) 60%, rgba(8, 8, 8, 0.45)), rgba(212, 175, 55, 0.12); }
.tb-in { position: absolute; left: 20px; right: 20px; bottom: 16px; z-index: 1; display: grid; gap: 8px; }
.tb-in h1 { text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
.tcard-img { height: 140px; }
.detail-img { height: 230px; border-radius: var(--radius); border: 1px solid var(--line-soft); }
.dhead { display: block; color: inherit; text-decoration: none; padding: 0; overflow: hidden; }
.dhead-img { height: 120px; border-radius: 0; }
.dhead-body { padding: 14px 16px; display: grid; gap: 8px; }
.dhead .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--warm); font-size: 0.9rem; }
.stats.ach .stat b { color: var(--accent); }
.picker-row { display: flex; gap: 14px; align-items: center; }
.picker-prev { width: 120px; height: 72px; border-radius: var(--radius-s); border: 1px dashed var(--line); background: var(--surface-hi); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--muted); font-size: 0.8rem; }
.picker-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.picker.round .picker-prev { width: 84px; height: 84px; border-radius: 50%; }
.draw-block { display: grid; gap: 10px; margin-bottom: 14px; }
.draw-block > .row h3 { font-size: 1.1rem; }
ol.zone { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.slot-label { min-width: 110px; color: var(--warm); font-size: 0.85rem; }
.round.champ .tie { border-color: var(--line); }
.tie.champion.crowned { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.tie.bye { opacity: 0.75; border-style: dashed; }
.tie.is-live { border-color: #ff6b5a; }
.draw-pick { display: flex; flex-wrap: wrap; gap: 10px; }
.draw-pick > legend { width: 100%; }
@media (max-width: 560px) { .picker-row { flex-direction: column; align-items: flex-start; } .slot-label { min-width: 100%; } }

/* ---------- v6: default avatar, closed tournaments, profile header ---------- */
.avatar.default { color: var(--accent); overflow: hidden; padding: 6px; background: var(--wash); }
.avatar.sm { width: 40px; height: 40px; font-size: 0.9rem; padding: 4px; }
.avatar.big.default { padding: 8px; }
.dash-head { gap: 14px; align-items: center; }
.dash-head .avatar { width: 64px; height: 64px; }
.pill.closed { background: rgba(160, 160, 160, 0.16); color: var(--ivory); border: 1px solid var(--line); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem; }
.closed-note { border-color: var(--line); }
.logout-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }

/* ---------- v9: WhatsApp icon, group card, ranking ---------- */
.wa-ico { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-left: 6px; border-radius: 50%; background: #25d366; color: #06210f; vertical-align: middle; text-decoration: none; flex: none; }
.wa-ico:hover, .wa-ico:focus-visible { background: #3be07b; outline: 2px solid var(--accent); outline-offset: 2px; }
.wa-ico svg { display: block; }
.phone-wa { display: inline-flex; align-items: center; flex-wrap: wrap; }
.wa-group { border-color: #25d366; }
.btn.wa svg { margin-right: 8px; flex: none; }
.rank-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; border: 1px solid var(--line); color: var(--accent); white-space: nowrap; }
.zone li .wa-ico { width: 22px; height: 22px; margin-left: 4px; } .zone li .wa-ico svg { width: 14px; height: 14px; }

/* ---------- v10: level description, Instagram menu icon, success page ---------- */
.level-desc { display: block; margin-top: 6px; min-height: 1.2em; line-height: 1.4; }
.nav a.nav-ico { display: inline-flex; align-items: center; justify-content: center; padding: 7px 9px; }
.nav a.nav-ico:hover, .nav a.nav-ico:focus-visible { color: var(--accent); background: var(--wash); }
.card.left { text-align: left; }

/* v11 */
.sep { border: 0; border-top: 1px solid var(--line-soft); margin: 6px 0; width: 100%; }
.category-pick .row { gap: 10px; }
.hist-row .dm-meta { flex-wrap: wrap; }
select.input optgroup { color: var(--accent); font-style: normal; }

/* ---------- v12: League module ---------- */
.combo { position: relative; display: inline-block; min-width: 180px; }
.combo > summary { list-style: none; cursor: pointer; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface-hi); color: var(--ivory); min-height: 40px; display: flex; align-items: center; }
.combo > summary::-webkit-details-marker { display: none; }
.combo[open] > summary { border-color: var(--accent); }
.combo-panel { position: absolute; z-index: 30; left: 0; top: calc(100% + 4px); width: min(320px, 86vw); background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius-s); padding: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.combo-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 240px; overflow: auto; }
.combo-li { margin: 0; }
.combo-group { padding: 6px 4px 2px; color: var(--accent); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.combo-item { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: var(--ivory); padding: 8px; border-radius: 6px; cursor: pointer; min-height: 38px; }
.combo-item:hover, .combo-item:focus-visible { background: var(--wash); outline: none; }
.combo-none { padding: 8px; }
.lg-list { display: grid; gap: 8px; }
.lg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius-s); background: var(--surface); }
.lg-name { flex: 1 1 160px; font-weight: 600; min-width: 0; }
.lg-confirm, .lg-rep { display: flex; align-items: center; gap: 6px; }
.yn { display: inline-flex; gap: 6px; }
.chip-btn { border: 1px solid var(--line); background: transparent; color: var(--warm); padding: 6px 14px; border-radius: 999px; cursor: pointer; min-height: 36px; font: inherit; }
.chip-btn.on.yes { background: var(--ok-wash); color: var(--ok); border-color: var(--ok); }
.chip-btn.on.no { background: var(--bad-wash); color: var(--bad); border-color: var(--bad); }
.chip { display: inline-block; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .78rem; color: var(--accent); }
.table-wrap { overflow-x: auto; padding: 0; }
.lg-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.lg-table th, .lg-table td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.lg-table th:nth-child(2), .lg-table td:nth-child(2) { text-align: left; }
.lg-table th { color: var(--accent); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.lg-table tr.mine td { background: var(--wash); }
.lg-match { display: grid; gap: 8px; }
.lg-score-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.input.score { width: 64px; text-align: center; }
.input.slim { padding: 6px 8px; min-height: 36px; }
.lg-mline.mine { border-color: var(--accent); }
.lg-mline .win, .win { color: var(--ok); }
.lg-mline .loss, .loss { color: var(--bad); }
.right { text-align: right; margin-left: auto; }
.grow { flex: 1 1 auto; }
.mt-s { margin-top: 8px; }
@media (max-width: 560px) { .combo { width: 100%; } .lg-row { flex-direction: column; align-items: stretch; } }

/* ---- League v13: week / division tabs, ranking grid, view switches */
.lg-tabgroup { display: grid; gap: 8px; }
.lg-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.lg-tab { flex: 0 0 auto; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-height: 44px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; color: inherit; text-decoration: none; white-space: nowrap; font-weight: 600; font-size: .92rem; line-height: 1.15; }
.lg-tab small { font-size: .7rem; font-weight: 400; opacity: .7; }
.lg-tab.done { border-color: rgba(120, 200, 140, .5); }
.lg-tab.live { border-color: var(--gold, #d4af37); }
.lg-tab.on { background: var(--gold, #d4af37); border-color: var(--gold, #d4af37); color: #111; }
.lg-tab.on small { opacity: .85; }
.lg-views { gap: 18px; margin: 4px 0; }
.lg-switch { gap: 8px; align-items: center; cursor: pointer; }
.lg-grid th, .lg-grid td { text-align: center; white-space: nowrap; }
.lg-grid th:nth-child(2), .lg-grid td:nth-child(2) { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.lg-grid td small { display: block; font-size: .68rem; opacity: .6; }
.lg-grid td.forced { color: #e8a0a0; }
.lg-grid td.prov { font-style: italic; opacity: .85; }
.lg-table tr.out td { opacity: .75; }
