:root {
  color-scheme: light;
  --bg: #f5f7f3;
  --bg-rise: #edf3ef;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-solid: #ffffff;
  --surface-soft: rgba(248, 250, 247, 0.72);
  --surface-tint: rgba(232, 243, 237, 0.7);
  --ink: #101418;
  --ink-soft: #252c33;
  --muted: #6f7882;
  --faint: #9aa3ad;
  --line: rgba(16, 20, 24, 0.08);
  --line-strong: rgba(16, 20, 24, 0.13);
  --brand: #1f7a5c;
  --brand-strong: #145c45;
  --accent: #d8ff4f;
  --money: #b8872d;
  --money-soft: rgba(255, 246, 221, 0.78);
  --danger: #d84a5f;
  --danger-soft: rgba(255, 240, 242, 0.76);
  --blue: #456cf6;
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-tint: rgba(255, 255, 255, 0.34);
  --glass-line: rgba(255, 255, 255, 0.7);
  --glass-blur: blur(22px) saturate(1.35);
  --shadow-soft: 0 24px 70px rgba(38, 52, 46, 0.13);
  --shadow-card: 0 14px 36px rgba(38, 52, 46, 0.1);
  --shadow-glass: 0 18px 42px rgba(38, 52, 46, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #eef3ef;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0, rgba(237, 243, 239, 0.94) 220px, rgba(245, 247, 243, 0.98) 100%),
    linear-gradient(135deg, rgba(216, 255, 79, 0.12), rgba(69, 108, 246, 0.08) 45%, rgba(31, 122, 92, 0.1)),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

button:focus:not(:focus-visible) {
  outline: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(31, 122, 92, 0.22);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: var(--ink);
  font-size: 36px;
  font-weight: 820;
  letter-spacing: 0;
  line-height: 0.98;
}

h2 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.2;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.button-icon,
.nav-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button-icon {
  width: 19px;
  height: 19px;
}

.app-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(245, 247, 243, 0.82) 34%, rgba(242, 246, 240, 0.92)),
    var(--bg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7), var(--shadow-soft);
}

.hidden {
  display: none !important;
}

.screen,
.page {
  display: none;
}

.screen-active,
.page-active {
  display: block;
}

.onboarding-screen {
  min-height: 100vh;
  padding: 30px 18px 34px;
}

.brand-block {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 16px;
  align-items: center;
  padding: 22px 0 28px;
}

.brand-mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 38%),
    var(--accent);
  box-shadow: var(--shadow-glass);
  font-size: 20px;
  font-weight: 880;
  letter-spacing: 0;
}

.brand-mark svg {
  width: 43px;
  height: 43px;
}

.logo-leaf {
  fill: var(--ink);
}

.logo-line,
.logo-arc {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo-line {
  stroke-width: 3;
}

.logo-arc {
  stroke-width: 4;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--money);
  font-size: 12px;
  font-weight: 780;
}

.brand-copy {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 510;
  line-height: 1.55;
}

.panel,
.chart-panel,
.winner-card,
.payout-list {
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.32) 52%, rgba(255, 255, 255, 0.5)),
    var(--glass);
  box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.login-panel {
  padding: 18px;
}

.signup-status {
  display: grid;
  gap: 8px;
  border-radius: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background:
    linear-gradient(135deg, rgba(216, 255, 79, 0.2), rgba(255, 255, 255, 0.42)),
    var(--surface-tint);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.signup-roster {
  display: flex;
  align-items: center;
  gap: 8px;
}

.roster-seat {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
}

.roster-seat.is-filled {
  border: 2px solid rgba(31, 122, 92, 0.22);
  background: var(--glass-strong);
}

.roster-seat.is-empty {
  border: 1px dashed rgba(16, 20, 24, 0.16);
  background: rgba(255, 255, 255, 0.5);
}

.roster-avatar {
  width: 36px;
  height: 36px;
  font-size: 12px;
}

.signup-status > span {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--ink);
  background: var(--accent);
  font-size: 13px;
  font-weight: 820;
}

