/* poolean web — the iOS "Arena" visual system ported for full parity, laid out
   for desktop (sidebar + multi-column) instead of a phone column. */

:root {
  --blue: #0b63d6;
  --blue-deep: #0a4da8;
  --blue-tint: #eaf1fd;
  --gold: #f4b41a;
  --gold-deep: #b7820b;
  --gold-tint: #fcf1d2;
  --on-gold: #3a2b05;
  --on-gold-deep: #2a2003;
  --gold-text: #7a560a;
  --silver: #c4cbd4;
  --silver2: #9aa3ae;
  --ink: #15191f;
  --ink2: #576070;
  --ink3: #8b93a1;
  --header-top: #1b2330;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --line: #e6eaf0;
  --track: #edf0f5;
  --up: #1e9d5b;
  --up-tint: #e2f4ea;
  --down: #e1543c;
  --down-tint: #fbeae6;
  --flat: #9aa3ae;

  --disp: "Saira Condensed", system-ui, sans-serif;
  --ui: "Hanken Grotesk", system-ui, sans-serif;
  --r-sm: 8px; --r-md: 12px; --r-lg: 14px; --r-xl: 18px; --r-xxl: 22px;
  --sidebar-w: 250px;
  --maxw: 1140px;
  --shadow-card: 0 4px 16px rgba(21, 25, 31, 0.07);
  --shadow-gold: 0 8px 26px rgba(244, 180, 26, 0.22);
  --shadow-pop: 0 16px 44px rgba(21, 25, 31, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--ui); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--gold-tint); }

.eyebrow { font-family: var(--ui); font-weight: 800; font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink3); }
.disp { font-family: var(--disp); font-weight: 800; letter-spacing: 0.01em; line-height: 0.98; }
.spin { width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-screen { min-height: 100dvh; display: grid; place-items: center; }
.uc { text-transform: uppercase; }

/* ── avatar (initials on color; rings + crown for #1; photo when set) ── */
.avw { position: relative; flex: none; display: inline-flex; }
.av { border-radius: 50%; display: grid; place-items: center; color: #fff; font-family: var(--disp); font-weight: 700; overflow: hidden; background-size: cover; background-position: center; box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.06); }
.av span { line-height: 1; transform: translateY(6%); }
.avw.silver .av { box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.08); }
.avw.gold .av { box-shadow: none; }
/* gold double ring: white outer + gold inner */
.avw.gold::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 var(--ringw, 3px) #fff, 0 0 0 calc(var(--ringw, 3px) + var(--goldw, 2px)) var(--gold); }
.avw .crown { position: absolute; left: 50%; top: 0; transform: translate(-50%, -62%) rotate(-3deg); pointer-events: none; }
.avw .crown svg { display: block; }

/* ── jersey rank chip ── */
.jersey { display: grid; place-items: center; color: #fff; font-family: var(--disp); font-weight: 700; flex: none; background: linear-gradient(160deg, var(--blue), var(--blue-deep)); }
.jersey.gold { background: linear-gradient(160deg, var(--gold), var(--gold-deep)); color: var(--on-gold-deep); }
.jersey span { transform: translateY(4%); }

/* ── movement chip ── */
.move { display: inline-flex; align-items: center; gap: 3px; font-family: var(--ui); font-weight: 700; font-size: 13px; padding: 3px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.move.up { color: var(--up); background: var(--up-tint); }
.move.down { color: var(--down); background: var(--down-tint); }
.move.flat { color: var(--flat); background: transparent; padding: 3px 4px; }
.move.bare { background: transparent; padding: 0; }
.move .tri { font-size: 9px; line-height: 1; }

/* ── tally bar ── */
.tally { height: 11px; border-radius: 999px; background: var(--track); overflow: hidden; }
.tally > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--blue-deep)); }
.tally.gold > i { background: linear-gradient(90deg, var(--gold), var(--gold-deep)); }

/* ── segments (vote progress) ── */
.segs { display: flex; gap: 5px; }
.segs > i { height: 7px; flex: 1; border-radius: 4px; background: rgba(255, 255, 255, 0.18); }
.segs > i.on { background: var(--gold); }

