:root {
  --bg: #f3f4f6; --surface: #ffffff; --ink: #12161d; --ink2: #434b58; --muted: #767f8e; --line: #e6e8ec;
  --head: #15171e; --head2: #2a2d36; --on-head: #ffffff; --gold-grad: linear-gradient(135deg, #ffd978, #f2a71b);
  --head-grad: linear-gradient(90deg, #15171e 0%, #2b1216 38%, #8c0f19 72%, #d7192a 100%);
  --cta-grad: linear-gradient(180deg, #dc1f2c 0%, #c4141f 100%);
  --accent: #d7192a; --accent-dark: #b01220; --accent-soft: #fdeced;
  --ok: #0a7d4f; --ok-soft: #e7f5ef;
  --live: #dc2f2f; --live-soft: #fdecec; --gold: #d98a04; --gold-soft: #fdf3dc; --blue: #2159d3; --blue-soft: #e9effc;
  --radius: 14px; --nav-h: 60px; --top-h: calc(56px + env(safe-area-inset-top));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: none; }
a, button, label { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); width: 100%; padding: 11px 12px; border: 1px solid #d5d9e0; border-radius: 10px; background: #fff; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled { background: #f3f4f6; color: var(--muted); }
textarea { min-height: 76px; resize: vertical; }
.pwbox { position: relative; flex: 1; min-width: 0; }
.pwbox input { padding-right: 44px; }
.pweye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
label.f { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink2); margin: 14px 0 6px; }
svg { flex: none; display: block; }
.ci { width: 1.1em; height: 1.1em; vertical-align: -0.2em; display: inline-block; }
.ci.lg { width: 30px; height: 30px; vertical-align: -6px; }

/* ---------- shell ---------- */
.app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: var(--bg); padding-bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); }
.app.nonav { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
@media (min-width: 560px) { body.user { background: #dfe2e8; } body.user .app { box-shadow: 0 0 0 1px var(--line); } }
.topbar { position: sticky; top: 0; z-index: 40; background: var(--head-grad); color: var(--on-head); padding: 8px 14px; padding-top: calc(8px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 10px; min-height: var(--top-h); }
.topbar .grow { flex: 1; min-width: 0; }
.topbar h1 { font-size: 15.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { font-size: 12px; color: #c9ccd4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--gold-grad); color: #1d1405; display: grid; place-items: center; flex: none; }
.topbar .btn { background: #fff; color: var(--accent); }
.logo.img { background: #fff; overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.iconbtn { background: transparent; border: 0; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; color: inherit; flex: none; }
.iconbtn:active { background: rgba(255, 255, 255, .12); }
.coin { display: inline-flex; align-items: center; gap: 5px; background: var(--gold-soft); color: #7a4d00; font-weight: 700; border-radius: 999px; padding: 4px 11px; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.coin.dark { background: rgba(0, 0, 0, .35); color: #fff; border: 1px solid rgba(255, 255, 255, .22); }
.bottomnav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 40; }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }
.bottomnav a.on { color: var(--accent); font-weight: 600; }
.actionbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); display: flex; gap: 10px; z-index: 40; }
.actionbar .btn { flex: 1; }
.content { padding: 12px 14px; }
.offline { background: var(--live); color: #fff; text-align: center; padding: 5px; font-size: 12.5px; }

/* ---------- basics ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.flush { padding: 0; overflow: hidden; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.bold { font-weight: 600; }
.center { text-align: center; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tnum, .num { font-variant-numeric: tabular-nums; }
.num { text-align: right; }
.sec { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 2px 8px; font-size: 13.5px; font-weight: 700; }
.sec:first-child { margin-top: 2px; }
.grid { display: grid; gap: 0 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; padding: 12px 16px; font-weight: 600; font-size: 14px; cursor: pointer; background: var(--cta-grad); color: #fff; white-space: nowrap; }

.btn:disabled { background: #e3e6ea; color: #9aa2ae; cursor: default; }
.btn.dark { background: var(--head); }
.btn.ghost { background: var(--accent-soft); color: var(--accent-dark); }
.btn.outline { background: #fff; color: var(--ink); border-color: #d5d9e0; }
.btn.outline:active { background: var(--bg); }
.btn.danger { background: var(--live-soft); color: var(--live); }
.btn.gold { background: var(--gold); color: #fff; }
.btn.sm { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--accent-dark); font-weight: 600; cursor: pointer; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; background: #eef0f3; color: var(--ink2); }
.pill.live { background: var(--live-soft); color: var(--live); }
.pill.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--live); animation: blink 1.2s infinite; }
.pill.up { background: var(--blue-soft); color: var(--blue); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.gold { background: var(--gold-soft); color: #7a4d00; }
.pill.red { background: var(--live-soft); color: var(--live); }
@keyframes blink { 50% { opacity: .25; } }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.eico { width: 52px; height: 52px; border-radius: 50%; background: #e9ebef; color: var(--ink2); display: grid; place-items: center; margin: 0 auto 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11.5px; color: var(--muted); font-weight: 600; }
th.num { text-align: right; }
.scroll { overflow-x: auto; }

/* ---------- tabs ---------- */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 0 14px 2px; margin: 0 -14px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid #d5d9e0; background: #fff; border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; color: var(--ink2); display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg { display: flex; background: #e6e8ec; border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px 4px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); }
.utabs { display: flex; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: var(--top-h); z-index: 30; }
.utabs button { flex: 1; border: 0; background: none; padding: 12px 2px 10px; font-weight: 500; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.utabs button.on { color: var(--ink); font-weight: 600; border-color: var(--accent); }

/* ---------- team badge & avatars ---------- */
.tb { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 11.5px; flex: none; }
.tb.lg { width: 48px; height: 48px; font-size: 13px; }
.tb.sm { width: 24px; height: 24px; font-size: 8.5px; }
.av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 14px; flex: none; position: relative; }
.av .tag { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 8.5px; font-weight: 600; padding: 1px 4px; border-radius: 4px; white-space: nowrap; }
.uav { width: 34px; height: 34px; border-radius: 50%; background: #e4e7ec; color: var(--ink2); display: grid; place-items: center; font-weight: 600; font-size: 12.5px; flex: none; }

/* ---------- match card ---------- */
.mcard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.mcard:active { background: #fafafa; }
.mt { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px 0; font-size: 12px; color: var(--muted); }
.names { padding: 3px 14px 0; font-size: 13px; font-weight: 600; color: var(--ink2); }
.mm { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; padding: 10px 14px 12px; }
.team { display: flex; align-items: center; gap: 9px; min-width: 0; }
.team.r { flex-direction: row-reverse; text-align: right; }
.team .code { font-weight: 700; font-size: 15px; line-height: 1.2; }
.team .nm { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team .sc { font-size: 12.5px; color: var(--ink); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.team > div { min-width: 0; }
.mid { text-align: center; min-width: 78px; }
.cd { color: var(--live); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.mf { border-top: 1px solid var(--line); padding: 8px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.mf b { color: var(--ink); font-weight: 600; }

/* ---------- match header ---------- */
.hero { background: var(--head-grad); color: #fff; padding: 6px 16px 16px; }
.hero .teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.hero .tcol { display: flex; align-items: center; gap: 9px; min-width: 0; }
.hero .tcol.r { flex-direction: row-reverse; text-align: right; }
.hero .tcol > div { min-width: 0; }
.hero .code { font-weight: 700; font-size: 15px; }
.hero .sc { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hero .vs { text-align: center; font-size: 12px; color: #e6e8ec; min-width: 70px; }
.hero .cd { color: #fff; }
.hero .meta { text-align: center; font-size: 11.5px; color: #c9ccd4; margin-top: 10px; }
.hero .result { text-align: center; margin-top: 10px; font-size: 13px; font-weight: 600; color: #ffc94d; }
.welcome { position: relative; overflow: hidden; display: block; width: 100%; text-align: left; border: 0; background: linear-gradient(115deg, #15171e 0%, #2b1216 45%, #8c0f19 80%, #d7192a 100%); color: #fff; border-radius: 16px; padding: 18px; margin-bottom: 12px; }
.welcome .art { position: absolute; right: -14px; bottom: -10px; width: 190px; height: auto; pointer-events: none; }
.wtext { position: relative; max-width: 62%; }
.wtag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; color: #ffc94d; margin-bottom: 6px; }
.welcome.mini { padding: 13px 16px; cursor: pointer; font: inherit; }
.welcome.mini h2 { font-size: 15px; }
.welcome.mini p { margin: 0; font-size: 12px; }
.welcome.mini .art { width: 118px; right: -6px; bottom: -8px; }
.welcome h2 { font-size: 21px; line-height: 1.2; margin-bottom: 6px; }
.welcome p { margin: 0 0 14px; color: #ffe3e4; font-size: 13px; }
.welcome .btn { background: var(--gold-grad); color: #1d1405; }

/* ---------- contests ---------- */
.ccard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; cursor: pointer; }
.cb { padding: 12px 14px; }
.pool { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.entry { border: 0; background: var(--cta-grad); color: #fff; font-weight: 600; padding: 9px 14px; border-radius: 8px; cursor: pointer; min-width: 78px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-variant-numeric: tabular-nums; }
.entry.joined { background: var(--ok-soft); color: var(--ok); }
.entry.full { background: #eef0f3; color: var(--muted); }
.bar { height: 4px; background: #eceef1; border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.cf { background: #fafbfc; border-top: 1px solid var(--line); padding: 7px 14px; display: flex; gap: 12px; font-size: 12px; color: var(--muted); align-items: center; }
.lrow { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.lrow.click { cursor: pointer; }
.lrow.me { background: #fff5f5; }
.lrow:last-child { border-bottom: 0; }
.rank { width: 30px; font-weight: 600; color: var(--ink2); text-align: center; flex: none; font-variant-numeric: tabular-nums; }
.pts { font-weight: 700; font-variant-numeric: tabular-nums; }
.tbl-head { display: flex; justify-content: space-between; padding: 8px 14px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--line); }

/* ---------- team builder ---------- */
.cstick { position: sticky; top: var(--top-h); z-index: 30; }
.cstats { background: var(--head-grad); color: #fff; padding: 4px 16px 12px; }
.cstats .r1 { display: flex; justify-content: space-between; align-items: center; }
.cstats .big { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cstats .lbl { font-size: 11px; color: #c9ccd4; }
.slots { display: flex; gap: 3px; margin-top: 10px; }
.slots i { flex: 1; height: 5px; border-radius: 2px; background: rgba(255, 255, 255, .28); }
.slots i.on { background: var(--gold-grad); }
.rtabs { display: flex; background: #fff; border-bottom: 1px solid var(--line); }
.rtabs button { flex: 1; border: 0; background: none; padding: 11px 1px 9px; font-weight: 500; font-size: 12.5px; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.rtabs button.on { color: var(--ink); font-weight: 600; border-color: var(--accent); }
.rhint { padding: 7px 16px; font-size: 12px; color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.prow { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); cursor: pointer; }
.prow.sel { background: #fff3f3; }
.prow.dis { opacity: .5; }
.prow .info { flex: 1; min-width: 0; }
.prow .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .cr { width: 40px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.xi { font-size: 11px; font-weight: 500; }
.xi.yes { color: var(--ok); }
.xi.no { color: var(--live); }
.addbtn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--accent); background: #fff; color: var(--accent); display: grid; place-items: center; cursor: pointer; flex: none; }
.addbtn.rm { background: var(--live-soft); border-color: transparent; color: var(--live); }
.cvbtn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid #d5d9e0; background: #fff; font-weight: 600; font-size: 12.5px; cursor: pointer; color: var(--ink2); flex: none; }
.cvbtn.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- pitch preview ---------- */
.pitch { position: relative; border-radius: 12px; padding: 16px 6px; overflow: hidden; color: #fff; background: radial-gradient(circle at 50% 45%, #2a9c69 0%, #17794f 55%, #0f5d3b 100%); }
.pitch::before { content: ""; position: absolute; left: 50%; top: 50%; width: 56px; height: 40%; transform: translate(-50%, -50%); background: rgba(255, 255, 255, .1); border-radius: 4px; }
.pline { position: relative; z-index: 1; margin-bottom: 12px; }
.pline:last-child { margin-bottom: 0; }
.pline .lbl { text-align: center; font-size: 10px; font-weight: 600; letter-spacing: .08em; color: #cdeadb; margin-bottom: 6px; }
.toks { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 2px; }
.tok { width: 70px; text-align: center; }
.tok .av { margin: 0 auto; width: 38px; height: 38px; font-size: 12.5px; border: 2px solid #fff; }
.tok .cvb { position: absolute; top: -5px; left: -8px; background: var(--ink); color: #fff; font-size: 9px; font-weight: 700; border-radius: 50%; width: 19px; height: 19px; display: grid; place-items: center; }
.tok .nm { margin-top: 4px; background: #fff; color: var(--ink); font-size: 10.5px; font-weight: 600; border-radius: 4px; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tok .pt { font-size: 10.5px; font-weight: 500; margin-top: 2px; }

/* ---------- team card ---------- */
.tcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.tcard .th { background: var(--ink); color: #fff; padding: 8px 14px; display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 13px; }
.tcard .tb2 { padding: 12px 14px; display: flex; gap: 10px; }
.tcard .tf { border-top: 1px solid var(--line); padding: 8px 14px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.iconrow { display: flex; gap: 4px; }
.iconrow .iconbtn { width: 32px; height: 32px; }

/* ---------- scorecard ---------- */
.score td, .score th { padding: 7px 4px; font-size: 13px; }
.score th { font-size: 11px; }
.score td:first-child, .score th:first-child { padding-left: 14px; }
.score td:last-child, .score th:last-child { padding-right: 14px; }
.score tr:last-child td { border-bottom: 0; }

/* ---------- profile ---------- */
.phead { background: var(--head-grad); color: #fff; padding: 12px 16px 50px; display: flex; align-items: center; gap: 12px; }
.pav { width: 54px; height: 54px; border-radius: 50%; background: var(--gold-grad); color: #1d1405; border: 1px solid rgba(255, 255, 255, .4); display: grid; place-items: center; font-size: 19px; font-weight: 600; flex: none; }
.pname { font-size: 17px; font-weight: 600; }
.pwallet .bal { font-size: 27px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.pstats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; text-align: center; }
.pstat b { display: block; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pstat span { font-size: 11.5px; color: var(--muted); }
.menu { padding: 0 14px; }
.mi { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 0; border: 0; border-bottom: 1px solid var(--line); background: none; font-size: 14px; text-align: left; cursor: pointer; }
.mi:last-child { border-bottom: 0; }
.mi .mic { color: var(--ink2); display: grid; place-items: center; flex: none; }
.mi .chev { color: #a5acb8; display: grid; place-items: center; }
.mi.danger, .mi.danger .mic { color: var(--live); }
.hist { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.hist:last-child { border-bottom: 0; }
.plus { color: var(--ok); font-weight: 600; font-variant-numeric: tabular-nums; }
.minus { color: var(--live); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- sheet & toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(10, 14, 22, .5); z-index: 100; display: flex; align-items: flex-end; justify-content: center; animation: fade .12s; }
.sheet { background: #fff; width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); animation: up .14s ease-out; }
.grab { width: 36px; height: 4px; border-radius: 2px; background: #d5d9e0; margin: 4px auto 12px; }
.sheet h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
@media (min-width: 700px) { .modal { align-items: center; } .sheet { border-radius: 16px; max-width: 540px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); } }
.toast { position: fixed; left: 0; right: 0; margin: 0 auto; bottom: calc(var(--nav-h) + 18px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13.5px; z-index: 200; max-width: calc(100% - 32px); width: max-content; text-align: center; }
.toast.err { background: #b42323; }
.pick { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 1px solid #d5d9e0; border-radius: 10px; background: #fff; margin-bottom: 8px; cursor: pointer; text-align: left; }
.pick.on { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- login ---------- */
.auth { min-height: 100vh; min-height: 100dvh; background: #fff; padding: 48px 20px 28px; display: flex; flex-direction: column; }
.auth .logo { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 16px; }
.auth h1 { font-size: 24px; font-weight: 700; }
.auth p.tag { color: var(--muted); margin: 4px 0 22px; }
.auth .inner { max-width: 400px; width: 100%; margin: 0 auto; }

/* ---------- admin ---------- */
body.admin .app { max-width: none; padding-bottom: 40px; }
body.admin .tabsbar { position: sticky; top: var(--top-h); z-index: 35; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 14px; }
body.admin .tabsbar .chips { margin: 0; padding: 0; }
body.admin .tabsbar .chip { border-color: transparent; background: transparent; border-radius: 8px; padding: 7px 10px; }
body.admin .tabsbar .chip.on { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
body.admin .content { max-width: 860px; margin: 0 auto; }
@media (min-width: 960px) {
  body.admin .tabsbar { position: fixed; left: 0; top: var(--top-h); bottom: 0; width: 220px; border-bottom: 0; border-right: 1px solid var(--line); padding: 12px; }
  body.admin .tabsbar .chips { flex-direction: column; overflow: visible; }
  body.admin .tabsbar .chip { width: 100%; justify-content: flex-start; padding: 9px 10px; }
  body.admin .content { margin-left: 220px; max-width: 860px; padding: 18px 24px; }
}
.count { background: var(--cta-grad); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 9px; min-width: 18px; padding: 0 5px; text-align: center; line-height: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 8px; margin-bottom: 12px; }
.qbtns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.qbtns button { min-width: 50px; height: 42px; padding: 0 11px; font-size: 14px; font-weight: 600; border-radius: 8px; border: 1px solid #d5d9e0; background: #fff; cursor: pointer; }
.qbtns button.more { color: var(--muted); font-weight: 500; }
.allrules { margin-top: 10px; background: #f7f8fa; border-radius: 10px; padding: 6px 12px; }
.allrules .rule { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.allrules .rule span { flex: 1; font-size: 13px; }
.allrules button { width: 36px; height: 36px; font-size: 17px; border-radius: 8px; border: 1px solid #d5d9e0; background: #fff; cursor: pointer; }
.allrules b { min-width: 24px; text-align: center; }
.ballpad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ballpad button { height: 56px; border-radius: 10px; border: 1px solid #d5d9e0; background: #fff; font-size: 19px; font-weight: 700; cursor: pointer; color: var(--ink); }
.ballpad button:active:not(:disabled) { background: var(--accent-soft); }
.ballpad button:disabled { opacity: .35; cursor: default; }
.ballpad button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.ballpad .b4 { color: var(--blue); border-color: #bcd0f5; }
.ballpad .b6 { color: #6d3bd1; border-color: #d3c4f4; }
.ballpad .bx { font-size: 13px; font-weight: 600; color: #7a4d00; background: var(--gold-soft); border-color: #f1dfb4; }
.ballpad .bw { grid-column: span 3; font-size: 15px; background: var(--cta-grad); border-color: transparent; color: #fff; }
.sheet .ballpad button { font-size: 14px; height: 48px; font-weight: 600; }
.mini { padding: 7px 9px; border-radius: 8px; font-size: 13.5px; }
.defrow { display: grid; gap: 0 8px; grid-template-columns: 1fr 1fr 1fr auto; align-items: end; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.defrow .dname, .defrow .dprize { grid-column: 1 / -1; }
.lineup { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.lineup input { width: 20px; height: 20px; flex: none; }

/* ---------- motion: quick and quiet ---------- */
@keyframes fadein { from { opacity: 0; } }
.anim .content, .anim > .prow, .anim > .lrow { animation: fadein .14s ease-out backwards; }
.pill.live::before { animation: blink 1.4s infinite; }
.tcard .th { background: var(--ink); }
.toast { animation: fadein .15s ease-out; }
.btn:active, .entry:active, .addbtn:active, .cvbtn:active { opacity: .85; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
