:root {
  --bg: #07111d;
  --bg-2: #0d1725;
  --panel: rgba(14, 23, 36, 0.88);
  --panel-strong: #111c2b;
  --line: rgba(138, 162, 191, 0.14);
  --text: #f5f8fc;
  --muted: #8da0b6;
  --green: #31c97f;
  --green-soft: rgba(49, 201, 127, 0.18);
  --red: #ff5d52;
  --red-soft: rgba(255, 93, 82, 0.16);
  --blue: #2597ff;
  --blue-soft: rgba(37, 151, 255, 0.2);
  --gold: #ffb84d;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  --radius: 20px;
}

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

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 151, 255, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(10, 212, 162, 0.1), transparent 24%),
    linear-gradient(180deg, #09111b 0%, #06101a 100%);
}

button,
input {
  font: inherit;
}

.shell {
  max-width: 1560px;
  margin: 0 auto;
  padding: 26px 28px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(9, 17, 27, 0.72);
  backdrop-filter: blur(14px);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 160px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1da8ff, #0bf0ae);
  color: #04111d;
  font-weight: 900;
  text-transform: uppercase;
}

.brand-wordmark {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(480px, 45vw);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(19, 29, 45, 0.92), rgba(14, 23, 36, 0.92));
}

.search input {
  width: 100%;
  height: 46px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.search-icon,
.how-link {
  color: var(--muted);
}

.how-link {
  text-decoration: none;
  font-weight: 600;
}

.primary-btn,
.ghost-btn,
.icon-btn,
.market-tab,
.filter-pill,
.outcome {
  border: 0;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    opacity 160ms ease;
}

.primary-btn:hover,
.ghost-btn:hover,
.icon-btn:hover,
.market-tab:hover,
.filter-pill:hover,
.outcome:hover {
  transform: translateY(-1px);
}

.primary-btn {
  padding: 12px 18px;
  border-radius: 14px;
  color: #04111d;
  font-weight: 800;
  background: linear-gradient(135deg, #26a0ff, #5be7a8);
  box-shadow: 0 12px 32px rgba(37, 151, 255, 0.25);
}

.ghost-btn {
  padding: 12px 18px;
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.market-nav,
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.market-nav {
  margin: 18px 4px 0;
  border-bottom: 1px solid rgba(138, 162, 191, 0.1);
  padding-bottom: 14px;
}

.market-tab,
.filter-pill {
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
}

.market-tab {
  padding: 10px 8px;
  font-weight: 600;
}

.market-tab.active,
.filter-pill.active {
  color: var(--text);
}

.filters {
  margin: 18px 0 26px;
}

.filter-pill {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-weight: 700;
}

.filter-pill.active {
  background: var(--blue-soft);
  border-color: rgba(37, 151, 255, 0.3);
}

.content {
  padding-top: 24px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-end;
  margin-bottom: 10px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  color: #99c6ff;
  background: rgba(37, 151, 255, 0.12);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero h1 {
  margin: 14px 0 10px;
  max-width: 760px;
  font-size: clamp(2.4rem, 4.5vw, 4.7rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.06rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 12px;
  min-width: 420px;
}

.stat-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(20, 31, 48, 0.94), rgba(13, 23, 36, 0.94));
  box-shadow: var(--shadow);
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.2rem;
}

.stat-label {
  color: var(--muted);
  font-size: 0.86rem;
}

.stat-card.live {
  position: relative;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 50%;
  background: #11d689;
  box-shadow: 0 0 0 6px rgba(17, 214, 137, 0.12);
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.market-card {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(17, 28, 43, 0.95), rgba(11, 19, 30, 0.97)),
    var(--panel);
  box-shadow: var(--shadow);
}

.market-card.featured {
  grid-column: span 2;
  background:
    radial-gradient(circle at top right, rgba(37, 151, 255, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(17, 28, 43, 0.95), rgba(11, 19, 30, 0.98));
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.token-badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 0.92rem;
  font-weight: 800;
}

.btc {
  background: rgba(255, 184, 77, 0.2);
  color: var(--gold);
}

.politics,
.elections {
  background: rgba(73, 130, 255, 0.16);
  color: #7bb6ff;
}

.sports {
  background: rgba(255, 94, 140, 0.16);
  color: #ff81ad;
}

.ai {
  background: rgba(91, 231, 168, 0.16);
  color: #6df0b3;
}

.macro {
  background: rgba(255, 156, 77, 0.16);
  color: #ffb26d;
}

.culture {
  background: rgba(204, 120, 255, 0.16);
  color: #d7a0ff;
}

.weather {
  background: rgba(255, 203, 90, 0.16);
  color: #ffd77c;
}

.mini-pill {
  padding: 6px 10px;
  border-radius: 999px;
  color: #89d4ff;
  background: rgba(37, 151, 255, 0.12);
  font-size: 0.75rem;
  font-weight: 700;
}

.mini-pill.neutral {
  color: #d2dae5;
  background: rgba(255, 255, 255, 0.07);
}

.market-card h2 {
  margin: 0 0 10px;
  font-size: 1.14rem;
  line-height: 1.2;
}

.card-meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.rows,
.candidate-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.row,
.candidate {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.row span,
.candidate span {
  color: #dfe8f2;
}

.outcomes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.outcome {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  font-weight: 800;
}

.outcome.yes {
  color: var(--green);
  background: var(--green-soft);
}

.outcome.no {
  color: var(--red);
  background: var(--red-soft);
}

.two-up .yes,
.two-up .no {
  min-height: 52px;
}

.probability-ring {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.probability-ring strong {
  font-size: 1rem;
}

.probability-ring span {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: lowercase;
}

.probability-ring.positive {
  border-top-color: #17d88b;
  border-left-color: #17d88b;
}

.probability-ring.warning {
  border-top-color: #ff6658;
  border-left-color: #ff6658;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 8, 15, 0.72);
  backdrop-filter: blur(10px);
}

.modal {
  width: min(480px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, #111c2b, #0b1522);
  box-shadow: var(--shadow);
}

.modal-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 151, 255, 0.14);
  color: #95c7ff;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.modal h2 {
  margin: 14px 0 10px;
  font-size: 1.9rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.modal p {
  margin: 0;
  color: var(--muted);
}

.modal-error {
  min-height: 18px;
  margin: 16px 0;
  color: #ff8c84;
  font-weight: 700;
  font-size: 0.9rem;
}

.modal-actions {
  display: grid;
  gap: 10px;
}

.full-width {
  width: 100%;
}

@media (max-width: 1100px) {
  .topbar,
  .hero {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-right,
  .topbar-left {
    width: 100%;
  }

  .search {
    min-width: 0;
    width: 100%;
  }

  .hero-stats {
    min-width: 0;
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 18px 14px 40px;
  }

  .brand-wordmark {
    font-size: 26px;
  }

  .topbar-right {
    flex-wrap: wrap;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .market-card.featured {
    grid-column: span 1;
  }
}
