/* PredictGame — dark + light themes, VS card design */

:root {
  --green: #2ee6a8;
  --green-dim: #10b981;
  --orange: #f6465d;
  --orange-dim: #e03e52;
  --accent: #ff7a59;
  --accent-dim: #ff9b82;
  --bg: #05080f;
  --surface: #0a0e17;
  --surface2: #0d1424;
  --card-bg: #101828;
  --border: #1c2740;
  --text: #ffffff;
  --muted: #7e8ba3;
  --glow-green: rgba(46, 230, 168, 0.45);
  --glow-orange: rgba(246, 70, 93, 0.45);
  --glow-accent: rgba(255, 122, 89, 0.35);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  /* Reference aliases */
  --panel: #0a0e17;
  --card: #101828;
  --card2: #0d1424;
  --line: #1c2740;
  --line2: #22314f;
  --muted2: #93a0b8;
  --up: #2ee6a8;
  --up-strong: #10b981;
  --down: #f6465d;
  --txt: #ffffff;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --dur-fast: 0.18s;
  --dur-med: 0.38s;
  --dur-slow: 0.55s;
}

html[data-theme="light"] {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface2: #eef1f7;
  --card-bg: #ffffff;
  --border: #d8deea;
  --text: #111827;
  --muted: #5f6672;
  --muted2: #6b7280;
  --panel: #ffffff;
  --card: #ffffff;
  --card2: #f0f3f9;
  --line: #d8deea;
  --line2: #c5cddb;
  --txt: #111827;
  --green: #10b981;
  --green-dim: #059669;
  --up: #10b981;
  --up-strong: #059669;
  --orange: #e03e52;
  --orange-dim: #c93446;
  --down: #e03e52;
  --accent: #e85a3a;
  --accent-dim: #ff7a59;
  --glow-green: rgba(16, 185, 129, 0.25);
  --glow-orange: rgba(224, 62, 82, 0.25);
  --glow-accent: rgba(255, 122, 89, 0.2);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: min(1200px, 100%);
  width: 100%;
  margin: 0 auto;
  background: var(--bg);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* ── Header ── */
.game-header {
  flex-shrink: 0;
  padding: 0.6rem 1rem 0.5rem;
  padding-top: calc(0.6rem + var(--safe-top));
  background: var(--bg);
}

.header-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--orange));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #000;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img,
.leader-avatar img,
.profile-editor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-level {
  font-size: 0.7rem;
  color: var(--muted);
}

.balance-chip {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.65rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.balance-chip.bump {
  animation: balanceBump 0.55s var(--ease-spring);
}

.balance-icon {
  color: var(--green);
  font-size: 0.75rem;
}

.balance-unit {
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 500;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast);
}

.theme-toggle:active {
  transform: scale(0.88) rotate(15deg);
}

.brand-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.brand {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
}

.brand-a { color: var(--green); }
.brand-b { color: var(--orange); }

.tagline {
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── Main ── */
.main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 1rem;
  padding-bottom: calc(4.5rem + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

.view { display: none; }
.view.active:not(.view-overlay) {
  display: block;
  animation: viewIn var(--dur-med) var(--ease-out) both;
}
.view.hidden { display: none; }

.hidden {
  display: none !important;
}

#app.telegram-miniapp #web-login-gate {
  display: none !important;
}

#app.overlay-open .main {
  overflow: hidden;
  pointer-events: none;
}

.web-login-gate {
  margin: 0.4rem 0 0.8rem;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: var(--shadow-soft);
  position: relative;
  z-index: 4;
  text-align: center;
}

.web-login-gate h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.web-login-gate p {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.guest-login-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  max-width: 280px;
  margin: 0 auto 0.85rem;
  text-align: left;
}

.guest-login-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.guest-login-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg, #0b1220);
  color: var(--text, #fff);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.guest-login-input:focus {
  outline: 2px solid #2aabee;
  outline-offset: 1px;
}

.guest-login-hint {
  margin: 0 !important;
  font-size: 0.75rem !important;
  line-height: 1.35 !important;
  color: var(--muted);
}

.guest-login-error {
  margin: 0;
  font-size: 0.78rem;
  color: #ff6b6b;
  line-height: 1.35;
}

.guest-login-btn {
  margin-top: 0.25rem;
}

.web-login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 280px;
  margin: 0.2rem auto 0.85rem;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: lowercase;
}

.web-login-divider::before,
.web-login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.telegram-login-widget {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  margin: 0 0 0.75rem;
}

.telegram-login-widget-focus {
  outline: 2px solid #2aabee;
  outline-offset: 6px;
  border-radius: 12px;
}

.telegram-open-link {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: underline;
}

#web-login-gate .telegram-open-btn {
  width: 100%;
  max-width: 280px;
}

#app.auth-locked .market-filters,
#app.auth-locked .deck-shell,
#app.auth-locked #bottom-nav,
#app.auth-locked #btn-balance,
#app.auth-locked #theme-toggle,
#app.auth-locked .user-chip {
  pointer-events: none;
  opacity: 0.35;
}

#app.auth-locked #bottom-nav {
  display: none;
}

.channel-gate {
  margin: 0.4rem 0 0.8rem;
  padding: 1.1rem 1rem 1.2rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: var(--shadow-soft);
  position: relative;
  z-index: 5;
  text-align: center;
}

.channel-gate h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.channel-gate p {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.channel-gate .telegram-open-btn {
  display: inline-flex;
  margin-bottom: 0.65rem;
}

.channel-gate .channel-check-btn {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

.channel-gate-hint {
  margin: 0.75rem 0 0;
  color: var(--danger, #e57373);
  font-size: 0.8rem;
}

#app.channel-locked .market-filters,
#app.channel-locked .deck-shell,
#app.channel-locked #bottom-nav,
#app.channel-locked #btn-balance,
#app.channel-locked #theme-toggle,
#app.channel-locked .user-chip {
  pointer-events: none;
  opacity: 0.35;
}

#app.channel-locked #bottom-nav {
  display: none;
}

.telegram-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  border: none;
  border-radius: 12px;
  padding: 0.7rem 1rem;
  background: linear-gradient(180deg, #2aabee 0%, #229ed9 100%);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.telegram-open-btn:active {
  transform: scale(0.98);
}

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

/* ── Card deck ── */
.card-deck {
  position: relative;
  min-height: 540px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  touch-action: pan-y;
}

.loading-state, .empty-state {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
  font-size: 0.9rem;
}

.prediction-card {
  width: 100%;
  min-height: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.1rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: visible;
  will-change: transform, opacity;
  display: flex;
  flex-direction: column;
  /* Allow vertical page scroll on the card; horizontal swipe handled in JS after axis lock. */
  touch-action: pan-y;
  user-select: none;
}

.card-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
  touch-action: pan-y;
}

.card-actions-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 0.65rem;
  padding-bottom: calc(0.35rem + var(--safe-bottom));
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: linear-gradient(to top, var(--card-bg) 78%, transparent);
}

.prediction-card.swiping {
  transition: none;
  cursor: grabbing;
}

.prediction-card.snap-back {
  transition: transform 0.3s var(--ease-spring), opacity 0.28s var(--ease-out);
}

.prediction-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    125deg,
    transparent 40%,
    rgba(99, 102, 241, 0.06) 50%,
    transparent 60%
  );
  background-size: 200% 200%;
  animation: cardShimmer 6s ease-in-out infinite;
  pointer-events: none;
  opacity: 0.7;
}

html[data-theme="light"] .prediction-card::before {
  background: linear-gradient(
    125deg,
    transparent 40%,
    rgba(99, 102, 241, 0.04) 50%,
    transparent 60%
  );
}

.prediction-card.enter {
  animation: cardEnter var(--dur-slow) var(--ease-out) both;
}

.prediction-card.enter-from-left {
  animation: cardEnterFromLeft var(--dur-slow) var(--ease-out) both;
}

.prediction-card.enter-from-right {
  animation: cardEnterFromRight var(--dur-slow) var(--ease-out) both;
}

.prediction-card.exit-left {
  animation: cardExitLeft var(--dur-med) var(--ease-out) forwards;
  pointer-events: none;
}

.prediction-card.exit-right {
  animation: cardExitRight var(--dur-med) var(--ease-out) forwards;
  pointer-events: none;
}

.prediction-card .card-meta-row { animation: staggerIn var(--dur-med) var(--ease-out) 0.04s both; }
.prediction-card .card-question { animation: staggerIn var(--dur-med) var(--ease-out) 0.1s both; }
.prediction-card .vs-row { animation: staggerIn var(--dur-med) var(--ease-out) 0.16s both; }
.prediction-card .participants-row { animation: staggerIn var(--dur-med) var(--ease-out) 0.22s both; }
.prediction-card .bet-row { animation: staggerIn var(--dur-med) var(--ease-out) 0.28s both; }
.prediction-card .card-chart-wrap { animation: staggerIn var(--dur-med) var(--ease-out) 0.24s both; }
.prediction-card .card-powered { animation: staggerIn var(--dur-med) var(--ease-out) 0.34s both; }

.card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.card-category {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.card-volume {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--green);
  background: rgba(0, 230, 118, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  white-space: nowrap;
}

html[data-theme="light"] .card-volume {
  background: rgba(0, 180, 90, 0.1);
}

.card-question {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.35;
}

/* VS layout */
.vs-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.vs-side {
  flex: 1;
  text-align: center;
  padding: 0.75rem 0.5rem;
  border-radius: 14px;
  border: 2px solid transparent;
  background: var(--surface2);
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-out);
}

.vs-side::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(
    var(--side-angle, 135deg),
    transparent 30%,
    var(--side-accent, var(--accent-dim)) 50%,
    transparent 70%
  );
  background-size: 250% 250%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  animation: sideBorderSweep 4s ease-in-out infinite;
  pointer-events: none;
}

.vs-side.green {
  border-color: var(--green);
  box-shadow: 0 0 0 0 var(--glow-green);
  --side-accent: var(--green);
  animation: sideBreatheGreen 3.5s ease-in-out infinite;
}

.vs-side.green::after { opacity: 0.55; }

.vs-side.orange {
  border-color: var(--orange);
  box-shadow: 0 0 0 0 var(--glow-orange);
  --side-accent: var(--orange);
  animation: sideBreatheOrange 3.5s ease-in-out infinite 0.6s;
}

.vs-side.orange::after { opacity: 0.55; }

.vs-side.neutral {
  border-color: var(--border);
}

.vs-side-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  margin: 0 auto 0.35rem;
  object-fit: cover;
  background: var(--surface);
}

.vs-side-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.vs-side.green .vs-side-label { color: var(--green); }
.vs-side.orange .vs-side-label { color: var(--orange); }

.vs-side-pct {
  font-size: 1.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  display: block;
}

.vs-side-cents {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-top: 0.15rem;
}

.vs-draw-col {
  text-align: center;
  min-width: 3.5rem;
}

.vs-draw-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.vs-draw-pct {
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.vs-draw-cents {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.card-chart-wrap {
  width: 100%;
  height: 72px;
  margin: 0.5rem 0 0.75rem;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.card-chart-wrap.card-chart-dual {
  height: 84px;
}

.card-chart {
  display: block;
  width: 100%;
  height: 72px;
}

.countdown-chip {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.countdown-chip.finished {
  color: var(--muted);
}

.event-result-banner {
  position: fixed;
  bottom: calc(3.6rem + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 1.5rem);
  max-width: 456px;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  z-index: 110;
  box-shadow: var(--shadow);
  animation: bannerSlideUp 0.45s var(--ease-out) both;
}

.event-result-banner.won {
  background: rgba(0, 230, 118, 0.92);
  color: #003314;
  border: 1px solid var(--green);
  animation: bannerSlideUp 0.45s var(--ease-out) both, victoryPulse 1.2s ease-in-out 0.3s 2;
}

.event-result-banner.lost {
  background: rgba(255, 82, 82, 0.9);
  color: #fff;
  border: 1px solid #ff5252;
  animation: bannerSlideUp 0.45s var(--ease-out) both, defeatShake 0.5s ease-in-out 0.2s 2;
}

.event-result-banner.finished,
.event-result-banner.open {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.event-result-banner.hidden {
  display: none;
}

@keyframes bannerSlideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(1rem); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes victoryPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.5); }
  50% { box-shadow: 0 0 24px 8px rgba(0, 230, 118, 0.35); }
}

@keyframes defeatShake {
  0%, 100% { transform: translateX(-50%) translateX(0); }
  20% { transform: translateX(-50%) translateX(-6px); }
  40% { transform: translateX(-50%) translateX(6px); }
  60% { transform: translateX(-50%) translateX(-4px); }
  80% { transform: translateX(-50%) translateX(4px); }
}

.vs-side-pct.counting {
  animation: pctPop 0.4s var(--ease-spring) both;
}

.vs-center {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.vs-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--accent), var(--orange));
  background-size: 200% 200%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: #000;
  position: relative;
  animation: vsGradientShift 4s ease-in-out infinite, vsBadgePulse 2.8s ease-in-out infinite;
}

.vs-badge::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent-dim);
  border-bottom-color: var(--green);
  opacity: 0.5;
  animation: vsRingSpin 6s linear infinite;
}

.vs-draw {
  font-size: 0.6rem;
  color: var(--muted);
  text-align: center;
  max-width: 48px;
}

.participants-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.participant-bars {
  display: flex;
  gap: 2px;
  flex: 1;
}

.participant-bar {
  height: 8px;
  border-radius: 2px;
  flex: 1;
  transform-origin: left center;
  animation: barGrow var(--dur-med) var(--ease-out) both;
}

