/* ---- shared: chips, segmented control, rows ------------------------------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; scrollbar-width: none; }
.chip {
  flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); cursor: pointer;
}
.chip.on { background: var(--felt); color: var(--felt-ink); border-color: transparent; font-weight: 600; }
.chip-add { border-style: dashed; color: var(--muted); background: transparent; }


.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 36px; }
.hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.badge { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 12px; line-height: 20px; background: var(--win-bg); color: var(--win); }
.badge-gold { background: rgb(201 150 47 / 16%); color: var(--gold); }
.me-badge {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; vertical-align: 1px;
  background: var(--felt); color: var(--felt-ink); font-size: 11px; font-weight: 700; line-height: 18px;
}
.sc-row.mine { font-weight: 600; }
.title-badge {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; vertical-align: 1px;
  border: 1px solid var(--gold); color: var(--gold); font-size: 11px; font-weight: 600; line-height: 16px;
}

/* ---- record form ---------------------------------------------------------- */

.player-row {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.player-row:first-child { border-top: 0; padding-top: 2px; }
.pr-name { font-weight: 600; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-amount { grid-column: 1 / -1; display: flex; gap: 8px; }

.sign {
  flex: none; width: 56px; min-height: 44px; border-radius: 10px; border: 0;
  font-weight: 700; font-size: 16px; cursor: pointer;
}
.sign.win { background: var(--win-bg); color: var(--win); }
.sign.lose { background: var(--lose-bg); color: var(--lose); }
.amount-input { flex: 1; min-width: 0; text-align: right; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }


.autofill {
  width: 100%; margin-top: 8px; min-height: 42px; border-radius: 10px; cursor: pointer;
  border: 1px dashed var(--gold); background: rgb(201 150 47 / 8%);
}

.inline-input { width: 88px; min-height: 36px; padding: 4px 10px; text-align: right; }
.fees { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.fees label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.pool-line { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: var(--bg); font-size: 14px; }

.savebar {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px); z-index: 5;
  display: flex; align-items: center; gap: 12px; margin-top: 4px;
  padding: 10px 10px 10px 16px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); box-shadow: 0 8px 28px rgb(0 0 0 / 14%);
}
.savebar .sum { flex: 1; font-size: 14px; line-height: 1.35; }
.savebar .btn { min-width: 96px; min-height: 44px; }

/* ---- history -------------------------------------------------------------- */

.session-card { cursor: pointer; }
.session-card:active { transform: scale(.995); }
.sc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.sc-date { font-weight: 700; }
.sc-note { font-size: 13px; color: var(--muted); }
.sc-row { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 0; }
.sc-row .amt { font-weight: 600; }
.sc-foot {
  display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--line); font-size: 13px; color: var(--muted);
}

/* ---- stats ---------------------------------------------------------------- */


.rank-row {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 2px 10px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.rank-row:first-of-type { border-top: 0; }
.rank { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; font-size: 13px; font-weight: 700; background: var(--bg); color: var(--muted); }
.rank-1 { background: var(--gold); color: #fff; }
.rank-name { font-weight: 600; }
.rank-total { font-size: 20px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.rank-sub { grid-column: 2 / -1; font-size: 13px; color: var(--muted); }

/* ---- settings ------------------------------------------------------------- */

.list-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.list-row:first-of-type { border-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row.inactive .name { color: var(--muted); text-decoration: line-through; }
.stack { display: grid; gap: 8px; }

.member { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.member:first-of-type { border-top: 0; padding-top: 0; }
.member-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.member select { width: 100%; text-align: left; }
