/* Design tokens extracted from the captured app (sc/*.png):
   page #f1f1f2, card #fff, dark card #111, accent #0066cc, link #2997ff,
   live/handicap red #fb2c36, under/over green #009966, gold #ffb900. */
:root {
  --bg: #f1f1f2;
  --card: #ffffff;
  --dark: #111111;
  --text: #111827;
  --text-soft: #4b5563;
  --hint: #9ca3af;
  --line: #e5e7eb;
  --accent: #0066cc;
  --accent-soft: #2997ff;
  --red: #fb2c36;
  --green: #009966;
  --gold: #ffb900;
  --silver: #d9d9de;
  --bronze: #e8a87c;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
  --tg-theme-bg-color: #ffffff;
  --tg-theme-secondary-bg-color: #f1f1f2;
  --tg-theme-text-color: #111827;
  --tg-theme-hint-color: #9ca3af;
  --tg-theme-button-color: #0066cc;
  --tg-theme-button-text-color: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Apple SD Gothic Neo",
    "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  padding: 0;
}

input {
  font: inherit;
}

.shell {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
}

.screen {
  padding: 12px 16px calc(84px + env(safe-area-inset-bottom, 0px));
}

.fold {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.screen-title {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 800;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.segment {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  background: #ececee;
  border-radius: var(--radius-sm);
  padding: 3px;
}

.segment-item {
  padding: 9px 6px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
}

.segment-item.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.12);
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
}

.chip {
  flex: 0 0 auto;
  padding: 7px 16px;
  border-radius: 999px;
  background: #ececee;
  color: #4b5563;
  font-size: 13px;
  font-weight: 600;
}

.chip.active {
  background: var(--accent);
  color: #fff;
}

.chip:disabled {
  opacity: 0.45;
}

/* --- pager (measured `wins` pager: page / pageSize / total) ---------------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 4px 0 8px;
}

.pager-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--hint);
}

.banner {
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff4e5;
  color: #92400e;
  font-size: 12px;
}

.info-card {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #f3f4f6;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.5;
}

.empty {
  margin: 0;
  padding: 24px 0;
  text-align: center;
  color: var(--hint);
  font-size: 13px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.primary {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.primary:disabled {
  opacity: 0.6;
}

.primary.small {
  width: auto;
  padding: 9px 22px;
  border-radius: 999px;
  font-size: 13px;
}

.link {
  color: var(--accent-soft);
  font-size: 12px;
  font-weight: 600;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--card);
  color: var(--text-soft);
  font-size: 16px;
  box-shadow: var(--shadow);
}

.icon-btn.light {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: none;
}

.avatar {
  overflow: hidden;
}

/* --- bottom navigation ------------------------------------------------------ */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: grid;
  /* Seven tabs for an admin (six for everyone else). A fixed count overflowed
     onto a second row and repeated '관리자' below the bar; `auto-fit` sizes the
     columns to however many buttons the view actually renders. */
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(245, 244, 247, 0.94);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 20;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 0;
  /* Seven columns on a 360px phone is ~48px each; the label must not widen the
     column or the row overflows. */
  min-width: 0;
  font-size: 10px;
  font-weight: 600;
  color: #8a8a90;
}

.tab span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab.active {
  color: var(--accent);
}

.tab-icon {
  width: 21px;
  height: 21px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  font-size: 12.5px;
  padding: 10px 16px;
  border-radius: 999px;
  z-index: 60;
  max-width: 88vw;
  text-align: center;
}

/* --- home points card ------------------------------------------------------- */

.points-card {
  background: var(--dark);
  border-radius: 22px;
  padding: 18px 16px 12px;
  color: #fff;
}

.points-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.points-label {
  margin: 0 0 6px;
  font-size: 12.5px;
  color: #b9b9be;
}

.points-value {
  margin: 0 0 6px;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
}

.points-unit {
  font-size: 18px;
  font-weight: 700;
  color: #d6d6da;
}

.points-sub {
  margin: 0;
  font-size: 12px;
  color: #9d9da4;
}

.points-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-content: start;
}

.pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #232326;
  color: #e7e7ea;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.pill-icon {
  font-size: 12px;
}