.participant-bar:nth-child(1) { animation-delay: 0.24s; }
.participant-bar:nth-child(2) { animation-delay: 0.27s; }
.participant-bar:nth-child(3) { animation-delay: 0.3s; }
.participant-bar:nth-child(4) { animation-delay: 0.33s; }
.participant-bar:nth-child(5) { animation-delay: 0.36s; }
.participant-bar:nth-child(6) { animation-delay: 0.39s; }
.participant-bar:nth-child(7) { animation-delay: 0.42s; }
.participant-bar:nth-child(8) { animation-delay: 0.45s; }
.participant-bar:nth-child(9) { animation-delay: 0.48s; }
.participant-bar:nth-child(10) { animation-delay: 0.51s; }
.participant-bar:nth-child(11) { animation-delay: 0.54s; }
.participant-bar:nth-child(12) { animation-delay: 0.57s; }

.participant-bar.g { background: var(--green); }
.participant-bar.o { background: var(--orange); }
.participant-bar.n { background: var(--border); }

/* Bet buttons */
.bet-row {
  display: flex;
  gap: 0.5rem;
}

.bet-btn {
  flex: 1;
  padding: 0.75rem 0.5rem;
  border: none;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  color: #000;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}

.bet-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.35) 0%, transparent 65%);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.35s, transform 0.35s var(--ease-out);
  pointer-events: none;
}

.bet-btn.pressed::after {
  opacity: 1;
  transform: scale(1.8);
  transition: opacity 0.15s, transform 0.45s var(--ease-out);
}

.bet-btn:active {
  transform: scale(0.94);
}

.bet-btn.green {
  background: var(--green);
  box-shadow: 0 4px 14px var(--glow-green);
}

.bet-btn.green:active {
  box-shadow: 0 2px 8px var(--glow-green), inset 0 0 0 2px rgba(255,255,255,0.25);
}

.bet-btn.orange {
  background: var(--orange);
  box-shadow: 0 4px 14px var(--glow-orange);
}

.bet-btn.orange:active {
  box-shadow: 0 2px 8px var(--glow-orange), inset 0 0 0 2px rgba(255,255,255,0.25);
}

.bet-btn.neutral {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.bet-btn.neutral:active {
  border-color: var(--accent-dim);
  box-shadow: inset 0 0 0 1px var(--glow-accent);
}

.card-powered {
  text-align: right;
  font-size: 0.6rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.card-powered strong { color: var(--text); }

.deck-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.deck-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-spring), border-color var(--dur-fast), color var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}

.deck-btn:active {
  transform: scale(0.85);
}

.deck-btn.next:active {
  border-color: var(--accent-dim);
  color: var(--accent-dim);
}

.deck-btn.skip:active {
  border-color: var(--orange);
  color: var(--orange);
}

.deck-btn.next {
  background: var(--surface);
  color: var(--text);
}

/* ── Leaderboard ── */
.my-rank-card {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.15), rgba(255, 107, 53, 0.1));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.my-rank-card .rank-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--green);
}

.leaderboard-list { display: flex; flex-direction: column; gap: 0.5rem; }

#view-leaderboard .leaderboard-metric-tabs.stat-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 3px;
  margin: 0 0 12px;
  gap: 0;
}

#view-leaderboard .leaderboard-metric-tabs .leaderboard-tab {
  padding: 8px 0;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
}

#view-leaderboard .leaderboard-metric-tabs .leaderboard-tab.on,
#view-leaderboard .leaderboard-metric-tabs .leaderboard-tab.active {
  background: #1e2b45;
  color: #fff;
}

html[data-theme="light"] #view-leaderboard .leaderboard-metric-tabs.stat-tabs {
  background: var(--card);
  border-color: var(--line);
}

html[data-theme="light"] #view-leaderboard .leaderboard-metric-tabs .leaderboard-tab {
  color: var(--muted);
  background: transparent;
}

html[data-theme="light"] #view-leaderboard .leaderboard-metric-tabs .leaderboard-tab.on,
html[data-theme="light"] #view-leaderboard .leaderboard-metric-tabs .leaderboard-tab.active {
  background: #e2e8f4;
  color: #1e293b;
}

#view-leaderboard .leader-sub {
  font-size: 0.72rem;
  opacity: 0.72;
  margin-top: 0.15rem;
  line-height: 1.25;
}
#view-leaderboard .pod-sub,
#view-leaderboard .rank-sub {
  font-size: 0.68rem;
  opacity: 0.7;
  margin-top: 0.2rem;
  line-height: 1.2;
  max-width: 11rem;
}
#view-leaderboard .lb-tab-info {
  margin-left: 0.15rem;
  font-size: 0.75em;
  vertical-align: baseline;
  opacity: 0.75;
}
#view-leaderboard .lb-tab-info:hover,
#view-leaderboard .lb-tab-info:focus {
  opacity: 1;
}
.user-stats-iq {
  margin-top: 0.35rem;
  font-weight: 700;
  font-size: 1.05rem;
}
.user-stats-iq-sub {
  font-size: 0.72rem;
  opacity: 0.7;
  margin-top: 0.15rem;
}
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

.leader-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  animation: staggerIn var(--dur-med) var(--ease-out) both;
}

.leader-rank {
  width: 28px;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.leader-rank.top { color: var(--green); }

.leader-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--green), var(--orange));
  color: #0a0a0a;
  font-weight: 800;
}

.leader-info { flex: 1; min-width: 0; }

.leader-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-meta { font-size: 0.75rem; color: var(--muted); }

.leader-pts {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--green);
}

/* ── Profile ── */
.profile-editor {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.profile-editor-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--green), var(--orange));
  color: #0a0a0a;
  font-size: 1.25rem;
  font-weight: 900;
}

.profile-editor-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  min-width: 0;
}

.profile-field span {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
}

.profile-field input,
#profile-display-name,
.pn-input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  box-sizing: border-box;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.3;
  outline: none;
}

.profile-field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(0, 230, 118, 0.12);
}

.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.avatar-pick {
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.avatar-pick img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-pick.active {
  border-color: var(--green);
  background: rgba(0, 230, 118, 0.12);
  box-shadow: 0 0 0 2px rgba(0, 230, 118, 0.12);
}

.avatar-pick-tg {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.avatar-pick-tg:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.profile-save-btn {
  width: 100%;
  margin-top: 0.15rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--green);
  border-radius: 10px;
  background: rgba(0, 230, 118, 0.1);
  color: var(--green);
  font-weight: 800;
  cursor: pointer;
}

.profile-notif-block {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.profile-notif-open-btn {
  margin: 0.75rem 0 1rem;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}
.profile-notif-open-icon {
  font-size: 1rem;
  line-height: 1;
}
.profile-notif-heading {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.15rem;
}
.profile-notif-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  user-select: none;
}

.profile-notif-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.profile-notif-title {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
}

.profile-notif-hint {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.25;
}

.profile-notif-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.profile-notif-track {
  position: relative;
  flex-shrink: 0;
  width: 2.6rem;
  height: 1.45rem;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.profile-notif-track::after {
  content: "";
  position: absolute;
  top: 0.12rem;
  left: 0.12rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.15s ease, background 0.15s ease;
}

.profile-notif-input:checked + .profile-notif-track {
  background: rgba(0, 230, 118, 0.22);
  border-color: var(--green);
}

.profile-notif-input:checked + .profile-notif-track::after {
  transform: translateX(1.1rem);
  background: var(--green);
}

.profile-notif-input:disabled + .profile-notif-track {
  opacity: 0.55;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  text-align: center;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.action-pill {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--green), var(--accent-dim));
  color: #000;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast);
}

.action-pill:active:not(:disabled) {
  transform: scale(0.97);
  box-shadow: 0 0 20px var(--glow-accent);
}

.action-pill:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.daily-bonus-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.daily-bonus-row .action-pill {
  flex: 1;
  margin-bottom: 0;
}

.daily-help-btn {
  flex-shrink: 0;
  width: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface, rgba(255, 255, 255, 0.04));
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast), border-color var(--dur-fast);
}

.daily-help-btn:active {
  transform: scale(0.96);
}

.daily-help-btn:hover,
.daily-help-btn:focus-visible {
  color: var(--text);
  border-color: var(--accent-dim, var(--accent));
  outline: none;
}

.daily-help-sheet .daily-help-lead {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.4;
}

.daily-help-schedule,
.daily-help-rules {
  margin: 0 0 0.85rem;
  padding-left: 1.15rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text);
}

.daily-help-schedule li,
.daily-help-rules li {
  margin-bottom: 0.28rem;
}

.daily-help-rules {
  color: var(--muted);
}

.profile-section h3 {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
}

.predictions-list { display: flex; flex-direction: column; gap: 0.5rem; }

.prediction-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
}

.prediction-item .title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.prediction-item .meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.prediction-item .status-open { color: var(--green); }
.prediction-item .status-won { color: var(--green); font-weight: 600; }
.prediction-item .status-lost { color: #ff5252; font-weight: 600; }

.prediction-item.status-won {
  border-color: rgba(0, 230, 118, 0.45);
  background: rgba(0, 230, 118, 0.08);
}

.prediction-item.status-lost {
  border-color: rgba(255, 82, 82, 0.45);
  background: rgba(255, 82, 82, 0.08);
}

.resolution-banner {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
}

.resolution-banner.won {
  background: rgba(0, 230, 118, 0.15);
  border: 1px solid rgba(0, 230, 118, 0.4);
  color: var(--green);
}

.resolution-banner.lost {
  background: rgba(255, 82, 82, 0.12);
  border: 1px solid rgba(255, 82, 82, 0.35);
  color: #ff5252;
}

.resolution-banner.open {
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.25);
  color: var(--text);
}

.resolution-banner.finished {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}

.detail-outcome-row.winner {
  background: rgba(0, 230, 118, 0.1);
  border-radius: 8px;
}

.powered-by {
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: min(1200px, 100%);
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  z-index: 200;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.55rem 0.25rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.65rem;
  cursor: pointer;
  transition: color var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}

.nav-item.active { color: var(--green); }

.nav-item.active .nav-icon {
  animation: navPop 0.45s var(--ease-spring);
}

.nav-icon {
  font-size: 1.2rem;
  transition: transform var(--dur-fast) var(--ease-out);
}

.nav-item:active .nav-icon {
  transform: scale(0.85);
}