.signup-status strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 780;
}

.signup-status small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin: 16px 0 2px;
  padding: 4px;
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
}

.auth-tab {
  min-width: 0;
  min-height: 38px;
  border-radius: 12px;
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.16)),
    rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48), 0 1px 2px rgba(38, 52, 46, 0.025);
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.auth-tab-active {
  color: var(--ink);
  background: var(--glass-strong);
  box-shadow: 0 7px 16px rgba(38, 52, 46, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.auth-tab:disabled {
  color: var(--faint);
  cursor: not-allowed;
  opacity: 0.48;
}

.auth-panel {
  padding-top: 2px;
}

.role-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.role-choice-button {
  display: grid;
  min-height: 82px;
  gap: 5px;
  align-content: center;
  border: 1px solid rgba(16, 20, 24, 0.055);
  border-radius: 16px;
  padding: 11px;
  color: var(--muted);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.28)),
    rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62), 0 3px 10px rgba(38, 52, 46, 0.035);
  text-align: left;
  cursor: pointer;
}

.role-choice-button strong,
.role-choice-button span {
  display: block;
}

.role-choice-button strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.role-choice-button span {
  font-size: 11px;
  line-height: 1.35;
}

.role-choice-button.is-active {
  border-color: rgba(31, 122, 92, 0.28);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(232, 243, 237, 0.7)),
    var(--surface-tint);
  box-shadow:
    inset 0 0 0 1px rgba(31, 122, 92, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 8px 18px rgba(31, 122, 92, 0.08);
}

.role-choice-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.form-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.section-block {
  margin-top: 22px;
}

.field-label {
  display: block;
  margin: 18px 0 9px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 760;
}

.field-block {
  margin: 18px 0 0;
}

.field-block .input {
  margin-top: 9px;
}

.split-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.input,
select.input {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  border: 1px solid rgba(16, 20, 24, 0.085);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(249, 251, 247, 0.48)),
    rgba(255, 255, 255, 0.44);
  color: var(--ink);
  padding: 0 14px;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(16, 20, 24, 0.018),
    0 1px 1px rgba(16, 20, 24, 0.018);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  backdrop-filter: blur(12px) saturate(1.15);
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.input:hover,
select.input:hover {
  border-color: rgba(16, 20, 24, 0.13);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(249, 251, 247, 0.58)),
    rgba(255, 255, 255, 0.52);
}

.input:focus,
.weight-input:focus {
  border-color: rgba(31, 122, 92, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(249, 251, 247, 0.68)),
    rgba(255, 255, 255, 0.62);
  box-shadow:
    0 0 0 3px rgba(31, 122, 92, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 2px 8px rgba(38, 52, 46, 0.04);
}

.avatar-picker {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 18px 0;
  padding: 12px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.42)),
    rgba(248, 250, 247, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.avatar-picker.compact {
  margin-top: 12px;
}

.avatar-picker strong,
.avatar-picker small {
  display: block;
}

.avatar-picker strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
}

.avatar-picker small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  color: #fff;
  background: var(--brand);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36), 0 7px 18px rgba(38, 52, 46, 0.12);
  font-weight: 820;
  letter-spacing: 0;
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.avatar-md {
  width: 52px;
  height: 52px;
  font-size: 18px;
}

.avatar-xl {
  width: 74px;
  height: 74px;
  font-size: 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.primary-button,
.secondary-button,
.danger-button,
.danger-outline-button,
.mini-danger-button,
.admin-entry-button,
.scope-button,
.text-button,
.ghost-icon-button,
.nav-button {
  cursor: pointer;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    rgba(31, 37, 43, 0.92);
  font-size: 15px;
  font-weight: 760;
  box-shadow: 0 8px 18px rgba(16, 20, 24, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary-button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0)),
    var(--brand);
  box-shadow: 0 14px 30px rgba(31, 122, 92, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.primary-button:active,
.secondary-button:active,
.nav-button:active,
.text-button:active,
.danger-button:active {
  transform: translateY(1px);
}

.danger-button,
.text-button {
  padding: 8px 0;
  color: var(--brand);
  background: transparent;
  font-size: 12px;
  font-weight: 760;
}

.danger-button {
  color: var(--danger);
}

.danger-outline-button {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(216, 74, 95, 0.26);
  border-radius: 16px;
  color: var(--danger);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.28)),
    var(--danger-soft);
  font-size: 14px;
  font-weight: 760;
}

