:root {
  --bg: #1a0f2e;
  --card: #2b1b48;
  --text: #f5f2fb;
  --muted: #ab9bc9;
  --brand: #f97316;
  --brand-dark: #ea580c;
  --brand-purple: #7c3aed;
  --brand-purple-dark: #6d28d9;
  --brand-purple-darker: #5b21b6;
  --border: #402a5e;
  --good: #16a34a;
  --stale: #d97706;
  --danger: #dc2626;
}

* { box-sizing: border-box; }

body {
  position: relative;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  max-width: 480px;
  margin-inline: auto;
  padding: 16px;
  padding-bottom: 48px;
  overflow-x: hidden;
}

.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}

.aurora {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(38% 32% at 22% 22%, rgba(124, 58, 237, 0.55), transparent 70%),
    radial-gradient(42% 38% at 80% 15%, rgba(249, 115, 22, 0.28), transparent 70%),
    radial-gradient(48% 42% at 50% 90%, rgba(109, 40, 217, 0.55), transparent 70%),
    radial-gradient(35% 30% at 85% 80%, rgba(167, 139, 250, 0.3), transparent 70%);
  filter: blur(50px);
  will-change: transform;
  animation: aurora-drift 20s ease-in-out infinite alternate;
}

@keyframes aurora-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-3%, 2%, 0) scale(1.1); }
  100% { transform: translate3d(3%, -2%, 0) scale(1); }
}

.sparks {
  position: absolute;
  inset: 0;
}

.spark {
  position: absolute;
  bottom: -12px;
  width: var(--size, 4px);
  height: var(--size, 4px);
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 6px 2px rgba(249, 115, 22, 0.7);
  opacity: 0;
  animation: spark-rise var(--duration, 9s) ease-in var(--delay, 0s) infinite;
}

.spark.purple {
  background: #c4b5fd;
  box-shadow: 0 0 6px 2px rgba(196, 181, 253, 0.65);
}

@keyframes spark-rise {
  0%   { transform: translate(0, 0); opacity: 0; }
  8%   { opacity: 1; }
  85%  { opacity: 0.7; }
  100% { transform: translate(var(--drift, 20px), -115vh); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora,
  .spark {
    animation: none;
  }
}

header {
  text-align: center;
  margin-bottom: 20px;
}

h1 {
  margin: 0;
  font-size: 1.5rem;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.primary-btn {
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
}
.primary-btn:hover { background: var(--brand-dark); }

.launch-console {
  padding: 8px;
  margin: 20px auto 24px;
  width: fit-content;
  border-radius: 26px;
  background: repeating-linear-gradient(
    135deg,
    #17171a,
    #17171a 12px,
    #f5b400 12px,
    #f5b400 24px
  );
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.launch-console-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 34px;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 30%, #2b2b31, #131316 75%);
}

#report-btn {
  position: relative;
  width: 168px;
  height: 168px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: white;
  font-family: inherit;
  font-weight: 900;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.4;
  background: radial-gradient(
    circle at 35% 28%,
    #a78bfa 0%,
    var(--brand-purple) 45%,
    var(--brand-purple-dark) 75%,
    var(--brand-purple-darker) 100%
  );
  box-shadow:
    0 0 0 9px #2a2a30,
    0 0 0 13px #050506,
    0 14px 0 5px #3d1f7a,
    0 22px 26px rgba(0, 0, 0, 0.55);
  transform: translateY(0);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

#report-btn::before {
  content: "";
  position: absolute;
  top: 14%;
  left: 22%;
  width: 50%;
  height: 32%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

#report-btn::after {
  content: "";
  position: absolute;
  inset: -13px;
  border-radius: 50%;
  border: 4px solid var(--brand-purple);
  opacity: 0;
  pointer-events: none;
}

#report-btn:hover {
  filter: brightness(1.08);
}

#report-btn.pressed {
  transform: translateY(5px);
  box-shadow:
    0 0 0 9px #2a2a30,
    0 0 0 13px #050506,
    0 9px 0 1px #3d1f7a,
    0 12px 14px rgba(0, 0, 0, 0.45);
}

@keyframes launch-ring {
  0% { opacity: 0.85; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.9); }
}

#report-btn.pop::after {
  animation: launch-ring 0.55s ease-out;
}

.btn-line {
  display: block;
}

.secondary-btn {
  background: var(--border);
  color: var(--text);
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.95rem;
  cursor: pointer;
}

#list-section {
  margin-top: 20px;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 32px 0;
}

#sighting-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sighting-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.sighting-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.drink-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.location-name {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.sighting-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.time-ago {
  color: var(--muted);
  font-size: 0.82rem;
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.status-badge.fresh { background: #dcfce7; color: var(--good); }
.status-badge.stale { background: #fef3c7; color: var(--stale); }

.sighting-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.sighting-actions button {
  flex: 1;
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
  padding: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}
.confirm-btn { color: var(--good); }
.gone-btn { color: var(--danger); }

.confirm-count {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(124, 58, 237, 0.18);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

dialog {
  border: none;
  border-radius: 14px;
  padding: 20px;
  width: min(90vw, 400px);
}
dialog::backdrop {
  background: rgba(0,0,0,0.4);
}

#report-form h2 {
  margin: 0 0 12px;
}

#report-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 12px 0 4px;
}

#report-form select,
#report-form input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}

.hint {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 4px 0 0;
}

.dialog-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}
.dialog-actions .primary-btn,
.dialog-actions .secondary-btn {
  width: auto;
  flex: 1;
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 10px 0 0;
}
