:root {
  --bg: #0d1a12;
  --bg-card: #14251a;
  --bg-card-hover: #1a2f21;
  --border: #24402e;
  --text: #e8f5ec;
  --text-dim: #9db8a6;
  --green: #34d399;
  --green-dark: #059669;
  --yellow: #fbbf24;
  --red: #f87171;
  --common: #9ca3af;
  --uncommon: #4ade80;
  --rare: #38bdf8;
  --epic: #a78bfa;
  --legendary: #fbbf24;
  --mythic: #fb7185;
  --super: #f0abfc;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ---------- alert banner ---------- */
.alert-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: linear-gradient(90deg, var(--green-dark), #10b981);
  color: #fff;
  font-weight: 700;
  padding: 14px 48px 14px 20px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(16, 185, 129, .45);
  animation: bannerIn .3s ease;
}
.alert-banner.heads-up { background: linear-gradient(90deg, #b45309, #d97706); box-shadow: 0 4px 20px rgba(217, 119, 6, .45); }
@keyframes bannerIn { from { transform: translateY(-100%); } to { transform: translateY(0); } }
.alert-banner button {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #fff; font-size: 16px; cursor: pointer; opacity: .8;
}
.hidden { display: none !important; }

/* ---------- header ---------- */
.site-header {
  background: linear-gradient(180deg, #10241701, #10241766), var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 18px 20px;
}
.header-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-emoji { font-size: 38px; }
.brand h1 { font-size: 22px; letter-spacing: .3px; }
.tagline { color: var(--text-dim); font-size: 13px; }
.header-right { display: flex; align-items: center; gap: 14px; }
.mode-pill {
  font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-dim);
}
.mode-pill.exact { color: #052e16; background: var(--green); border-color: var(--green); }
.mode-pill.estimated { color: #451a03; background: var(--yellow); border-color: var(--yellow); }
.countdown-box {
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 8px 18px;
}
.countdown-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .6px; }
.countdown { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--green); }

/* ---------- main ---------- */
main { max-width: 960px; margin: 0 auto; padding: 18px 20px 40px; }

.controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.btn {
  border: none; border-radius: 10px; padding: 10px 16px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: transform .1s ease, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--green); color: #052e16; }
.btn-primary.enabled { background: var(--bg-card); color: var(--green); border: 1px solid var(--green); cursor: default; }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-dim); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--green); width: 16px; height: 16px; cursor: pointer; }
.perm-status { font-size: 12px; color: var(--text-dim); }

.stale-notice {
  background: #422006; border: 1px solid #a16207; color: #fde68a;
  border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; line-height: 1.5;
}

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tab {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 10px; padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.tab.active { background: var(--green); border-color: var(--green); color: #052e16; }

.track-shortcuts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.chip {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.chip:hover { border-color: var(--green); }
.chip-clear:hover { border-color: var(--red); color: var(--red); }

/* ---------- grid / cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px; position: relative; transition: border-color .15s, background .15s;
}
.card:hover { background: var(--bg-card-hover); }
.card.in-stock { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), 0 0 18px rgba(52, 211, 153, .15); }
.card.tracked-card { outline: 1px dashed rgba(251, 191, 36, .4); outline-offset: 2px; }

.card-top { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.card-icon {
  width: 46px; height: 46px; border-radius: 10px; background: #0a140e;
  display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0;
}
.card-icon img { width: 40px; height: 40px; object-fit: contain; }
.card-name { font-weight: 700; font-size: 14px; line-height: 1.25; }
.card-price { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.rarity {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; margin-top: 4px; color: #0b0f0c;
}
.r-Common { background: var(--common); }
.r-Uncommon { background: var(--uncommon); }
.r-Rare { background: var(--rare); }
.r-Epic { background: var(--epic); }
.r-Legendary { background: var(--legendary); }
.r-Mythic { background: var(--mythic); }
.r-Super { background: var(--super); }

.card-status { font-size: 13px; font-weight: 600; min-height: 20px; }
.status-in { color: var(--green); }
.status-next { color: var(--text-dim); font-weight: 500; }
.status-none { color: #6b7280; font-weight: 500; }

.bell {
  position: absolute; top: 10px; right: 10px;
  background: none; border: none; font-size: 18px; cursor: pointer;
  filter: grayscale(1); opacity: .45; transition: transform .1s, opacity .15s, filter .15s;
}
.bell:hover { transform: scale(1.15); opacity: .8; }
.bell.on { filter: none; opacity: 1; }

/* ---------- weather rows ---------- */
.weather-row {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px;
}
.weather-row.now { border-color: var(--green); }
.weather-row .w-icon { font-size: 26px; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; }
.weather-row .w-icon img { width: 40px; height: 40px; }
.weather-row .w-name { font-weight: 700; flex: 1; }
.weather-row .w-when { color: var(--text-dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.weather-note { grid-column: 1 / -1; color: var(--text-dim); font-size: 13px; padding: 4px 2px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  max-width: 960px; margin: 0 auto; padding: 18px 20px 30px;
  color: var(--text-dim); font-size: 12px; line-height: 1.7;
}
.site-footer a { color: var(--green); }

@media (max-width: 560px) {
  .header-inner { justify-content: center; text-align: center; }
  .brand { flex-direction: column; }
  .countdown { font-size: 22px; }
}
