/* ════════════════════════════════════════════════════════════
   predict.day - design chassis v1
   Dark terminal aesthetic. Kalshi-class layout, crypto-native edge.
   Content max-width: 1300px (matches Kalshi/Polymarket range).
   Shared by all pages; header/footer/tabs markup injected by shell.js
   ════════════════════════════════════════════════════════════ */

/* Space Grotesk - wordmark only (OFL, fine to ship) */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&display=swap');

/* ── PREVIEW-ONLY comp fonts (see fonts_preview/README.md) ──
   Unlicensed comps for the client demo. MUST be swapped for a licensed
   family (Manrope / Hanken Grotesk / Space Grotesk) before going live:
   replace this block and the two --font-* tokens below, nothing else. */
@font-face {
  font-family: 'PredictOne';
  src: url('fonts/PredictOne-400_v1.0.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'PredictOne';
  src: url('fonts/PredictOne-600_v1.0.ttf') format('truetype');
  font-weight: 500 600;
  font-display: swap;
}

@font-face {
  font-family: 'PredictOne';
  src: url('fonts/PredictOne-800_v1.0.ttf') format('truetype');
  font-weight: 700 800;
  font-display: swap;
}

@font-face {
  font-family: 'Predict Sharp Sans';
  src: url('fonts/PredictSharpSans-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Predict Sharp Sans';
  src: url('fonts/PredictSharpSans-Medium.otf') format('opentype');
  font-weight: 500 800;
  font-display: swap;
}

:root {
  /* surfaces */
  --bg: #0a0e13;
  --bg-2: #0d1219;
  --card: #121924;
  --card-2: #17202d;
  --line: #1e2936;
  --line-2: #2a3646;

  /* text */
  --text: #e9eef4;
  --dim: #8b98a7;
  --dim-2: #5b6a7a;

  /* brand */
  --accent: #0fa968;
  /* predict.day green - rgb(15,169,104) */
  --accent-soft: rgba(15, 169, 104, 0.14);
  --accent-line: rgba(15, 169, 104, 0.40);

  /* semantics */
  --yes: #2fd575;
  --yes-soft: rgba(47, 213, 117, 0.12);
  --no: #ff5d5d;
  --no-soft: rgba(255, 93, 93, 0.12);
  --amber: #f5b83d;

  /* type */
  --font-ui: 'PredictOne', 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Predict Sharp Sans', 'PredictOne', 'Inter', system-ui, sans-serif;
  --font-num: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* geometry */
  --max-w: 1300px;
  --r-card: 14px;
  --r-btn: 10px;
  --r-pill: 999px;
}

/* light theme - toggled via data-theme on <html>, persisted by shell.js */
[data-theme="light"] {
  --bg: #f6f8fa;
  --bg-2: #eef1f5;
  --card: #ffffff;
  --card-2: #f1f4f8;
  --line: #e2e8f0;
  --line-2: #c9d4e0;

  --text: #0e1620;
  --dim: #5a6b7c;
  --dim-2: #8598aa;

  --accent: #0c8a56;
  --accent-soft: rgba(15, 169, 104, 0.10);
  --accent-line: rgba(15, 169, 104, 0.45);

  --yes: #0da05f;
  --yes-soft: rgba(13, 160, 95, 0.10);
  --no: #e5484d;
  --no-soft: rgba(229, 72, 77, 0.09);
  --amber: #b26a05;
}

[data-theme="light"] .pd-header {
  background: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .btn-accent {
  background: #0fa968;
  color: #fff;
}

[data-theme="light"] .btn-accent:hover {
  background: #12b975;
}

[data-theme="light"] .chip-count {
  background: rgba(178, 106, 5, 0.08);
  border-color: rgba(178, 106, 5, 0.3);
}

[data-theme="light"] .pd-bottomnav {
  background: rgba(255, 255, 255, 0.92);
}

[data-theme="light"] .card,
[data-theme="light"] .panel {
  box-shadow: 0 1px 3px rgba(14, 22, 32, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* numeric styling - the terminal signature */
.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* display type - headings and event titles */
h1,
h2,
h3,
.event-tile .t {
  font-family: var(--font-display);
}

/* wordmark gets its own face */
.pd-logo {
  font-family: 'Space Grotesk', var(--font-display);
}

/* ─────────────────────────────────────────────
   HEADER  (injected by shell.js)
   ───────────────────────────────────────────── */
.pd-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 19, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.pd-header .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}

.pd-logo {
  display: flex;
  align-items: baseline;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.pd-logo .d1 {
  color: var(--text);
}

.pd-logo .d2 {
  color: var(--accent);
}

.pd-logo .cursor {
  display: inline-block;
  width: 9px;
  height: 18px;
  margin-left: 3px;
  background: var(--accent);
  align-self: center;
  animation: pd-blink 1.1s steps(1) infinite;
}

@keyframes pd-blink {
  50% {
    opacity: 0;
  }
}

.pd-nav {
  display: flex;
  gap: 4px;
}

.pd-nav a {
  padding: 8px 13px;
  border-radius: var(--r-btn);
  font-size: 14px;
  font-weight: 600;
  color: var(--dim);
  transition: color .15s, background .15s;
  white-space: nowrap;
}

.pd-nav a:hover {
  color: var(--text);
  background: var(--card);
}

.pd-nav a.active {
  color: var(--text);
  background: var(--card-2);
}

.pd-search {
  flex: 1;
  max-width: 380px;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  color: var(--dim-2);
  font-size: 14px;
  transition: border-color .15s;
}

.pd-search:hover {
  border-color: var(--line-2);
}

.pd-search svg {
  flex: none;
}

.pd-search .kbd {
  margin-left: auto;
  font-family: var(--font-num);
  font-size: 11px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 1px 6px;
}

.pd-auth {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--r-btn);
  font-weight: 700;
  font-size: 14px;
  padding: 9px 18px;
  border: 1px solid transparent;
  transition: transform .1s, background .15s, border-color .15s;
  white-space: nowrap;
}

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

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-2);
}

.btn-ghost:hover {
  border-color: var(--dim-2);
}

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

.btn-accent:hover {
  background: #12c178;
}

.btn-tg {
  background: #2ea6da;
  color: #fff;
}

.btn-tg:hover {
  background: #44b4e4;
}

.pd-theme-btn {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--dim);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, border-color .15s;
}

.pd-theme-btn:hover {
  color: var(--accent);
  border-color: var(--accent-line);
}

.pd-burger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  padding: 6px;
}

