:root {
  --bg: #07060a;
  --bg-2: #0d0a12;
  --card: rgba(22, 16, 24, 0.55);
  --card-border: rgba(255, 120, 50, 0.16);
  --text: #f4ede9;
  --muted: #9a8f8a;
  --ember: #ff6a1a;
  --ember-2: #ff3d2e;
  --ember-soft: #ffb347;
  --gold: #ffd27a;
  --good: #5fe08a;
  --bad: #ff5a6a;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

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

html, body { height: 100%; }

body {
  font-family: "Inter", system-ui, sans-serif;
  background: radial-gradient(1200px 700px at 50% -10%, #1a0f0c 0%, var(--bg-2) 45%, var(--bg) 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---------- Ambient background ---------- */
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(700px 380px at 50% 0%, rgba(255, 90, 30, 0.18), transparent 70%),
    radial-gradient(500px 320px at 85% 20%, rgba(255, 60, 46, 0.10), transparent 70%);
  z-index: 0;
}

.embers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.embers span {
  position: absolute;
  bottom: -10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ember-soft), var(--ember-2));
  box-shadow: 0 0 10px 2px rgba(255, 120, 40, 0.55);
  opacity: 0;
  animation: rise linear infinite;
}
.embers span:nth-child(1)  { left: 6%;  animation-duration: 11s; animation-delay: 0s;   }
.embers span:nth-child(2)  { left: 14%; animation-duration: 14s; animation-delay: 2s;   width:3px;height:3px;}
.embers span:nth-child(3)  { left: 22%; animation-duration: 9s;  animation-delay: 1s;   }
.embers span:nth-child(4)  { left: 31%; animation-duration: 16s; animation-delay: 4s;   width:4px;height:4px;}
.embers span:nth-child(5)  { left: 39%; animation-duration: 12s; animation-delay: 0.5s; }
.embers span:nth-child(6)  { left: 47%; animation-duration: 15s; animation-delay: 3s;   width:3px;height:3px;}
.embers span:nth-child(7)  { left: 55%; animation-duration: 10s; animation-delay: 2.5s; }
.embers span:nth-child(8)  { left: 63%; animation-duration: 13s; animation-delay: 1.5s; width:6px;height:6px;}
.embers span:nth-child(9)  { left: 71%; animation-duration: 17s; animation-delay: 5s;   }
.embers span:nth-child(10) { left: 79%; animation-duration: 11s; animation-delay: 0s;   width:3px;height:3px;}
.embers span:nth-child(11) { left: 86%; animation-duration: 14s; animation-delay: 3.5s; }
.embers span:nth-child(12) { left: 92%; animation-duration: 9s;  animation-delay: 2s;   width:4px;height:4px;}
.embers span:nth-child(13) { left: 10%; animation-duration: 18s; animation-delay: 6s;   }
.embers span:nth-child(14) { left: 50%; animation-duration: 13s; animation-delay: 4.5s; width:3px;height:3px;}
.embers span:nth-child(15) { left: 68%; animation-duration: 12s; animation-delay: 1s;   }

@keyframes rise {
  0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  10%  { opacity: 0.9; }
  50%  { transform: translateY(-50vh) translateX(20px) scale(1.1); opacity: 0.7; }
  100% { transform: translateY(-105vh) translateX(-10px) scale(0.4); opacity: 0; }
}

/* ---------- Layout ---------- */
.topbar, .wrap, .footer { position: relative; z-index: 1; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(16px, 4vw, 48px);
  max-width: 1100px;
  margin: 0 auto;
}

