/* Black Friday Deal Swipe — mobile-first, dark festive theme. */
:root {
  --navy: #0b1026;
  --navy-2: #141a3a;
  --card: #1a2145;
  --card-2: #232c5c;
  --ink: #f4f1ea;
  --muted: #aab0d6;
  --red: #e63946;
  --red-dark: #b91f2d;
  --gold: #f5b942;
  --green: #3fbf7f;
  --blue: #5b8cff;
  --line: #2c3566;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--navy);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--gold); }
a:visited { color: #e8a93a; }

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--card-2);
  color: var(--ink);
}
button:hover { filter: brightness(1.15); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: var(--red); color: #fff; font-weight: 700; }
button.gold { background: var(--gold); color: #221503; font-weight: 700; }
button.ghost { background: transparent; border: 1px solid var(--line); }
button.danger { background: var(--red-dark); color: #fff; }
button.small { padding: 6px 12px; font-size: 14px; }

input[type="text"], input[type="email"], input[type="number"], select {
  font: inherit;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--navy-2);
  color: var(--ink);
}
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--gold); }
label { display: block; margin: 10px 0 4px; font-weight: 600; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0; padding: 10px 12px; }
legend { font-weight: 700; padding: 0 6px; }

.shell { max-width: 560px; margin: 0 auto; padding: 16px 14px 90px; width: 100%; }
.loading { text-align: center; color: var(--muted); margin-top: 40vh; }

h1 { font-size: 26px; margin: 8px 0 4px; }
h2 { font-size: 20px; margin: 20px 0 8px; }
h3 { font-size: 17px; margin: 14px 0 6px; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }

.brand { text-align: center; margin: 12px 0 4px; }
.brand .tagline { color: var(--muted); margin: 0; }
.hero-emoji { font-size: 44px; text-align: center; }

.card-box, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
}
.panel.warn { border-color: var(--red); }
.panel.gold-border { border-color: var(--gold); }

