/* ── Google Font ──────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;500;600;700;800&display=swap');

/* ── Reset & Base ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #fff9f2;
  --surface:  #ffffff;
  --border:   #FD840E;
  --orange:   #FD840E;
  --green:    #1a9960;
  --gold:     #FD840E;
  --text:     #1a1a1a;
  --muted:    #666666;
  --red:      #dc3545;
  --radius:   14px;
  --font:     'Baloo 2', system-ui, sans-serif;
}

/* ── Fixed Background ─────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('assets/bg.png') center / cover no-repeat;
  z-index: -1;
}

/* docs.html gets a much more subtle background */
body.docs-page { background: #ffffff; }
body.docs-page::before { opacity: 0.08; }

body {
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 60px;
}

/* ── Hero Brand Logo ──────────────────────── */
.hero-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 0 8px;
  width: 100%;
  max-width: 480px;
}

.hero-logo {
  width: 168px;
  height: 168px;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(253,132,14,0.30));
  animation: hero-float 4s ease-in-out infinite;
}

@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ── Header ───────────────────────────────── */
header {
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 12px 18px;
  border: 2px solid rgba(253,132,14,0.35);
  box-shadow: 0 4px 20px rgba(253,132,14,0.12);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  font-family: var(--font);
}

.logo-fox {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.logo span { color: var(--orange); }

.network-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(253,132,14,0.1);
  color: var(--orange);
  border: 1.5px solid rgba(253,132,14,0.4);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.network-badge img {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  object-fit: cover;
}

/* ── Connect Button ───────────────────────── */
#btn-connect {
  background: #111111;
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: var(--font);
}
#btn-connect:hover { opacity: 0.82; }
#btn-connect.connected {
  background: rgba(255,255,255,0.7);
  color: var(--muted);
  border: 1.5px solid var(--border);
  font-weight: 600;
  font-size: 0.78rem;
}

/* ── Main Layout ──────────────────────────── */
main {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Cards ────────────────────────────────── */
.card {
  background: rgba(255,255,255,0.95);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 18px rgba(253,132,14,0.10);
}

.card-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--orange);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-title img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

/* ── Stats Grid ───────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat {
  background: var(--bg);
  border: 1.5px solid rgba(253,132,14,0.2);
  border-radius: 10px;
  padding: 12px 14px;
}

.stat-label {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-label img {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  object-fit: cover;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
}

.stat-value.green  { color: var(--green); }
.stat-value.gold   { color: var(--orange); }

/* ── Countdown ────────────────────────────── */
.countdown-wrap {
  text-align: center;
  padding: 18px;
  background: var(--bg);
  border: 1.5px solid rgba(253,132,14,0.2);
  border-radius: 10px;
  margin-bottom: 12px;
}

.countdown-label {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.countdown-timer {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--orange);
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
}

#btn-draw {
  width: 100%;
  padding: 12px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: var(--font);
}
#btn-draw:hover:not(:disabled) { opacity: 0.85; }
#btn-draw:disabled { background: #ddd; color: #aaa; cursor: not-allowed; }

/* ── Forms ────────────────────────────────── */
.input-row {
  display: flex;
  gap: 8px;
}

