/* Countdown — public static build for doohickeytools.com/countdown/ */
/* Hidden elements must stay hidden: .dialog-backdrop sets display:flex,
   which otherwise overrides the browser's built-in [hidden] rule and
   leaves dialogs visible (and unclosable) on load. */
[hidden] { display: none !important; }
:root {
  --bg: #faf6ee;
  --surface: #ffffff;
  --surface2: #f1ead9;
  --ink: #10162e;
  --dim: #6d6a5e;
  --border: #e3dac4;
  --line: #e3dac4;
  --accent: #b07d10;
  --gold: #e8b34b;
  --accent-soft: #fbeecd;
  --berry: #c9372c;
  --berry-dark: #a92a21;
  --navy: #10162e;
  --navy2: #1b2342;
  --cream: #f4efe2;
  --red: #c9372c;
  --red-dark: #a92a21;
  --dark: #22252b;
  --amber: #f0a832;
  --amber-dark: #d18d1d;
  --radius: 16px;
  --font: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f22;
    --surface: #141a33;
    --surface2: #1b2342;
    --ink: #f4efe2;
    --dim: #a3a7bd;
    --border: #2c3557;
    --line: #2c3557;
    --accent: #e8b34b;
    --accent-soft: #2a2f4d;
    --berry: #ff7a6b;
    --berry-dark: #ff7a6b;
    --red: #ff7a6b;
    --red-dark: #ff7a6b;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

.page { max-width: 1024px; margin: 0 auto; padding: 20px 20px 48px; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

h2 { font-size: 1.25rem; margin: 0; }
h3 { font-size: 1.05rem; margin: 0 0 12px; }

/* ---------- Header ---------- */
/* ---------- Premium preview banner ---------- */
/* NOTE: this uses display:flex — it still hides correctly because the
   global [hidden] { display: none !important; } rule at the top wins. */
.preview-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--amber); color: #231a05;
  border-radius: 12px; padding: 12px 16px; margin-bottom: 16px;
  font-weight: 700; font-size: 0.95rem;
}

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.01em; }
.brand-emoji { font-size: 1.7rem; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill {
  background: #eef3e6; color: #4c7a34; border: 1px solid #cfdfc0;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  padding: 4px 10px; border-radius: 999px;
}
.pill.guest { background: #fdf3e3; color: #9a6a12; border-color: #f0d9a8; }
.pill.premium { background: #22252b; color: #ffd97a; border-color: #22252b; }
@media (prefers-color-scheme: dark) {
  .pill { background: #1d2b1a; color: #a8d08a; border-color: #33502c; }
  .pill.premium { background: #e8b34b; color: #10162e; border-color: #e8b34b; }
}

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit; font-size: 0.95rem; font-weight: 600;
  border: 1px solid transparent; border-radius: 999px;
  padding: 9px 18px; cursor: pointer; background: var(--surface); color: var(--ink);
}
.btn:hover { filter: brightness(0.97); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: var(--surface); border-color: var(--line); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); }
.btn-berry { background: var(--berry); color: #fff; }
.btn-berry:hover { background: var(--berry-dark); }
.btn-amber { background: var(--amber); color: #231a05; }
.btn-amber:hover { background: var(--amber-dark); color: #fff; }
.btn-light { background: var(--surface); color: var(--ink); }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }
.btn-block { width: 100%; padding: 13px 18px; font-size: 1.02rem; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; align-items: start; }
.col-left, .col-right { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .brand { font-size: 1.35rem; }
}

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
  box-shadow: 0 1px 3px rgba(16, 22, 46, 0.05);
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 100%);
  color: var(--cream);
  border-radius: 24px;
  padding: 32px 28px 28px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(16, 22, 46, 0.25);
}
.hero-eyebrow {
  margin: 0 0 6px; color: var(--gold);
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.hero-title { margin: 0; font-size: 2.2rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; }
.hero-date { margin: 10px 0 0; color: #c9cde0; font-size: 1rem; }
.hero-timer {
  display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
  margin: 24px 0 0;
}
.tile {
  background: rgba(244, 239, 226, 0.08);
  border: 1px solid rgba(232, 179, 75, 0.35);
  border-radius: 16px;
  min-width: 104px;
  padding: 14px 10px 12px;
}
.tile-num {
  font-size: 2.4rem; font-weight: 800; line-height: 1;
  color: var(--gold); font-variant-numeric: tabular-nums;
}
.tile-label { margin-top: 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; color: #c9cde0; }
.tile-seconds .tile-num { animation: pulse-soft 2s ease-in-out infinite; }
@keyframes pulse-soft { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) {
  .tile-seconds .tile-num { animation: none; }
  .confetti-piece { animation: none !important; }
}
.hero-arrived { margin: 24px 0 0; }
.arrived-big { font-size: 2.2rem; font-weight: 800; }
.arrived-sub { margin: 8px 0 0; color: #c9cde0; }
.progress-wrap { margin: 26px auto 0; max-width: 520px; }
.progress-bar {
  height: 10px; border-radius: 999px; overflow: hidden;
  background: rgba(244, 239, 226, 0.15);
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold), #f5cd7a);
  border-radius: 999px; transition: width 0.5s linear;
}
.progress-text { margin: 10px 0 0; color: #c9cde0; font-size: 0.92rem; }
.hero-note { margin: 18px 0 0; font-style: italic; color: #c9cde0; }

/* ---------- Confetti ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.confetti-piece {
  position: absolute; top: -16px; width: 10px; height: 14px; border-radius: 2px;
  animation: confetti-fall 6s linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(105vh) rotate(720deg); opacity: 0.9; }
}

/* ---------- Ad slot (exactly one) ---------- */
.ad-slot {
  border: 2px dashed #cfc4ae; border-radius: var(--radius);
  padding: 18px 20px; text-align: center; background: #fffdf8;
  max-width: 560px; margin: 20px auto 0;
}
@media (prefers-color-scheme: dark) {
  .ad-slot { border-color: #2c3557; background: #141a33; }
}
.ad-label { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.14em; color: #a39a86; }
.ad-copy { margin: 10px 0 4px; font-weight: 600; }
.ad-sub { margin: 0 0 10px; color: var(--dim); font-size: 0.9rem; }
.ad-link {
  font-family: inherit; font-size: 0.92rem; font-weight: 700; color: var(--berry);
  background: none; border: 0; cursor: pointer; padding: 0; text-decoration: none;
}
.ad-link:hover { text-decoration: underline; }
.premium-note {
  text-align: center; font-weight: 700; color: var(--accent);
  margin: 20px 0 0;
}

/* ---------- Next countdown widget ---------- */
.widget {
  background: var(--navy); color: var(--cream);
  border-radius: 20px; padding: 24px 28px; margin-top: 20px;
  text-align: center;
}
.widget-title {
  margin: 0; color: var(--gold); font-size: 0.8rem; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.widget-name { margin: 10px 0 0; font-size: 1.25rem; font-weight: 700; }
.widget-days { margin: 6px 0 0; line-height: 1; }
.widget-days span:first-child {
  font-size: 3.2rem; font-weight: 800; color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.widget-days-label { font-size: 1.1rem; font-weight: 600; color: #c9cde0; margin-left: 8px; }
.widget-time { margin: 8px 0 0; font-size: 1.1rem; font-variant-numeric: tabular-nums; color: var(--gold); font-weight: 700; }
.widget-date { margin: 4px 0 0; color: #c9cde0; font-size: 0.92rem; }

/* ---------- Form ---------- */
.plan-line { color: var(--dim); margin: 8px 0 18px; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label, .field-label { display: block; font-weight: 600; margin-bottom: 5px; }
.field input {
  width: 100%; font-family: inherit; font-size: 1rem; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface);
}
.field input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.optional { font-weight: 400; color: var(--dim); font-size: 0.88rem; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-btn {
  font-family: inherit; font-size: 1.25rem; line-height: 1;
  width: 42px; height: 42px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface);
}
.emoji-btn:hover { border-color: var(--gold); }
.emoji-btn.selected { border: 2px solid var(--gold); background: var(--accent-soft); }
.form-error { color: var(--berry); font-weight: 600; margin: 0 0 12px; }

/* ---------- How it works ---------- */
.how-card { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.how-card h3 { color: #fff; }
.steps { margin: 0 0 18px; padding-left: 22px; }
.steps li { margin-bottom: 8px; }
.steps li::marker { color: var(--gold); font-weight: 700; }
.how-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.how-card .btn-light { background: #fff; color: var(--ink); }

/* ---------- Presets ---------- */
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.preset-card {
  font-family: inherit; text-align: left; cursor: pointer;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.preset-card:hover { border-color: var(--gold); }
.preset-card.active { border: 2px solid var(--gold); box-shadow: 0 0 0 3px rgba(232, 179, 75, 0.25); }
.preset-top { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1rem; }
.preset-emoji { font-size: 1.3rem; }
.preset-remaining { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.preset-date { color: var(--dim); font-size: 0.88rem; }

/* ---------- Saved list ---------- */
.saved-head { display: flex; align-items: baseline; justify-content: space-between; }
.saved-count { color: var(--dim); font-size: 0.92rem; font-weight: 600; }
.empty-state {
  color: var(--dim); margin: 16px 0 0; padding: 18px;
  border: 2px dashed var(--border); border-radius: 12px; text-align: center;
}
.saved-list { list-style: none; margin: 16px 0 0; padding: 0; }
.saved-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 2px; border-bottom: 1px solid var(--surface2);
  cursor: pointer;
}
.saved-row:last-child { border-bottom: 0; }
.saved-row.active { background: var(--accent-soft); border-radius: 10px; padding-left: 10px; padding-right: 10px; }
.saved-emoji { font-size: 1.4rem; flex: none; line-height: 1.3; }
.saved-main { flex: 1; min-width: 0; }
.saved-title { font-weight: 700; overflow-wrap: anywhere; }
.badge {
  display: inline-block; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em;
  background: var(--accent-soft); color: var(--accent); border-radius: 999px;
  padding: 2px 8px; margin-left: 6px; vertical-align: middle;
}
.badge.guest { background: #fdf3e3; color: #9a6a12; }
.saved-meta { color: var(--dim); font-size: 0.88rem; margin-top: 2px; overflow-wrap: anywhere; }
.saved-remaining {
  flex: none; text-align: right; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.saved-remaining.done { color: var(--berry); }
.saved-actions { flex: none; display: flex; gap: 2px; }
.icon-btn {
  font-family: inherit; font-size: 0.95rem; background: none; border: 0;
  cursor: pointer; color: var(--dim); padding: 4px; line-height: 1;
}
.icon-btn:hover { color: var(--ink); }
.icon-btn.pinned { color: var(--gold); }

/* ---------- Dialogs ---------- */
.dialog-backdrop {
  position: fixed; inset: 0; background: rgba(16, 22, 46, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 50;
}
.dialog {
  background: var(--surface); color: var(--ink); border-radius: 18px; padding: 26px; width: 100%; max-width: 440px;
  max-height: calc(100vh - 48px); overflow-y: auto;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}
.dialog-wide { max-width: 720px; }
.dialog h2 { font-size: 1.4rem; margin-bottom: 6px; }
.dialog-sub { color: var(--dim); margin: 0 0 18px; }
.field { margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; margin: 10px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--berry); cursor: pointer; }
.dialog-note { color: var(--dim); font-size: 0.9rem; margin: 16px 0 6px; }
.context-note { color: var(--berry); font-weight: 600; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .plans { grid-template-columns: 1fr; } }
.plan {
  border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.plan-highlight { border: 2px solid var(--berry); background: #fff8f5; }
@media (prefers-color-scheme: dark) {
  .plan-highlight { background: #2a1a18; }
}
.plan h3 { margin: 0; }
.plan-price { font-size: 1.5rem; font-weight: 800; }
.plan-price span { font-size: 0.85rem; font-weight: 500; color: var(--dim); }
.plan ul { margin: 0; padding-left: 18px; font-size: 0.92rem; }
.plan ul li { margin-bottom: 5px; }
.plan-cta { margin-top: auto; width: 100%; }
.preview-check { margin-top: 14px; font-weight: 600; }

/* ---------- Site footer ---------- */
.site-footer { text-align: center; margin-top: 28px; font-size: 0.85rem; }
.site-footer a { color: var(--dim); }