/* ── Toast & modal ── */
.toast {
  position: fixed;
  bottom: calc(4.5rem + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  padding: 0.75rem 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.875rem;
  z-index: 200;
  box-shadow: var(--shadow);
  animation: toastIn 0.35s var(--ease-out) both;
}

.toast.hidden { display: none; }

.modal { position: fixed; inset: 0; z-index: 300; }
.modal.hidden { display: none; }

.modal:not(.hidden) .modal-backdrop {
  animation: fadeIn 0.25s ease both;
}

.modal:not(.hidden) .modal-sheet {
  animation: sheetUp var(--dur-med) var(--ease-out) both;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

html[data-theme="light"] .modal-backdrop {
  background: rgba(15, 23, 42, 0.35);
}

.modal-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 1.25rem;
  padding-bottom: calc(1.25rem + var(--safe-bottom));
  border-top: 1px solid var(--border);
}

.modal-sheet h3 { margin-bottom: 0.25rem; font-size: 1.1rem; }

.modal-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.modal-sheet-head h3 {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.modal-sheet-close {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.modal-sheet-close:active { opacity: 0.85; }
.notif-modal-sheet {
  max-height: min(85vh, 560px);
  overflow-y: auto;
}

.predict-outcome {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.predict-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.predict-stats .muted { color: var(--muted); font-size: 0.75rem; }

.field-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.stake-presets {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.stake-btn {
  flex: 1;
  padding: 0.45rem;
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}

.stake-btn:active {
  transform: scale(0.92);
}

.stake-btn.active {
  border-color: var(--accent);
  color: var(--accent-dim);
  animation: stakeFlash 0.35s var(--ease-out);
}

.modal-sheet input[type="number"] {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.modal-actions { display: flex; gap: 0.5rem; }

.btn {
  flex: 1;
  padding: 0.75rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out);
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--green);
  color: #000;
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.error-banner {
  background: rgba(255, 107, 53, 0.12);
  border: 1px solid var(--orange);
  color: var(--orange);
  padding: 0.75rem;
  border-radius: 12px;
  font-size: 0.875rem;
}

/* ── Keyframes ── */
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cardEnterFromLeft {
  from { opacity: 0; transform: translateX(-28px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes cardEnterFromRight {
  from { opacity: 0; transform: translateX(28px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes cardExitLeft {
  to { opacity: 0; transform: translateX(-105%) scale(0.92); }
}

@keyframes cardExitRight {
  to { opacity: 0; transform: translateX(105%) scale(0.92); }
}

@keyframes cardShimmer {
  0%, 100% { background-position: 200% 50%; }
  50% { background-position: -50% 50%; }
}

@keyframes staggerIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sideBreatheGreen {
  0%, 100% { box-shadow: 0 0 8px 0 var(--glow-green); }
  50% { box-shadow: 0 0 18px 2px var(--glow-green); }
}

@keyframes sideBreatheOrange {
  0%, 100% { box-shadow: 0 0 8px 0 var(--glow-orange); }
  50% { box-shadow: 0 0 18px 2px var(--glow-orange); }
}

@keyframes sideBorderSweep {
  0%, 100% { background-position: 0% 50%; opacity: 0.35; }
  50% { background-position: 100% 50%; opacity: 0.7; }
}

@keyframes vsGradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes vsBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes vsRingSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes barGrow {
  from { transform: scaleX(0); opacity: 0.4; }
  to { transform: scaleX(1); opacity: 1; }
}

@keyframes pctPop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes balanceBump {
  0% { transform: scale(1); border-color: var(--border); }
  35% { transform: scale(1.06); border-color: var(--accent-dim); box-shadow: 0 0 12px var(--glow-accent); }
  100% { transform: scale(1); border-color: var(--border); box-shadow: none; }
}

@keyframes navPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes stakeFlash {
  0% { box-shadow: 0 0 0 0 var(--glow-accent); }
  50% { box-shadow: 0 0 0 4px var(--glow-accent); }
  100% { box-shadow: none; }
}

/* ── Categories ── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  padding-bottom: 1rem;
}

.category-card[data-id="fast"] {
  border-color: rgba(255, 193, 7, 0.35);
  background: linear-gradient(145deg, var(--surface), rgba(255, 193, 7, 0.06));
}

.info-chip.fast-chip {
  color: #ffc107;
  border-color: rgba(255, 193, 7, 0.35);
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem 0.75rem;
  min-height: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: transform var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.category-card:active {
  transform: scale(0.96);
  border-color: var(--accent-dim);
  box-shadow: 0 4px 16px var(--glow-accent);
}

.cat-icon { font-size: 1.75rem; }
.cat-label { font-size: 0.9rem; font-weight: 600; text-align: center; }

/* ── Play toolbar ── */
.play-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.back-cat-btn {
  background: none;
  border: none;
  color: var(--accent-dim);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.25rem 0;
}

.active-category {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

/* ── Card extras ── */
.card-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.info-chip {
  font-size: 0.68rem;
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.vs-side-icon.placeholder {
  background: var(--surface);
}

.details-btn {
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}

.details-btn:active {
  background: var(--surface);
  border-color: var(--accent-dim);
}

.card-actions-footer .bet-row {
  margin-top: 0;
}

.card-actions-footer .details-btn {
  margin-top: 0.5rem;
}

.card-powered {
  margin-top: 0.35rem;
  padding-top: 0;
}

.bottom-nav.hidden { display: none; }

.view-overlay-with-nav {
  bottom: calc(3.35rem + var(--safe-bottom));
  padding-bottom: 0.75rem;
}

.overlay-close-btn {
  position: absolute;
  top: calc(0.65rem + var(--safe-top));
  left: 0.85rem;
  z-index: 5;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-sheet {
  position: relative;
  z-index: 2;
  padding: 2.5rem 0.75rem 1rem;
  text-align: center;
  animation: resultPopIn 0.45s var(--ease-out) both;
}

.result-sheet.won-sheet {
  animation: resultPopIn 0.45s var(--ease-out) both, victoryPulse 1.2s ease-in-out 0.35s 2;
}

.result-sheet.lost-sheet {
  animation: resultPopIn 0.45s var(--ease-out) both, defeatShake 0.45s ease-in-out 0.25s 2;
}

.result-autoclose {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0.75rem 0 1rem;
}

.celebration-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.celebration-layer.hidden { display: none; }

.fireworks-col {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  overflow: hidden;
}

.fireworks-left { left: 0; }
.fireworks-right { right: 0; }

.fireworks-col .spark {
  position: absolute;
  bottom: 15%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0;
  animation: fireworkBurst 1.4s ease-out forwards;
  box-shadow: 0 0 8px currentColor;
}

@keyframes fireworkBurst {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx, 0), var(--ty, -120px)) scale(0.2); }
}

.fireworks-left .spark:nth-child(odd) { --tx: 40px; --ty: -140px; }
.fireworks-left .spark:nth-child(even) { --tx: -20px; --ty: -100px; }
.fireworks-right .spark:nth-child(odd) { --tx: -40px; --ty: -130px; }
.fireworks-right .spark:nth-child(even) { --tx: 25px; --ty: -110px; }

@keyframes resultPopIn {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

#view-event-result.is-won::before {
  content: "🎺";
  position: absolute;
  top: calc(1.2rem + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
  z-index: 3;
  pointer-events: none;
  animation: fanfarePop 0.6s ease-out 0.15s both;
}

#view-event-result.is-lost::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(255, 82, 82, 0.22), transparent 65%);
  pointer-events: none;
  z-index: 1;
  animation: lossTintPulse 1.8s ease-in-out 2;
}

#view-event-result.is-lost .result-sheet {
  animation: resultPopIn 0.45s var(--ease-out) both, cardLossShake 0.55s ease-in-out 0.2s 3;
}

.loss-particle {
  position: absolute;
  top: -8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  opacity: 0;
  animation: lossFall 1.6s ease-in forwards;
  box-shadow: 0 0 6px currentColor;
}

@keyframes lossTintPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.85; }
}

@keyframes cardLossShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

@keyframes lossFall {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(110vh) scale(0.3); }
}

@keyframes fanfarePop {
  0% { opacity: 0; transform: translateX(-50%) scale(0.5); }
  60% { opacity: 1; transform: translateX(-50%) scale(1.15); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* ── Detail view ── */
.view-overlay {
  display: none;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background: var(--bg);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 1rem calc(5rem + var(--safe-bottom));
  padding-top: calc(0.75rem + var(--safe-top));
  max-width: min(1200px, 100%);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  pointer-events: auto;
}

.view-overlay.active {
  display: block;
  animation: overlayIn var(--dur-med) var(--ease-out) both;
}

@keyframes overlayIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-overlay.hidden { display: none !important; }

.detail-header {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.detail-img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.detail-cat {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.detail-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.35rem;
}

.detail-end {
  font-size: 0.75rem;
  color: var(--muted);
}

.detail-window-range {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.detail-tabs {
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.detail-tab {
  display: inline-block;
  padding: 0.5rem 0;
  margin-right: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-bottom: 2px solid var(--green);
  color: var(--green);
}

.detail-action-section {
  margin-top: 0.25rem;
}

.detail-action-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  padding: 0.2rem;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.detail-action-tab {
  flex: 1;
  padding: 0.55rem 0.45rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}

.detail-action-tab.active {
  background: var(--surface);
  color: var(--green);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.detail-action-panel {
  display: none;
}

.detail-action-panel.active {
  display: block;
}

.detail-bets-banner {
  margin-bottom: 0.65rem;
}

.detail-action-panel .position-panel {
  margin-bottom: 0;
}

.predict-outcome-picker {
  margin-bottom: 0.85rem;
}

.predict-outcome-picker.hidden {
  display: none;
}

.predict-outcome.hidden {
  display: none;
}

.predict-outcome-row {
  display: flex;
  gap: 0.5rem;
}

.predict-outcome-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.65rem 0.5rem;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  transition: transform var(--dur-fast), border-color var(--dur-fast), background var(--dur-fast);
}

.predict-outcome-btn:active {
  transform: scale(0.97);
}

.predict-outcome-btn.green.active {
  border-color: var(--green);
  background: rgba(0, 230, 118, 0.12);
  color: var(--green);
}

.predict-outcome-btn.orange.active {
  border-color: var(--orange);
  background: rgba(255, 107, 53, 0.12);
  color: var(--orange);
}

.predict-outcome-btn.neutral.active {
  border-color: var(--accent);
  background: rgba(120, 120, 255, 0.1);
}

.predict-outcome-name {
  font-size: 0.92rem;
  font-weight: 800;
}

.predict-outcome-cents {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.85;
}

.detail-chart {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.5rem;
  height: 140px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 0.25rem;
}

.chart-bar {
  width: 100%;
  max-width: 48px;
  border-radius: 6px 6px 2px 2px;
  min-height: 4px;
  animation: barGrow var(--dur-med) var(--ease-out) both;
}

.chart-bar.green { background: var(--green); }
.chart-bar.orange { background: var(--orange); }
.chart-bar.neutral { background: var(--border); }

.chart-bar-label {
  font-size: 0.6rem;
  color: var(--muted);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-bar-val {
  font-size: 0.7rem;
  font-weight: 700;
}

.detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.detail-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
}

.detail-stat-label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.detail-stat-val {
  font-size: 1rem;
  font-weight: 700;
}

.detail-stat-val.accent { color: var(--green); }

.detail-section {
  margin-bottom: 1rem;
}

.detail-section h4 {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
}

.detail-outcome-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.detail-outcome-row .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.detail-outcome-row .dot.green { background: var(--green); }
.detail-outcome-row .dot.orange { background: var(--orange); }
.detail-outcome-row .dot.neutral { background: var(--muted); }

.detail-outcome-row .name { flex: 1; font-weight: 600; font-size: 0.9rem; }
.detail-outcome-row .val { font-size: 0.85rem; color: var(--muted); }

.detail-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.detail-bet-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.detail-bet-row .bet-btn {
  flex: 1 1 calc(50% - 0.25rem);
  min-width: 0;
}

.detail-markets {
  list-style: none;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
}

.detail-markets li {
  padding: 0;
  border-bottom: none;
}

.related-market-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
  padding: 0.65rem 0.75rem;
}

.related-market-type {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.25rem;
}

.related-market-q {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 0.45rem;
}

.related-market-outcomes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.related-market-bet {
  flex: 1 1 calc(50% - 0.2rem);
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}

.related-market-bet:nth-child(1) {
  border-color: rgba(0, 230, 118, 0.35);
}

.related-market-bet:nth-child(2) {
  border-color: rgba(255, 145, 0, 0.4);
}

.related-market-bet:active {
  transform: scale(0.98);
}

.related-market-bet .pct {
  color: var(--muted);
  font-weight: 600;
}

.related-market-vol {
  margin-top: 0.35rem;
  font-size: 0.68rem;
  color: var(--muted);
}

.performance-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

.green-text { color: var(--green); font-weight: 700; }
.loss-text { color: var(--orange); font-weight: 700; }

/* ── Prediction detail modal ── */
.modal-sheet-tall { max-height: 85vh; overflow-y: auto; }

.pred-detail-body { margin-bottom: 1rem; }

.pred-detail-grid { display: flex; flex-direction: column; gap: 0.5rem; }

.pred-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.pred-detail-label { color: var(--muted); flex-shrink: 0; }
.pred-detail-value { font-weight: 600; text-align: right; word-break: break-word; }

.prediction-item.clickable {
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: none;
  font: inherit;
  color: inherit;
  transition: border-color var(--dur-fast);
}

.prediction-item.clickable:active {
  border-color: var(--accent-dim);
}

.btn.full-width { width: 100%; flex: none; }

.back-btn {
  background: none;
  border: none;
  color: var(--accent-dim);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  padding: 0.35rem 0;
  position: relative;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
}

.back-btn.sticky-back {
  position: sticky;
  top: 0;
  z-index: 12;
  background: var(--bg);
  padding: 0.35rem 0 0.5rem;
}

/* v5: fullscreen play, view modes, live */
.play-fullscreen { display: flex; flex-direction: column; min-height: 0; }
.header-compact .brand-row { display: none; }
.header-compact { padding-bottom: 0.25rem; }
.card-deck-full { flex: 1; min-height: 0; max-height: none; display: flex; flex-direction: column; }
.card-deck-full .prediction-card {
  flex: 1;
  min-height: 0;
  max-height: calc(100dvh - 11.5rem - var(--safe-top) - var(--safe-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.deck-controls { display: none !important; }

/* ── Side navigation (PC + touch) ── */
.scroll-strip-wrap {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}

.strip-nav-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}

.strip-nav-btn:disabled {
  opacity: 0.25;
  pointer-events: none;
}

.strip-nav-btn:not(:disabled):active {
  transform: scale(0.9);
  border-color: var(--green);
  color: var(--green);
}

.scroll-strip-wrap .category-chips-row {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  padding-bottom: 0.35rem;
}

.deck-shell {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
  touch-action: pan-y;
}

.deck-shell.is-loading .card-deck {
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.view-loader {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border-radius: 12px;
}

html[data-theme="light"] .view-loader {
  background: rgba(255, 255, 255, 0.62);
}

.view-loader.hidden {
  display: none !important;
}

.view-loader-inline {
  position: relative;
  inset: auto;
  min-height: 8rem;
  margin: 0.5rem 0 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.view-loader-spinner {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  border-top-color: var(--green);
  animation: viewLoaderSpin 0.7s linear infinite;
}

.view-loader-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

@keyframes viewLoaderSpin {
  to { transform: rotate(360deg); }
}

.detail-loader {
  min-height: 12rem;
}

.deck-shell.mode-cards {
  /* pan-y so vertical scroll works on the card; JS captures horizontal after axis lock */
  touch-action: pan-y;
  cursor: grab;
}

.deck-shell.mode-cards.dragging {
  cursor: grabbing;
}

.deck-indicators {
  position: absolute;
  left: 50%;
  bottom: calc(0.45rem + var(--safe-bottom) * 0.35);
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: auto;
}

html[data-theme="light"] .deck-indicators {
  background: rgba(255, 255, 255, 0.72);
}

.deck-indicators.hidden {
  display: none !important;
}

.deck-dot {
  appearance: none;
  border: none;
  padding: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.45;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast), width var(--dur-fast), background var(--dur-fast);
}

.deck-dot.edge {
  opacity: 0.28;
  transform: scale(0.75);
}

.deck-dot.active {
  width: 14px;
  border-radius: 4px;
  opacity: 1;
  background: var(--green);
}

.deck-shell.mode-cards .card-deck {
  padding-bottom: 1.35rem;
}

.deck-shell .card-deck {
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.card-deck-full > .tiles-grid,
.card-deck-full > .list-view {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.card-deck-full > .prediction-card {
  width: 100%;
}
.search-row { margin-bottom: 0.5rem; }

.search-field {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color var(--dur-fast);
}

.search-field:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(0, 230, 118, 0.12);
}

.search-field input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}

.search-field input::placeholder {
  color: var(--muted);
}

.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.75rem;
  padding: 0;
  border: none;
  border-left: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
  transition: color var(--dur-fast), background var(--dur-fast);
}

.search-btn:hover,
.search-btn:active {
  color: var(--green);
  background: rgba(0, 230, 118, 0.08);
}

.search-btn-icon {
  width: 1.05rem;
  height: 1.05rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.market-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.filter-select-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
}

.filter-select-row.single-col {
  grid-template-columns: auto minmax(0, 1fr);
}

.sports-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sports-filters.hidden {
  display: none;
}

.sports-time-chips,
.sports-activity-chips {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0;
  margin: 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  touch-action: pan-x;
}

.sports-time-chips.drag-scrolling,
.sports-activity-chips.drag-scrolling {
  cursor: grabbing;
  user-select: none;
}

.sports-time-chips.drag-scrolling .sports-chip,
.sports-activity-chips.drag-scrolling .sports-chip {
  /* Only disable while actually dragging (class added after move threshold). */
  pointer-events: none;
}

.sports-time-chips {
  cursor: default;
  overflow-x: visible;
}

.sports-time-chips::-webkit-scrollbar,
.sports-activity-chips::-webkit-scrollbar {
  display: none;
}

.sports-chip {
  flex-shrink: 0;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}

.sports-chip.active {
  border-color: var(--green);
  color: var(--green);
  background: rgba(0, 230, 118, 0.08);
}

.sports-chip:active {
  transform: scale(0.96);
}

.sports-chip[data-sports-time="live"].active {
  border-color: rgba(255, 82, 82, 0.55);
  color: #ff5252;
  background: rgba(255, 82, 82, 0.1);
}

.filter-select-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.filter-select {
  min-width: 0;
  width: 100%;
  padding: 0.42rem 1.8rem 0.42rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.filter-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(0, 230, 118, 0.12);
}

.filter-select option {
  background: var(--surface);
  color: var(--text);
}

@media (max-width: 360px) {
  .filter-select-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .game-header {
    padding: 0.35rem 0.65rem 0.25rem;
    padding-top: calc(0.35rem + var(--safe-top));
  }

  .header-top {
    gap: 0.35rem;
    margin-bottom: 0.3rem;
  }

  .avatar {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }

  .user-name { font-size: 0.72rem; }
  .user-level { font-size: 0.62rem; }

  .balance-chip {
    padding: 0.28rem 0.5rem;
    font-size: 0.78rem;
    border-radius: 16px;
  }

  .theme-toggle {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }

  .brand {
    font-size: 1.05rem;
  }

  .brand-row {
    gap: 0.45rem;
  }

  .tagline {
    font-size: 0.52rem;
    letter-spacing: 0.08em;
  }

  .main {
    padding: 0.35rem 0.65rem;
    padding-bottom: calc(4.15rem + var(--safe-bottom));
  }

  .card-deck-full .prediction-card {
    max-height: calc(100dvh - 9.75rem - var(--safe-top) - var(--safe-bottom));
    padding: 0.75rem;
    border-radius: 14px;
  }

  .prediction-card .card-question {
    font-size: 0.95rem;
  }

  .deck-indicators {
    bottom: 0.3rem;
    gap: 0.28rem;
    padding: 0.22rem 0.45rem;
  }

  .deck-dot {
    width: 5px;
    height: 5px;
  }

  .deck-dot.active {
    width: 12px;
  }

  .filter-select {
    font-size: 0.68rem;
    padding: 0.36rem 1.55rem 0.36rem 0.5rem;
  }

  .filter-select-label {
    font-size: 0.62rem;
  }

  .card-counter,
  .live-dot {
    font-size: 0.62rem;
  }

  .pm-trade-card {
    padding: 0.4rem 0.5rem 0.5rem;
    border-radius: 12px;
  }

  .pm-trade-tabs {
    gap: 0.75rem;
    margin-bottom: 0.35rem;
  }

  .pm-trade-tab {
    font-size: 0.76rem;
  }

  .pm-trade-btn {
    padding: 0.45rem 0.3rem;
    border-radius: 10px;
  }

  .pm-btn-label { font-size: 0.8rem; }
  .pm-btn-cents { font-size: 0.7rem; }

  .pm-presets {
    gap: 0.22rem;
  }

  .pm-preset-btn {
    padding: 0.35rem 0.15rem;
    font-size: 0.68rem;
  }

  .pm-balance-chip {
    font-size: 0.68rem;
  }

  .pm-market-card .pm-detail-chart {
    height: 150px;
    min-height: 150px;
    max-height: 150px;
  }

  .pm-market-card .pm-live-chart,
  .pm-market-card .pm-live-chart-host {
    height: 130px;
    min-height: 130px;
    max-height: 130px;
  }
}

@media (max-width: 320px) {
  .brand-row .tagline { display: none; }
  .balance-unit { display: none; }
  .user-level { display: none; }
  .main {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .game-header {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

.view-mode-row { display: none; }
.view-mode-btn { display: none; }
.filter-meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.live-dot { margin-left: 0; font-size: 0.65rem; color: var(--muted); }
.live-dot.pulse { color: var(--green); animation: livePulse 0.4s ease; }
.card-counter { font-size: 0.7rem; color: var(--muted); margin-left: 0; }
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  overflow-y: auto;
  padding-bottom: 1rem;
  scrollbar-width: thin;
}

@media (min-width: 768px) {
  .tiles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.tile-card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 0.5rem; text-align: left; color: inherit; cursor: pointer; display: flex; flex-direction: column; }
.tile-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.35rem;
  background: var(--surface2);
}
.tile-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-placeholder { width: 100%; height: 100%; background: var(--surface2); }
.tile-pct {
  position: absolute;
  bottom: 0.35rem;
  right: 0.35rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 800;
}
.tile-title { font-size: 0.75rem; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile-meta { font-size: 0.65rem; color: var(--muted); margin-top: 0.25rem; }
.list-view { display: flex; flex-direction: column; gap: 0.5rem; overflow-y: auto; padding-bottom: 0.5rem; }

.market-list-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.mlc-header {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  padding: 0.75rem 0.75rem 0.5rem;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.mlc-header:active { opacity: 0.85; }

.mlc-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface2);
}

.mlc-icon-ph { display: block; }

.mlc-title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}

.mlc-head-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mlc-window {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.68rem;
  color: var(--muted);
}

.mlc-window-k {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.mlc-window-sep { opacity: 0.5; }

.mlc-window-item { white-space: nowrap; }

.mlc-outcomes {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0 0.75rem;
}

.mlc-outcome {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.15rem 0.5rem;
  align-items: center;
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color var(--dur-fast), transform var(--dur-fast);
}

.mlc-outcome:active { transform: scale(0.98); }

.mlc-outcome.green { border-color: rgba(0, 230, 118, 0.35); }
.mlc-outcome.orange { border-color: rgba(255, 107, 53, 0.35); }
.mlc-outcome.neutral { border-color: var(--border); }

.mlc-bar-wrap {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}

.mlc-bar {
  display: block;
  height: 100%;
  border-radius: 2px;
  transition: width 0.35s var(--ease-out);
}

.mlc-outcome.green .mlc-bar { background: var(--green); }
.mlc-outcome.orange .mlc-bar { background: var(--orange); }
.mlc-outcome.neutral .mlc-bar { background: var(--muted); }

.mlc-name {
  font-size: 0.78rem;
  font-weight: 600;
}

.mlc-pct {
  font-size: 0.85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.mlc-outcome.green .mlc-pct { color: var(--green); }
.mlc-outcome.orange .mlc-pct { color: var(--orange); }

.mlc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem 0.65rem;
  font-size: 0.68rem;
  color: var(--muted);
}

.mlc-vol { font-weight: 600; }

.mlc-markets { margin-left: auto; }
.layout-hero .hero-img-wrap { height: 140px; border-radius: 12px; overflow: hidden; margin-bottom: 0.75rem; }
.layout-hero .hero-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.detail-chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0;
  position: relative;
  width: 100%;
  overflow: hidden;
}

.chart-embed-wrap {
  aspect-ratio: 1 / 1;
  min-height: 220px;
  max-height: min(72vw, 420px);
  padding: 0;
}

.polymarket-chart-iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.detail-chart-host,
.detail-chart-host .detail-chart-svg,
.detail-chart-svg,
.card-chart-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.card-chart-wrap {
  width: 100%;
  height: 72px;
  margin: 0.5rem 0 0.75rem;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.card-chart-wrap.card-chart-dual {
  height: 84px;
}

.card-chart-wrap .detail-chart-svg {
  height: 72px;
}

.card-chart-wrap.card-chart-dual .detail-chart-svg {
  height: 84px;
}

.chart-skeleton {
  position: absolute;
  inset: 0.5rem;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.chart-skeleton.hidden { display: none; }

.chart-panel { margin-bottom: 1rem; }

.chart-status {
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 0.35rem;
  text-align: right;
}
.detail-live-note { font-size: 0.7rem; color: var(--muted); text-align: center; margin-top: 1rem; }

/* ── Polymarket-style fast crypto detail (compact Signal-like) ── */
.pm-detail {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pm-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.pm-detail-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface2);
}

.pm-detail-icon.placeholder {
  border: 1px solid var(--border);
}

.pm-detail-header-text {
  flex: 1;
  min-width: 0;
}

.pm-detail-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.2;
}

.pm-detail-window {
  margin-top: 0.12rem;
  font-size: 0.68rem;
  color: var(--muted);
}

.pm-countdown {
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
  flex-shrink: 0;
  padding: 0.1rem 0.15rem;
}

.pm-cd-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 1.7rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #ef5350;
}

.pm-cd-sep {
  color: #ef5350;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0 0.05rem;
}

.pm-cd-val {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pm-cd-label {
  margin-top: 0.08rem;
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.85;
  text-transform: lowercase;
  color: var(--muted);
}

.pm-price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  padding: 0.35rem 0 0.2rem;
  flex-shrink: 0;
}

.pm-price-col {
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
}

.pm-price-label {
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.pm-price-val {
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.pm-spot-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pm-price-current .pm-spot-val {
  color: var(--text);
  font-size: 1.2rem;
}

.pm-spot-delta {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
}

.pm-spot-delta.hidden { display: none; }
.pm-spot-delta.positive { color: var(--green); }
.pm-spot-delta.negative { color: #ef5350; }

.pm-detail-chart {
  width: 100%;
  height: 180px;
  min-height: 180px;
  max-height: 180px;
  border-radius: 12px;
  overflow: hidden;
  border: none;
  background: transparent;
}

.pm-live-chart {
  position: relative;
  width: 100%;
  height: 160px;
  min-height: 160px;
  max-height: 160px;
  border-radius: 12px;
  overflow: hidden;
  /* Force Signal-dark chart well (even in light app theme) */
  background: #0e0e0e;
  border: 1px solid #242424;
}

.pm-live-chart-host {
  width: 100%;
  height: 160px;
  background: #0e0e0e;
}

.pm-live-chart-host a#tv-attr-logo,
.pm-live-chart-host a[href*="tradingview.com"] {
  display: none !important;
}

.pm-live-overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.pm-live-strike,
.pm-live-price-line {
  position: absolute;
  left: 0;
  right: 46px;
  top: 0;
  height: 0;
  will-change: transform;
}

.pm-live-strike::before {
  content: "";
  position: absolute;
  left: 0;
  right: 18px;
  top: 0;
  border-top: 1px dashed rgba(160, 160, 160, 0.7);
}

.pm-live-strike-label {
  position: absolute;
  left: 8px;
  top: -15px;
  font-size: 0.64rem;
  font-weight: 700;
  color: rgba(220, 220, 220, 0.88);
  letter-spacing: 0.01em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.pm-live-strike-target {
  position: absolute;
  right: 0;
  top: -7px;
  width: 14px;
  height: 14px;
  color: rgba(210, 210, 210, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pm-live-strike-target svg {
  display: block;
}

.pm-live-price-line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  border-top: 1px dashed rgba(245, 247, 250, 0.55);
}

.pm-live-dot {
  position: absolute;
  right: -4px;
  top: -5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.18),
    0 0 10px 3px rgba(255, 255, 255, 0.35);
  animation: pmLiveDotPulse 1.6s ease-in-out infinite;
}

@keyframes pmLiveDotPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18), 0 0 10px 3px rgba(255, 255, 255, 0.32); }
  50% { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12), 0 0 14px 5px rgba(255, 255, 255, 0.45); }
}

.pm-live-badge {
  position: absolute;
  right: 12px;
  top: -12px;
  padding: 0.16rem 0.42rem;
  border-radius: 5px;
  background: rgba(18, 18, 18, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: #f5f7fa;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.12);
}

.pm-live-deltas {
  position: absolute;
  left: 8px;
  top: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  max-width: 42%;
  z-index: 3;
}

.pm-live-delta-chip {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.08rem 0.28rem;
  border-radius: 4px;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.45);
  animation: pmDeltaIn 0.28s var(--ease-out);
}

.pm-live-delta-chip.positive { color: #00e676; }
.pm-live-delta-chip.negative { color: #ff5252; }

@keyframes pmDeltaIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.pm-live-strike.hidden,
.pm-live-price-line.hidden {
  display: none;
}

.pm-live-chart .pm-chart-mode-toggle {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 2px;
  border-radius: 8px;
  background: rgba(20, 20, 20, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: auto;
}

.pm-chart-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(200, 200, 200, 0.55);
  cursor: pointer;
  transition: color var(--dur-fast), background var(--dur-fast);
}

.pm-chart-icon-btn svg {
  display: block;
}

.pm-chart-icon-btn.active {
  color: #f2f4f7;
  background: rgba(255, 255, 255, 0.1);
}

.pm-chart-icon-btn:active {
  transform: scale(0.96);
}

.pm-grapher-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.pm-detail-chart .polymarket-chart-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.pm-position-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.pm-pos-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.pm-pos-outcome {
  font-size: 0.82rem;
  font-weight: 700;
}

.pm-pos-meta {
  font-size: 0.68rem;
  color: var(--muted);
}

.pm-pos-side {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.pm-pos-pnl {
  font-size: 0.78rem;
  font-weight: 700;
}

.pm-pos-sell {
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.pm-trade-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.pm-trade-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.4rem;
  border-radius: 12px;
  border: none;
  font-weight: 800;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast);
}

.pm-trade-btn:active { transform: scale(0.98); }

.pm-up-btn {
  background: var(--green);
  color: #0a0a0a;
}

.pm-down-btn {
  background: #3a3a3a;
  color: var(--text);
}

html[data-theme="light"] .pm-down-btn {
  background: #e8e8e8;
  color: #1a1a1a;
}

.pm-btn-label {
  font-size: 0.88rem;
}

.pm-btn-cents {
  font-size: 0.78rem;
  opacity: 0.85;
  font-weight: 700;
}

.pm-preset-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pm-preset-label {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
}

.pm-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
}

.pm-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  min-height: 2.2rem;
  padding: 0.35rem 0.2rem;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 0.68rem;
}

html[data-theme="light"] .pm-preset-btn {
  background: rgba(0, 0, 0, 0.05);
}

.pm-preset-btn:active {
  outline: 1px solid var(--green);
}

.pm-preset-stake {
  font-weight: 700;
  font-size: 0.8rem;
}

.pm-preset-win {
  color: var(--green);
  font-weight: 700;
  font-size: 0.56rem;
}

/* Single-column detail: chart then trade, no overlap */
#view-detail.pm-detail-layout {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
}

#view-detail.pm-detail-layout .detail-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pm-detail.pm-signal {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pm-detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: block;
  padding: 0.1rem 0 1rem;
}

.pm-viewport {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  /* natural height — do NOT force 100% or flex-shrink chart under trade */
  min-height: 0;
}

.pm-market-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.7rem 0.75rem 0.55rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  flex: none;
  position: relative;
  z-index: 1;
}

.pm-market-card .pm-chart-panel {
  display: flex;
  flex-direction: column;
  margin-top: 0.15rem;
  flex: none;
  height: auto;
  gap: 0;
}

.pm-market-card .pm-detail-chart {
  flex: none;
  height: 180px;
  min-height: 180px;
  max-height: 180px;
}

.pm-market-card .pm-live-chart,
.pm-market-card .pm-live-chart-host {
  flex: none;
  height: 160px;
  min-height: 160px;
  max-height: 160px;
}

.pm-trade-card {
  flex: none;
  position: relative;
  z-index: 2;
  padding: 0.55rem 0.7rem 0.65rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.pm-trade-panel {
  display: none;
}

.pm-trade-panel.active {
  display: block;
}

.pm-scroll-hint {
  flex-shrink: 0;
  text-align: center;
  font-size: 0.66rem;
  color: var(--muted);
  padding: 0.05rem 0;
  opacity: 0.75;
}

.pm-below-fold {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem 0 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: 0.45rem;
  content-visibility: auto;
  contain-intrinsic-size: auto 240px;
}

.pm-trade-tabs {
  display: flex;
  gap: 1.1rem;
  margin-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}

.pm-trade-tab {
  appearance: none;
  background: none;
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  padding: 0 0 0.35rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}

.pm-trade-tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

.pm-trade-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0.4rem 0 0.3rem;
}

.pm-balance-chip {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
}

.pm-sell-summary {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.pm-sell-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.pm-sell-row span { color: var(--muted); }
.pm-sell-row strong { font-weight: 700; }

.pm-sell-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  /* list grows with page scroll — no nested clip that hides bets */
  max-height: none;
  overflow: visible;
}

.pm-sell-item {
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2, rgba(255,255,255,0.03));
}

.pm-sell-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
}

.pm-sell-item-time {
  color: var(--muted);
  font-size: 0.68rem;
}

.pm-sell-main-btn {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: none;
  border-radius: 10px;
  background: #ef5350;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  margin-top: 0.35rem;
}

.pm-sell-main-btn:active { transform: scale(0.98); }

.position-bet-item {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.position-bet-item:last-child {
  border-bottom: none;
}

.pm-detail-finished .pm-market-card {
  flex: 1 1 auto;
}

.pm-detail-finished .pm-detail-chart {
  min-height: 180px;
}

.pm-trade-btn.active {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: -2px;
}

.pm-up-btn.active {
  box-shadow: 0 0 0 2px rgba(0, 230, 118, 0.45);
}

.pm-down-btn.active {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.pm-chart-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pm-info-card {
  padding: 0.75rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.pm-info-head,
.detail-rules-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.pm-info-head .pm-info-title,
.detail-rules-head h4 {
  margin: 0;
}

.desc-translate-btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.desc-translate-btn:active { transform: scale(0.98); }
.desc-translate-btn:disabled,
.desc-translate-btn.is-done {
  opacity: 0.7;
  cursor: default;
}

.stat-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}

.stat-info-btn:active { color: var(--text); }

/* Stat-info sheet: fixed head + OK; only body scrolls */
#stat-info-modal .modal-sheet {
  display: flex;
  flex-direction: column;
  max-height: min(85dvh, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
  overflow: hidden;
}

#stat-info-modal .modal-sheet-head,
#stat-info-modal .modal-actions {
  flex-shrink: 0;
}

.stat-info-body {
  margin: 0.35rem 0 1rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-line;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.top-markets-title .stat-info-btn {
  margin-left: 0.35rem;
}

.pm-info-title {
  margin: 0 0 0.45rem;
  font-size: 0.86rem;
  font-weight: 800;
}

.pm-info-desc {
  margin: 0;
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.45;
}

.pm-info-outcomes {
  margin-top: 0.6rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.pm-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.pm-info-row {
  min-width: 0;
  padding: 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
}

.pm-info-row span {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.66rem;
}

.pm-info-row strong {
  display: block;
  color: var(--text);
  font-size: 0.75rem;
  line-height: 1.25;
  word-break: break-word;
}

.pm-chart-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

.pm-chart-variant-btn {
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}

.pm-chart-variant-btn.active {
  border-color: #2e7cf6;
  color: #2e7cf6;
  background: rgba(46, 124, 246, 0.12);
}

.pm-chart-variant-btn:active {
  transform: scale(0.97);
}

.pm-grapher-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.pm-grapher-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.pm-chart-embed-wrap.hidden,
.pm-grapher-wrap.hidden,
.pm-live-activity-wrap.hidden {
  display: none !important;
}

.pm-chart-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
}

.pm-live-activity-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.pm-toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: #3a3a3a;
  transition: background var(--dur-fast);
}

.pm-toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--dur-fast) var(--ease-out);
}

.pm-live-activity-input:checked + .pm-toggle-track {
  background: #2e7cf6;
}

.pm-live-activity-input:checked + .pm-toggle-track::after {
  transform: translateX(16px);
}

.pm-toggle-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.ai-advice-section { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0.75rem; margin-top: 0.5rem; }
.ai-advice-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.ai-advice-header h4 { margin: 0; font-size: 0.9rem; }
.ai-advice-btn { padding: 0.35rem 0.65rem; border-radius: 8px; border: 1px solid var(--green); background: transparent; color: var(--green); font-size: 0.72rem; font-weight: 700; cursor: pointer; }
.ai-advice-body { font-size: 0.82rem; line-height: 1.45; }
.ai-advice-probs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.5rem; }
.ai-prob-chip { padding: 0.25rem 0.5rem; border-radius: 6px; background: var(--surface2); font-size: 0.72rem; font-weight: 700; }
.ai-prob-chip.model { color: var(--accent-dim); border: 1px solid var(--accent-dim); background: transparent; }
.ai-edge { font-size: 0.75rem; color: var(--green); font-weight: 600; margin-bottom: 0.35rem; }
.ai-rec { margin: 0; }
.ai-cached-note { font-size: 0.65rem; color: var(--muted); margin-top: 0.35rem; }
.loading-state.small, .error-banner.small { padding: 0.5rem; font-size: 0.8rem; }
.info-chip.live-score { color: #ff5252; font-weight: 700; border-color: rgba(255, 82, 82, 0.35); }
@keyframes livePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ── Category chips (home 01) ── */
.category-chips-row,
.category-chips {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.25rem 0 0.65rem;
  margin-bottom: 0.25rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.category-chips::-webkit-scrollbar { display: none; }
.category-chip {
  flex-shrink: 0;
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}
.category-chip.active {
  border-color: var(--green);
  color: var(--green);
  background: rgba(0, 230, 118, 0.08);
}
.category-chip:active { transform: scale(0.96); }

/* ── Skeleton loading ── */
.skeleton-card { padding: 1rem; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  margin-bottom: 0.65rem;
}
.skeleton-line.short { width: 60%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Flow screens (stake, confirm, sell) ── */
.flow-screen { padding: 0.5rem 0 1.5rem; }
.flow-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 0.35rem; }
.flow-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }
.stake-price-row { display: flex; gap: 1rem; margin-bottom: 1.25rem; }
.stake-stat { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; }
.stake-stat strong { font-size: 1.1rem; }
.stake-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}
.stake-balance-note { font-size: 0.75rem; color: var(--muted); text-align: center; margin-bottom: 1.25rem; }
.stake-submit { margin-top: 0.5rem; }
.balance-chip { cursor: pointer; border: none; font: inherit; color: inherit; }
.balance-chip:active { border-color: var(--green); box-shadow: 0 0 0 2px var(--glow-green); }

.confirm-screen { text-align: center; padding-top: 2rem; }
.confirm-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; font-weight: 800; margin: 0 auto 1rem;
  background: var(--surface2); border: 2px solid var(--border);
}
.confirm-icon.success { background: rgba(0, 230, 118, 0.15); border-color: var(--green); color: var(--green); }
.confirm-icon.loss { background: rgba(255, 107, 53, 0.15); border-color: var(--orange); color: var(--orange); }
.confirm-grid { text-align: left; margin: 1.25rem 0 1.5rem; }
.confirm-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.65rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem;
}
.confirm-row span:first-child { color: var(--muted); }

/* ── Position panel (07–08) ── */
.position-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem;
  margin-bottom: 1rem;
}
.position-panel.open { border-color: var(--green); box-shadow: 0 0 0 1px rgba(0, 230, 118, 0.15); }
.position-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.65rem; }
.position-header h4 { font-size: 0.85rem; margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.position-status { font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 6px; background: rgba(0, 230, 118, 0.12); color: var(--green); }
.position-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 0.75rem; }
.position-stat { font-size: 0.78rem; }
.position-stat .label { color: var(--muted); display: block; margin-bottom: 0.15rem; }
.position-stat .val { font-weight: 700; font-size: 0.95rem; }
.position-stat .val.positive { color: var(--green); }
.position-stat .val.negative { color: var(--orange); }
.position-actions { display: flex; gap: 0.5rem; }
.position-actions .btn { flex: 1; padding: 0.65rem; font-size: 0.85rem; }

/* ── Sell screen ── */
.sell-value-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1rem;
}
.sell-value-label { font-size: 0.75rem; color: var(--muted); margin-bottom: 0.35rem; }
.sell-value-amount { font-size: 2rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.sell-pnl { font-size: 0.95rem; font-weight: 700; margin-top: 0.35rem; }
.sell-pnl.positive { color: var(--green); }
.sell-pnl.negative { color: var(--orange); }
.sell-info-row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 0.45rem 0; border-bottom: 1px solid var(--border); }
.sell-note { font-size: 0.72rem; color: var(--muted); text-align: center; margin: 1rem 0; }