input[type="number"] {
  flex: 1;
  background: #ffffff;
  border: 1.5px solid #ddd;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
  font-family: var(--font);
}
input[type="number"]:focus { border-color: var(--orange); }
input[type="number"]::placeholder { color: #aaa; }

.btn-action {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
  font-family: var(--font);
}
.btn-action:hover { opacity: 0.82; }
.btn-action:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-deposit  { background: #111111; color: #ffffff; }
.btn-withdraw { background: var(--red); color: #ffffff; border: 2px solid var(--red); }
.btn-max      { background: var(--orange); color: #ffffff; border: 2px solid var(--orange); }

.user-balance {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 8px;
}

.user-balance span { color: var(--green); font-weight: 600; }

/* ── Winners ──────────────────────────────── */
.winner-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.winner-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg);
  border: 1.5px solid rgba(253,132,14,0.15);
  border-radius: 8px;
  font-size: 0.85rem;
}

.winner-addr  { color: var(--muted); font-family: monospace; }
.winner-prize { color: var(--orange); font-weight: 700; }

.empty-state {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 20px;
}

/* ── Toast ────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #ffffff;
  border: 2px solid var(--orange);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.875rem;
  transition: transform 0.25s ease;
  pointer-events: none;
  max-width: 360px;
  text-align: center;
  z-index: 999;
  font-family: var(--font);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
#toast.show    { transform: translateX(-50%) translateY(0); }
#toast.success { border-color: var(--green); color: var(--green); }
#toast.error   { border-color: var(--red);   color: var(--red);   }

/* ── Pulse animation ──────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(1.4); }
}

/* ── Fox Card ────────────────────────────── */
.fox-card { border-color: var(--orange); }

/* Two-column layout */
.fox-columns {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: start;
}

.fox-img-col {
  border-radius: 14px;
  overflow: hidden;
  background: url('assets/fondozorrito.png') center/cover no-repeat;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fox-img-col img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  transition: opacity 0.3s;
}

.fox-info-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Keep old classes for resetStats compatibility */
.fox-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (max-width: 380px) {
  .fox-columns {
    grid-template-columns: 110px 1fr;
  }
}

.fox-status-line {
  font-size: 0.875rem;
  font-weight: 700;
}

.fox-meta {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-feed {
  background: var(--orange);
  color: #ffffff;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
  border-radius: 10px;
  transition: background 0.2s, opacity 0.15s;
  font-family: var(--font);
}
.btn-feed:disabled { background: #ddd; color: #aaa; cursor: not-allowed; }

.btn-tweet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #000000;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: opacity 0.15s;
  text-decoration: none;
  margin-top: 10px;
  width: 100%;
  justify-content: center;
}
.btn-tweet:hover { opacity: 0.82; }
.btn-tweet svg { flex-shrink: 0; }

/* ── Leaderboard agent/human badge ────────── */
.lb-badge {
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.lb-badge-human { background: rgba(26,153,96,0.12); color: var(--green); }
.lb-badge-agent { background: rgba(99,102,241,0.12); color: #6366f1; }

/* ── Leaderboard ─────────────────────────── */
.lb-row {
  display: grid;
  grid-template-columns: 28px 22px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  border-bottom: 1.5px solid rgba(253,132,14,0.12);
  font-size: 0.83rem;
}
.lb-row:last-child { border-bottom: none; }
.lb-me { background: rgba(253,132,14,0.07); border-radius: 8px; padding: 10px 8px; }

.lb-rank   { color: var(--muted); font-size: 0.85rem; text-align: center; }
.lb-fox    { font-size: 1rem; text-align: center; }
.lb-addr   { color: var(--text); font-family: monospace; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; }
.lb-streak { color: var(--orange); font-weight: 800; white-space: nowrap; }
.lb-fish   { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }

/* ── Fish presets ────────────────────────── */
.fish-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fish-preset {
  background: #ffffff;
  border: 2px solid #e0e0e0;
  color: var(--text);
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  font-family: var(--font);
}
.fish-preset:hover    { border-color: var(--orange); color: var(--orange); }
.fish-preset.selected { border-color: var(--orange); background: rgba(253,132,14,0.10); color: var(--orange); }

.deposit-preview {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(253,132,14,0.08);
  border: 1.5px solid rgba(253,132,14,0.25);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--orange);
  font-weight: 700;
}

/* ── Winning Odds ────────────────────────── */
.odds-display {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.odds-pct {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--orange);
  line-height: 1;
}

.odds-detail {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.odds-bar-wrap {
  width: 100%;
  height: 6px;
  background: #eee;
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}

.odds-bar {
  height: 100%;
  background: var(--orange);
  border-radius: 3px;
  transition: width 0.6s ease;
  min-width: 2px;
}

/* ── Yield Progress ───────────────────────── */
.yield-progress {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(253,132,14,0.06);
  border: 1.5px solid rgba(253,132,14,0.18);
  border-radius: 8px;
  font-size: 0.8rem;
}

.yp-hint  { color: var(--muted); line-height: 1.5; }
.yp-ready { color: var(--green); font-weight: 700; }
.yp-cta   { color: var(--orange); font-weight: 600; line-height: 1.5; }

/* ── Live APY ────────────────────────────── */
.live-apy { color: var(--green); font-weight: 700; }

/* ── Addr box (shared between index + docs) ─ */
.addr-box {
  background: var(--bg);
  border: 1.5px solid rgba(253,132,14,0.25);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-all;
  margin-bottom: 8px;
}

.addr-label {
  color: var(--orange);
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
  font-family: var(--font);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Footer ───────────────────────────────── */
footer {
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  background: rgba(255,255,255,0.80);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 10px 20px;
  border-radius: 12px;
  border: 1.5px solid rgba(253,132,14,0.2);
}