.points-rank {
  margin-top: 14px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #1d1d20;
  color: #c9c9cf;
  font-size: 13px;
  font-weight: 600;
}

.points-rank-value {
  color: var(--accent-soft);
  font-weight: 800;
}

.points-rank-arrow {
  margin-left: auto;
  color: #7d7d84;
}

/* --- promo tiles ------------------------------------------------------------ */

.banner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tile {
  /* The tile is a <button> (tappable catalog entry), so reset the UA styles:
     without this a banner renders 1-up, with a grey background and a huge image. */
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tile-art {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile-emoji {
  font-size: 34px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}

.tile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 2px;
}

.tile-name {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-cta {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-soft);
  white-space: nowrap;
}

/* --- live score strip ------------------------------------------------------- */

.live-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-title {
  font-size: 13px;
  font-weight: 800;
}

.live-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--hint);
}

/* A slow pulse reads as "live" without pulling attention from the content. */
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  animation: live-pulse 1.6s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.live-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.live-row {
  padding: 7px 9px;
  border-radius: 10px;
  background: var(--bg);
}

.live-row.done {
  opacity: 0.72;
}

.live-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10.5px;
  color: var(--hint);
}

.live-phase {
  font-weight: 700;
}

.live-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 600;
}

.live-team {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-team.away {
  text-align: right;
}

.live-score {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  white-space: nowrap;
}

/* --- external score feeds (admin) ------------------------------------------- */

.admin-subtitle {
  display: block;
  margin: 14px 0 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-soft);
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
}

/* An unmatched row is a button: tapping it prefills the alias form with the
   feed's spelling, which is the whole point of the list. */
.feed-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 7px 9px;
  border-radius: 10px;
  background: var(--bg);
  text-align: left;
}

.feed-row.static {
  cursor: default;
}

.feed-row-main {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-row-meta {
  font-size: 10.5px;
  color: var(--hint);
}

/* --- affiliate (제휴사) ------------------------------------------------------ */
/* The captured client renders partner cards at 2:1 (1200x600), unlike the
   home-screen banners which are 16:9. Scoping the ratio here keeps both. */
.affiliate-grid .tile-art {
  aspect-ratio: 2 / 1;
}

.affiliate-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 34px 18px;
  text-align: center;
}

.affiliate-empty-icon {
  margin: 0 0 4px;
  font-size: 34px;
  line-height: 1;
}

.affiliate-empty-title {
  font-size: 15px;
  font-weight: 800;
}

.affiliate-empty-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--hint);
  white-space: pre-line;
  max-width: 300px;
}

/* --- leaderboard ------------------------------------------------------------ */

.rank-list {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid #f1f1f3;
}

.rank-row:last-child {
  border-bottom: none;
}

.rank-badge {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #f2f2f4;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.rank-badge.gold {
  background: var(--gold);
  color: #fff;
}

.rank-badge.silver {
  background: var(--silver);
  color: #fff;
}

.rank-badge.bronze {
  background: var(--bronze);
  color: #fff;
}

.rank-name {
  font-size: 13.5px;
  font-weight: 600;
}

.rank-value {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-soft);
}

/* --- picks ------------------------------------------------------------------ */

.pick-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pick-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pick-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  text-align: left;
}

.pick-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.pick-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
}

.pick-meta {
  font-size: 11.5px;
  color: var(--hint);
}

/* 3.png's second line: odds + timestamp, quieter than the round/match line. */
.pick-submeta {
  font-size: 10.5px;
  color: var(--hint);
  opacity: 0.75;
}

/* --- admin screen ---------------------------------------------------------- */

.admin-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-title {
  font-size: 14px;
  font-weight: 800;
}

.admin-hint {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--hint);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.target-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #232326;
}

.target-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.settle-markets {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 12px 10px;
}

.settle-market {
  display: flex;
  align-items: center;
  gap: 6px;
}

.settle-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--ink-dim, #a1a1aa);
}