/* mobile menu drawer */
.pd-drawer {
  display: none;
  position: fixed;
  inset: 64px 0 0 0;
  z-index: 99;
  background: var(--bg);
  padding: 20px 24px;
  flex-direction: column;
  gap: 6px;
}

.pd-drawer.open {
  display: flex;
}

.pd-drawer a {
  padding: 13px 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
}

.pd-drawer a.active {
  color: var(--text);
}

.pd-drawer .pd-auth {
  margin-top: 18px;
  flex-direction: column;
  align-items: stretch;
}

.pd-drawer .btn {
  padding: 13px;
}

/* ─────────────────────────────────────────────
   TICKER TAPE  (injected by shell.js)
   ───────────────────────────────────────────── */
.pd-ticker {
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-num);
  font-size: 12.5px;
  user-select: none;
}

.pd-ticker-track {
  display: inline-flex;
  gap: 36px;
  padding: 8px 0;
  animation: pd-scroll 60s linear infinite;
}

.pd-ticker:hover .pd-ticker-track {
  animation-play-state: paused;
}

@keyframes pd-scroll {
  to {
    transform: translateX(-50%);
  }
}

.tick {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--dim);
}

.tick b {
  color: var(--text);
  font-weight: 500;
}

.tick .up {
  color: var(--yes);
}

.tick .dn {
  color: var(--no);
}

/* ─────────────────────────────────────────────
   CATEGORY TABS  (injected by shell.js)
   ───────────────────────────────────────────── */
.pd-tabs {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 64px;
  z-index: 90;
}

.pd-tabs .wrap {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pd-tabs .wrap::-webkit-scrollbar {
  display: none;
}

.pd-tabs a {
  flex: none;
  padding: 13px 2px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--dim);
  border-bottom: 2px solid transparent;
  transition: color .15s;
}

.pd-tabs a:hover {
  color: var(--text);
}

.pd-tabs a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.pd-tabs a .live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--no);
  margin-right: 6px;
  vertical-align: 1px;
  animation: pd-pulse 1.6s ease infinite;
}

@keyframes pd-pulse {
  50% {
    opacity: 0.35;
  }
}

/* ─────────────────────────────────────────────
   GENERIC SECTION SCAFFOLD
   ───────────────────────────────────────────── */
.sec {
  padding: 34px 0 10px;
}

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
}

.sec-head h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sec-head .see-all {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
}

.sec-head .see-all:hover {
  text-decoration: underline;
}

.sec-sub {
  color: var(--dim);
  font-size: 14px;
  margin-top: 2px;
}