/* ── Wallet (11) ── */
.wallet-balance-card {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.12), rgba(255, 107, 53, 0.08));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1rem;
}
.wallet-balance-label { font-size: 0.75rem; color: var(--muted); }
.wallet-balance-value { font-size: 1.75rem; font-weight: 900; margin-top: 0.25rem; }
.wallet-list { display: flex; flex-direction: column; gap: 0.35rem; max-height: calc(100dvh - 280px); overflow-y: auto; }
.wallet-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem;
  padding: 0.75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.wallet-row-main { flex: 1; min-width: 0; }
.wallet-row-desc { font-size: 0.82rem; font-weight: 600; }
.wallet-row-date { font-size: 0.68rem; color: var(--muted); margin-top: 0.15rem; }
.wallet-row-amt { font-weight: 800; font-size: 0.9rem; white-space: nowrap; }
.wallet-row-amt.positive { color: var(--green); }
.wallet-row-amt.negative { color: var(--orange); }

/* ── Profile (12) ── */
.profile-stats-main { grid-template-columns: repeat(3, 1fr); }
.stat-box.highlight .stat-value { color: var(--green); }
.profile-tabs { display: flex; gap: 0.35rem; margin: 1rem 0 0.75rem; }
.profile-tab {
  flex: 1; padding: 0.55rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--muted); font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.profile-tab.active { border-color: var(--green); color: var(--green); background: rgba(0, 230, 118, 0.08); }