.ledger-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ledger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ledger-reason {
  color: var(--ink-dim, #a1a1aa);
}

.ledger-delta.up {
  color: #4ade80;
}

.ledger-delta.down {
  color: #f87171;
}

.target-label {
  font-size: 13px;
  font-weight: 700;
}

.target-meta {
  font-size: 10.5px;
  color: var(--hint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A toggle button: green when on, muted when off. */
.pill.on {
  background: #103d2a;
  color: #62e0a0;
}

.pill.off {
  background: #2b2b30;
  color: #9a9aa2;
}

.score-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.score-pair {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 72px;
  min-width: 0;
  font-size: 11.5px;
  color: var(--hint);
}

.field input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: #232326;
  color: var(--fg, #e7e7ea);
  font-size: 14px;
  font-weight: 600;
  outline: none;
  min-width: 0;
}

.field input:focus {
  box-shadow: 0 0 0 2px #3d7bff;
}

.pick-chevron {
  margin-left: auto;
  color: #b6b6bc;
  font-size: 18px;
}

.badge {
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.badge.pro {
  background: #dbeeff;
  color: #0077e6;
}

.badge.best {
  background: linear-gradient(120deg, #ff5f9e, #a855f7);
  color: #fff;
}

.pick-body {
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pick-payout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pick-payout {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-soft);
}

.pick-slip {
  font-size: 11px;
  color: var(--hint);
}

.legs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: #f4f7fb;
}

.leg-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #6b7280;
}

.leg-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.leg-side {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: #dbeafe;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 800;
}

.leg-selection {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leg-result {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  white-space: nowrap;
}

.leg-result.win {
  color: var(--accent-soft);
}

.leg-result.lose {
  color: var(--red);
}

.pick-bio {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #f7f7f8;
  font-size: 12px;
  color: #4b5563;
}

.pick-bio-label {
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
}


/* --- betting / register ----------------------------------------------------- */

.pill-banner {
  padding: 12px;
  border-radius: var(--radius);
  background: var(--card);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.balance-label {
  font-size: 13px;
  color: var(--text-soft);
}

.balance-value {
  font-size: 16px;
  font-weight: 800;
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.match-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.match-league {
  font-size: 11.5px;
  font-weight: 700;
  color: #6b7280;
}

.match-time {
  font-size: 11px;
  color: var(--hint);
}

.match-title {
  margin: 8px 0 12px;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.market {
  margin-bottom: 10px;
}

.market-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #6b7280;
}

.market-label.red {
  color: var(--red);
}

.market-label.green {
  color: var(--green);
}

.odds-row {
  display: flex;
  gap: 8px;
}

.odds-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 6px;
  border-radius: 10px;
  background: #f1f2f4;
}

.odds-btn .odds-label {
  font-size: 11px;
  color: #6b7280;
}

.odds-btn .odds-value {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.odds-btn.active {
  background: var(--accent);
}

.odds-btn.active .odds-label,
.odds-btn.active .odds-value {
  color: #fff;
}

.bet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.bet-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bet-slip {
  font-size: 13px;
  font-weight: 800;
}

.bet-meta {
  font-size: 11.5px;
  color: var(--hint);
}

.bet-stake {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-soft);
  white-space: nowrap;
}

.slip {
  position: fixed;
  left: 50%;
  bottom: calc(66px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(448px, calc(100vw - 24px));
  background: var(--card);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: 0 -4px 24px rgba(17, 24, 39, 0.16);
  z-index: 30;
}

.slip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
}

.slip-legs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 84px;
  overflow-y: auto;
  margin: 8px 0;
}

.slip-leg {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-soft);
}

.slip-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stake-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--hint);
}

.stake-label input {
  width: 74px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  background: #fafafa;
}

.slip-payout {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--accent-soft);
  white-space: nowrap;
}

.slip-row .primary {
  width: auto;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
}

/* --- tv / chat -------------------------------------------------------------- */

.tv-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tv-head-title {
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 800;
}

.tv-head-sub {
  margin: 0;
  font-size: 11.5px;
  color: var(--hint);
}

.tv-card {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--card);
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.tv-card.active {
  border-color: var(--accent);
}

.tv-title {
  margin: 8px 0 6px;
  font-size: 15px;
  font-weight: 800;
}

.tv-channel {
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--hint);
}

.live-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--red);
  letter-spacing: 0.4px;
}