/* ─────────────────────────────────────────────
   MARKET CARDS
   ───────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 18px;
  transition: border-color .15s, transform .15s;
}

a.card:hover,
.card.hover:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
}

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

.mcard-top {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.mcard-ico {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--card-2);
  border: 1px solid var(--line);
  overflow: hidden;
}

.mcard-ico img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mcard-cat {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim-2);
  margin-bottom: 2px;
}

.mcard-title {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
}

.orow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}

.orow:last-of-type {
  border-bottom: none;
}

.orow .flag {
  font-size: 17px;
  flex: none;
}

.flag-img {
  width: 24px;
  height: 17px;
  border-radius: 3px;
  object-fit: cover;
  flex: none;
  box-shadow: 0 0 0 1px var(--line-2);
}

.h2h-side .e .flag-img {
  margin: 5px auto 4px;
  width: 30px;
  height: 21px;
}

.orow .lbl {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orow .pays {
  font-family: var(--font-num);
  font-size: 12.5px;
  color: var(--dim);
}

.orow .odds {
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 700;
  min-width: 58px;
  text-align: center;
  padding: 5px 0;
  border-radius: var(--r-pill);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  background: var(--accent-soft);
}

.ynrow {
  display: flex;
  gap: 9px;
}

.ynbtn {
  flex: 1;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  padding: 9px 0;
  font-weight: 700;
  font-size: 13.5px;
  font-family: var(--font-num);
}

.ynbtn.yes {
  background: var(--yes-soft);
  color: var(--yes);
  border-color: rgba(47, 213, 117, 0.3);
}

.ynbtn.yes:hover {
  background: rgba(47, 213, 117, 0.22);
}

.ynbtn.no {
  background: var(--no-soft);
  color: var(--no);
  border-color: rgba(255, 93, 93, 0.3);
}

.ynbtn.no:hover {
  background: rgba(255, 93, 93, 0.22);
}

.mcard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--dim-2);
}

.mcard-foot .num {
  font-size: 12px;
}

/* countdown chip - the predict.day signature */
.chip-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-num);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--amber);
  background: rgba(245, 184, 61, 0.1);
  border: 1px solid rgba(245, 184, 61, 0.28);
  border-radius: var(--r-pill);
  padding: 3px 10px;
}

.chip-count.closing {
  color: var(--no);
  background: var(--no-soft);
  border-color: rgba(255, 93, 93, 0.3);
}

.chip-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--no);
  background: var(--no-soft);
  border-radius: var(--r-pill);
  padding: 3px 10px;
}

.chip-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--no);
  animation: pd-pulse 1.6s ease infinite;
}

/* grids */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ─────────────────────────────────────────────
   FOOTER  (injected by shell.js)
   ───────────────────────────────────────────── */
.pd-footer {
  margin-top: 70px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: 48px 0 90px;
  font-size: 14px;
}

.pd-footer .cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 32px;
}

.pd-footer h4 {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim-2);
  margin-bottom: 14px;
}

.pd-footer ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.pd-footer ul a {
  color: var(--dim);
  transition: color .15s;
}

.pd-footer ul a:hover {
  color: var(--text);
}

.pd-footer .brand-col p {
  color: var(--dim);
  margin-top: 12px;
  max-width: 300px;
  line-height: 1.6;
}

.pd-footer .socials {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.pd-footer .socials a {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  transition: color .15s, border-color .15s;
}

.pd-footer .socials a:hover {
  color: var(--accent);
  border-color: var(--accent-line);
}

.pd-fineprint {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--dim-2);
  font-size: 12px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ─────────────────────────────────────────────
   MOBILE BOTTOM NAV  (injected by shell.js)
   ───────────────────────────────────────────── */
.pd-bottomnav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: rgba(10, 14, 19, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
}

.pd-bottomnav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--dim-2);
  padding: 4px 0;
}

.pd-bottomnav a.active {
  color: var(--accent);
}

.pd-bottomnav a .lv {
  color: var(--no);
}

/* ─────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────── */
@media (max-width:1200px) {

  /* mid breakpoint: drop the search first, then tighten the header so
     nav + auth stay on one line all the way down to the burger at 768px */
  .pd-search {
    display: none;
  }

  .pd-header .wrap {
    gap: 14px;
  }

  .pd-nav {
    margin-left: auto;
  }

  .pd-nav a {
    padding: 8px 9px;
    font-size: 13.5px;
  }

  .pd-auth {
    gap: 8px;
  }

  .pd-auth .btn {
    padding: 9px 13px;
    font-size: 13.5px;
  }
}

@media (max-width:1080px) {

  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width:900px) {
  .pd-footer .cols {
    grid-template-columns: 1fr 1fr;
  }

  .pd-footer .brand-col {
    grid-column: 1/-1;
  }
}

@media (max-width:768px) {

  .pd-nav,
  .pd-auth-desktop {
    display: none;
  }

  .pd-burger {
    display: block;
    margin-left: auto;
  }

  .pd-bottomnav {
    display: flex;
  }

  .pd-tabs {
    top: 64px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .sec {
    padding: 26px 0 6px;
  }

  body {
    padding-bottom: 64px;
  }
}