:root {
  --ink: #0b1f2a;
  --ink-2: #123240;
  --paper: #f4ede0;
  --paper-2: #efe6d6;
  --card: #fffdf8;
  --muted: #6d7c82;
  --line: #e4d8c5;
  --line-strong: #d4c3a9;
  --accent: #e4572e;
  --accent-dark: #c8431f;
  --jade: #2a9d8f;
  --gold: #d4a017;
  --danger: #b23a2e;
  --shadow: 0 12px 30px rgba(32, 43, 48, 0.08);
  --radius: 20px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(228, 87, 46, 0.08), transparent 34%),
    radial-gradient(circle at 100% 18%, rgba(42, 157, 143, 0.08), transparent 30%),
    var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

img,
svg {
  display: block;
}

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

ul,
ol {
  margin: 0;
  padding: 0;
}

.site {
  position: relative;
  width: 100%;
  max-width: 760px;
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(82px + var(--safe-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 9px 16px;
  border-bottom: 1px solid rgba(212, 195, 169, 0.6);
  background: rgba(244, 237, 224, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font-family: "Songti SC", "STSong", serif;
  font-size: 22px;
  font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--accent);
  flex: 0 0 auto;
}

.brand-text {
  min-width: 0;
}

.brand-title {
  display: block;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.top-link {
  padding: 8px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.top-link:hover {
  color: var(--ink);
}

.points-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.points-pill b {
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.login-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
}

.main {
  padding: 16px 16px 26px;
  outline: none;
}

.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 90px 0;
  color: var(--muted);
  font-size: 14px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.page-enter {
  animation: rise 0.35s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 24px 20px 20px;
  border-radius: 26px;
  color: #f9f3e8;
  background:
    radial-gradient(circle at 92% 0%, rgba(228, 87, 46, 0.36), transparent 36%),
    linear-gradient(135deg, #0b1f2a 0%, #103444 62%, #154958 100%);
  box-shadow: 0 18px 36px rgba(11, 31, 42, 0.22);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 54px, rgba(255, 255, 255, 0.05) 54px 56px),
    linear-gradient(to bottom, transparent 70%, rgba(0, 0, 0, 0.18));
  mask-image: linear-gradient(to bottom, transparent, black 40%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 40%);
}

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

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #f2d7c7;
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.hero-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(228, 87, 46, 0.18);
}

.hero h1 {
  margin-top: 14px;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(32px, 9vw, 44px);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.12;
}

.hero-sub {
  margin-top: 6px;
  color: #c9d7da;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.hero-desc {
  max-width: 30em;
  margin-top: 12px;
  color: #aec3c8;
  font-size: 13px;
  line-height: 1.7;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.hero-badge {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  color: #d8e3e4;
  background: rgba(255, 255, 255, 0.05);
  font-size: 10px;
  font-weight: 700;
}

.countdown-band {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.countdown-label {
  color: #a9c0c6;
  font-size: 11px;
  font-weight: 600;
}

.countdown-value {
  margin-top: 2px;
  color: #fff7ea;
  font-size: clamp(26px, 8vw, 36px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  line-height: 1.1;
}

.countdown-value.is-done {
  color: #f0b9a6;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.countdown-note {
  color: #93adb4;
  font-size: 10px;
  text-align: right;
}

.hero-actions {
  display: flex;
  gap: 9px;
  margin-top: 16px;
}

.hero-actions .btn {
  flex: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: translateY(1px) scale(0.995);
}

.btn:disabled {
  opacity: 0.45;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.btn-paper {
  border-color: var(--line-strong);
  background: var(--card);
  color: var(--ink);
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #f3eee4;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.card-pad {
  padding: 18px;
}

.section {
  margin-top: 18px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 0 2px;
}

.section-title {
  font-family: "Songti SC", "STSong", serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.section-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.section-link {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.stage-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.stage-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(228, 87, 46, 0.1);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
}

.stage-time {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.match-side {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fffaf1;
}

.match-side.is-winner {
  border-color: rgba(42, 157, 143, 0.55);
  background: rgba(42, 157, 143, 0.07);
}

.match-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.horse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(11, 31, 42, 0.06);
}

.match-meta {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.match-meta b {
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.vs {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: "Songti SC", serif;
  font-size: 11px;
  font-weight: 800;
}

.match-empty {
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 15px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.prob-bar {
  display: flex;
  overflow: hidden;
  height: 5px;
  margin-top: 9px;
  border-radius: 999px;
  background: var(--line);
}

.prob-bar span {
  height: 100%;
}

.horse-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.horse-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
}

.horse-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.horse-card-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 800;
}

.horse-stats {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.horse-stats b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.horse-pool {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 10px;
  color: var(--muted);
}

.horse-pool b {
  color: var(--accent-dark);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.champion-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(212, 160, 23, 0.42);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 90% 10%, rgba(212, 160, 23, 0.18), transparent 45%),
    #fffaf0;
}

.champion-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  font-family: "Songti SC", serif;
  font-size: 20px;
  font-weight: 800;
  flex: 0 0 auto;
}

.champion-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #927014;
}

.champion-name {
  margin-top: 3px;
  font-family: "Songti SC", serif;
  font-size: 24px;
  font-weight: 800;
}

.champion-note {
  color: var(--muted);
  font-size: 11px;
}

.notice {
  display: flex;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 253, 248, 0.7);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.notice strong {
  color: var(--ink);
}

.notice > div:first-child {
  flex: 1;
  min-width: 0;
}

.notice .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.compliance {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.compliance span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 253, 248, 0.55);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.share-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.55);
}

.share-text {
  font-family: "Songti SC", serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.share-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.page-head h2 {
  font-family: "Songti SC", serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.page-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.bet-layout {
  display: grid;
  gap: 12px;
}

.bet-horse {
  position: relative;
  display: block;
  cursor: pointer;
}

.bet-horse input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bet-horse-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.bet-horse input:checked + .bet-horse-inner {
  border-color: var(--accent);
  background: rgba(228, 87, 46, 0.05);
}

.bet-horse input:focus-visible + .bet-horse-inner {
  outline: 3px solid rgba(228, 87, 46, 0.28);
  outline-offset: 2px;
}

.bet-horse-color {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  flex: 0 0 auto;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}

.bet-horse-info {
  flex: 1;
  min-width: 0;
}

.bet-horse-name {
  display: block;
  font-size: 16px;
  font-weight: 800;
}

.bet-horse-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.bet-horse-rate {
  text-align: right;
  font-size: 10px;
  color: var(--muted);
}

.bet-horse-rate b {
  display: block;
  color: var(--accent-dark);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.field {
  display: block;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
}

.field-hint {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: #fffdf9;
  font-size: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(228, 87, 46, 0.13);
}

textarea.input {
  min-height: 100px;
  resize: vertical;
}

.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffaf0;
}

.preview-label {
  color: var(--muted);
  font-size: 11px;
}

.preview-value {
  color: var(--accent-dark);
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.balance-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.balance-line b {
  color: var(--ink);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.pool-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pool-stat {
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fffaf1;
  text-align: center;
}

.pool-stat-label {
  color: var(--muted);
  font-size: 10px;
}

.pool-stat-value {
  margin-top: 3px;
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.bet-closed {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  text-align: center;
}

.bet-closed-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--paper-2);
  font-family: "Songti SC", serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(239, 230, 214, 0.65);
}

.tab {
  flex: 1;
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tab.is-active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 3px 10px rgba(32, 43, 48, 0.07);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.list-row.is-me {
  border-color: rgba(228, 87, 46, 0.55);
  background: rgba(228, 87, 46, 0.04);
}

.rank-num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.rank-num.rank-1 {
  background: #f5dc9a;
  color: #6d4f07;
}

.rank-num.rank-2 {
  background: #e4e1d9;
  color: #5c5a53;
}

.rank-num.rank-3 {
  background: #efccb2;
  color: #7a4427;
}

.rank-user {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-me-tag {
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  vertical-align: 2px;
}

.rank-points {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rank-points small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.my-rank-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0%, rgba(228, 87, 46, 0.22), transparent 45%),
    var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
}

.my-rank-label {
  color: #a9c0c6;
  font-size: 11px;
}

.my-rank-value {
  margin-top: 2px;
  font-size: 30px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.my-rank-value small {
  font-size: 12px;
  font-weight: 600;
  color: #a9c0c6;
}

.my-rank-points {
  text-align: right;
  font-size: 12px;
  color: #a9c0c6;
}

.my-rank-points b {
  display: block;
  color: #fff7ea;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.profile {
  padding: 20px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 95% 10%, rgba(42, 157, 143, 0.28), transparent 42%),
    linear-gradient(135deg, #0b1f2a, #143a48);
  color: #f9f3e8;
  box-shadow: 0 18px 36px rgba(11, 31, 42, 0.2);
}

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

.profile-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.profile-meta {
  margin-top: 2px;
  color: #a9c0c6;
  font-size: 11px;
}

.profile-points {
  text-align: right;
}

.profile-points span {
  color: #a9c0c6;
  font-size: 10px;
}

.profile-points b {
  display: block;
  font-size: 30px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.profile-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.profile-actions .btn {
  flex: 1;
}

.checkin-note {
  margin-top: 8px;
  color: #a9c0c6;
  font-size: 10px;
  text-align: center;
}

.record {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.record-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.record-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
}

.record-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.record-amount {
  text-align: right;
  font-size: 11px;
  color: var(--muted);
}

.record-amount b {
  display: block;
  color: var(--ink);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.record-amount b.positive {
  color: var(--jade);
}

.record-amount b.negative {
  color: var(--accent-dark);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.badge-pending {
  background: #f3e7c9;
  color: #80601a;
}

.badge-won {
  background: rgba(42, 157, 143, 0.14);
  color: #1d7268;
}

.badge-lost {
  background: rgba(109, 124, 130, 0.12);
  color: var(--muted);
}

.badge-open {
  background: rgba(42, 157, 143, 0.14);
  color: #1d7268;
}

.badge-locked {
  background: rgba(228, 87, 46, 0.12);
  color: var(--accent-dark);
}

.load-more {
  margin-top: 10px;
}

.empty {
  padding: 36px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.55);
  text-align: center;
}

.empty-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--muted);
  font-family: "Songti SC", serif;
  font-size: 18px;
  font-weight: 800;
}

.empty-title {
  font-size: 15px;
  font-weight: 800;
}

.empty-text {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.auth-card {
  padding: 24px 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.auth-head {
  text-align: center;
  margin-bottom: 18px;
}

.auth-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 10px;
  border-radius: 18px;
  background: var(--ink);
  color: var(--paper);
  font-family: "Songti SC", serif;
  font-size: 30px;
  font-weight: 800;
  box-shadow: inset 0 -4px 0 var(--accent);
}

.auth-title {
  font-family: "Songti SC", serif;
  font-size: 24px;
  font-weight: 800;
}

.auth-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.form-error {
  display: none;
  padding: 9px 11px;
  border: 1px solid rgba(178, 58, 46, 0.28);
  border-radius: 10px;
  background: rgba(178, 58, 46, 0.06);
  color: var(--danger);
  font-size: 11px;
}

.form-error.is-visible {
  display: block;
}

.auth-switch {
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.auth-switch a {
  color: var(--accent-dark);
  font-weight: 800;
}

.auth-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
  text-align: center;
}

.bracket-scroll {
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.bracket {
  display: grid;
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  gap: 12px;
  min-width: 680px;
}

.bracket-col-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.bracket-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bracket-match {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bracket-match.is-live {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(228, 87, 46, 0.12);
}

.bracket-match-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
}

.bracket-horse {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  font-size: 12px;
  font-weight: 700;
}

.bracket-horse.is-winner {
  color: var(--jade);
}

.bracket-horse.is-lost {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(109, 124, 130, 0.4);
}

.canvas-card {
  overflow: hidden;
  padding: 0;
}

.canvas-wrap {
  position: relative;
  background: var(--ink);
}

#race-canvas {
  display: block;
  width: 100%;
  height: 238px;
}

.canvas-overlay {
  position: absolute;
  inset: auto 12px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.canvas-caption {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.canvas-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(228, 87, 46, 0.9);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.canvas-live::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  50% { opacity: 0.25; }
}

.canvas-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
}

.canvas-controls .btn {
  flex: 1;
}

.play-status {
  padding: 0 14px 12px;
  color: var(--muted);
  font-size: 11px;
  min-height: 18px;
}

.settlement-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.settlement-strip span {
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 9px;
}

.settlement-strip b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.fairness {
  padding: 16px;
}

.fairness h3 {
  font-size: 14px;
  font-weight: 800;
}

.fairness p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.code-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffaf1;
}

.code-line code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.verify-list {
  margin-top: 10px;
  border-top: 1px dashed var(--line);
}

.verify-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  color: var(--muted);
  font-size: 10px;
}

.verify-row b {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.rules-card {
  padding: 20px;
}

.rules-intro {
  padding: 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: rgba(228, 87, 46, 0.05);
  color: #435158;
  font-size: 12px;
  line-height: 1.85;
}

.rules-section {
  margin-top: 20px;
}

.rules-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
}

.rules-section h3::before {
  content: "";
  width: 5px;
  height: 16px;
  border-radius: 2px;
  background: var(--accent);
}

.rules-section ul {
  margin-top: 8px;
  padding-left: 2px;
  list-style: none;
}

.rules-section li {
  position: relative;
  padding-left: 16px;
  margin-top: 6px;
  color: #4b5960;
  font-size: 12px;
  line-height: 1.8;
}

.rules-section li::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line-strong);
}

.const-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.const-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffaf1;
  font-size: 10px;
  color: var(--muted);
}

.const-item b {
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.rules-foot {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
  text-align: center;
}

.site-foot {
  margin-top: 22px;
  padding: 14px 4px 4px;
  color: #8b989d;
  font-size: 10px;
  line-height: 1.8;
  text-align: center;
}

.site-foot strong {
  color: var(--muted);
}

.tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 7px 10px calc(7px + var(--safe-bottom));
  border-top: 1px solid rgba(212, 195, 169, 0.7);
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.tabbar.is-hidden {
  display: none;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 50px;
  border-radius: 12px;
  color: #8b989d;
  font-size: 9px;
  font-weight: 700;
}

.tab-item svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-item.is-active {
  color: var(--accent-dark);
}

.tab-item.is-active svg {
  stroke: var(--accent);
}

.toast {
  position: fixed;
  top: 76px;
  left: 50%;
  z-index: 100;
  max-width: min(86vw, 420px);
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(11, 31, 42, 0.94);
  color: #fff7ea;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 10px 28px rgba(11, 31, 42, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.toast.is-error {
  background: rgba(150, 43, 34, 0.96);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 18, 24, 0.55);
  backdrop-filter: blur(3px);
}

.modal-panel {
  width: 100%;
  max-width: 360px;
  padding: 20px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  animation: rise 0.2s ease both;
}

.modal-title {
  font-family: "Songti SC", serif;
  font-size: 19px;
  font-weight: 800;
}

.modal-body {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.modal-body strong {
  color: var(--ink);
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.modal-actions .btn {
  flex: 1;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  text-align: center;
}

@media (min-width: 620px) {
  .main {
    padding: 20px 20px 30px;
  }

  .hero {
    padding: 30px 26px 24px;
  }

  .horse-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .const-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .brand-sub {
    display: none;
  }

  .match {
    gap: 5px;
  }

  .match-side {
    padding: 9px;
  }

  .match-name {
    font-size: 13px;
  }

  .pool-stat-value {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