.profile-footer { margin-top: 1.5rem; padding: 1rem 0 0.5rem; text-align: center; font-size: 0.72rem; }
.footer-link { color: var(--muted); text-decoration: none; }
.footer-link:active { color: var(--green); }
.footer-sep { color: var(--border); margin: 0 0.35rem; }
.status-sold { color: var(--accent-dim); }

/* v10 PredictGame flows */
.brand-latin .brand-a, .brand-latin .brand-b { letter-spacing: 0.04em; }
.balance-chip.clickable { cursor: pointer; }
.balance-chip.clickable:active { opacity: 0.85; }
.category-chip-all { border-style: dashed; }
.skeleton-deck { padding: 0.5rem 0; }
.skeleton-deck.hidden { display: none; }
.skeleton-deck .skeleton-card { height: 280px; background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 16px; }
.stake-btn.active { border-color: var(--green); color: var(--green); background: rgba(0, 230, 118, 0.1); font-weight: 700; }
.positive { color: var(--green); font-weight: 700; }
.negative { color: var(--orange); font-weight: 700; }
.confirm-sheet { padding: 1.5rem 0.5rem; text-align: center; }
.confirm-body { text-align: left; margin: 1rem 0 1.25rem; }
.confirm-icon.sell { background: rgba(255, 107, 53, 0.12); border-color: var(--orange); color: var(--orange); }
.position-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.5rem; }
.position-row { display: flex; justify-content: space-between; padding: 0.4rem 0; font-size: 0.88rem; border-bottom: 1px solid var(--border); }
.position-row.highlight strong { font-size: 1rem; }
.position-panel.sold { border-color: var(--accent-dim); }
.sell-preview { margin: 0.75rem 0; }
.sell-row { display: flex; justify-content: space-between; padding: 0.5rem 0; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
.profile-stats-v2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 0.75rem; }
.referral-open-btn { margin: 0.5rem 0 1rem; width: 100%; }
.referral-tabs { margin: 0.35rem 0 0.85rem; }
.referral-tab-panel.hidden { display: none; }
.referral-overlay-card {
  margin: 0.25rem 0 1rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface, rgba(255,255,255,0.03));
}
.referral-title { font-weight: 700; font-size: 0.92rem; margin-bottom: 0.25rem; }
.referral-rules {
  margin: 0.4rem 0 0.85rem;
  padding-left: 1.1rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}