.mini-danger-button {
  min-height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 12px;
  font-weight: 780;
}

.admin-entry-button {
  display: block;
  width: fit-content;
  margin: 12px auto 0;
  border: 0;
  background: transparent;
  color: var(--faint);
  font-size: 12px;
  font-weight: 680;
  box-shadow: none;
}

.main-app {
  min-height: 100vh;
  padding: 0 16px 112px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -16px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.58);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.42)),
    rgba(246, 247, 244, 0.7);
  box-shadow: 0 8px 24px rgba(38, 52, 46, 0.06);
  -webkit-backdrop-filter: blur(22px) saturate(1.45);
  backdrop-filter: blur(22px) saturate(1.45);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.topbar-name {
  max-width: 250px;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 760;
}

.topbar-status,
.muted {
  color: var(--muted);
  font-size: 12px;
  font-weight: 510;
}

.ghost-icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.42)),
    rgba(255, 255, 255, 0.56);
  color: var(--ink);
  box-shadow: 0 9px 20px rgba(38, 52, 46, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.76);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  backdrop-filter: blur(16px) saturate(1.25);
}

.page {
  padding-top: 16px;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--glass-line);
  border-radius: 28px;
  color: var(--ink);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.82) 0, rgba(255, 255, 255, 0.46) 46%, rgba(255, 255, 255, 0.64) 100%),
    rgba(255, 255, 255, 0.5);
  box-shadow: 0 24px 64px rgba(38, 52, 46, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(26px) saturate(1.45);
  backdrop-filter: blur(26px) saturate(1.45);
}

.hero-panel::before {
  position: absolute;
  top: 0;
  right: 20px;
  left: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
  content: "";
}

.hero-panel::after {
  position: absolute;
  inset: 1px;
  border-radius: 27px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 36%);
  content: "";
  pointer-events: none;
}

.hero-panel > * {
  position: relative;
  z-index: 1;
}

.hero-meta,
.hero-detail,
.section-heading,
.weight-input-row,
.rank-row,
.payout-row,
.history-row,
.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hero-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 11px;
  color: var(--brand-strong);
  border: 1px solid rgba(255, 255, 255, 0.66);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.24)),
    var(--surface-tint);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 760;
}

.pill-light {
  color: var(--money);
  background: var(--money-soft);
}

.hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.metric-label {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.rate-line {
  color: var(--brand);
  font-size: clamp(48px, 15vw, 62px);
  font-weight: 820;
  letter-spacing: 0;
  line-height: 0.9;
}

.rank-card {
  min-width: 104px;
  padding: 13px 14px;
  border-radius: 20px;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.68);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 42%),
    var(--accent);
  box-shadow: 0 12px 24px rgba(80, 104, 30, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.48);
  text-align: left;
}

.rank-card .metric-label {
  margin-bottom: 6px;
  color: rgba(16, 20, 24, 0.62);
}

.rank-line {
  color: var(--ink);
  font-size: 29px;
  font-weight: 820;
  letter-spacing: 0;
  line-height: 1;
}

.rank-line span {
  padding-left: 2px;
}

.money-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 15px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)),
    rgba(16, 20, 24, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 12px 24px rgba(16, 20, 24, 0.14);
}

.money-strip p {
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 620;
}

.money-strip strong {
  color: #fff;
  text-align: right;
  font-size: 24px;
  font-weight: 780;
  line-height: 1.1;
}