.error { background: #3a1220; border: 1px solid var(--red); color: #ffd7db; border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.notice { background: #12263a; border: 1px solid var(--blue); color: #d6e4ff; border-radius: 10px; padding: 10px 12px; margin: 10px 0; }

/* Tabs */
.tabs { display: flex; gap: 6px; margin: 14px 0 4px; overflow-x: auto; padding-bottom: 4px; }
.tabs button { flex: 1 0 auto; white-space: nowrap; padding: 9px 12px; }
.tabs button.active { background: var(--red); color: #fff; font-weight: 700; }

/* Deck */
.deck-count { text-align: center; color: var(--muted); }
.deck-area { position: relative; min-height: 420px; margin-top: 8px; }
.deal-card {
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0 0 16px;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.deal-card.dragging { transition: none !important; box-shadow: 0 20px 44px rgba(0, 0, 0, 0.55); }
.deal-emoji { font-size: 64px; text-align: center; padding: 22px 0 6px; }
.deal-body { padding: 0 16px; }
.deal-title { font-size: 20px; font-weight: 800; margin: 4px 0; }
.deal-meta { color: var(--muted); font-size: 14px; }
.deal-prices { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 4px; flex-wrap: wrap; }
.deal-price { font-size: 30px; font-weight: 800; color: var(--gold); }
.deal-was { text-decoration: line-through; color: var(--muted); }
.deal-off { background: var(--red); color: #fff; font-weight: 700; border-radius: 999px; padding: 2px 10px; font-size: 14px; }
.match { font-weight: 700; color: var(--green); }
.trust { display: inline-block; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 700; margin: 6px 0; }
.trust.real { background: #0d3b26; color: #7be3ae; }
.trust.fair { background: #3a2f10; color: #ffd97a; }
.trust.check { background: #3a1220; color: #ffb3bb; }
.trust-note { font-size: 14px; color: var(--muted); margin: 4px 0; }
.countdown { font-weight: 700; color: var(--gold); }
.countdown.live { color: var(--green); }

.compare { background: var(--navy-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 12px 0; }
.compare h4 { margin: 0 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.compare-row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 15px; }
.compare-row.cheapest { color: var(--green); font-weight: 700; }
.compare-row a { color: inherit; }

.swipe-buttons { display: flex; gap: 10px; justify-content: center; margin: 16px 0 6px; flex-wrap: wrap; }
.swipe-buttons button { min-width: 86px; }
.btn-skip { background: #2c3566; }
.btn-save { background: var(--green); color: #06281a; font-weight: 700; }
.btn-must { background: var(--gold); color: #221503; font-weight: 700; }
.undo-row { text-align: center; margin-top: 4px; }

.store-link { display: inline-block; margin-top: 10px; font-weight: 700; }

/* Saved */
.budget-bar { margin: 8px 0; }
.budget-track { height: 12px; background: var(--navy-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.budget-fill { height: 100%; background: var(--green); }
.budget-fill.over { background: var(--red); }
.budget-nums { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 14px; margin-top: 6px; }
.over-warning { color: #ffb3bb; font-weight: 700; }
.filters { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.filters button.active { background: var(--gold); color: #221503; font-weight: 700; }

.saved-item { display: flex; gap: 12px; align-items: flex-start; }
.saved-emoji { font-size: 34px; }
.saved-main { flex: 1; min-width: 0; }
.saved-main .deal-title { font-size: 17px; }
.saved-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.saved-controls select { width: auto; padding: 6px 8px; }
.saved-controls input[type="text"] { width: 150px; padding: 6px 8px; }
.purchased { opacity: 0.75; }
.purchased .deal-title { text-decoration: line-through; }
.badge-must { background: var(--gold); color: #221503; font-weight: 800; font-size: 12px; border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: middle; }

.share-code { font-size: 26px; font-weight: 800; letter-spacing: 0.2em; text-align: center; background: var(--navy-2); border: 1px dashed var(--gold); border-radius: 12px; padding: 12px; margin: 10px 0; word-break: break-all; }
.share-summary { width: 100%; min-height: 74px; font: inherit; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--navy-2); color: var(--ink); resize: vertical; }

/* Plan */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline-time { min-width: 86px; font-weight: 700; color: var(--gold); font-size: 14px; }
.event-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }

/* Ads */
.store-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.store-tabs button.active { background: var(--red); color: #fff; font-weight: 700; }
.ad-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ad-item:last-child { border-bottom: none; }
.ad-item .saved-emoji { font-size: 28px; }
.ad-main { flex: 1; min-width: 0; }

/* Checkboxes grid */
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.check-grid label { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-weight: 500; }

/* Taste */
.taste-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.taste-name { width: 130px; flex-shrink: 0; font-size: 14px; }
.taste-track { flex: 1; height: 10px; background: var(--navy-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.taste-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--gold)); }
.taste-score { width: 34px; text-align: right; font-weight: 700; }
.taste-row button { padding: 4px 10px; }

/* Alerts */
.alerts { margin: 10px 0; }
.alert { border-radius: 10px; padding: 10px 12px; margin: 6px 0; font-size: 15px; }
.alert.priority { background: #3a2f10; border: 1px solid var(--gold); }
.alert.normal { background: #12263a; border: 1px solid var(--blue); }

/* Auth */
.auth-list { list-style: none; margin: 0; padding: 0; }
.auth-list li { margin: 6px 0; }
.auth-list button { width: 100%; text-align: left; }

/* Footer */
.app-footer { text-align: center; color: var(--muted); font-size: 14px; margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); }
.app-footer a { margin: 0 6px; }
.app-footer .made-by { margin-top: 6px; }

.empty { text-align: center; padding: 28px 10px; color: var(--muted); }
.empty .big { font-size: 40px; }

@media (max-width: 380px) {
  .deal-price { font-size: 26px; }
  .swipe-buttons button { min-width: 76px; padding: 10px 12px; }
  .taste-name { width: 104px; }
  .check-grid { grid-template-columns: 1fr; }
}