.referral-rules li { margin-bottom: 0.25rem; }
.referral-rules strong { color: var(--text); font-weight: 700; }
.referral-hint { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.7rem; line-height: 1.35; }
.referral-link-row { display: flex; gap: 0.5rem; align-items: stretch; }
.referral-link-row input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg, rgba(0,0,0,0.2));
  color: var(--text);
  font-size: 0.75rem;
}
.referral-link-row .profile-save-btn { flex-shrink: 0; width: auto; margin: 0; padding: 0.55rem 0.75rem; font-size: 0.78rem; }
.referral-meta { margin-top: 0.55rem; font-size: 0.75rem; color: var(--muted); }
.referral-claim-box {
  margin-top: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: rgba(46, 204, 113, 0.12);
  border: 1px solid rgba(46, 204, 113, 0.35);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  justify-content: space-between;
}
.referral-claim-box.hidden { display: none; }
.referral-claim-text { font-size: 0.8rem; line-height: 1.35; flex: 1; }
.referral-claim-btn { flex-shrink: 0; padding: 0.45rem 0.85rem; font-size: 0.82rem; }
.referral-invitees-list { max-height: min(280px, calc(100dvh - 380px)); margin-bottom: 0.75rem; }
.referral-invitee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.15rem;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}
.referral-invitee-name { font-size: 0.85rem; font-weight: 600; }
.referral-invitee-meta { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; }
.referral-invitee-status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}
.referral-invitee-status.pending { background: rgba(241, 196, 15, 0.15); color: #f1c40f; }
.referral-invitee-status.claimable { background: rgba(46, 204, 113, 0.18); color: #2ecc71; }
.referral-invitee-status.rewarded { background: rgba(52, 152, 219, 0.18); color: #3498db; }
.referral-invitee-status.forfeited { background: rgba(149, 165, 166, 0.2); color: #95a5a6; }
.referral-history-title {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0.25rem 0 0.55rem;
}
.referral-history-list { max-height: min(420px, calc(100dvh - 220px)); }
.profile-footer { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); text-align: center; font-size: 0.72rem; color: var(--muted); }
.profile-footer a { color: var(--muted); text-decoration: none; }
.profile-footer a:active { color: var(--green); }
.footer-dot { margin: 0 0.35rem; }
.wallet-type { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; }
.wallet-desc { font-size: 0.82rem; font-weight: 600; margin-top: 0.15rem; }
.wallet-flow { font-size: 0.68rem; color: var(--muted); margin-top: 0.2rem; }
.wallet-amount { font-weight: 800; white-space: nowrap; }
.wallet-date { font-size: 0.65rem; color: var(--muted); text-align: right; min-width: 4.5rem; }

/* ═══ Redesign v92 — PredictGame reference overrides ═══ */

/* ── General / app shell ── */
#app {
  background: var(--panel);
}

.main {
  padding: 0.75rem 1rem;
  padding-bottom: calc(4.75rem + var(--safe-bottom));
}

.visually-hidden,
.filter-select.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  appearance: none !important;
  pointer-events: none;
}

/* ── Header ── */
.game-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(10, 14, 23, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 1rem 0.5rem;
  padding-top: calc(0.65rem + var(--safe-top));
}

.game-header .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.game-header .user,
.game-header .user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

html[data-theme="light"] .game-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: var(--line);
}

.game-header .brand-row,
.game-header .compact-brand {
  display: none;
}

.avatar {
  background: linear-gradient(135deg, #34d399, #0d9488);
  color: #06251b;
}

.balance-chip {
  border: 1px solid var(--line2);
  background: #121a2c;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}

html[data-theme="light"] .balance-chip {
  background: var(--card2);
  border-color: var(--line2);
}

.balance-icon,
.balance-chip > svg {
  color: var(--up);
  stroke: var(--up);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: block;
}

.theme-toggle {
  width: 30px;
  height: 30px;
  font-size: 0.85rem;
  border-color: var(--line);
  background: var(--card2);
  opacity: 0.85;
}

.theme-toggle:active {
  opacity: 1;
}

/* ── Play brand (reference + existing brand classes) ── */
.play-brand,
.view-play > .brand-row {
  margin-bottom: 0.25rem;
}

.play-brand .logo,
.play-brand .brand,
.view-play .brand {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.play-brand .brand-a,
.brand-a {
  color: var(--up);
}

.play-brand .brand-b,
.brand-b {
  color: var(--accent);
}

.play-brand .tagline,
.view-play .tagline {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Category chips / filters ── */
#category-chips.cats,
#category-chips.category-chips,
.category-chips.cats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 4px;
  overflow: visible;
  margin-bottom: 0;
}

.category-chips:not(#category-chips) {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0.1rem 0 0.15rem;
  scrollbar-width: none;
}

#category-chips .category-chip,
.cats > button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 0;
  border-radius: 12px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

#category-chips .category-chip svg,
.cats > button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

#category-chips .category-chip.active,
#category-chips .category-chip.on,
.cats > button.on {
  background: rgba(46, 230, 168, 0.13);
  color: var(--up);
  box-shadow: inset 0 0 0 1px rgba(46, 230, 168, 0.4);
  border-color: transparent;
}

html[data-theme="light"] #category-chips .category-chip.active,
html[data-theme="light"] #category-chips .category-chip.on {
  background: rgba(16, 185, 129, 0.12);
  color: var(--up-strong);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.35);
}

/* Row tools / seg (existing filters + reference classes) */
.row-tools,
.filter-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  margin-bottom: 0;
}

.filter-select-row {
  flex-wrap: wrap;
}

.filter-select-label {
  display: none;
}

.seg,
.filter-select-row .filter-meta {
  display: flex;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2px;
}

.seg button,
.seg-btn,
.filter-select {
  padding: 6px 12px;
  border-radius: 9px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  appearance: none;
  min-width: 0;
  cursor: pointer;
}

.seg button.on,
.seg-btn.on,
.seg-btn.active {
  background: #1e2b45;
  color: #fff;
}

.seg.icon button.on,
.seg.icon .seg-btn.on {
  color: var(--up);
}

.seg.icon button,
.seg.icon .seg-btn {
  padding: 6px 8px;
  display: grid;
  place-items: center;
}

.seg svg {
  width: 16px;
  height: 16px;
}

.filter-select {
  padding: 6px 1.6rem 6px 10px;
  border-radius: 9px;
  background-color: transparent;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 10px) 50%,
    calc(100% - 6px) 50%;
  background-size: 4px 4px, 4px 4px;
}

.filter-select:focus {
  box-shadow: none;
  border-color: transparent;
  color: var(--text);
}

.filter-meta,
.counter,
.card-counter {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  padding: 0;
}

.counter i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--up);
  flex-shrink: 0;
  display: inline-block;
}

#live-dot,
.live-dot {
  font-size: 11px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

#live-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--up);
  flex-shrink: 0;
}

.card-counter {
  font-size: 11px;
}

.live-dot.pulse {
  animation: livePulse 1.2s ease-in-out infinite;
}

/* Period / sports chips */
.chips,
#crypto-period-row,
.sports-time-chips,
.sports-activity-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 8px -1rem 0;
  padding: 0 1rem 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chips::-webkit-scrollbar,
#crypto-period-row::-webkit-scrollbar,
.sports-time-chips::-webkit-scrollbar,
.sports-activity-chips::-webkit-scrollbar {
  display: none;
}

#crypto-period-row {
  display: flex;
  align-items: center;
  margin-left: -1rem;
  margin-right: -1rem;
}

#crypto-period-row .filter-select {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--card);
  color: var(--muted2);
  font-size: 12px;
}

.chips button,
.period-chip,
.sports-chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--card);
  color: var(--muted2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.chips button.on,
.period-chip.on,
.period-chip.active,
.sports-chip.active {
  border-color: rgba(46, 230, 168, 0.5);
  background: rgba(46, 230, 168, 0.13);
  color: var(--up);
}

html[data-theme="light"] .chips button.on,
html[data-theme="light"] .period-chip.on,
html[data-theme="light"] .sports-chip.active {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.1);
  color: var(--up-strong);
}

.sports-chip[data-sports-time="live"].active {
  border-color: rgba(246, 70, 93, 0.55);
  color: var(--down);
  background: rgba(246, 70, 93, 0.1);
}

.market-filters {
  gap: 8px;
  margin-bottom: 10px;
}

/* ── List items (.m-item + .market-list-card) ── */
.m-item,
.market-list-card {
  width: 100%;
  text-align: left;
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
  overflow: hidden;
}

.m-item:active,
.market-list-card:active {
  background: #141e33;
}

html[data-theme="light"] .m-item:active,
html[data-theme="light"] .market-list-card:active {
  background: var(--card2);
}

.m-head,
.mlc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0;
  width: 100%;
}

.coin,
.mlc-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  object-fit: cover;
}

.m-title,
.mlc-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mlc-head-text {
  gap: 2px;
}

.mlc-window,
.m-title p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mlc-window-k {
  display: none;
}

.mlc-window-sep {
  opacity: 0.45;
}

.chev {
  width: 16px;
  height: 16px;
  color: #44506b;
  flex-shrink: 0;
}

.odds-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  padding: 0;
}

.odds-labels .l {
  color: var(--up);
}

.odds-labels .r {
  color: var(--down);
}

.mlc-outcomes {
  padding: 0;
  gap: 6px;
  display: flex;
  flex-direction: column;
}

.mlc-outcome {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.15rem 0.5rem;
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.mlc-outcome.green .mlc-name {
  color: var(--up);
  font-size: 12px;
  font-weight: 700;
}

.mlc-outcome.orange .mlc-name {
  color: var(--down);
  font-size: 12px;
  font-weight: 700;
}

.mlc-bar-wrap,
.bar {
  grid-column: 1 / -1;
  display: flex;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: #1a2338;
}

.bar .u,
.mlc-outcome.green .mlc-bar {
  background: var(--up);
}

.bar .d,
.mlc-outcome.orange .mlc-bar {
  background: rgba(246, 70, 93, 0.8);
}

.mlc-pct {
  font-size: 12px;
  font-weight: 700;
}

.mlc-outcome.green .mlc-pct {
  color: var(--up);
}

.mlc-outcome.orange .mlc-pct {
  color: var(--down);
}

.mlc-footer {
  padding: 0.35rem 0 0;
  font-size: 11px;
  color: var(--muted);
  border: none;
}

.list-view {
  gap: 0;
}

/* ── Prediction / big cards ── */
.big-card,
.prediction-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: none;
  padding: 14px 16px 16px;
}

.prediction-card::before {
  display: none;
}

.big-card h2,
.prediction-card .card-question {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  padding: 8px 0 12px;
  margin-bottom: 0;
}

.prediction-card .card-body {
  padding: 0;
}

.prediction-card .card-meta-row,
.prediction-card .bc-meta {
  padding: 0;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--muted2);
}

.prediction-card .card-info-row {
  padding: 0;
  margin-bottom: 10px;
}

.prediction-card .card-volume {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.vs-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  padding: 0;
  margin-bottom: 0.75rem;
}

.vs-side {
  border-radius: 16px;
  padding: 12px 10px;
  text-align: center;
  border-width: 1px;
  background: transparent;
  min-width: 0;
}

.vs-side.green {
  border: 1px solid rgba(46, 230, 168, 0.4);
  background: rgba(46, 230, 168, 0.08);
  box-shadow: none;
  --side-accent: var(--up);
}

.vs-side.orange {
  border: 1px solid rgba(246, 70, 93, 0.4);
  background: rgba(246, 70, 93, 0.08);
  box-shadow: none;
  --side-accent: var(--down);
}

.vs-side.green .vs-side-label {
  color: var(--up);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.vs-side.orange .vs-side-label {
  color: var(--down);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.vs-side-pct {
  font-size: 22px;
  font-weight: 800;
  margin-top: 4px;
  line-height: 1.1;
  padding: 0 2px;
}

.vs-side-cents {
  font-size: 12px;
  margin-top: 2px;
}

.vs-side.green .vs-side-cents {
  color: rgba(110, 240, 200, 0.8);
}

.vs-side.orange .vs-side-cents {
  color: rgba(246, 70, 93, 0.8);
}

.vs-center {
  position: static;
  transform: none;
  left: auto;
  top: auto;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
  gap: 0.25rem;
  pointer-events: none;
}

.vs-badge,
.vs-center .vs-badge {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1a2338;
  border: 1px solid #2a3856;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 1;
  flex-shrink: 0;
}

.prediction-card .participants-row {
  padding: 0;
  margin-bottom: 0.5rem;
}

.prediction-card .card-chart-wrap {
  margin: 12px 0 0;
  border: none;
  background: transparent;
  border-radius: 0;
  height: 72px;
}

.bet-row,
.buy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 0 0;
}

.bet-btn.green,
.buy-grid .b-up,
.b-up {
  background: var(--up-strong);
  color: #06251b;
  box-shadow: none;
}

.bet-btn.orange,
.buy-grid .b-down,
.b-down {
  background: var(--down);
  color: #fff;
  box-shadow: none;
}

.details-btn,
.more-btn {
  display: block;
  width: 100%;
  margin: 10px 0 0;
  padding: 11px 0;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: #141e33;
  font-size: 14px;
  font-weight: 600;
  color: #c6d0e2;
  text-align: center;
  cursor: pointer;
}

html[data-theme="light"] .details-btn,
html[data-theme="light"] .more-btn {
  background: var(--card2);
  color: var(--text);
}

.prediction-card .card-actions-footer {
  background: transparent;
  padding-top: 0;
  position: static;
}

.card-actions-footer .details-btn {
  margin-left: auto;
  margin-right: auto;
}

.dots,
.deck-indicators {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  margin-bottom: 2px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
  padding: 0;
  width: 100%;
  flex-shrink: 0;
  z-index: 8;
}

.dots button,
.deck-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #2a3856;
  opacity: 1;
  transition: all 0.2s;
}