.hero-detail {
  align-items: flex-start;
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.hero-detail span:last-child {
  max-width: 46%;
  color: var(--ink-soft);
  text-align: right;
  font-weight: 650;
}

.weight-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-top: 16px;
  padding: 18px;
}

.weight-input-row {
  align-items: baseline;
  justify-content: flex-start;
  border-bottom: 1px solid rgba(16, 20, 24, 0.12);
}

.weight-input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 47px;
  font-weight: 760;
  letter-spacing: 0;
  outline: none;
}

.weight-input::placeholder {
  color: #b0b8bf;
}

.weight-input-row span {
  color: var(--muted);
  font-weight: 720;
}

.section-heading {
  margin-bottom: 13px;
}

.heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.scope-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
  -webkit-backdrop-filter: blur(14px) saturate(1.18);
  backdrop-filter: blur(14px) saturate(1.18);
}

.scope-button {
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 760;
  box-shadow: none;
}

.scope-button.is-active {
  color: var(--ink);
  background: var(--glass-strong);
  box-shadow: 0 5px 12px rgba(38, 52, 46, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.ledger-help-button {
  display: inline-grid;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  color: var(--muted);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.26)),
    rgba(255, 255, 255, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 5px 12px rgba(38, 52, 46, 0.08);
  font-size: 12px;
  font-weight: 820;
  line-height: 1;
  -webkit-backdrop-filter: blur(12px) saturate(1.18);
  backdrop-filter: blur(12px) saturate(1.18);
}

.ledger-help-button:active {
  transform: translateY(1px);
}

.ledger-help-button:focus-visible {
  outline: none;
  border-color: rgba(216, 255, 79, 0.72);
  box-shadow: 0 0 0 3px rgba(216, 255, 79, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.invite-panel {
  display: grid;
  gap: 10px;
  margin: -2px 0 12px;
  padding: 12px;
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.34)),
    var(--surface-tint);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}

.invite-panel strong,
.invite-panel small {
  display: block;
}

.invite-panel strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
}

.invite-panel small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.invite-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.invite-link-input {
  min-height: 42px;
  border-radius: 13px;
  font-size: 12px;
}

.sticky-heading {
  position: sticky;
  top: 65px;
  z-index: 10;
  margin: 0 -16px 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.58);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4)),
    rgba(246, 247, 244, 0.72);
  box-shadow: 0 8px 20px rgba(38, 52, 46, 0.05);
  -webkit-backdrop-filter: blur(22px) saturate(1.45);
  backdrop-filter: blur(22px) saturate(1.45);
}

.list-stack {
  display: grid;
  gap: 10px;
}

.rank-row {
  position: relative;
  min-height: 70px;
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  padding: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.36)),
    var(--glass);
  box-shadow: 0 10px 24px rgba(38, 52, 46, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(1.24);
  backdrop-filter: blur(18px) saturate(1.24);
}

.rank-row.is-leader {
  border-color: rgba(216, 255, 79, 0.38);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(246, 248, 243, 0.5)),
    rgba(255, 255, 255, 0.54);
  box-shadow:
    inset 0 0 0 1px rgba(216, 255, 79, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 14px 30px rgba(38, 52, 46, 0.09);
}

.rank-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rank-index {
  position: relative;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  overflow: visible;
  border-radius: 10px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 760;
}

.rank-index > span {
  position: relative;
  z-index: 1;
}

.rank-row.is-leader .rank-index {
  color: var(--ink);
  border: 1px solid rgba(216, 255, 79, 0.6);
  background:
    linear-gradient(180deg, rgba(216, 255, 79, 0.92), rgba(216, 255, 79, 0.64)),
    rgba(216, 255, 79, 0.72);
  box-shadow: 0 6px 14px rgba(80, 104, 30, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.rank-crown {
  position: absolute;
  top: -12px;
  left: 50%;
  z-index: 2;
  width: 17px;
  height: 17px;
  color: #7d8f25;
  fill: rgba(216, 255, 79, 0.36);
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateX(-50%);
}

.waiting-slot {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.36);
  box-shadow: none;
}

.empty-avatar {
  color: var(--muted);
  background: var(--surface-soft);
}

.rank-name {
  max-width: 130px;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 760;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  border-radius: 999px;
  padding: 0 6px;
  color: var(--brand-strong);
  border: 1px solid rgba(255, 255, 255, 0.56);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.12)),
    var(--surface-tint);
  font-size: 10px;
  font-weight: 760;
  vertical-align: 1px;
}