.chat-card {
  padding: 12px 14px;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.chat-title {
  font-size: 13.5px;
  font-weight: 800;
}

.chat-count {
  font-size: 11px;
  color: var(--hint);
}

.chat-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-row {
  display: flex;
  gap: 8px;
}

.chat-body {
  min-width: 0;
}

.chat-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.chat-name {
  font-size: 12px;
  font-weight: 700;
}

.chat-time {
  font-size: 10px;
  color: var(--hint);
}

.chat-text {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #374151;
  word-break: break-word;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.chat-input-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  background: #fafafa;
}

.chat-input-row button {
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
}


/* --- roulette --------------------------------------------------------------- */

.wheel-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 14px 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 185, 0, 0.10), transparent 62%),
    var(--card);
}

/* Stage holds the pointer so it does not rotate with the wheel. */
.wheel-stage {
  position: relative;
  --wheel-size: 216px;
  width: var(--wheel-size);
  height: var(--wheel-size);
  display: grid;
  place-items: center;
}

/* The indicator at 12 o'clock. */
.wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 16px solid var(--dark);
  filter: drop-shadow(0 2px 3px rgba(17, 24, 39, 0.32));
  z-index: 3;
}

.wheel {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    #ff5f9e 0deg 45deg,
    #ffb900 45deg 90deg,
    #2997ff 90deg 135deg,
    #a855f7 135deg 180deg,
    #00c2a8 180deg 225deg,
    #fb2c36 225deg 270deg,
    #0066cc 270deg 315deg,
    #22c55e 315deg 360deg
  );
  transition: transform 1.9s cubic-bezier(0.16, 0.84, 0.18, 1);
  box-shadow:
    inset 0 0 0 7px rgba(255, 255, 255, 0.5),
    inset 0 0 22px rgba(0, 0, 0, 0.14),
    0 10px 24px rgba(17, 24, 39, 0.18);
  /* Keep the labels from painting outside the circle at odd angles. */
  overflow: hidden;
}

/* The hub: covers the apex of the slices. */
.wheel::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34%;
  height: 34%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.72),
    0 3px 10px rgba(17, 24, 39, 0.22);
  z-index: 2;
}

/* Slice labels. Positioned at the slice centre and counter-rotated so they stay
   upright; `translateY` pushes them out to the rim. */
.wheel-label {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -9px 0 0 -18px;
  width: 36px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.42);
  pointer-events: none;
  z-index: 1;
}

.wheel-reward {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}

.wheel-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.wheel-chip {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.wheel-chip.hit {
  background: var(--gold);
  color: #3a2a00;
  transform: translateY(-1px) scale(1.06);
}

.wheel-button {
  max-width: 260px;
}

.wheel-hint {
  margin: 0;
  font-size: 11px;
  color: var(--hint);
}

/* --- dark mode -------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f11;
    --card: #1a1a1d;
    --text: #f3f4f6;
    --text-soft: #d1d5db;
    --hint: #6b7280;
    --line: #2a2a2e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  }

  .segment {
    background: #232327;
  }

  .segment-item.active {
    background: #2f2f34;
    color: var(--text);
  }

  .chip {
    background: #232327;
    color: #d1d5db;
  }

  .rank-row {
    border-bottom-color: #232327;
  }

  .rank-badge {
    background: #2a2a2e;
    color: #9ca3af;
  }

  .info-card {
    background: #232327;
  }

  .odds-btn {
    background: #232327;
  }

  .odds-btn .odds-label {
    color: #9ca3af;
  }

  .legs {
    background: #202024;
  }

  .leg-selection,
  .chat-text {
    color: #e5e7eb;
  }

  .pick-bio {
    background: #232327;
    color: #d1d5db;
  }

  .chat-input-row input,
  .stake-label input {
    background: #232327;
    border-color: #34343a;
    color: #f3f4f6;
  }

  .tabbar {
    background: rgba(20, 20, 23, 0.94);
    border-top-color: rgba(255, 255, 255, 0.06);
  }

  .tab {
    color: #7d7d84;
  }

  .icon-btn {
    background: #232327;
  }

  .pill-banner {
    background: #1a1a1d;
  }
}