.dots button.on,
.deck-dot.active {
  width: 20px;
  background: var(--up);
}

/* ── Bottom nav ── */
.bottom-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(12, 18, 32, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 4px 8px calc(4px + var(--safe-bottom));
}

html[data-theme="light"] .bottom-nav {
  background: rgba(255, 255, 255, 0.95);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0;
  font-size: 11px;
  font-weight: 500;
  color: #6b7894;
}

.nav-item svg,
.nav-item .nav-icon svg {
  width: 20px;
  height: 20px;
}

.nav-item.active {
  color: var(--up);
}

.nav-icon {
  font-size: 20px;
}

/* ── Leaderboard ── */
.podium {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  align-items: end;
  margin-top: 16px;
  margin-bottom: 0.75rem;
}

.pod {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pod.first {
  padding-top: 16px;
}

.pod.second,
.pod.third {
  margin-top: 20px;
}

.pod .pav {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--card);
  background: #1a2338;
}

.pod .pp {
  font-size: 10px;
  color: var(--up);
}

.leader,
.leader-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  margin-top: 8px;
}

.leader.me,
.leader-row.me {
  border-color: rgba(46, 230, 168, 0.5);
  background: rgba(46, 230, 168, 0.08);
}

.leader .rank,
.leader-rank {
  width: 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.leader-rank.top {
  color: var(--up);
}

.leader .lav,
.leader-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1a2338;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #c6d0e2;
}

.leader-pts,
.leader .pts {
  font-size: 14px;
  font-weight: 700;
  color: var(--up);
}

.my-rank-card {
  background: rgba(46, 230, 168, 0.08);
  border: 1px solid rgba(46, 230, 168, 0.45);
  border-radius: 16px;
}

.my-rank-card .rank-num {
  color: var(--up);
}

.section-title,
.page-title {
  font-size: 20px;
  font-weight: 800;
}

/* ── Profile ── */
.profile-card,
.profile-editor {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px;
  margin-bottom: 0.75rem;
}

.profile-card .pav,
.profile-editor-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  color: #06251b;
  background: linear-gradient(135deg, #34d399, #0d9488);
}

.xp,
.profile-xp-bar {
  height: 6px;
  border-radius: 999px;
  background: #1a2338;
  margin-top: 6px;
  overflow: hidden;
}

.xp i,
.profile-xp-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #14b8a6);
}

.stats,
.profile-stats,
.profile-stats-v2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 0.75rem;
}

.stat,
.stat-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
}

.stat .v,
.stat-value {
  font-size: 18px;
  font-weight: 800;
  margin-top: 6px;
}

.stat .l,
.stat-label {
  font-size: 10px;
  color: var(--muted);
}

.hist,
.prediction-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  margin-top: 8px;
}

.prediction-item.status-won {
  border-color: rgba(46, 230, 168, 0.45);
  background: rgba(46, 230, 168, 0.08);
}

.prediction-item.status-lost {
  border-color: rgba(246, 70, 93, 0.45);
  background: rgba(246, 70, 93, 0.08);
}

.hist .hp.win,
.prediction-item .status-won {
  color: var(--up);
}

.hist .hp.lose,
.prediction-item .status-lost {
  color: var(--down);
}

.menu,
.profile-actions {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  margin-top: 16px;
}

.menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: #c6d0e2;
  background: transparent;
  border: none;
  border-radius: 0;
  margin-bottom: 0;
}

.menu button + button {
  border-top: 1px solid var(--line);
}

.menu button:active {
  background: #141e33;
}

.menu svg.mi {
  width: 20px;
  height: 20px;
  color: var(--up);
}

.action-pill.profile-notif-open-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 0.75rem;
  background: var(--card);
  color: #c6d0e2;
  font-size: 14px;
  font-weight: 500;
}

/* ── Detail / event (pm-*) ── */
.pm-market-card,
.pm-detail .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px;
  margin-bottom: 12px;
}

.pm-countdown,
.timer {
  flex-shrink: 0;
  text-align: center;
  border: 1px solid rgba(246, 70, 93, 0.3);
  background: rgba(246, 70, 93, 0.1);
  border-radius: 12px;
  padding: 6px 10px;
}

.pm-countdown b,
.pm-cd-val,
.timer b {
  font-size: 14px;
  font-weight: 800;
  color: var(--down);
}

.pm-cd-label,
.timer small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(246, 70, 93, 0.7);
}

.pm-cd-block {
  color: var(--down);
}

.pm-cd-sep {
  color: var(--down);
}

.pm-price-row,
.prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.pm-price-col,
.price {
  background: var(--card2);
  border-radius: 16px;
  padding: 12px;
  border: none;
}

.pm-price-label,
.price small {
  font-size: 11px;
  color: var(--muted);
}

.pm-price-val,
.price .v {
  font-size: 18px;
  font-weight: 800;
  margin-top: 2px;
}

.pm-spot-delta.negative,
.price .delta {
  font-size: 12px;
  font-weight: 600;
  color: var(--down);
}

.pm-detail-chart,
.chart-box {
  background: var(--card2);
  border-radius: 16px;
  padding: 8px;
  margin-top: 12px;
}

.side-pick,
.pm-trade-row,
.predict-outcome-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.side-pick button,
.pm-trade-btn,
.predict-outcome-btn {
  padding: 15px 0;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 800;
  transition: all 0.15s;
  border: none;
}

.side-pick .up.on,
.pm-trade-btn.green.active,
.predict-outcome-btn.green.active {
  background: var(--up-strong);
  color: #06251b;
  box-shadow: 0 0 0 2px rgba(46, 230, 168, 0.6);
}

.side-pick .up.off,
.pm-trade-btn.green:not(.active),
.predict-outcome-btn.green:not(.active) {
  background: rgba(46, 230, 168, 0.1);
  color: var(--up);
  box-shadow: inset 0 0 0 1px rgba(46, 230, 168, 0.3);
}

.side-pick .down.on,
.pm-trade-btn.orange.active,
.predict-outcome-btn.orange.active {
  background: var(--down);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(246, 70, 93, 0.6);
}

.side-pick .down.off,
.pm-trade-btn.orange:not(.active),
.predict-outcome-btn.orange:not(.active) {
  background: rgba(246, 70, 93, 0.1);
  color: var(--down);
  box-shadow: inset 0 0 0 1px rgba(246, 70, 93, 0.3);
}

.amounts,
.stake-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.amounts button,
.stake-btn {
  border: 1px solid var(--line2);
  background: var(--card2);
  border-radius: 12px;
  padding: 8px 0;
  text-align: center;
}

.amounts button.on,
.stake-btn.active {
  border-color: rgba(46, 230, 168, 0.6);
  background: rgba(46, 230, 168, 0.13);
  color: var(--up);
  font-weight: 800;
}

.stake,
.stake-submit,
.btn-primary.stake-submit {
  width: 100%;
  margin-top: 12px;
  padding: 15px 0;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 800;
  border: none;
}

.stake.up,
.stake-submit.green {
  background: var(--up-strong);
  color: #06251b;
}

.stake.down,
.stake-submit.orange {
  background: var(--down);
  color: #fff;
}

.pm-trade-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.empty,
.empty-state {
  display: grid;
  place-items: center;
  padding: 64px 0;
  font-size: 14px;
  color: var(--muted);
  border: 1px dashed var(--line2);
  border-radius: 16px;
}

/* ═══ Redesign v93 — regression fixes ═══ */

/* Light theme: active segments must not use near-black */
html[data-theme="light"] .seg button.on,
html[data-theme="light"] .seg-btn.on,
html[data-theme="light"] .seg-btn.active {
  background: #e2e8f4;
  color: #1e293b;
}

html[data-theme="light"] .seg.icon button.on,
html[data-theme="light"] .seg.icon .seg-btn.on {
  background: rgba(16, 185, 129, 0.14);
  color: var(--up-strong);
}

html[data-theme="light"] .bar,
html[data-theme="light"] .mlc-bar-wrap,
html[data-theme="light"] .xp,
html[data-theme="light"] .profile-xp-bar {
  background: #e5eaf3;
}

html[data-theme="light"] .bar .d,
html[data-theme="light"] .mlc-outcome.orange .mlc-bar {
  background: rgba(224, 62, 82, 0.8);
}

html[data-theme="light"] .menu button,
html[data-theme="light"] .menu .action-pill,
html[data-theme="light"] .action-pill.profile-notif-open-btn,
html[data-theme="light"] .menu .ml,
html[data-theme="light"] .profile-menu .ml {
  color: var(--text);
}

html[data-theme="light"] .menu button:active,
html[data-theme="light"] .menu .action-pill:active {
  background: var(--card2);
}

html[data-theme="light"] .menu svg.mi,
html[data-theme="light"] .action-pill.profile-notif-open-btn svg.mi {
  color: var(--up-strong);
}

html[data-theme="light"] .chev {
  color: #94a3b8;
}

html[data-theme="light"] .vs-badge,
html[data-theme="light"] .vs-center .vs-badge {
  background: #fff;
  border-color: var(--line2);
  color: var(--text);
}

html[data-theme="light"] .pod .pav,
html[data-theme="light"] .leader .lav,
html[data-theme="light"] .leader-avatar {
  color: #0f172a;
}

/* Horizontal chip rows — constrain width so overflow-x scrolls (not parent-clipped) */
.main {
  overflow-x: clip;
}

.market-filters,
.sports-filters,
#view-play {
  overflow: visible;
  min-width: 0;
}

.chips,
#crypto-period-row,
#crypto-period-row.chips,
.sports-time-chips,
#sports-activity-chips,
.sports-activity-chips {
  display: flex !important;
  flex-direction: row;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 8px;
  overflow-x: auto !important;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scrollbar-width: none;
  margin: 8px -1rem 0;
  padding: 0 1rem 2px;
  width: calc(100% + 2rem);
  max-width: none;
  box-sizing: border-box;
  min-width: 0;
}

/* ID + flex !important must not defeat .hidden when Sport is selected */
#crypto-period-row.hidden,
.chips.hidden {
  display: none !important;
}

.chips::-webkit-scrollbar,
#crypto-period-row::-webkit-scrollbar,
.sports-time-chips::-webkit-scrollbar,
.sports-activity-chips::-webkit-scrollbar,
#sports-activity-chips::-webkit-scrollbar {
  display: none;
}

.chips > *,
#crypto-period-row > *:not(.visually-hidden),
.sports-time-chips > *,
.sports-activity-chips > *,
#sports-activity-chips > * {
  flex-shrink: 0;
}

#crypto-period-row .filter-select.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  border: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  flex: none !important;
}

.sports-time-chips {
  cursor: default;
  margin-bottom: 0;
}

.sports-filters {
  gap: 8px;
  margin-top: 0;
}

