/* ========== Epston Files — retarded meme cartoon theme ========== */
:root {
  --sky:        #4DA6E0;
  --sky-deep:   #1E78C4;
  --sand:       #F4D58D;
  --sand-dark:  #D9A441;
  --ink:        #0B0F14;
  --paper:      #FFF8E7;
  --red:        #DC2626;
  --red-deep:   #991B1B;
  --green:      #22C55E;
  --green-deep: #15803D;
  --ufo:        #6FE26F;
  --gold:       #F59E0B;
  --line:       #000000;
  --shadow:     6px 6px 0 #000;
  --shadow-sm:  3px 3px 0 #000;
  --radius:     14px;
  --bangers:    "Bangers", "Bowlby One", system-ui, sans-serif;
  --bowl:       "Bowlby One", "Bangers", system-ui, sans-serif;
  --ui:         "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ui);
  color: var(--ink);
  background: linear-gradient(180deg, #87CEEB 0%, #4DA6E0 35%, #F4D58D 100%);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ========== Background scene ========== */
.bg-scene { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-sky { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% -20%, rgba(255,255,255,.6), transparent 60%); }
.bg-sun { position: absolute; top: 8%; right: 8%; width: 120px; height: 120px; background: radial-gradient(circle, #FFE066 0%, #FFB000 70%, transparent 72%); border-radius: 50%; opacity: .5; animation: sunPulse 6s ease-in-out infinite; }
@keyframes sunPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.bg-cloud { position: absolute; width: 180px; height: 60px; background: #fff; border-radius: 60px; opacity: .55; box-shadow: 50px -15px 0 -5px #fff, -40px -10px 0 -10px #fff; animation: drift 60s linear infinite; }
.cloud-1 { top: 12%; left: -10%; animation-duration: 70s; }
.cloud-2 { top: 25%; left: -25%; animation-duration: 95s; transform: scale(.8); opacity: .4; }
.cloud-3 { top: 6%; left: -30%; animation-duration: 55s; transform: scale(1.2); opacity: .3; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(140vw); } }

.bg-ufo { position: absolute; top: 18%; left: 60%; font-size: 56px; filter: drop-shadow(0 0 20px #6FE26F); animation: ufo 14s ease-in-out infinite; }
@keyframes ufo {
  0%   { transform: translate(0,0)       rotate(-2deg); }
  25%  { transform: translate(-80px,40px) rotate(2deg); }
  50%  { transform: translate(40px,80px)  rotate(-3deg); }
  75%  { transform: translate(80px,20px)  rotate(2deg); }
  100% { transform: translate(0,0)        rotate(-2deg); }
}

.bg-alien { position: absolute; bottom: 8%; right: 6%; font-size: 50px; animation: bobAlien 3s ease-in-out infinite; }
@keyframes bobAlien { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-12px) rotate(3deg); } }

.bg-paper { position: absolute; font-size: 40px; opacity: .4; animation: float 12s ease-in-out infinite; }
.paper-1 { top: 35%; left: 4%; animation-delay: 0s; }
.paper-2 { top: 60%; left: 15%; animation-delay: 2s; font-size: 48px; }
.paper-3 { top: 75%; right: 20%; animation-delay: 4s; }
.paper-4 { top: 45%; right: 6%; animation-delay: 6s; font-size: 52px; }
.paper-5 { top: 80%; left: 40%; animation-delay: 1s; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-25px) rotate(5deg); } }

.bg-money { position: absolute; font-size: 36px; opacity: .35; animation: floatMoney 9s ease-in-out infinite; }
.money-1 { top: 28%; left: 30%; }
.money-2 { top: 70%; right: 35%; animation-delay: 3s; }
@keyframes floatMoney { 0%,100% { transform: translateY(0) rotate(8deg); } 50% { transform: translateY(-30px) rotate(-8deg); } }

/* ========== Stock ticker ========== */
.ticker-bar {
  position: relative; z-index: 5;
  display: flex; align-items: stretch;
  background: var(--ink); color: #FFF;
  border-bottom: 4px solid var(--line);
  font-weight: 800; font-size: 14px;
  height: 38px; overflow: hidden;
}
.ticker-label {
  background: var(--red); color: #FFF;
  padding: 0 14px; display: flex; align-items: center;
  font-family: var(--bangers); letter-spacing: 1.2px; font-size: 18px;
  border-right: 4px solid #000;
  flex-shrink: 0;
}
.ticker-track { display: flex; align-items: center; white-space: nowrap; animation: ticker 60s linear infinite; }
.ticker-track:hover { animation-play-state: paused; }
.tick-item { padding: 0 22px; display: inline-flex; gap: 8px; align-items: center; }
.tick-up   { color: #4ADE80; }
.tick-down { color: #F87171; }
.tick-symbol { font-weight: 900; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ========== Navbar ========== */
.navbar { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 4px solid var(--line); box-shadow: 0 4px 0 #000; }
.nav-inner { max-width: 1400px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 50px; height: 50px; border-radius: 10px; border: 3px solid #000; background: #FFF; box-shadow: var(--shadow-sm); object-fit: cover; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-title { font-family: var(--bangers); font-size: 28px; letter-spacing: 1.5px; color: var(--ink); -webkit-text-stroke: 1px #000; }
.brand-tag { font-size: 11px; color: var(--red); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }

.nav-links { display: flex; gap: 18px; margin-left: 14px; }
.nav-links a { font-weight: 700; padding: 8px 4px; position: relative; }
.nav-links a:hover { color: var(--red); }
.nav-links a:hover::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--red); }

.nav-actions { display: flex; gap: 8px; margin-left: auto; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 800; font-size: 13px;
  padding: 10px 14px;
  border: 3px solid var(--line);
  border-radius: 10px;
  background: #FFF; color: #000;
  box-shadow: var(--shadow-sm);
  transition: transform .08s, box-shadow .08s;
  text-transform: uppercase; letter-spacing: .5px;
  white-space: nowrap;
}
.btn:hover  { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 #000; }
.btn:active { transform: translate(2px,2px);  box-shadow: 1px 1px 0 #000; }

.btn-x { background: #000; color: #FFF; }
.btn-buy { background: var(--gold); color: #000; }
.btn-wallet { background: var(--red); color: #FFF; }
.btn-wallet.connected { background: var(--green); }

.hamburger { display: none; background: var(--red); color: #FFF; border: 3px solid #000; border-radius: 10px; padding: 8px 12px; font-size: 18px; box-shadow: var(--shadow-sm); }
.mobile-menu { display: none; flex-direction: column; gap: 10px; padding: 14px 20px; background: var(--paper); border-top: 3px solid #000; }
.mobile-menu a { padding: 8px 0; font-weight: 700; border-bottom: 2px solid rgba(0,0,0,.1); }
.mobile-menu .btn { justify-content: center; }
.mobile-menu.open { display: flex; }

/* ========== Hero ========== */
.hero { position: relative; z-index: 1; max-width: 1400px; margin: 18px auto 0; padding: 0 20px; }
.hero-banner { width: 100%; border: 4px solid #000; border-radius: 18px; box-shadow: var(--shadow); background: var(--sky); }
.hero-fallback { width: 100%; padding: 60px 20px; text-align: center; border: 4px solid #000; border-radius: 18px; background: linear-gradient(135deg, #4DA6E0, #87CEEB); box-shadow: var(--shadow); }
.hero-fallback h1 { font-family: var(--bangers); font-size: 80px; margin: 0; color: #FFF; -webkit-text-stroke: 3px #000; letter-spacing: 3px; }
.hero-fallback p  { font-family: var(--bangers); font-size: 32px; color: #FFE066; -webkit-text-stroke: 2px #000; }
.hero-overlay { margin-top: 14px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.hero-stat { background: var(--paper); border: 3px solid #000; border-radius: 12px; padding: 12px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hero-stat-num { font-family: var(--bangers); font-size: 26px; letter-spacing: 1.2px; color: var(--ink); }
.hero-stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #555; }

/* ========== Filters ========== */
.filters { max-width: 1400px; margin: 24px auto 12px; padding: 0 20px; position: relative; z-index: 1; }
.filters-inner { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { background: #FFF; color: #000; border: 3px solid #000; border-radius: 999px; padding: 8px 14px; font-weight: 800; font-size: 13px; box-shadow: var(--shadow-sm); white-space: nowrap; transition: transform .08s, box-shadow .08s; }
.chip:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 #000; }
.chip-active { background: var(--red); color: #FFF; }
.search { margin-left: auto; min-width: 220px; flex: 1; max-width: 360px; padding: 10px 14px; border: 3px solid #000; border-radius: 999px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-sm); background: #FFF; }

/* ========== Main grid ========== */
.main-grid { max-width: 1400px; margin: 0 auto; padding: 8px 20px 30px; position: relative; z-index: 1; }
.markets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }

/* ========== Market card ========== */
.market { background: var(--paper); border: 3px solid #000; border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px; display: flex; flex-direction: column; gap: 10px; position: relative; transition: transform .1s ease; }
.market:hover { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 #000; }
.market-cat { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800; text-transform: uppercase; background: #000; color: #FFF; padding: 3px 8px; border-radius: 999px; letter-spacing: .8px; align-self: flex-start; }
.market-q { font-weight: 800; font-size: 15px; line-height: 1.3; min-height: 42px; color: var(--ink); }
.market-meta { display: flex; justify-content: space-between; font-size: 11px; color: #555; font-weight: 600; }
.market-meta .vol { color: #000; }
.bar { height: 8px; background: #fee; border: 2px solid #000; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--green), #16A34A); }
.market-actions { display: flex; gap: 8px; }
.bet { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px; border: 3px solid #000; border-radius: 10px; background: #FFF; font-weight: 800; font-size: 14px; box-shadow: var(--shadow-sm); transition: transform .08s, box-shadow .08s; }
.bet:hover  { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 #000; }
.bet:active { transform: translate(2px,2px);  box-shadow: 1px 1px 0 #000; }
.bet-yes { background: #BBF7D0; }
.bet-no  { background: #FECACA; }
.bet.selected { outline: 3px solid var(--gold); outline-offset: 2px; }
.bet small { font-weight: 700; font-size: 10px; opacity: .7; }
.bet b { font-family: var(--bangers); font-size: 18px; letter-spacing: 1px; }

/* ========== Section titles (parlay, leaderboard, how) ========== */
.section-title { font-family: var(--bangers); font-size: 44px; letter-spacing: 2px; text-align: center; margin: 0 0 6px; color: var(--ink); -webkit-text-stroke: 1px #000; }
.section-sub   { text-align: center; font-size: 14px; color: #333; max-width: 640px; margin: 0 auto 22px; font-weight: 600; }

/* ========== Parlay section ========== */
.parlay-section { position: relative; z-index: 1; padding: 30px 20px; }
.parlay-section-inner { max-width: 900px; margin: 0 auto; }
.parlay-card-wide {
  background: var(--paper);
  border: 4px solid #000;
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.parlay-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.parlay-head h3 { margin: 0; font-family: var(--bangers); font-size: 26px; letter-spacing: 1.2px; }
.parlay-clear { background: transparent; border: 0; color: var(--red); font-weight: 800; font-size: 13px; padding: 6px 10px; border-radius: 6px; }
.parlay-clear:hover { background: rgba(220,38,38,.1); }

.parlay-body { min-height: 90px; max-height: 360px; overflow-y: auto; margin: 10px 0 14px; padding: 4px; }
.parlay-empty { font-size: 14px; color: #555; line-height: 1.5; text-align: center; padding: 24px 8px; }

.leg { background: #FFF; border: 2px solid #000; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 13px; display: flex; gap: 10px; align-items: center; }
.leg-pick { font-family: var(--bangers); font-size: 16px; padding: 4px 10px; border-radius: 8px; border: 2px solid #000; flex-shrink: 0; }
.leg-pick.yes { background: #BBF7D0; }
.leg-pick.no  { background: #FECACA; }
.leg-q { flex: 1; font-weight: 700; line-height: 1.3; }
.leg-odds { display: inline-block; margin-top: 4px; font-weight: 800; font-size: 12px; color: #000; background: var(--gold); padding: 2px 6px; border-radius: 4px; border: 2px solid #000; }
.leg-x { background: var(--red); color: #FFF; border: 2px solid #000; border-radius: 6px; width: 28px; height: 28px; font-weight: 900; font-size: 16px; flex-shrink: 0; padding: 0; }

.parlay-foot { display: flex; flex-direction: column; gap: 12px; }
.stake-label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.stake-label input { padding: 12px 14px; border: 3px solid #000; border-radius: 10px; font-weight: 800; font-size: 16px; background: #FFF; }
.parlay-meta { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; text-align: center; }
.parlay-meta div { background: #FFF; border: 3px solid #000; border-radius: 10px; padding: 10px 6px; }
.parlay-meta span { display: block; font-size: 10px; color: #555; text-transform: uppercase; font-weight: 800; margin-bottom: 4px; }
.parlay-meta b { font-family: var(--bangers); font-size: 22px; letter-spacing: 1px; }

.btn-place { width: 100%; background: var(--red); color: #FFF; font-family: var(--bangers); font-size: 24px; letter-spacing: 1.5px; padding: 14px; border: 3px solid #000; border-radius: 12px; box-shadow: var(--shadow-sm); }
.btn-place:hover  { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 #000; }
.btn-place:active { transform: translate(2px,2px);  box-shadow: 1px 1px 0 #000; }

/* ========== Leaderboard ========== */
.leaderboard-section { position: relative; z-index: 1; padding: 40px 20px; }
.leaderboard-inner { max-width: 1200px; margin: 0 auto; }
.leaderboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.lb-card {
  background: var(--paper);
  border: 4px solid #000;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 16px;
  text-align: center;
  position: relative;
}
.lb-card .lb-rank {
  position: absolute; top: -14px; left: -14px;
  width: 38px; height: 38px; border-radius: 50%;
  background: #000; color: #FFF;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--bangers); font-size: 20px;
  border: 3px solid #000;
}
.lb-1 { background: linear-gradient(135deg, #FFE066, #F59E0B); }
.lb-1 .lb-rank { background: #F59E0B; }
.lb-2 { background: linear-gradient(135deg, #E5E7EB, #9CA3AF); }
.lb-2 .lb-rank { background: #6B7280; }
.lb-3 { background: linear-gradient(135deg, #FCD34D, #B45309); color: #FFF; }
.lb-3 .lb-rank { background: #92400E; }
.lb-emoji { font-size: 36px; line-height: 1; }
.lb-name  { font-weight: 900; font-size: 16px; margin: 6px 0 2px; }
.lb-amount { font-family: var(--bangers); font-size: 22px; color: var(--green-deep); letter-spacing: 1px; }
.lb-3 .lb-amount, .lb-2 .lb-amount, .lb-1 .lb-amount { color: #000; }
.lb-meta  { font-size: 11px; font-weight: 600; opacity: .7; margin-top: 4px; }

/* ========== How it works ========== */
.how { max-width: 1400px; margin: 30px auto; padding: 30px 20px; position: relative; z-index: 1; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 18px; margin-top: 22px; }
.how-card { background: var(--paper); border: 4px solid #000; border-radius: 16px; padding: 18px; box-shadow: var(--shadow); position: relative; }
.how-num { position: absolute; top: -16px; left: -16px; width: 44px; height: 44px; border-radius: 50%; background: var(--red); color: #FFF; display: flex; align-items: center; justify-content: center; font-family: var(--bangers); font-size: 24px; border: 3px solid #000; box-shadow: var(--shadow-sm); }
.how-card h4 { margin: 4px 0 8px; font-size: 18px; font-weight: 800; }
.how-card p  { margin: 0; font-size: 13px; line-height: 1.5; color: #333; }

/* ========== Footer ========== */
.footer { background: var(--ink); color: #FFF; margin-top: 40px; padding: 30px 20px 16px; border-top: 4px solid #000; position: relative; z-index: 1; }
.footer-inner { max-width: 1400px; margin: 0 auto; display: flex; gap: 30px; flex-wrap: wrap; justify-content: space-between; }
.footer-brand { display: flex; gap: 14px; align-items: flex-start; max-width: 460px; }
.footer-logo { width: 56px; height: 56px; border-radius: 12px; border: 3px solid #FFF; }
.footer-brand b { font-family: var(--bangers); font-size: 22px; letter-spacing: 1.5px; }
.footer-brand p { margin: 4px 0 0; font-size: 13px; opacity: .8; }
.footer-links { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; }
.footer-links a:hover { color: var(--gold); }
.footer-bottom { max-width: 1400px; margin: 20px auto 0; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.15); font-size: 12px; opacity: .7; text-align: center; }

/* ========== Floating parlay FAB ========== */
.parlay-fab {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 60;
  background: var(--red); color: #FFF;
  border: 3px solid #000; border-radius: 999px;
  padding: 12px 18px;
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 14px;
  box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s;
}
.parlay-fab:hover  { transform: translate(-2px,-2px); box-shadow: 8px 8px 0 #000; }
.parlay-fab:active { transform: translate(2px,2px);  box-shadow: 2px 2px 0 #000; }
.fab-icon { font-size: 18px; }
.fab-label { font-family: var(--bangers); font-size: 18px; letter-spacing: 1px; }
.fab-count { background: var(--gold); color: #000; border: 2px solid #000; border-radius: 999px; padding: 2px 8px; min-width: 24px; text-align: center; font-weight: 900; font-size: 13px; }
.parlay-fab.pulse { animation: fabPulse .5s ease; }
@keyframes fabPulse { 0% { transform: scale(1); } 50% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ========== Toast ========== */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--ink); color: #FFF;
  padding: 12px 20px; border-radius: 999px;
  border: 3px solid var(--gold);
  font-weight: 700; font-size: 14px;
  z-index: 100; opacity: 0;
  transition: transform .25s, opacity .25s;
  box-shadow: var(--shadow);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .nav-links { display: none; }
}

@media (max-width: 720px) {
  .nav-actions .btn-x, .nav-actions .btn-buy, .nav-actions .btn-wallet { display: none; }
  .hamburger { display: inline-flex; margin-left: auto; }
  .brand-title { font-size: 22px; }
  .brand-logo { width: 42px; height: 42px; }
  .hero-stats { grid-template-columns: repeat(2,1fr); }
  .hero-stat-num { font-size: 22px; }
  .ticker-label { font-size: 14px; padding: 0 10px; }
  .ticker-bar { font-size: 12px; height: 32px; }
  .markets-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 32px; }
  .filters-inner { gap: 6px; }
  .chip { padding: 6px 10px; font-size: 12px; }
  .search { min-width: 100%; max-width: 100%; margin-left: 0; }
  .footer-inner { flex-direction: column; }
  .parlay-meta b { font-size: 18px; }
  .leaderboard-grid { grid-template-columns: repeat(2, 1fr); }
  .fab-label { display: none; }
}
