:root {
  --bg: #f8f5ef;
  --ink: #1f2730;
  --muted: #8d887e;
  --faint: #b3ab9f;
  --panel: #fffdfa;
  --soft: #eee8dc;
  --line: #ded7ca;
  --card: rgba(255, 253, 249, 0.72);
  --sage: #3f6b55;
  --sage-2: #e6eee8;
  --gold: #e3c36a;
  --silver: #d7d6d2;
  --bronze: #e0b08a;
  --blue: #2877ad;
  --red: #bd5651;
  --shadow: 0 16px 40px rgba(70, 54, 28, 0.08);
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "PingFang SC", "Noto Sans SC", sans-serif;
  letter-spacing: 0.01em;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.45; }

#app {
  width: min(430px, 100%);
  margin: 0 auto;
  padding: 14px 14px 96px;
}
@media (min-width: 760px) {
  #app { width: min(930px, 98%); padding-left: 20px; padding-right: 20px; }
}
.tabbar[hidden] + #app, body:has(.tabbar[hidden]) #app { padding-bottom: 32px; }

.login-wrap {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
}
.login-card {
  width: min(320px, 100%);
  background: #fffdfb;
  border: 1px solid #efeae2;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px 18px 16px;
}
.login-card h1, .brand-title {
  margin: 0 0 16px;
  text-align: center;
  font-size: 22px;
  letter-spacing: -0.03em;
}
.login-card input {
  width: 100%;
  border: 1px solid #ece7df;
  background: #fbfaf7;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  outline: none;
}
.login-card input:focus { border-color: #c9d5cc; }
.login-card button[type="submit"], .sage {
  width: 100%;
  border: 0;
  background: var(--sage);
  color: #f7f4ee;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 18px;
}
.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.brand {
  display: grid;
  gap: 2px;
}
.brand h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.05;
  font-weight: 760;
  letter-spacing: 0;
}
.brand span, .signed-role { color: var(--muted); font-size: 13px; font-weight: 400; }
.signed-name { color: var(--muted); }
.spacer { flex: 1; }
.icon-btn, .menu-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
  color: var(--muted);
}
.menu { position: relative; }
.menu-pop {
  position: absolute;
  right: 0;
  top: 42px;
  background: #fffdfb;
  border-radius: 14px;
  box-shadow: var(--shadow);
  min-width: 148px;
  padding: 6px;
  z-index: 5;
}
.menu-pop button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
}
.menu-pop button:hover { background: var(--panel); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 6px 20px rgba(40, 32, 18, 0.03);
  margin-bottom: 10px;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.panel h2 { margin: 0; font-size: 19px; font-weight: 760; }
.seg {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
}
.seg button, .chip {
  border: 0;
  background: #e7e2d8;
  color: #5e584f;
  border-radius: 999px;
  padding: 8px 14px;
  white-space: nowrap;
}
.seg button.on, .chip.on { background: var(--sage); color: #f6f3ec; }

.rank {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 40px 1fr auto;
  gap: 10px;
  align-items: center;
  background: transparent;
  border: 0;
  text-align: left;
  padding: 10px 6px;
  border-radius: 12px;
}
.rank:hover { background: rgba(255,255,255,0.45); }
.medal {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  background: #e7e1d6;
  color: #4e4942;
}
.medal.m1 { background: var(--gold); }
.medal.m2 { background: var(--silver); }
.medal.m3 { background: var(--bronze); }
.rank b { font-weight: 650; }
.rank small, .muted { color: var(--muted); font-size: 12px; }
.avg { font-size: 22px; font-weight: 720; font-variant-numeric: tabular-nums; }
.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #ece7df;
  color: #6d665c;
  font-size: 11px;
  font-weight: 600;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid #e7e2d8; }
th { color: var(--muted); font-weight: 600; }
.caption { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0 0 8px; }

.pager { display: flex; gap: 6px; justify-content: flex-end; margin-top: 10px; }
.pager button {
  border: 0;
  background: #fff;
  border-radius: 8px;
  min-width: 32px;
  height: 32px;
}
.pager button.on { background: var(--sage); color: white; }

.player-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.player-strip button, .avatar-btn {
  border: 0;
  background: transparent;
  min-width: 64px;
  color: var(--muted);
}
.avatar-btn.on { color: var(--ink); font-weight: 700; }
.avatar {
  width: 48px;
  height: 48px;
  margin: 0 auto 4px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 18px;
}
.card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: var(--radius);
  padding: 14px;
  margin: 10px 0;
}
.card h3 { margin: 0; }
.card > .sage { margin-bottom: 14px; }
.request-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.request-row > span { flex: 1; min-width: 0; }
.request-row .sage,
.request-row .ghost {
  width: auto;
  flex: 0 0 auto;
  padding: 8px 12px;
  font-size: 14px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.stats div { background: #fff; border-radius: 12px; padding: 8px; }
.stats b { display: block; font-size: 18px; }
.stats span { color: var(--muted); font-size: 12px; }
.spark { width: 100%; height: 72px; }
.spark polyline { fill: none; stroke: var(--sage); stroke-width: 2.5; }
.dates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.resist-row { margin-bottom: 18px; }
.dates button, .mini {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

.field { margin-bottom: 12px; max-width: 100%; min-width: 0; overflow: hidden; }
.field span, label.lbl { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
input[type="text"], input[type="password"], input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  outline: none;
}
input[type="date"] {
  display: block;
  -webkit-appearance: none;
  appearance: none;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  display: none;
  -webkit-appearance: none;
}
textarea { min-height: 88px; resize: vertical; }
.seats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-areas: ". north ." "west table east" ". south .";
  gap: 8px;
  align-items: center;
  margin: 8px 0 16px;
}
.seat-n { grid-area: north; }
.seat-s { grid-area: south; }
.seat-w { grid-area: west; }
.seat-e { grid-area: east; }
.table-mid {
  grid-area: table;
  min-height: 72px;
  border-radius: 16px;
  background: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 8px;
}
.seat select, .seat-btn {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 8px;
}
.seat.blue select, .seat.blue .seat-btn { border-color: #c5d5e4; }
.seat.red select, .seat.red .seat-btn { border-color: #e7cfcb; }
.seat-btn { min-height: 64px; }
.seat-btn small { display: block; color: var(--muted); }
.seat-btn em { font-style: normal; color: var(--sage); font-weight: 700; }
.seat-btn.picked { background: var(--sage-2); }

.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.level-card { background: #fff; border-radius: 16px; padding: 12px; }
.level-card strong { font-size: 28px; letter-spacing: -0.04em; }
.level-card.blue { box-shadow: inset 3px 0 0 var(--blue); }
.level-card.red { box-shadow: inset 3px 0 0 var(--red); }
.level-card.on { outline: 2px solid var(--sage); }
.track { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.idblock { display: flex; flex-direction: column; gap: 2px; }
.track i {
  font-style: normal;
  min-width: 22px;
  height: 22px;
  padding: 0 3px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #f3f0ea;
  color: var(--faint);
  font-size: 11px;
}
.track i.done { color: var(--ink); background: #e7efe9; }
.track i.now { background: var(--sage); color: white; }

.log { list-style: none; padding: 0; margin: 0; }
.log li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.log li small { display: block; margin-top: 6px; font-size: 13px; line-height: 1.55; }
.log .tribute-note { margin: 10px 0 0; text-align: left; font-size: 14px; line-height: 1.55; font-weight: 600; }
.row { display: flex; gap: 8px; }
.x-join { margin-bottom: 12px; align-items: center; }
.x-join input { flex: 1; }
.x-join .ghost { flex: 0 0 auto; }
.row > * { flex: 1; }
.ghost, .danger, .sage.narrow {
  width: auto;
  border-radius: 12px;
  padding: 12px 14px;
}
.ghost { background: #fff; border: 1px solid var(--line); }
.danger { background: #fff; border: 1px solid #e7cfcb; color: var(--red); }
.banner {
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
}
.banner b { font-size: 20px; }
.match-link, .block-link {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.match-link b { display: block; }
.empty {
  background: #fff;
  border-radius: 16px;
  min-height: 140px;
  display: grid;
  place-items: center;
  color: var(--faint);
  text-align: center;
  padding: 24px;
}
.rules h3 { margin: 18px 0 6px; font-size: 16px; }
.rules p, .rules li { color: #3c4450; line-height: 1.6; font-size: 14px; }
.toc { display: flex; gap: 6px; flex-wrap: wrap; }
.toc a { color: var(--sage); font-size: 13px; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(48, 42, 34, 0.28);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 20px;
}
.dialog {
  width: min(360px, 100%);
  background: #fffdfb;
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.dialog p { margin: 0 0 14px; font-size: 18px; }
.dialog .row button { font-size: 20px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.dialog .row .yes { background: var(--sage); color: white; border: 0; }

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgba(255, 253, 250, 0.92);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  padding: 6px 12px calc(6px + var(--safe-b));
  z-index: 20;
}
.nav-inner {
  width: min(430px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: 4px;
}
.tabbar .nav {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 40px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
}
.tabbar .nav.active { background: var(--soft); color: var(--ink); }
.tabbar .nav.plus {
  width: 36px;
  height: 36px;
  min-height: 36px;
  justify-self: center;
  padding: 0;
  background: #143e2b;
  color: #fff;
  border-radius: 50%;
  font-size: 0;
  position: relative;
}
.tabbar.has-live .nav.plus { background: #b3b0a8; }
.tabbar .nav.plus::before,
.tabbar .nav.plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: currentColor;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}
.tabbar .nav.plus::before { width: 14px; height: 1.5px; }
.tabbar .nav.plus::after { width: 1.5px; height: 14px; }
.error { color: var(--red); font-size: 13px; min-height: 1.2em; text-align: center; }

.avatar.x-mark {
  color: #2d5f86;
  font-family: Didot, "Didot Bold", "Bodoni 72", serif;
  font-weight: 700;
}
.avatar.image-avatar, .avatar.emoji-avatar {
  width: 64px;
  height: 64px;
  border-radius: 0;
  border: 0;
  background: transparent;
  font-size: 42px;
  overflow: visible;
}
.avatar img { width: 100%; height: 100%; max-width: none; display: block; object-fit: contain; }
.rank .avatar.mini { width: 40px; height: 40px; min-width: 40px; margin: 0; font-size: 26px; }
.rank .avatar.mini img { width: 40px; height: 40px; }
.player-title { display: flex; align-items: center; gap: 8px; }
.player-title .avatar { width: 48px; height: 48px; margin: 0; font-size: 32px; }
.level-pair {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 14px;
  margin: 4px 0 8px;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 0;
}
.level-pair span { color: var(--muted); font-weight: 500; }
.level-pair .blue, .tribute-line .blue, .tribute-note .blue { color: var(--blue); }
.level-pair .red, .tribute-line .red, .tribute-note .red { color: var(--red); }
.tribute-line { margin: 0 0 12px; text-align: center; font-size: 15px; font-weight: 650; line-height: 1.45; }
.tribute-note { margin: 0 0 10px; text-align: center; font-size: 15px; font-weight: 650; }
.tribute-line span, .tribute-note span { color: var(--muted); font-weight: 500; }
.tribute-note { color: var(--ink); }
.tribute-line b, .tribute-note b { font-weight: 750; }
.felt {
  position: relative;
  height: 300px;
  border-radius: 28px;
  margin: 0 0 12px;
  overflow: hidden;
  background:
    radial-gradient(circle at 48% 47%, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(135deg, #6f8d70, #2e5749);
}
.felt::after {
  content: "";
  position: absolute;
  inset: 36px 22px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  pointer-events: none;
}
.felt-chip {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.16);
  color: white;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
}
.felt .seat {
  position: absolute;
  z-index: 3;
  min-width: 108px;
  height: 44px;
  padding: 0 14px 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 800;
}
.felt-chip.blue { color: var(--blue); background: #e7f3fb; border-color: var(--blue); }
.felt-chip.red { color: var(--red); background: #fdeeed; border-color: var(--red); }
.felt .seat.blue { color: var(--blue); background: #e7f3fb; box-shadow: inset 0 0 0 1.5px var(--blue); }
.felt .seat.red { color: var(--red); background: #fdeeed; box-shadow: inset 0 0 0 1.5px var(--red); }
.felt .seat.top { top: 14px; left: 50%; transform: translateX(-50%); }
.felt .seat.bottom { bottom: 14px; left: 50%; transform: translateX(-50%); }
.felt .seat.left { left: 10px; top: 50%; transform: translateY(-50%); }
.felt .seat.right { right: 10px; top: 50%; transform: translateY(-50%); }
.felt .seat::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex: 0 0 auto;
  font-size: 11px;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.felt .seat.blue::before { background: var(--blue); }
.felt .seat.red::before { background: var(--red); }
.felt .seat.rank-1::before { content: "1"; background: currentColor; color: white; }
.felt .seat.rank-2::before { content: "2"; background: currentColor; color: white; }
.felt .seat.rank-3::before { content: "3"; background: currentColor; color: white; }
.felt .seat.rank-4::before { content: "4"; background: currentColor; color: white; }
.felt .seat.blue.rank-1::before, .felt .seat.blue.rank-2::before, .felt .seat.blue.rank-3::before, .felt .seat.blue.rank-4::before { background: var(--blue); }
.felt .seat.red.rank-1::before, .felt .seat.red.rank-2::before, .felt .seat.red.rank-3::before, .felt .seat.red.rank-4::before { background: var(--red); }
.felt-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}
.felt-progress {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.overview-tabs {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}
.overview-tabs.total { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.overview-tabs.stage { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.overview-tabs.records { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.overview-tabs .tab {
  height: 32px;
  min-width: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  padding: 0 4px;
}
.overview-tabs .tab.active { background: var(--soft); color: var(--ink); }
.rank-list { display: grid; gap: 8px; }
.rank-row {
  width: 100%;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid #e7e0d3;
  border-radius: 10px;
  background: rgba(255, 253, 250, 0.72);
  text-align: left;
  color: inherit;
}
.rank-no { color: var(--muted); font-size: 16px; font-weight: 650; display: flex; align-items: center; justify-content: center; }
.rank-name { display: block; font-size: 16px; font-weight: 780; }
.rank-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; }
.rank-value { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 820; }
.rank-row.unranked .rank-name, .rank-row.unranked .rank-value { color: rgba(141, 136, 126, 0.56); }
.rank-change {
  min-width: 36px;
  height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 820;
}
.rank-change.up { background: rgba(202, 164, 59, 0.14); color: #b8902e; }
.rank-change.down { background: rgba(60, 130, 167, 0.12); color: #3c82a7; }
.rank-trophy { width: 20px; height: 20px; display: block; }
.rank-trophy.gold { color: #d5a93f; }
.rank-trophy.silver { color: #aeb4bb; }
.rank-trophy.bronze { color: #b47743; }
.overview-note { margin: 2px 0 0; color: #80796e; font-size: 11px; line-height: 1.2; }
.records-total { color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
.overview-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 8px;
  border: 1px solid #ece6da;
  border-radius: 8px;
  background: #fff;
}
.overview-table { width: 100%; min-width: 720px; border-collapse: separate; border-spacing: 0; background: #fff; }
.overview-table.player-metric-table { min-width: 640px; }
.overview-table th, .overview-table td {
  height: 32px;
  padding: 0 6px;
  border-top: 0.5px dashed rgba(215, 207, 194, 0.58);
  text-align: center;
  vertical-align: middle;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}
.overview-table th:first-child, .overview-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 96px;
  background: #fffdfa;
  font-size: 13px;
  text-align: left;
}
.overview-table thead th { border-top: 0; color: #787163; background: #faf8f3; font-weight: 500; }
.overview-table thead th:first-child { z-index: 3; background: #faf8f3; }
.overview-table td.strong { font-weight: 520; }
.overview-table .name-col { white-space: normal; }
.overview-table .danger { color: var(--red); font-weight: 820; }
.overview-table td.metric-muted { color: #b3ada3; }
.overview-table tr[data-act] { cursor: pointer; }
.result-only-badge { margin-left: 4px; color: var(--muted); font-size: 11px; }
.records-pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 12px; min-height: 32px; }
.records-page-button {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #b8b3aa;
  font-size: 14px;
  padding: 0;
}
.records-page-button.active { color: var(--ink); font-weight: 500; box-shadow: inset 0 -1px 0 currentColor; }
.records-page-button:disabled { color: #ded9d1; }

@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  #app { padding-left: 14px; padding-right: 14px; }
  .felt { height: 280px; }
  .level-pair { font-size: 36px; }
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.8);
  color: var(--ink);
  display: inline-grid;
  place-items: center;
}
.member-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.member-chip {
  flex: 0 0 calc((100% - 24px) / 4);
  border: 0;
  background: transparent;
  display: grid;
  justify-items: center;
  gap: 4px;
  color: var(--ink);
  min-width: 0;
}
.member-chip .avatar { width: 52px; height: 52px; margin: 0; }
.member-chip strong { font-size: 12px; font-weight: 650; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-chip.active strong { font-weight: 780; }
.player-list { display: grid; gap: 10px; }
.player-card {
  border: 1px solid #e7e0d3;
  background: rgba(255, 253, 250, 0.72);
  border-radius: 10px;
  padding: 12px;
}
.player-head, .player-id, .player-name-with-medals, .variety-group-head, .variety-board-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.player-head, .variety-group-head, .variety-board-head { justify-content: space-between; }
.player-card h2, .variety-board h2, .variety-group h3 { margin: 0; }
.player-card h2 { font-size: 18px; }
.player-rank-medals, .stat-rank-label { display: inline-flex; align-items: center; gap: 2px; }
.player-rank-medal { width: 16px; height: 16px; display: inline-flex; }
.player-rank-medal .rank-trophy { width: 16px; height: 16px; }
.dates-summary { border: 0; background: transparent; color: var(--muted); font-size: 16px; width: 28px; height: 28px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.stat {
  min-height: 36px;
  border: 1px solid #e7e0d3;
  border-radius: 8px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.stat span { color: var(--muted); font-size: 12px; }
.stat strong { font-size: 16px; }
.player-card .dates { display: none; }
.player-card.open .dates { display: block; margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(219, 211, 195, 0.8); }
.player-trends { display: grid; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(219, 211, 195, 0.8); }
.player-trends-head strong { font-size: 14px; font-weight: 650; }
.player-trend-grid { display: grid; gap: 10px; }
.player-trend-chart { min-width: 0; border: 1px solid #e7e0d3; border-radius: 10px; background: rgba(255, 253, 250, 0.54); padding: 10px; }
.player-trend-title { margin-bottom: 6px; font-size: 13px; font-weight: 650; }
.player-trend-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.player-trend-chart svg text { font-family: inherit; }
.player-trend-gridline { stroke: rgba(219, 211, 195, 0.92); stroke-width: 1; stroke-dasharray: 4 5; }
.player-trend-axis, .player-trend-date { fill: var(--muted); font-size: 9px; }
.player-trend-path { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.player-trend-rank-path { fill: none; stroke: rgba(202, 164, 59, 0.8); stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 4 5; }
.player-trend-path.avg { stroke: var(--blue); }
.player-trend-dot.avg { fill: var(--blue); }
.player-trend-path.rate { stroke: var(--red); }
.player-trend-dot.rate { fill: var(--red); }
.player-trend-dot.last { stroke: #fffdfa; stroke-width: 2; }
.player-trend-rank-dot { fill: rgba(202, 164, 59, 0.88); }
.player-trend-value-label, .player-trend-rank-label { font-size: 10px; font-weight: 700; dominant-baseline: middle; paint-order: stroke; stroke: rgba(255, 253, 250, 0.92); stroke-width: 3px; stroke-linejoin: round; }
.player-trend-value-label.avg { fill: var(--blue); }
.player-trend-value-label.rate { fill: var(--red); }
.player-trend-rank-label { fill: #a88428; }
.player-trend-empty { min-height: 72px; display: grid; place-items: center; color: var(--muted); font-size: 12px; border: 1px dashed rgba(219, 211, 195, 0.8); border-radius: 10px; }
.dates-title { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.date-links { display: flex; flex-wrap: wrap; gap: 6px; }
.date-link { border: 0; background: var(--soft); border-radius: 999px; padding: 4px 8px; color: var(--ink); font-size: 12px; }
.variety-board { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.variety-board-head span, .variety-reason, .variety-empty { color: var(--muted); font-size: 12px; }
.variety-board-grid { display: grid; gap: 18px; }
.variety-row { padding: 10px 0; border-bottom: 1px solid #e7e0d3; }
.variety-row-main { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.variety-row-main span { color: var(--sage); text-align: right; }
.variety-reason { margin: 4px 0 0; }
.match-meta { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.empty-match { margin: 28px 0; text-align: center; color: var(--muted); }
.setup-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 10px; width: 100%; max-width: 100%; min-width: 0; }
.setup-field { display: grid; gap: 4px; min-width: 0; max-width: 100%; overflow: hidden; font-size: 12px; color: var(--muted); }
.setup-field input { display: block; width: 100%; min-width: 0; max-width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 10px; color: var(--ink); font-size: 16px; }
.setup-field input[type="date"], .field input[type="date"] {
  padding-right: 34px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238d887e' stroke-width='1.6'%3E%3Crect x='2' y='3' width='12' height='11' rx='2'/%3E%3Cpath d='M2 7h12M6 2v3M10 2v3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
}
.recorder-field { grid-column: 1 / -1; }
.recorder-apply {
  display: block;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  color: #2d5f86;
  font-size: 16px;
  text-align: left;
}
.recorder-inbox { margin: 0 0 12px; }
@media (min-width: 760px) {
  .setup-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); column-gap: 16px; }
}
.setup-table {
  position: relative;
  height: 300px;
  border-radius: 28px;
  overflow: hidden;
  background: radial-gradient(circle at 48% 47%, rgba(255, 255, 255, 0.22), transparent 34%), linear-gradient(135deg, #6f8d70, #2e5749);
}
.setup-table::before {
  content: "";
  position: absolute;
  inset: 36px 22px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  pointer-events: none;
}
.setup-seat {
  position: absolute;
  z-index: 3;
  min-width: 112px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(18, 46, 39, 0.1);
}
.setup-seat.top { top: 14px; left: 50%; transform: translateX(-50%); }
.setup-seat.bottom { bottom: 14px; left: 50%; transform: translateX(-50%); }
.setup-seat.left { left: 10px; top: 50%; transform: translateY(-50%); }
.setup-seat.right { right: 10px; top: 50%; transform: translateY(-50%); }
.setup-seat.blue,
.setup-seat.blue .seat-name,
.setup-seat.blue .picker-chevron { color: var(--blue); }
.setup-seat.red,
.setup-seat.red .seat-name,
.setup-seat.red .picker-chevron { color: var(--red); }
.setup-seat.blue { background: #e7f3fb; box-shadow: inset 0 0 0 1.5px var(--blue), 0 10px 22px rgba(18, 46, 39, 0.1); }
.setup-seat.red { background: #fdeeed; box-shadow: inset 0 0 0 1.5px var(--red), 0 10px 22px rgba(18, 46, 39, 0.1); }
.setup-seat.is-empty { font-weight: 450; }
.picker-chevron { position: absolute; right: 8px; font-size: 12px; }
.setup-lead { cursor: pointer; color: var(--blue); background: #e7f3fb; border-color: var(--blue); }
.setup-lead.right { left: auto; right: 12px; color: var(--red); background: #fdeeed; border-color: var(--red); }
.setup-lead.on { box-shadow: inset 0 0 0 1.5px currentColor; }
.setup-center-actions { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; }
.start-match {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.16);
  color: white;
  display: grid;
  place-items: center;
  padding: 0;
}
.start-match svg { width: 28px; height: 28px; }
.player-picker-menu {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  width: min(280px, calc(100% - 32px));
  max-height: 280px;
  overflow: auto;
  z-index: 40;
  background: #fffdfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(33, 28, 19, 0.16);
}
.player-picker-option { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 10px 12px; }
.player-picker-option.is-active { color: var(--blue); }