.brand { display: flex; align-items: center; gap: 12px; }
.flame {
  display: grid; place-items: center;
  filter: drop-shadow(0 0 8px rgba(255, 100, 30, 0.7));
  animation: flicker 2.4s ease-in-out infinite;
}
.flame svg path { fill: var(--ember); }
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(-1deg); opacity: 1; }
  50%      { transform: scale(1.08) rotate(1deg); opacity: 0.92; }
}
.wordmark {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: -0.5px;
}
.wordmark em {
  font-style: normal;
  background: linear-gradient(100deg, var(--ember-soft), var(--ember), var(--ember-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.net-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
}
.net-badge.ok { color: var(--good); border-color: rgba(95,224,138,0.35); }
.net-badge.warn { color: var(--gold); border-color: rgba(255,210,122,0.4); cursor: pointer; }

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px clamp(16px, 4vw, 48px) 60px;
}

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 36px 0 28px; }
.hero-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -1.5px;
}
.grad {
  background: linear-gradient(100deg, var(--ember-soft), var(--ember), var(--ember-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(255, 90, 30, 0.25);
}
.hero-sub {
  margin-top: 14px;
  color: var(--muted);
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
}

/* ---------- Global stats ---------- */
.global-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 8px 0 28px;
}
.gstat {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(14px);
  text-align: center;
}
.gstat-label { color: var(--muted); font-size: 0.8rem; font-weight: 500; }
.gstat-value {
  margin-top: 6px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(1.1rem, 3vw, 1.55rem);
}

/* ---------- Grid / cards ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,140,60,0.6), transparent);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.card-head h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
}
.pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 106, 26, 0.12);
  border: 1px solid rgba(255, 106, 26, 0.3);
  color: var(--ember-soft);
}

/* ---------- Action card ---------- */
.balance-row {
  display: flex; justify-content: space-between; align-items: baseline;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.balance-row strong { color: var(--text); font-weight: 600; font-size: 1rem; }

.input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 6px 8px 6px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-wrap:focus-within {
  border-color: rgba(255, 106, 26, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 106, 26, 0.12);
}
.input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1.4rem;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  min-width: 0;
}
.input-wrap input::placeholder { color: #5a504c; }

.minburn-note { color: var(--muted); font-size: 0.78rem; margin: 8px 2px 0; min-height: 1em; }

.action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.action-buttons .btn { flex: 1; }

.poke-row { margin-top: 16px; text-align: center; }
.poke-link {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
  transition: color 0.2s;
}
.poke-link:hover { color: var(--ember-soft); }

/* ---------- Stats card ---------- */
.countdown-block {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  margin-bottom: 18px;
}
.countdown-label { color: var(--muted); font-size: 0.8rem; }
.countdown {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 8vw, 2.8rem);
  letter-spacing: 2px;
  margin: 6px 0 12px;
  background: linear-gradient(100deg, var(--ember-soft), var(--ember));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.countdown.expired {
  background: none;
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
}
.countdown-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
}
.countdown-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ember-2), var(--ember), var(--ember-soft));
  transition: width 1s linear;
}
.countdown-hint { color: var(--muted); font-size: 0.76rem; margin-top: 8px; min-height: 1em; }

.ustat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.ustat {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 14px;
}
.ustat-label { color: var(--muted); font-size: 0.78rem; }
.ustat-value {
  margin-top: 4px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  word-break: break-word;
}

.claim-block {
  background: linear-gradient(135deg, rgba(255,106,26,0.10), rgba(255,61,46,0.06));
  border: 1px solid rgba(255,106,26,0.25);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
}
.claim-label { color: var(--ember-soft); font-size: 0.82rem; font-weight: 600; }
.claim-value {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  margin: 6px 0 14px;
}

/* ---------- Buttons ---------- */
.btn {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: 12px;
  padding: 13px 20px;
  cursor: pointer;
  color: #fff;
  transition: transform 0.12s, box-shadow 0.2s, opacity 0.2s, background 0.2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.full { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 0.82rem; border-radius: 10px; }

.btn-primary {
  background: linear-gradient(100deg, var(--ember), var(--ember-2));
  box-shadow: 0 8px 24px rgba(255, 80, 30, 0.35);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 10px 30px rgba(255, 80, 30, 0.5); }

.btn-fire {
  background: linear-gradient(100deg, #ff8a1f, var(--ember), var(--ember-2));
  background-size: 200% 100%;
  box-shadow: 0 8px 28px rgba(255, 70, 26, 0.45);
  animation: fireshift 4s ease infinite;
}
.btn-fire:hover:not(:disabled) { box-shadow: 0 12px 36px rgba(255, 70, 26, 0.6); }
@keyframes fireshift { 0%,100%{background-position:0% 0}50%{background-position:100% 0} }

.btn-secondary {
  background: rgba(255, 210, 122, 0.14);
  border: 1px solid rgba(255, 210, 122, 0.4);
  color: var(--gold);
}
.btn-secondary:hover:not(:disabled) { background: rgba(255, 210, 122, 0.22); }

.btn-ghost {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.1); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: 92vw;
  background: rgba(20, 14, 18, 0.95);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 14px 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.25s ease;
}
@keyframes toastIn { from { opacity:0; transform: translate(-50%, 12px);} to {opacity:1;} }
.toast a { color: var(--ember-soft); text-decoration: none; font-weight: 600; }
.toast a:hover { text-decoration: underline; }
.toast.pending { border-color: rgba(255,210,122,0.4); }
.toast.success { border-color: rgba(95,224,138,0.4); }
.toast.error   { border-color: rgba(255,90,106,0.45); }
.toast .spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: var(--ember-soft);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 48px) 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}
.footer a { color: var(--ember-soft); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .global-stats { grid-template-columns: 1fr; }
  .wordmark { font-size: 1.4rem; }
  .topbar { padding: 16px; }
}
