:root {
  --bg: #0F2E2C;
  --surface: #16403C;
  --surface-raised: #1D4C46;
  --marigold: #F2A93B;
  --chili: #E4614F;
  --text: #F6F1E7;
  --text-muted: #9FC1BB;
  --border: rgba(246, 241, 231, 0.10);
  --radius: 14px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--marigold); outline-offset: 2px; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(15, 46, 44, 0.92);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.15rem; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--marigold); color: var(--bg);
  font-weight: 700; font-size: 1rem;
}
.brand-name em { font-style: normal; color: var(--marigold); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.how-btn, .lang-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
}
.how-btn:hover, .lang-btn:hover { border-color: var(--marigold); color: var(--marigold); }
.lang-btn { font-family: var(--font-mono); font-size: 0.72rem; }

/* ---------- Hero ---------- */
.hero {
  padding: 40px 20px 28px;
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--marigold);
  margin: 0 0 12px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  line-height: 1.15;
  margin: 0 0 14px;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 46ch;
  margin: 0 0 26px;
}

.ticker-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.ticker-label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }
.ticker-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 600;
  color: var(--marigold);
  letter-spacing: -0.01em;
}
.ticker-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* ---------- Controls ---------- */
.controls {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 20px 4px;
}

.search-wrap { margin-bottom: 14px; }
#searchInput {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
}
#searchInput::placeholder { color: var(--text-muted); }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.83rem;
  white-space: nowrap;
}
.chip.active {
  background: var(--marigold);
  border-color: var(--marigold);
  color: var(--bg);
  font-weight: 600;
}

/* ---------- Deal grid ---------- */
.deal-grid {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 20px 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 620px) {
  .deal-grid { grid-template-columns: 1fr 1fr; }
}

.deal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deal-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.deal-merchant {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.deal-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(228, 97, 79, 0.16);
  color: var(--chili);
}

.deal-title { font-family: var(--font-display); font-size: 1.05rem; margin: 0; }
.deal-desc { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

.deal-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.deal-expiry { font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-mono); }

.deal-actions { display: flex; align-items: center; gap: 8px; }

.share-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-btn:hover { border-color: var(--marigold); color: var(--marigold); }

.redeem-btn {
  background: var(--marigold);
  color: var(--bg);
  border: none;
  padding: 9px 16px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.85rem;
}
.redeem-btn:hover { filter: brightness(1.08); }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  max-width: 640px;
  margin: 0 auto;
}

/* ---------- Footer ---------- */
.footer {
  max-width: 640px;
  margin: 20px auto 0;
  padding: 20px 20px 60px;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.link-btn {
  background: none;
  border: none;
  color: var(--marigold);
  text-decoration: underline;
  font-size: 0.78rem;
  padding: 0;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}
@media (min-width: 620px) {
  .modal-backdrop { align-items: center; }
}

.modal {
  background: var(--surface-raised);
  border-radius: 18px 18px 0 0;
  padding: 26px 24px 30px;
  max-width: 480px;
  width: 100%;
  border: 1px solid var(--border);
}
@media (min-width: 620px) {
  .modal { border-radius: 18px; }
}

.modal h2 { font-family: var(--font-display); font-size: 1.2rem; margin: 0 0 16px; }
.modal ol { padding-left: 20px; font-size: 0.88rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 12px; }
.modal ol strong { color: var(--text); }

.close-btn {
  margin-top: 18px;
  width: 100%;
  background: var(--marigold);
  color: var(--bg);
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
}

@media (prefers-reduced-motion: no-preference) {
  .deal-card { transition: transform 0.15s ease; }
  .deal-card:hover { transform: translateY(-2px); }
}
