:root {
  --red: #d11013;
  --red-dark: #a90d10;
  --yellow: #ffd500;
  --bg: #0f172a;
  --card: #1e293b;
  --hover: #27354a;
  --line: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --green: #34d399;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Plus Jakarta Sans', sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  padding-bottom: var(--safe-bottom);
  overflow-x: hidden;
}
img, video, svg { max-width: 100%; height: auto; }
a, button, input, select, label { -webkit-tap-highlight-color: transparent; }
button, .button, .tabs button, .plan {
  min-height: 44px;
  touch-action: manipulation;
}
header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #111b31ef;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  padding-top: var(--safe-top);
}
.header-inner, main { max-width: 1400px; margin: auto; }
.header-inner {
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
  font-size: 21px;
  font-weight: 800;
  min-width: 0;
}
.brand strong { white-space: nowrap; }
.brand strong span { color: var(--yellow); }
.brick {
  width: 36px;
  height: 36px;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: var(--red);
  display: grid;
  grid-template-columns: repeat(2, 7px);
  gap: 5px;
  place-content: center;
  box-shadow: 0 4px 15px #d1101366;
  cursor: pointer;
  flex-shrink: 0;
}
.brick i { width: 7px; height: 7px; background: #fff; border-radius: 50%; }
.owner-badge, .pro-tag {
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--yellow);
  border: 1px solid #a58b00;
  padding: 2px 6px;
  border-radius: 5px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.retailer-pills { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.retailer-pills span, .badge {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 5px;
}
.owner-tools {
  max-width: 1400px;
  margin: auto;
  padding: 9px 24px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-top: 1px solid var(--line);
  color: var(--yellow);
  font-size: 12px;
}
.owner-tools strong { margin-right: auto; }
.button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: #fff;
  padding: 9px 14px;
  font: 600 13px var(--sans);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}
.button:hover { background: var(--hover); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.primary { background: var(--red); border-color: var(--red); }
.primary:hover { background: var(--red-dark); }
main { padding: 26px 24px 70px; }
.hero {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 10% 20%, #d1101326, transparent 42%),
    radial-gradient(circle at 90% 80%, #006cb726, transparent 42%),
    var(--card);
  margin-bottom: 20px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--yellow);
  font-size: 11px;
  font-weight: 800;
}
.hero h1 { font-size: clamp(26px, 6vw, 46px); line-height: 1.12; margin: 12px 0; }
.hero h1 em { color: var(--yellow); font-style: normal; }
.hero p { max-width: 650px; color: var(--muted); font-size: 15px; }
.hero small { color: var(--muted); }
.hero b { color: #fff; font-family: var(--mono); font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 18px; }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font: 700 25px var(--mono); margin: 8px 0 2px; }
.stat-sub { color: var(--muted); font-size: 12px; }
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}
.tabs button {
  white-space: nowrap;
  border: 0;
  background: none;
  color: var(--muted);
  padding: 12px 15px;
  font: 600 13px var(--sans);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  flex-shrink: 0;
}
.tabs button.active { color: #fff; border-color: var(--yellow); }
.filters, .check-filters {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 13px;
  border-radius: 10px;
  margin-bottom: 14px;
}
.filters label:not(.search), .check-filters label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.filters input, .filters select, .check-filters input, .check-filters select,
.form-grid input, .form-grid select, dialog label input {
  background: #111b31;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #fff;
  padding: 10px 12px;
  font: 16px var(--sans);
  width: 100%;
  min-height: 44px;
}
.search {
  display: flex !important;
  align-items: center;
  background: #111b31;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding-left: 10px;
  color: var(--muted);
  flex: 1;
  min-width: 220px;
  min-height: 44px;
}
.search input {
  border: 0 !important;
  outline: 0;
  flex: 1;
  min-width: 0;
  font-size: 16px !important;
  min-height: 42px;
}
.result-line { color: var(--muted); font-size: 12px; margin: 10px 2px; }
.deal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; }
.deal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  transition: border-color .15s, transform .15s;
}
@media (hover: hover) and (pointer: fine) {
  .deal:hover { transform: translateY(-2px); border-color: #64748b; }
}
.deal-img { height: 170px; background: #121c30; display: grid; place-items: center; padding: 15px; }
.deal-img img {
  max-width: 100%;
  max-height: 145px;
  mix-blend-mode: screen;
  filter: drop-shadow(0 7px 8px #0008);
}
.deal-body { padding: 14px; }
.deal-top { display: flex; justify-content: space-between; gap: 5px; align-items: center; }
.deal-num { color: var(--yellow); font: 600 11px var(--mono); }
.discount {
  background: #064e3b;
  color: #6ee7b7;
  border-radius: 5px;
  padding: 3px 6px;
  font: 700 11px var(--mono);
}
.deal h3 { font-size: 14px; margin: 9px 0; line-height: 1.35; }
.price { display: flex; align-items: end; justify-content: space-between; gap: 8px; }
.sale { font: 700 22px var(--mono); }
.msrp { color: var(--muted); text-decoration: line-through; font-size: 11px; }
.save { color: var(--green); font: 700 11px var(--mono); }
.deal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.deal-foot .button { margin-left: auto; }
.retailer { color: var(--muted); font-size: 11px; }
.stock { color: var(--green); font-size: 11px; }
.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  overscroll-behavior: contain;
}
.compare {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.compare th, .compare td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.compare th { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.compare td { font-size: 13px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.theme-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 17px; }
.theme-card h3 { margin: 0 0 14px; color: var(--yellow); }
.theme-card p { color: var(--muted); margin: 5px 0; }
.theme-card strong { color: #fff; font-family: var(--mono); }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 15px;
  margin: 10px 0 18px;
}
.section-head h2 { font-size: clamp(22px, 5vw, 27px); margin: 5px 0; }
.section-head p { color: var(--muted); margin: 0; }
.section-head > div:last-child {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.check-filters { align-items: center; }
.check-filters > input { flex: 1; min-width: 210px; }
.check-filters label { display: flex; align-items: center; gap: 5px; }
.check-progress { color: var(--muted); margin: 12px 0; }
.check-progress strong { color: var(--yellow); font-family: var(--mono); }
.check-group { margin: 20px 0; }
.check-group h3 { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 7px; }
.check-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 9px;
  background: var(--card);
  border: 1px solid transparent;
  border-radius: 7px;
  min-height: 48px;
}
.check-item:hover { border-color: var(--line); }
.check-item input {
  accent-color: var(--yellow);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.check-item span { font-size: 13px; min-width: 0; }
.check-item small { color: var(--muted); margin-left: auto; flex-shrink: 0; }
.empty { grid-column: 1 / -1; text-align: center; padding: 35px; color: var(--muted); }
footer {
  text-align: center;
  border-top: 1px solid var(--line);
  padding: 22px 16px calc(22px + var(--safe-bottom));
  color: var(--muted);
  font-size: 11px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin: 16px 0; }
.form-grid label, dialog label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.form-grid .wide { grid-column: 1 / -1; }
dialog {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #fff;
  padding: 24px;
  max-width: 520px;
  width: calc(100% - 24px);
  max-height: calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  margin: auto;
}
dialog::backdrop { background: #020617bb; }
dialog h2 { margin: 0; font-size: clamp(20px, 5vw, 24px); }
dialog p { color: var(--muted); }
dialog .button.primary, dialog #paid-button { width: 100%; margin-top: 8px; }
.close {
  float: right;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
}
output { display: block; color: var(--green); margin-top: 10px; }
.donation-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 12px;
}
.plan {
  display: grid;
  gap: 2px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #111b31;
  color: #fff;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}
.plan:hover { border-color: var(--yellow); }
.plan strong { color: var(--yellow); font: 700 24px var(--mono); }
.plan span { color: var(--muted); font-size: 12px; }
.custom-donation {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #111b31;
  color: var(--muted);
  font-size: 12px;
}
.custom-donation > div {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font: 600 13px var(--sans);
  flex-wrap: wrap;
}
.custom-donation input {
  width: 90px;
  min-width: 0;
  background: #0f172a;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #fff;
  padding: 8px;
  font: 16px var(--sans);
  min-height: 44px;
}
.custom-donation .button { padding: 8px 10px; }
.custom-donation small { color: var(--muted); }
.payment-note {
  border-left: 3px solid var(--yellow);
  padding-left: 10px;
  color: #dbeafe !important;
}
.unlock-label { margin: 14px 0; }

/* Tablet */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .deal-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .theme-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* Phone / small tablet */
@media (max-width: 760px) {
  .header-inner {
    padding: 10px 14px;
    gap: 10px;
  }
  .brand { font-size: 18px; gap: 8px; }
  .brick { width: 32px; height: 32px; min-height: 32px; }
  .retailer-pills { display: none; }
  #add-btn {
    margin-left: auto;
    padding: 8px 12px;
    font-size: 12px;
  }
  main { padding: 16px 14px 56px; }
  .hero { padding: 18px; border-radius: 14px; }
  .hero p { font-size: 14px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 20px; }
  .tabs {
    margin: 0 -14px 16px;
    padding: 0 14px;
    gap: 0;
  }
  .tabs button { padding: 14px 12px; font-size: 13px; }
  .filters, .check-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }
  .filters label:not(.search),
  .check-filters label:not(:has(input[type="checkbox"])) {
    width: 100%;
  }
  .search { min-width: 0; width: 100%; }
  .filters .button, .check-filters .button { width: 100%; }
  .check-filters > input { min-width: 0; width: 100%; }
  .check-filters label:has(input[type="checkbox"]) {
    flex-direction: row;
    justify-content: flex-start;
    padding: 4px 0;
  }
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }
  .section-head > div:last-child {
    justify-content: stretch;
  }
  .section-head > div:last-child .button,
  .section-head > div:last-child label.button {
    flex: 1 1 calc(50% - 4px);
    min-width: 140px;
  }
  .owner-tools {
    padding: 10px 14px;
    flex-wrap: wrap;
  }
  .owner-tools strong { width: 100%; margin-right: 0; }
  .owner-tools .button { flex: 1 1 auto; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .deal-grid { grid-template-columns: 1fr; gap: 12px; }
  .theme-grid { grid-template-columns: 1fr; }
  .check-list { grid-template-columns: 1fr; }
  .deal-img { height: 150px; }
  .deal-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .deal-foot .retailer,
  .deal-foot .stock {
    display: inline;
  }
  .deal-foot .button {
    margin-left: 0;
    width: 100%;
  }
  .donation-options { grid-template-columns: 1fr; }
  .custom-donation > div { flex-wrap: nowrap; }
  .custom-donation input { flex: 1; width: auto; }
  dialog { padding: 18px 16px; width: calc(100% - 16px); border-radius: 14px; }
}

/* Narrow phones */
@media (max-width: 430px) {
  .stats { grid-template-columns: 1fr; }
  .hero h1 br { display: none; }
  #add-btn { font-size: 11px; padding: 8px 10px; }
  .section-head > div:last-child .button,
  .section-head > div:last-child label.button {
    flex: 1 1 100%;
  }
  .check-item {
    flex-wrap: wrap;
  }
  .check-item small {
    margin-left: 29px;
    width: calc(100% - 29px);
  }
}

/* Very small / landscape phones */
@media (max-width: 360px) {
  .brand strong { font-size: 16px; }
  .tabs button { padding: 12px 10px; font-size: 12px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  dialog {
    max-height: calc(100dvh - 12px);
    padding: 12px 16px;
  }
  .hero { padding: 14px; }
}

.theme-heading {
  grid-column: 1 / -1;
  margin: 8px 0 2px;
  padding: 10px 2px 6px;
  border-bottom: 1px solid var(--line);
}
.theme-heading h3 {
  margin: 0;
  color: var(--yellow);
  font-size: 15px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