.role-badge.supporter {
  color: #5f4b9a;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.12)),
    rgba(240, 236, 255, 0.82);
}

.rank-name .role-badge {
  margin-left: 5px;
}

.rank-sub,
.pay-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 510;
}

.rank-metric {
  text-align: right;
}

.rank-metric strong {
  display: block;
  font-size: 19px;
  font-weight: 780;
}

.rank-metric small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.chart-panel {
  padding: 8px 0 2px;
  overflow: hidden;
  border-radius: 24px;
}

#trend-canvas {
  display: block;
  width: 100%;
  height: 334px;
  cursor: crosshair;
  touch-action: pan-y;
}

.legend-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.heatmap-list {
  display: grid;
  gap: 10px;
}

.heatmap-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 56px;
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  padding: 10px 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.34)),
    var(--glass);
  box-shadow: 0 10px 22px rgba(38, 52, 46, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(1.18);
  backdrop-filter: blur(16px) saturate(1.18);
}

.heatmap-name {
  min-width: 0;
}

.heatmap-name strong,
.heatmap-name small {
  display: block;
}

.heatmap-name strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 760;
}

.heatmap-name small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.heatmap-cells {
  display: grid;
  grid-template-columns: repeat(14, 10px);
  gap: 4px;
}

.heatmap-cell {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: rgba(16, 20, 24, 0.1);
}

.heatmap-cell.is-on {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)),
    var(--brand);
  box-shadow: 0 2px 7px rgba(31, 122, 92, 0.18);
}

.heatmap-cell.is-today {
  outline: 2px solid rgba(16, 20, 24, 0.12);
  outline-offset: 1px;
}

.legend-row {
  min-height: 66px;
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  padding: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.34)),
    var(--glass);
  box-shadow: 0 10px 22px rgba(38, 52, 46, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(1.18);
  backdrop-filter: blur(16px) saturate(1.18);
}

.legend-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.color-dot {
  width: 9px;
  height: 32px;
  border-radius: 999px;
}

.winner-card {
  margin-bottom: 12px;
  padding: 18px;
  border-radius: 24px;
  color: var(--ink);
}

.winner-card .muted {
  color: var(--muted);
}

.winner-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.winner-title span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  padding: 0 11px;
  color: var(--money);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.12)),
    var(--money-soft);
  font-size: 12px;
  font-weight: 780;
}

.winner-title strong {
  color: var(--brand);
  font-size: 28px;
  font-weight: 820;
}

.winner-card h2 {
  margin-bottom: 5px;
  font-size: 25px;
  font-weight: 820;
}

.payout-list {
  display: grid;
  gap: 0;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 24px;
}

.payout-row {
  padding: 14px;
  border-bottom: 1px solid rgba(16, 20, 24, 0.055);
}

.payout-row:last-child {
  border-bottom: 0;
}

.payout-row strong {
  color: var(--danger);
  font-size: 17px;
  font-weight: 780;
}

.payout-row.pay-win {
  background:
    linear-gradient(90deg, rgba(232, 243, 237, 0.82), rgba(255, 255, 255, 0.16)),
    var(--surface-tint);
}

.payout-row.pay-win strong {
  color: var(--brand);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px 2px 18px;
}

.profile-header h2 {
  max-width: 280px;
  overflow-wrap: anywhere;
  font-size: 26px;
  font-weight: 820;
}

.profile-form {
  padding: 18px;
}