/* List cards — compact header + clock size */
.mlc-head-text.m-title,
.m-head .m-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-size: inherit;
  font-weight: inherit;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.mlc-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mlc-window-line {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.mlc-window-line svg,
.m-title svg,
.ico-clock {
  width: 12px !important;
  height: 12px !important;
  max-width: 12px;
  max-height: 12px;
  flex-shrink: 0;
  display: block;
}

.market-list-card:has(.odds-labels) .mlc-outcomes {
  display: none;
}

.bar {
  display: flex;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: #1a2338;
  padding: 0;
  border: none;
  width: 100%;
}

.bar .u,
.bar .d {
  display: block;
  height: 100%;
  border: none;
  padding: 0;
  margin: 0;
  border-radius: 0;
  cursor: pointer;
  min-width: 0;
}

.bar .u {
  background: var(--up);
  flex: 0 0 auto;
}

.bar .d {
  flex: 1 1 auto;
  background: rgba(246, 70, 93, 0.8);
}

.bar .mlc-outcome {
  grid-column: unset;
  grid-template-columns: unset;
  grid-template-rows: unset;
}

/* Card view — don't clip content; keep inner padding from redesign block */
.big-card,
.prediction-card {
  overflow: visible;
}

.deck-shell.mode-cards .prediction-card {
  overflow: visible;
  max-height: none;
}

/* Leaderboard podium — HTML uses .leaderboard-podium, not .podium */
.leaderboard-podium,
.podium {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  align-items: end;
  margin-top: 16px;
  margin-bottom: 0.75rem;
}

.pod {
  min-width: 0;
  overflow: hidden;
}

.pod .crown,
svg.crown {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px;
  max-height: 16px;
  display: block;
  color: #fbbf24;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.pod .pav {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px;
  max-height: 44px;
  overflow: hidden;
  flex-shrink: 0;
}

.pod .pav img,
.pod .pav .pav-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pod .pn {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.pod .place {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #1a2338;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted2);
}

html[data-theme="light"] .pod .place {
  background: var(--card2);
  color: var(--muted);
}

.pod .place svg,
.pod-medal {
  width: 12px !important;
  height: 12px !important;
  flex-shrink: 0;
}

.leader .info,
.leader-info {
  flex: 1;
  min-width: 0;
}

.leader .ln,
.leader-name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader .ln em,
.leader-name em {
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  color: var(--up);
}

/* Profile menu — menu-style pills, not green CTA gradient */
.menu .action-pill,
.profile-menu .action-pill,
.action-pill.profile-notif-open-btn,
.action-pill.referral-open-btn {
  width: 100%;
  margin-bottom: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  color: #c6d0e2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}

.menu .action-pill:active,
.profile-menu .action-pill:active {
  background: #141e33;
  transform: none;
  box-shadow: none;
}

.profile-menu .profile-logout-btn .ml {
  color: #ff8a9a;
}

.profile-menu .profile-logout-btn .mi {
  color: #ff8a9a;
}

.menu .ml {
  flex: 1;
  min-width: 0;
}

.menu .daily-bonus-row,
.daily-bonus-row.menu-item {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0;
  width: 100%;
  background: transparent;
  border-top: 1px solid var(--line);
  border-bottom: none;
  box-sizing: border-box;
}

.menu .daily-bonus-row .action-pill {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  margin: 0;
  border-top: none;
}

.menu .daily-bonus-row .daily-help-btn,
.daily-bonus-row .daily-help-btn {
  flex: 0 0 48px;
  width: 48px;
  min-height: 100%;
  align-self: stretch;
  margin: 0;
  border: none;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

html[data-theme="light"] .menu .daily-bonus-row .daily-help-btn {
  color: var(--muted);
}

.menu > .action-pill + .action-pill,
.menu > .action-pill + .daily-bonus-row,
.menu > .daily-bonus-row + .action-pill {
  border-top: 1px solid var(--line);
}

/* Profile avatar picker — editor layout (do not reuse podium .pav sizing) */
.profile-card.profile-editor {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

.profile-editor .profile-editor-fields,
.profile-editor .pinfo {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  gap: 0.55rem;
}

.profile-editor .profile-field {
  display: block;
  width: 100%;
  min-width: 0;
}

.profile-editor .profile-field span {
  display: block;
  margin-bottom: 0.25rem;
}

.profile-editor .profile-field-name,
.profile-editor .profile-field-avatar {
  display: block;
  width: 100%;
}

.profile-editor #profile-display-name,
.profile-editor .pn-input,
.profile-editor .profile-field input {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  padding: 0.55rem 0.65rem;
  font-size: 0.95rem;
  line-height: 1.3;
}

.profile-editor .profile-save-btn {
  display: block;
  width: 100%;
  grid-column: auto;
  justify-self: stretch;
  margin-top: 0.1rem;
  min-height: 40px;
}

.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: 100%;
}

.avatar-picker::before,
.avatar-picker::after,
.profile-field-avatar::before,
.profile-field-avatar::after {
  content: none !important;
  display: none !important;
}

.avatar-pick {
  flex: 0 0 2.35rem;
  width: 2.35rem;
  height: 2.35rem;
  min-width: 2.35rem;
  min-height: 2.35rem;
  box-sizing: border-box;
}

.avatar-pick:empty {
  display: none;
}

.avatar-pick img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-editor .profile-editor-avatar,
.profile-editor .profile-editor-avatar.pav,
#profile-avatar-preview {
  width: 60px !important;
  height: 60px !important;
  min-width: 60px;
  min-height: 60px;
  max-width: 60px;
  max-height: 60px;
  border-radius: 16px;
  flex-shrink: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 800;
}

.profile-editor-avatar.pav img,
.profile-editor .profile-editor-avatar img,
#profile-avatar-preview img,
.profile-card .pav img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-field-avatar > span {
  display: block;
  margin-bottom: 0.25rem;
}

html[data-theme="light"] .profile-editor .profile-field input,
html[data-theme="light"] .profile-editor #profile-display-name,
html[data-theme="light"] .profile-editor .pn-input {
  border-color: var(--line2);
  background: #fff;
  color: var(--text);
}

html[data-theme="light"] .profile-editor .avatar-pick {
  border-color: var(--line2);
  background: #fff;
  color: var(--text);
}

/* Card-view deck: dots below card, not beside / clipped */
.deck-shell {
  flex-direction: column;
  overflow: visible;
}

.deck-shell .card-deck {
  width: 100%;
  min-width: 0;
}

.deck-shell.mode-cards {
  flex-direction: column;
  overflow: visible;
}

.deck-shell.mode-cards .card-deck {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  padding-bottom: 0;
}

.deck-shell.mode-cards .deck-indicators {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
  justify-content: center;
  margin-top: 10px;
  margin-bottom: 4px;
  overflow: visible;
}

.deck-shell.mode-cards .prediction-card {
  overflow: visible;
  max-height: none;
}

/* VS badge lives in its own grid column — never overlay pct text */
.prediction-card .vs-row,
.big-card .vs-row {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.prediction-card .vs-center,
.big-card .vs-center {
  position: static;
  transform: none;
}

.prediction-card .vs-badge,
.big-card .vs-badge,
.prediction-card .vs-center .vs-badge,
.big-card .vs-center .vs-badge {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
}

.prediction-card .vs-side-pct,
.big-card .vs-side-pct {
  position: relative;
  z-index: 0;
}



/* Real mode / split stats */
.profile-earnings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
}
.profile-mode-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0.25rem 0 0.65rem;
}
.profile-stats-mode { margin-bottom: 0.5rem; }
.profile-top-markets { margin-bottom: 0.85rem; }
.top-markets-title {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.top-market-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
}
.top-market-title { flex: 1; min-width: 0; }
.top-market-meta { color: var(--muted); white-space: nowrap; }
.real-mode-block { margin: 0.5rem 0 0.85rem; }
.real-mode-toggle .profile-notif-title .stat-info-btn {
  margin-left: 0.25rem;
  font-size: 0.82rem;
}
.real-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0.25rem 0 0.5rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--green);
  border: 1px solid rgba(0, 230, 118, 0.35);
  background: rgba(0, 230, 118, 0.08);
}
.real-mode-badge .stat-info-btn {
  margin-left: 0;
  color: inherit;
  opacity: 0.85;
  font-size: 0.72rem;
}
.leader-clickable {
  width: 100%;
  text-align: left;
  border: none;
  background: inherit;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.leader.leader-clickable { display: flex; align-items: center; }
.pod[data-user-id] { cursor: pointer; border: none; background: transparent; color: inherit; font: inherit; }
.user-stats-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.user-stats-avatar { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; }
.user-stats-meta { color: var(--muted); font-size: 0.85rem; }

/* ═══ Profile bento v106 ═══ */
#view-profile .pcard {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #111b30, #0d1424);
  border: 1px solid var(--line2);
  border-radius: 22px;
  padding: 16px;
  margin-top: 4px;
  margin-bottom: 10px;
}

#view-profile .pcard .pav,
#view-profile #profile-avatar-preview {
  width: 58px !important;
  height: 58px !important;
  min-width: 58px;
  min-height: 58px;
  max-width: 58px;
  max-height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: linear-gradient(135deg, #1e2b45, #141e33);
  border: 1px solid var(--line2);
  color: var(--txt);
  flex-shrink: 0;
  overflow: hidden;
}

#view-profile .pcard .pi {
  flex: 1 1 auto;
  min-width: 0;
}

#view-profile .pcard .pnm {
  font-size: 17px;
  font-weight: 800;
  color: var(--txt);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-profile .pcard .pbal {
  font-size: 11px;
  font-weight: 700;
  color: var(--up);
  margin-top: 2px;
}

#view-profile .xpbar,
#view-profile .profile-xp-bar {
  height: 5px;
  border-radius: 999px;
  background: #1a2338;
  margin-top: 8px;
  overflow: hidden;
}

#view-profile .xpbar i,
#view-profile .profile-xp-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #14b8a6);
  transition: width var(--dur-med) var(--ease-out);
}

#view-profile .pcard .plvl {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

#view-profile .edit-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: #141e33;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--muted2);
  padding: 0;
  cursor: pointer;
}

#view-profile .edit-btn svg {
  width: 16px;
  height: 16px;
}

#view-profile .edit-btn[aria-expanded="true"] {
  border-color: rgba(46, 230, 168, 0.45);
  color: var(--up);
}

#view-profile .profile-edit-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 10px;
}

#view-profile .profile-edit-panel.hidden {
  display: none !important;
}

#view-profile .profile-edit-panel .profile-editor-fields {
  display: grid;
  gap: 12px;
}

#view-profile .profile-edit-panel .save-btn,
#view-profile .profile-edit-panel .profile-save-btn {
  width: 100%;
  padding: 14px 0;
  border-radius: 14px;
  background: var(--up-strong);
  color: #06251b;
  font-size: 14px;
  font-weight: 800;
  border: none;
  cursor: pointer;
}

#view-profile .profile-edit-panel .save-btn:disabled,
#view-profile .profile-edit-panel .profile-save-btn:disabled {
  background: #1a2338;
  color: var(--muted);
}

#view-profile .real-banner {
  margin-top: 2px;
  margin-bottom: 10px;
  border-radius: 22px;
  padding: 1.5px;
  background: linear-gradient(120deg, rgba(46, 230, 168, 0.55), rgba(124, 58, 237, 0.45), rgba(246, 70, 93, 0.45));
}

#view-profile .real-banner .inner {
  background: #0c1322;
  border-radius: 20px;
  padding: 14px;
}

#view-profile .real-banner .real-mode-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  width: 100%;
  cursor: pointer;
}

#view-profile .real-banner .profile-notif-text {
  flex: 1 1 auto;
  min-width: 0;
}

#view-profile .real-banner .tl,
#view-profile .real-banner .profile-notif-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--txt);
  display: flex;
  align-items: center;
  gap: 8px;
}

#view-profile .real-banner .ts,
#view-profile .real-banner .profile-notif-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  display: block;
}

#view-profile .real-banner .qbtn,
#view-profile .stat-info-btn.qbtn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line2);
  background: #141e33;
  color: var(--muted2);
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}

#view-profile .stat-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 3px;
  margin-bottom: 10px;
  gap: 0;
}

#view-profile .stat-tabs button {
  padding: 8px 0;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  flex: none;
}

#view-profile .stat-tabs .profile-tab.active,
#view-profile .stat-tabs .profile-tab.on {
  border: none;
  background: #1e2b45;
  color: #fff;
}

#view-profile .sg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

#view-profile .sgt {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
}

#view-profile .sgt .ic {
  font-size: 16px;
  line-height: 1;
}

#view-profile .sgt .v {
  font-size: 19px;
  font-weight: 800;
  margin-top: 6px;
  color: var(--txt);
  font-variant-numeric: tabular-nums;
}

#view-profile .sgt .v.up {
  color: var(--up);
}

#view-profile .sgt .v.dn {
  color: var(--down);
}

#view-profile .sgt .l {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

#view-profile .profile-tm-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 16px 6px;
  margin-bottom: 12px;
}

#view-profile .top-markets-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--txt);
  margin-bottom: 4px;
}

#view-profile .top-market-row,
#view-profile .tm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 2px;
  border-top: 1px solid var(--line);
  border-bottom: none;
  font-size: 12px;
}

#view-profile .top-market-title,
#view-profile .tm-row .mt {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted2);
}

#view-profile .top-market-meta,
#view-profile .tm-row .mv {
  flex-shrink: 0;
  color: var(--muted);
  white-space: nowrap;
}

#view-profile .bento {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

#view-profile .btile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  min-height: 112px;
  width: 100%;
  color: var(--txt);
  cursor: pointer;
  font: inherit;
}

#view-profile .btile:active {
  background: #141e33;
}

#view-profile .btile .bi {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: rgba(46, 230, 168, 0.1);
  margin-bottom: 8px;
}

#view-profile .btile .bl {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

#view-profile .btile .bs {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

#view-profile .btile .bv {
  font-size: 12px;
  font-weight: 700;
  color: var(--up);
  margin-top: auto;
  padding-top: 8px;
}

#view-profile .btile-wrap {
  position: relative;
  min-width: 0;
}

#view-profile .btile-wrap .btile {
  height: 100%;
}

#view-profile .btile-help {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line2);
  background: #141e33;
  color: var(--muted2);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  padding: 0;
  z-index: 1;
  cursor: pointer;
}

#view-profile .profile-logout-quiet {
  display: block;
  width: 100%;
  margin: 4px 0 12px;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

#view-profile .profile-logout-quiet.hidden {
  display: none !important;
}

#view-profile .profile-predictions-section {
  margin-top: 8px;
}

#view-profile .profile-predictions-section.hidden {
  display: none !important;
}

#view-profile .profile-footer {
  text-align: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--muted);
}

/* Light theme — bento profile */
html[data-theme="light"] #view-profile .pcard {
  background: linear-gradient(135deg, #eef2f9, #f8fafc);
  border-color: var(--line2);
}

html[data-theme="light"] #view-profile .pcard .pav,
html[data-theme="light"] #view-profile #profile-avatar-preview {
  background: linear-gradient(135deg, #e2e8f4, #f1f5f9);
  border-color: var(--line2);
  color: #0f172a;
}

html[data-theme="light"] #view-profile .edit-btn,
html[data-theme="light"] #view-profile .btile-help,
html[data-theme="light"] #view-profile .real-banner .qbtn {
  background: var(--card2);
  border-color: var(--line2);
  color: var(--muted2);
}

html[data-theme="light"] #view-profile .xpbar,
html[data-theme="light"] #view-profile .profile-xp-bar {
  background: #e5eaf3;
}

html[data-theme="light"] #view-profile .real-banner .inner {
  background: #fff;
}

html[data-theme="light"] #view-profile .stat-tabs button.on,
html[data-theme="light"] #view-profile .stat-tabs button.active {
  background: #e2e8f4;
  color: #1e293b;
}

html[data-theme="light"] #view-profile .btile:active {
  background: var(--card2);
}

html[data-theme="light"] #view-profile .profile-edit-panel .save-btn:disabled,
html[data-theme="light"] #view-profile .profile-edit-panel .profile-save-btn:disabled {
  background: var(--card2);
  color: var(--muted);
}

html[data-theme="light"] #view-profile .sgt .v,
html[data-theme="light"] #view-profile .btile,
html[data-theme="light"] #view-profile .pcard .pnm {
  color: var(--text);
}