/* ── buttons ── */
.btn { height: 46px; border-radius: var(--r-md); display: inline-grid; place-items: center; font-weight: 800; font-size: 15px; padding: 0 20px; transition: transform 0.06s, filter 0.15s; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn-gold { background: var(--gold); color: var(--on-gold-deep); }
.btn-gold:hover { filter: brightness(1.05); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--blue); border: 1px solid var(--line); }
.btn-danger { background: var(--down-tint); color: var(--down); }
.btn-danger:hover { background: var(--down); color: #fff; }
.btn-lg { height: 54px; font-size: 16px; }
.btn-full { width: 100%; }

/* ───────────────────────── sign in ───────────────────────── */
.auth { min-height: 100dvh; background: linear-gradient(155deg, var(--header-top) 0%, var(--ink) 70%); color: #fff; display: flex; flex-direction: column; }
.auth-wrap { width: 100%; max-width: 460px; margin: 0 auto; padding: 40px 26px 28px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.auth-brand { font-family: var(--disp); font-weight: 700; letter-spacing: 0.28em; font-size: 18px; color: var(--gold); }
.auth-hero { width: 150px; height: 150px; object-fit: cover; align-self: center; margin: 14px 0 6px; border-radius: var(--r-xl); box-shadow: 0 8px 20px rgba(244, 180, 26, 0.22); }
.auth h1 { font-family: var(--disp); font-weight: 800; font-size: 42px; line-height: 1.04; margin-top: 8px; }
.auth .lede { color: rgba(255, 255, 255, 0.62); font-weight: 500; font-size: 15px; line-height: 1.45; margin-top: 14px; }
.auth-form { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.field { height: 50px; border-radius: var(--r-md); border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.06); padding: 0 14px; color: #fff; font-size: 16px; font-weight: 500; }
.field::placeholder { color: rgba(255, 255, 255, 0.4); }
.field:focus { outline: none; border-color: var(--gold); background: rgba(255, 255, 255, 0.1); }
.auth .btn-gold { height: 52px; }
.auth .err { color: #ff9b9b; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.auth-row { display: flex; justify-content: center; gap: 18px; margin-top: 16px; }
.link-muted { color: rgba(255, 255, 255, 0.55); font-weight: 600; font-size: 13.5px; }
.pending-card { background: rgba(255, 255, 255, 0.08); border-radius: 16px; padding: 18px; }
.pending-card .eyebrow { color: var(--gold); }
@media (min-width: 920px) {
  .auth-wrap { max-width: var(--maxw); display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: 64px; padding: 48px; margin: auto; }
  .auth-hero { width: 200px; height: 200px; align-self: flex-start; margin: 0 0 18px; }
  .auth h1 { font-size: 64px; }
  .auth .lede { font-size: 17px; max-width: 30ch; }
  .auth-card { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--r-xxl); padding: 32px; }
  .auth-form { margin-top: 0; }
}

/* ───────────────────────── shell ───────────────────────── */
.shell { min-height: 100dvh; }
.sidebar { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--ink); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 14px 12px; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.topbar .brand { font-family: var(--disp); font-weight: 700; letter-spacing: 0.24em; font-size: 16px; color: var(--gold); }
.tb-right { display: flex; align-items: center; gap: 12px; }
.menu-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: #fff; margin-right: -6px; }

/* Hamburger dropdown (mobile nav) */
.navmenu { position: fixed; inset: 0; z-index: 50; display: none; }
.navmenu.open { display: block; }
.navmenu-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); animation: fade 0.18s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.navmenu-panel { position: relative; z-index: 1; background: var(--ink); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 14px 14px; border-radius: 0 0 20px 20px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4); animation: drop 0.2s ease; }
@keyframes drop { from { transform: translateY(-14px); opacity: 0.5; } to { transform: none; opacity: 1; } }
.navmenu-panel .brand { font-family: var(--disp); font-weight: 700; letter-spacing: 0.24em; font-size: 16px; color: var(--gold); }
.navmenu-list { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.navmenu-item { display: flex; align-items: center; gap: 14px; padding: 14px 12px; border-radius: 12px; color: rgba(255, 255, 255, 0.72); font-weight: 700; font-size: 16px; }
.navmenu-item svg { width: 22px; height: 22px; }
.navmenu-item.active { background: rgba(244, 180, 26, 0.14); color: var(--gold); }
.navmenu-item .badge { margin-left: auto; background: var(--gold); color: var(--on-gold-deep); font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; color: var(--gold); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(244, 180, 26, 0.5); } 70% { box-shadow: 0 0 0 9px rgba(244, 180, 26, 0); } 100% { box-shadow: 0 0 0 0 rgba(244, 180, 26, 0); } }

.main { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.wrap { max-width: 720px; margin: 0 auto; padding: 18px 16px 0; }

/* dark scoreboard header per screen (ArenaHeader) */
.arena { background: linear-gradient(160deg, var(--header-top), var(--ink)); color: #fff; border-radius: 0 0 26px 26px; padding: 22px 20px 22px; }
.arena .label { font-family: var(--disp); font-weight: 700; letter-spacing: 0.16em; font-size: 15px; color: var(--gold); }
.arena h1 { font-family: var(--disp); font-weight: 800; font-size: 38px; line-height: 1.0; letter-spacing: 0.01em; margin-top: 6px; }
.arena .sub { font-weight: 600; font-size: 12.5px; color: rgba(255, 255, 255, 0.6); margin-top: 12px; }
.arena .ul { width: 54px; height: 5px; border-radius: 3px; background: var(--gold); margin-top: 9px; }
.arena-wrap { max-width: 720px; margin: 0 auto; }

.section-label { font-family: var(--ui); font-weight: 800; font-size: 11.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink3); margin: 20px 2px 10px; display: flex; align-items: center; justify-content: space-between; }
.section-label .link { color: var(--blue); font-size: 12px; cursor: pointer; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-card); }

/* ── champion block ── */
.champion { position: relative; overflow: hidden; border-radius: var(--r-xxl); padding: 22px 18px 16px; background: linear-gradient(150deg, var(--gold), #d99e16); box-shadow: var(--shadow-gold); cursor: pointer; margin-top: 14px; }
.champion .wm { position: absolute; right: 6px; top: -34px; font-family: var(--disp); font-weight: 800; font-size: 188px; line-height: 1; color: rgba(42, 32, 3, 0.12); pointer-events: none; }
.champion .eyebrow { color: var(--gold-text); position: relative; }
.champ-main { display: flex; align-items: center; gap: 16px; position: relative; }
.champ-main .whitebox { background: #fff; border-radius: 50%; padding: 3px; flex: none; }
.champ-main .nm { font-family: var(--disp); font-weight: 800; font-size: 32px; line-height: 1.05; color: var(--on-gold-deep); }
.champ-main .badge { display: flex; align-items: center; gap: 7px; margin-top: 4px; }
.champ-main .badge .t { font-weight: 700; font-size: 12.5px; color: var(--on-gold-deep); }

/* ── board rows ── */
.board { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px 12px; box-shadow: var(--shadow-card); cursor: pointer; }
.row .nm { font-family: var(--ui); font-weight: 800; font-size: 15.5px; letter-spacing: 0.01em; text-transform: uppercase; flex: 1; }
.row .nm small { display: block; text-transform: none; color: var(--ink3); font-weight: 600; font-size: 11.5px; letter-spacing: 0; }

/* ── stat cards / tiles ── */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 13px; box-shadow: var(--shadow-card); cursor: pointer; }
.stat-card.flat { cursor: default; }
.stat-card .eyebrow { font-size: 10px; }
.stat-card .who { display: flex; align-items: center; gap: 9px; margin-top: 8px; }
.stat-card .who .n { font-family: var(--ui); font-weight: 800; font-size: 14px; text-transform: uppercase; }
.stat-card .val { font-family: var(--disp); font-weight: 700; font-size: 22px; line-height: 1.1; margin-top: 6px; }
.stat-card .val.up { color: var(--up); } .stat-card .val.down { color: var(--down); } .stat-card .val.gold { color: var(--gold-deep); }
.dark-block { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 13px 16px; margin-top: 12px; }
.dark-block .eyebrow { color: var(--gold); }
.dark-block .t { font-weight: 600; font-size: 13.5px; margin-top: 5px; color: rgba(255,255,255,0.85); }
.dark-block .t b { font-family: var(--disp); font-weight: 700; font-size: 18px; }

.mover { display: flex; align-items: center; gap: 11px; border-radius: var(--r-lg); padding: 12px 14px; }
.mover.up { background: var(--up-tint); } .mover.down { background: var(--down-tint); }
.mover .nm { flex: 1; font-family: var(--ui); font-weight: 800; font-size: 14px; text-transform: uppercase; }
.mover .eyebrow { font-size: 10px; }

/* trend (sparkline) rows */
.trend { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-top: 1px solid var(--line); }
.trend:first-child { border-top: none; }
.trend .nm { flex: 1; font-family: var(--ui); font-weight: 800; font-size: 14.5px; text-transform: uppercase; }
.trend .nm small { display: block; text-transform: none; color: var(--ink3); font-weight: 600; font-size: 11.5px; }

/* ── rules ── */
.rule { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 15px; box-shadow: var(--shadow-card); margin-bottom: 9px; }
.rule .n { font-family: var(--disp); font-weight: 700; font-size: 30px; line-height: 1; color: var(--blue); width: 26px; text-align: center; flex: none; }
.rule h3 { font-weight: 800; font-size: 16px; }
.rule ul { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.rule li { position: relative; padding-left: 15px; color: var(--ink2); font-size: 13.5px; line-height: 1.48; }
.rule li::before { content: "·"; position: absolute; left: 2px; color: var(--gold); font-weight: 800; }
.rule .sub { margin-top: 12px; } .rule .sub h4 { font-weight: 700; font-size: 13.5px; } .rule .sub ul { margin-top: 5px; }

/* ── party ── */
.banner { border-radius: var(--r-xl); padding: 18px; color: #fff; box-shadow: var(--shadow-card); }
.banner.head { background: linear-gradient(150deg, var(--header-top), var(--ink)); }
.banner.gold { background: linear-gradient(150deg, var(--gold), #d99e16); color: var(--on-gold-deep); }
.banner.idle { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.banner .eyebrow { color: rgba(255, 255, 255, 0.7); }
.banner.gold .eyebrow { color: var(--gold-text); } .banner.idle .eyebrow { color: var(--ink3); }
.banner h3 { font-family: var(--disp); font-weight: 800; font-size: 30px; margin-top: 8px; text-transform: uppercase; }
.banner .when { font-weight: 600; font-size: 14px; margin-top: 6px; opacity: 0.92; }
.banner .infobox { display: flex; gap: 10px; margin-top: 14px; }
.banner .infobox .ib { flex: 1; background: rgba(255,255,255,0.1); border-radius: var(--r-md); padding: 10px 12px; }
.banner.idle .infobox .ib { background: var(--bg); }
.banner .ib .k { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; opacity: 0.7; text-transform: uppercase; }
.banner .ib .v { font-weight: 700; font-size: 16px; margin-top: 3px; }
.banner .actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.checkins { display: flex; gap: 14px; overflow-x: auto; padding: 12px 2px 4px; }
.checkin { width: 56px; flex: none; text-align: center; cursor: pointer; }
.checkin .nm { font-weight: 600; font-size: 11.5px; color: var(--ink2); margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-circle { width: 50px; height: 50px; border-radius: 50%; border: 2px dashed var(--silver2); display: grid; place-items: center; font-family: var(--disp); font-size: 26px; color: var(--silver2); margin: 0 auto; cursor: pointer; }
.rsvp-btns { display: flex; gap: 10px; margin-top: 4px; }
.rsvp-btn { flex: 1; height: 48px; border-radius: var(--r-lg); border: 1.5px solid var(--line); background: var(--surface); font-family: var(--ui); font-weight: 800; font-size: 14.5px; color: var(--ink); cursor: pointer; box-shadow: var(--shadow-card); }
.rsvp-btn.yes.on { background: var(--up); border-color: var(--up); color: #fff; box-shadow: none; }
.rsvp-btn.no.on { background: var(--down); border-color: var(--down); color: #fff; box-shadow: none; }
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 16px 8px; margin-top: 10px; }
.roster-grid .checkin { width: auto; }
.past-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; box-shadow: var(--shadow-card); cursor: pointer; margin-bottom: 6px; }
.past-row .nm { flex: 1; font-weight: 800; font-size: 15.5px; }
.past-row .nm small { display: block; font-weight: 600; font-size: 12px; color: var(--ink3); }

/* ── vote ── */
.vote-card { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 2px solid transparent; border-radius: var(--r-lg); padding: 11px 13px; box-shadow: var(--shadow-card); cursor: pointer; margin-bottom: 8px; }
.vote-card.lead { border-color: var(--gold); background: var(--gold-tint); }
.vote-card.mine { border-color: var(--blue); background: var(--blue-tint); }
.vote-card .mid { flex: 1; min-width: 0; }
.vote-card .nm { font-family: var(--ui); font-weight: 800; font-size: 15.5px; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.vote-card .tag { font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; }
.vote-card .tag.lead { background: var(--gold); color: var(--on-gold-deep); } .vote-card .tag.mine { background: var(--blue); color: #fff; }
.vote-card .tally { margin-top: 8px; }
.vote-count { width: 46px; height: 46px; border-radius: var(--r-md); display: grid; place-items: center; font-family: var(--disp); font-weight: 700; font-size: 24px; flex: none; background: var(--blue-tint); color: var(--blue); }
.vote-card.lead .vote-count { background: var(--gold); color: var(--on-gold-deep); }
.locked { display: flex; align-items: center; gap: 13px; border-radius: var(--r-lg); padding: 10px 13px; background: linear-gradient(150deg, var(--gold), #d99e16); margin-bottom: 8px; }
.locked .nm { flex: 1; font-family: var(--ui); font-weight: 800; font-size: 15.5px; text-transform: uppercase; color: var(--on-gold-deep); }
.locked .rk { font-weight: 700; font-size: 12px; color: var(--gold-text); }
.vote-foot { display: flex; gap: 10px; margin-top: 14px; }
.vote-foot .btn { flex: 1; }
.vote-foot .btn.wide { flex: 1.7; }

/* ── profile ── */
.prof-hero { background: linear-gradient(160deg, var(--header-top), var(--ink)); color: #fff; border-radius: 0 0 26px 26px; padding: 22px 20px; }
.prof-top { display: flex; align-items: center; justify-content: space-between; }
.prof-id { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.prof-id .nm { font-family: var(--disp); font-weight: 800; font-size: 30px; line-height: 1.05; }
.prof-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.pill { font-weight: 700; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); }
.pill.gold { background: var(--gold); color: var(--on-gold-deep); }
.edit-av { position: relative; background: none; border: none; padding: 0; cursor: pointer; line-height: 0; }
.edit-badge { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: var(--on-gold-deep); display: grid; place-items: center; font-family: var(--disp); font-weight: 800; font-size: 18px; border: 2.5px solid var(--ink); }
.stat-tiles { display: flex; gap: 9px; margin-top: 14px; }
.stat-tile { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 13px; box-shadow: var(--shadow-card); text-align: left; }
.stat-tile .big { font-family: var(--disp); font-weight: 800; font-size: 26px; line-height: 1; }
.stat-tile .big.gold { color: var(--gold-deep); }
.stat-tile .lab { font-weight: 600; font-size: 11.5px; color: var(--ink3); margin-top: 5px; }

/* rank-over-time bar chart */
.barchart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-card); padding: 18px; margin-top: 10px; }
.bars { display: flex; align-items: flex-end; justify-content: center; gap: 14px; height: 104px; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar-col .rk { font-family: var(--disp); font-weight: 700; font-size: 13px; color: var(--ink3); margin-bottom: 5px; }
.bar-col .rk.cur { color: var(--gold-deep); }
.bar-col .bar { width: 26px; border-radius: 7px; background: linear-gradient(180deg, var(--blue), var(--blue-deep)); }
.bar-col .bar.cur { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); }
.barchart .traj { text-align: center; font-weight: 600; font-size: 12px; color: var(--ink3); margin-top: 12px; }

/* settings / lists */
.list-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); margin-top: 12px; overflow: hidden; }
.li { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-top: 1px solid var(--line); font-weight: 600; }
.li:first-child { border-top: none; }
.li .v { color: var(--ink3); font-weight: 700; }
.li .v.gold { color: var(--gold-deep); }
.li.tap { cursor: pointer; } .li.tap:hover { background: var(--bg); }
.danger { color: var(--down); }

.empty { text-align: center; color: var(--ink2); padding: 40px 20px; }
.empty .ic { font-size: 34px; } .empty p { margin-top: 8px; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-weight: 700; font-size: 13.5px; box-shadow: var(--shadow-pop); z-index: 70; }

/* admin roster */
.adm-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 11px 14px; box-shadow: var(--shadow-card); margin-bottom: 8px; }
.adm-row .nm { font-weight: 700; font-size: 15.5px; display: flex; align-items: center; gap: 7px; }
.adm-row .sub { color: var(--ink3); font-size: 12.5px; font-weight: 600; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-row .meta { flex: 1; min-width: 0; }
.adm-tag { font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gold-text); background: var(--gold-tint); padding: 1px 7px; border-radius: 999px; }
.adm-manage { flex: none; height: 36px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg); font-weight: 700; font-size: 13.5px; }
.adm-manage:hover { background: var(--blue-tint); color: var(--blue-deep); }

/* ── rules editor ── */
.ed-body { max-height: 70vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; margin-top: 8px; padding-right: 4px; }
.ed-sec { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; background: var(--bg); }
.ed-head { display: flex; align-items: center; gap: 8px; }
.ed-num { font-family: var(--disp); font-weight: 800; font-size: 18px; color: var(--blue); width: 18px; text-align: center; flex: none; }
.ed-head .field-light { flex: 1; }
.ed-ta { width: 100%; margin-top: 8px; min-height: 96px; padding: 10px 12px; line-height: 1.5; font-size: 14.5px; resize: vertical; }
.ed-sub { border-left: 3px solid var(--line); padding: 8px 0 8px 10px; margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.ed-mini { height: 30px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 12.5px; color: var(--ink2); flex: none; }
.ed-mini:hover { background: var(--blue-tint); }
.ed-mini[disabled] { opacity: 0.4; pointer-events: none; }
.ed-mini.danger { color: var(--down); }

/* ── modal / bottom sheet ── */
.modal-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(21, 25, 31, 0.5); display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--surface); width: 100%; max-width: 480px; border-radius: var(--r-xxl) var(--r-xxl) 0 0; padding: 18px 20px calc(24px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-pop); animation: sheet 0.22s ease; max-height: 88vh; max-height: 88dvh; overflow-y: auto; }
@keyframes sheet { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle { width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: 0 auto 14px; }
.modal-head { display: flex; align-items: center; gap: 12px; }
.modal-head .mt { font-family: var(--disp); font-weight: 800; font-size: 22px; }
.modal-head .ms { color: var(--ink3); font-weight: 600; font-size: 12.5px; }
.modal-x { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; background: var(--bg); color: var(--ink2); }
.modal-sec { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.modal-sec:first-of-type { border-top: none; }
.modal-sec .eyebrow { color: var(--ink2); }
.modal-note { color: var(--ink2); font-size: 13px; line-height: 1.45; margin-top: 6px; }
.modal-err { color: var(--down); font-weight: 600; font-size: 13px; margin-top: 12px; }
.field-light { height: 46px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); padding: 0 12px; font-size: 15px; font-weight: 500; color: var(--ink); width: 100%; }
.field-light:focus { outline: none; border-color: var(--blue); }
.row-gap { display: flex; gap: 10px; }
.pick-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); cursor: pointer; }
.pick-row:first-child { border-top: none; }
.pick-row .nm { flex: 1; font-weight: 700; font-size: 15px; }
.pick-row:hover { background: var(--bg); }

/* game records — team A/B logging + read-only rows */
.game-row { display: flex; align-items: center; padding: 11px 13px; margin-bottom: 8px; }
.game-row .side { flex: 1; min-width: 0; font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-row .side.right { text-align: right; }
.game-row .vs { font-size: 11px; font-weight: 700; color: var(--ink3); margin: 0 8px; flex: none; }
.game-row .game-rm { flex: none; margin-left: 10px; background: none; border: none; color: var(--ink3); font-size: 15px; cursor: pointer; line-height: 1; }
.game-row .game-rm:hover { color: var(--down); }
.team-pill { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 28px; border-radius: var(--r-sm, 8px); font-family: var(--ui); font-weight: 800; font-size: 12.5px; color: var(--ink3); background: var(--bg); border: 1px solid var(--line); cursor: pointer; padding: 0; }
.team-pill.a-on { background: var(--blue); color: #fff; border-color: var(--blue); }
.team-pill.b-on { background: var(--gold-deep); color: #fff; border-color: var(--gold-deep); }
.win-btn { flex: 1; border-radius: var(--r-md); padding: 9px 8px; text-align: center; font-family: var(--ui); font-weight: 800; font-size: 13px; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow-card); cursor: pointer; }
.win-btn:disabled { opacity: 0.4; cursor: default; box-shadow: none; }
.win-btn small { display: block; font-weight: 600; font-size: 11px; margin-top: 2px; color: var(--ink3); }
.win-btn.a.on { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: none; }
.win-btn.a.on small { color: rgba(255,255,255,0.8); }
.win-btn.b.on { background: var(--gold-deep); border-color: var(--gold-deep); color: #fff; box-shadow: none; }
.win-btn.b.on small { color: rgba(255,255,255,0.85); }
.win-pct { font-family: var(--disp); font-weight: 700; font-size: 18px; color: var(--ink); }
.win-pct.lead { color: var(--gold-deep); }

/* log-a-game: a real full-screen modal (not a half-height bottom sheet) on
   every viewport -- one scroll region for the whole body, header + footer
   pinned, so nothing depends on nested-scroll gesture negotiation. */
.modal-overlay.game-modal { align-items: stretch; padding: 0; }
.modal-overlay.game-modal > .modal { width: 100%; max-width: 560px; height: 100%; max-height: 100%; border-radius: 0; padding: 0; display: flex; flex-direction: column; animation: sheet 0.22s ease; }
.game-modal-head { flex: 0 0 auto; padding: calc(16px + env(safe-area-inset-top)) 20px 12px; border-bottom: 1px solid var(--line); }
.game-modal-head .modal-head { margin: 0; }
.game-modal-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 20px 20px; }
.game-modal-foot { flex: 0 0 auto; display: flex; gap: 10px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.game-modal-foot .btn { flex: 1; height: 44px; }
.stat-tile.duo { cursor: pointer; }
.duo-av { display: flex; align-items: center; margin-top: 9px; }
.duo-av .avw:nth-child(2) { margin-left: -10px; }
.duo-av span { font-family: var(--ui); font-weight: 800; font-size: 13px; margin-left: 6px; color: var(--ink); }

/* ─────────────────── desktop ─────────────────── */
@media (min-width: 920px) {
  .shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; }
  .topbar, .tabbar, .menu-btn { display: none; }
  .navmenu, .navmenu.open { display: none; }
  .sidebar { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; background: var(--ink); color: #fff; padding: 26px 16px; }
  .sidebar .brand { font-family: var(--disp); font-weight: 700; letter-spacing: 0.24em; font-size: 20px; color: var(--gold); padding: 4px 12px 22px; }
  .sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .sidebar .nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-md); color: rgba(255, 255, 255, 0.62); font-weight: 700; font-size: 15px; }
  .sidebar .nav-item svg { width: 20px; height: 20px; }
  .sidebar .nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
  .sidebar .nav-item.active { background: rgba(244, 180, 26, 0.14); color: var(--gold); }
  .sidebar .nav-item .badge { margin-left: auto; background: var(--gold); color: var(--on-gold-deep); font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; }
  .sidebar .acct { display: flex; align-items: center; gap: 10px; padding: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); margin-top: 8px; cursor: pointer; }
  .sidebar .acct .nm { font-weight: 700; font-size: 14px; } .sidebar .acct .ro { color: var(--ink3); font-size: 12px; font-weight: 600; }
  .sidebar .acct .so { margin-left: auto; color: var(--ink3); font-size: 18px; }

  .arena { border-radius: 0; padding: 40px 40px 30px; }
  .arena h1 { font-size: 52px; }
  .arena-wrap, .wrap { max-width: var(--maxw); padding-left: 40px; padding-right: 40px; }
  .wrap { padding-top: 28px; }

  .board-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 24px; align-items: start; }
  .board-grid .side { position: sticky; top: 28px; display: flex; flex-direction: column; gap: 10px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-grid.movers { grid-template-columns: 1fr 1fr; }
  .rules-grid { columns: 2; column-gap: 12px; } .rules-grid .rule { break-inside: avoid; }
  .modal-overlay { align-items: center; padding: 24px; }
  .modal { border-radius: var(--r-xxl); animation: pop 0.16s ease; } @keyframes pop { from { transform: scale(0.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }
  .toast { bottom: 32px; }
  .desktop-only { display: block; }
}
@media (max-width: 919px) { .board-grid .side { margin-bottom: 6px; } .desktop-only { display: none; } }

/* Player + past-party overlays are full-screen pages on mobile web (a partial
   bottom sheet fought Safari's toolbar and looked glitchy). Dark hero pinned at
   the top, body scrolls under it. */
@media (max-width: 919px) {
  .modal-overlay.full { align-items: stretch; padding: 0; }
  .modal-overlay.full > .modal { width: 100%; max-width: none; height: 100%; max-height: 100%; border-radius: 0; display: flex; flex-direction: column; animation: pageIn 0.2s ease; }
  .modal-overlay.full > .modal > .prof-hero { flex: 0 0 auto; border-radius: 0; padding-top: calc(18px + env(safe-area-inset-top)); }
  .modal-overlay.full > .modal > :not(.prof-hero) { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  @keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