.profile-form .secondary-button + .danger-outline-button {
  margin-top: 12px;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-row {
  padding: 13px 0;
  border-bottom: 1px solid rgba(16, 20, 24, 0.07);
}

.history-row:last-child {
  border-bottom: 0;
}

.history-row strong {
  font-size: 16px;
  font-weight: 760;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(calc(100% - 24px), 406px);
  margin: 0 auto 10px;
  padding: 7px;
  border: 1px solid var(--glass-line);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.4)),
    rgba(255, 255, 255, 0.66);
  box-shadow: 0 -8px 30px rgba(38, 52, 46, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.84);
  -webkit-backdrop-filter: blur(24px) saturate(1.45);
  backdrop-filter: blur(24px) saturate(1.45);
}

.nav-button {
  display: grid;
  grid-template-rows: 24px 14px;
  place-content: center;
  place-items: center;
  gap: 4px;
  min-width: 0;
  height: 56px;
  border-radius: 18px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 680;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.nav-active {
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0)),
    rgba(31, 37, 43, 0.9);
  box-shadow: 0 6px 16px rgba(16, 20, 24, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.nav-active .nav-icon {
  color: var(--accent);
}

.bottom-nav .nav-button:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(216, 255, 79, 0.75);
}

.nav-icon {
  display: block;
  width: 21px;
  height: 21px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px 16px;
  background: rgba(16, 20, 24, 0.22);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
}

.modal-panel {
  width: min(100%, 360px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(246, 249, 244, 0.58)),
    rgba(246, 247, 244, 0.78);
  box-shadow: 0 24px 70px rgba(38, 52, 46, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(26px) saturate(1.35);
  backdrop-filter: blur(26px) saturate(1.35);
}

.ledger-help-modal {
  padding: 18px;
}

.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 860;
  line-height: 1.2;
}

.modal-close-button {
  display: inline-grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font-size: 20px;
  font-weight: 620;
  line-height: 1;
}

.modal-close-button:focus-visible {
  outline: none;
  border-color: rgba(216, 255, 79, 0.72);
  box-shadow: 0 0 0 3px rgba(216, 255, 79, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.ledger-help-copy {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.ledger-help-step,
.ledger-help-formula {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border: 1px solid rgba(16, 20, 24, 0.07);
  border-radius: 16px;
  padding: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.42)),
    rgba(248, 250, 247, 0.62);
}

.ledger-help-step span,
.ledger-help-formula span {
  display: inline-grid;
  min-height: 32px;
  place-items: center;
  border-radius: 999px;
  color: var(--ink);
  background: var(--accent);
  font-size: 12px;
  font-weight: 840;
}

.ledger-help-step p,
.ledger-help-formula strong {
  min-width: 0;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 680;
  line-height: 1.45;
}

.ledger-help-formula {
  border-color: rgba(216, 255, 79, 0.45);
  background:
    linear-gradient(145deg, rgba(216, 255, 79, 0.22), rgba(255, 255, 255, 0.46)),
    rgba(248, 250, 247, 0.72);
}

.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 60;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)),
    rgba(16, 20, 24, 0.9);
  box-shadow: 0 10px 24px rgba(16, 20, 24, 0.16);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.is-me {
  border-color: rgba(31, 122, 92, 0.28);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(238, 248, 242, 0.7)),
    #eef8f2;
}

.gain {
  color: var(--danger) !important;
}

.loss {
  color: var(--brand) !important;
}

@media (max-width: 360px) {
  .hero-main {
    grid-template-columns: 1fr;
  }

  .rank-card {
    width: 100%;
  }

  .hero-detail {
    display: grid;
  }

  .hero-detail span:last-child {
    max-width: none;
    text-align: left;
  }
}

@media (min-width: 431px) {
  body {
    padding: 18px 0;
  }

  .app-shell {
    min-height: calc(100vh - 36px);
    border-radius: 28px;
  }

  .bottom-nav {
    bottom: 18px;
  }
}
