/* Birthday Freebie Collector — Main Stylesheet */
:root {
  --bg: #0f1117;
  --bg-surface: #1a1d27;
  --bg-card: #222633;
  --bg-hover: #2a2f3e;
  --border: #2e3344;
  --border-light: #3a3f52;
  --text: #e4e6ed;
  --text-muted: #8b8fa3;
  --text-dim: #5c6078;
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --accent-bg: rgba(124, 58, 237, 0.12);
  --green: #34d399;
  --green-bg: rgba(52, 211, 153, 0.1);
  --red: #f87171;
  --red-bg: rgba(248, 113, 113, 0.1);
  --yellow: #fbbf24;
  --yellow-bg: rgba(251, 191, 36, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: 0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: 16px; }

/* Header */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}
.logo-icon { flex-shrink: 0; }
.site-nav {
  display: flex;
  gap: 8px;
}
.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
}
.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  background: var(--bg-hover);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  gap: 5px;
  flex-direction: column;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* Hero */
.hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 60px 24px 40px;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 700px;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-top: 16px;
  line-height: 1.7;
}
.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 32px;
}
.stat { display: flex; flex-direction: column; }
.stat strong {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-light);
}
.stat span {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* App Shell */
.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 48px;
}
.app-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}

/* Control Panel */
.control-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: 80px;
}
.panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
}
.panel-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-muted);
}
.control-group {
  margin-bottom: 16px;
}
.control-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.control-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  transition: border-color var(--transition);
  appearance: none;
}
.control-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
select.control-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%238b8fa3' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.panel-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}
.panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.panel-note {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
}
.btn:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: #6d28d9; }
.btn-secondary {
  background: var(--accent-bg);
  color: var(--accent-light);
  border-color: var(--accent);
}
.btn-secondary:hover { background: rgba(124, 58, 237, 0.2); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-danger-text { color: var(--red); }
.btn-danger-text:hover { background: var(--red-bg); }

/* Checklist Area */
.checklist-area {
  min-width: 0;
}
.checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.checklist-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Checklist Item */
.cl-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: start;
  transition: border-color var(--transition), background var(--transition);
}
.cl-item:hover { border-color: var(--border-light); }
.cl-item.urgent { border-color: var(--red); background: var(--red-bg); }
.cl-item.claimed { opacity: 0.6; }
.cl-item.claimed .cl-name { text-decoration: line-through; }

.cl-check {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  padding-top: 2px;
}
.cl-check-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.cl-check-btn:hover { border-color: var(--accent); }
.cl-check-btn:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; }
.cl-check-btn.signed { background: var(--yellow-bg); border-color: var(--yellow); }
.cl-check-btn.redeemed { background: var(--green-bg); border-color: var(--green); }
.cl-check-btn svg { width: 14px; height: 14px; }

.cl-info { min-width: 0; }
.cl-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
}
.cl-name a {
  color: var(--accent-light);
  text-decoration: none;
}
.cl-name a:hover { text-decoration: underline; }
.cl-detail {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.cl-detail span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cl-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.cl-tag.restaurant { background: rgba(251, 191, 36, 0.15); color: var(--yellow); }
.cl-tag.retail { background: rgba(124, 58, 237, 0.15); color: var(--accent-light); }
.cl-tag.service { background: rgba(52, 211, 153, 0.15); color: var(--green); }
.cl-tag.custom { background: rgba(139, 143, 163, 0.15); color: var(--text-muted); }

.cl-deadline {
  text-align: right;
  flex-shrink: 0;
}
.cl-countdown {
  font-size: 0.85rem;
  font-weight: 600;
}
.cl-countdown.urgent { color: var(--red); }
.cl-countdown.soon { color: var(--yellow); }
.cl-countdown.ok { color: var(--green); }
.cl-countdown.past { color: var(--text-dim); }

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.empty-state svg { margin-bottom: 16px; }

/* Walkthrough */
.walkthrough {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px;
}
.walkthrough h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.section-intro {
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 32px;
  line-height: 1.7;
}
.walkthrough-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.walkthrough-day {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.day-badge {
  display: inline-block;
  background: var(--accent-bg);
  color: var(--accent-light);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.walkthrough-day h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.walkthrough-day p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Tips */
.tips-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px;
}
.tips-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 32px;
}
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.tip-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.tip-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--yellow);
}
.tip-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* FAQ */
.faq-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px;
}
.faq-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 24px;
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.faq-item dt {
  font-size: 0.95rem;
  margin-bottom: 8px;
}
.faq-item dd {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 32px 24px;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.footer-logo {
  font-weight: 700;
  font-size: 0.95rem;
}
.footer-version {
  font-size: 0.8rem;
  color: var(--text-dim);
}
.footer-nav {
  display: flex;
  gap: 16px;
}
.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.footer-nav a:hover { color: var(--text); }
.footer-note {
  width: 100%;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 8px;
}

/* Responsive */
@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
  .control-panel { position: static; }
  .hero-stats { gap: 20px; }
}

@media (max-width: 640px) {
  .site-nav { display: none; }
  .site-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    z-index: 99;
  }
  .nav-toggle { display: flex; }
  .hero { padding: 40px 16px 32px; }
  .hero-stats { flex-direction: column; gap: 12px; }
  .app-shell { padding: 0 16px 32px; }
  .control-panel { padding: 20px 16px; }
  .cl-item { grid-template-columns: 1fr; gap: 12px; }
  .cl-deadline { text-align: left; }
  .walkthrough, .tips-section, .faq-section { padding: 32px 16px; }
  .walkthrough-grid { grid-template-columns: 1fr; }
  .tips-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* Print */
@media print {
  .site-header, .control-panel, .site-footer, .nav-toggle { display: none; }
  body { background: white; color: black; }
  .cl-item { border: 1px solid #ccc; break-inside: avoid; }
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
