/* BOOM? — Dark mode default, mobile-first */

:root {
  --bg: #111111;
  --surface: #1a1a1a;
  --border: #333333;
  --text: #e0e0e0;
  --muted: #888888;
  --accent: #ef4444;
  --accent-glow: rgba(239, 68, 68, 0.4);
  --yellow: #facc15;
  --orange: #f97316;
  --red: #ef4444;
  --green: #22c55e;
  --radius: 8px;
}

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

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 640px; margin: 0 auto; padding: 1rem; }
.muted { color: var(--muted); font-size: 0.875rem; }
.hidden { display: none !important; }

/* === HERO / BIG RED BUTTON === */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem 2rem;
  min-height: 50dvh;
}

.boom-button {
  width: min(80vw, 320px);
  height: min(80vw, 320px);
  border-radius: 50%;
  border: 4px solid var(--accent);
  background: radial-gradient(circle at 40% 40%, #dc2626, #991b1b, #7f1d1d);
  color: #fff;
  font-size: clamp(1.2rem, 5vw, 1.6rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.3;
  cursor: pointer;
  box-shadow: 0 0 40px var(--accent-glow), 0 0 80px rgba(239, 68, 68, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.boom-button:active {
  transform: scale(0.95);
  box-shadow: 0 0 60px var(--accent-glow), 0 0 120px rgba(239, 68, 68, 0.3);
}

.boom-button.pressed {
  transform: scale(0.9);
  opacity: 0.6;
  pointer-events: none;
}

.recent-count {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* === REPORT FORM === */

.report-form {
  max-width: 500px;
  margin: 0 auto 2rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.report-form h2 { margin-bottom: 0.25rem; }

.form-group {
  margin: 1.25rem 0;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.intensity-label {
  font-weight: 400;
  color: var(--orange);
  font-style: italic;
}

.intensity-slider {
  width: 100%;
  accent-color: var(--accent);
  height: 8px;
  cursor: pointer;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.direction-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  max-width: 280px;
}

.dir-btn {
  padding: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.dir-btn:hover { border-color: var(--muted); }
.dir-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.checkboxes {
  display: flex;
  gap: 1.5rem;
}

.checkboxes label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  cursor: pointer;
}

.checkboxes input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.submit-button {
  width: 100%;
  padding: 0.875rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.submit-button:hover { opacity: 0.9; }
.submit-button:disabled { opacity: 0.5; cursor: not-allowed; }

.cancel-button {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
}

.report-status {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  text-align: center;
  font-weight: 600;
}

.report-status.success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.report-status.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.report-status.warning {
  background: rgba(250, 204, 21, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(250, 204, 21, 0.3);
  font-weight: 400;
  font-size: 0.85rem;
}

/* === MAP === */

.map-preview {
  max-width: 640px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.mini-map {
  width: 100%;
  height: 200px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.map-link {
  display: block;
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.map-page { height: 100dvh; display: flex; flex-direction: column; }

.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.back-link { font-weight: 600; font-size: 0.9rem; white-space: nowrap; }

.map-filters { display: flex; gap: 0.25rem; }

.filter-btn {
  padding: 0.3rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--green);
  font-weight: 600;
}

.full-map { flex: 1; }

.map-legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.5rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
  flex-shrink: 0;
}

.legend-item { display: flex; align-items: center; gap: 0.3rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend-dot.yellow { background: var(--yellow); }
.legend-dot.orange { background: var(--orange); }
.legend-dot.red { background: var(--red); }

/* === REPORT CARDS === */

.recent-reports {
  max-width: 640px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.recent-reports h2 { margin-bottom: 1rem; }

.report-card {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
}

.report-header {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  width: 100%;
}

.report-intensity {
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--orange);
}

.report-card[data-intensity="7"] .report-intensity,
.report-card[data-intensity="8"] .report-intensity,
.report-card[data-intensity="9"] .report-intensity,
.report-card[data-intensity="10"] .report-intensity {
  color: var(--red);
}

.report-card[data-intensity="1"] .report-intensity,
.report-card[data-intensity="2"] .report-intensity,
.report-card[data-intensity="3"] .report-intensity {
  color: var(--yellow);
}

.report-time { color: var(--muted); font-size: 0.85rem; }
.report-dir { color: var(--muted); font-size: 0.85rem; }

.report-details {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--muted);
}

.report-notes {
  width: 100%;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* === ARCHIVE === */

.archive-page h1 { margin: 1rem 0 0.25rem; }

.archive-list { margin-top: 1.5rem; }

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
}

/* === ABOUT === */

.about-page h1 { margin: 1rem 0; }
.about-page h2 { margin: 1.5rem 0 0.5rem; }
.about-page p { margin-bottom: 1rem; line-height: 1.6; }
.about-page ul, .about-page ol { margin-left: 1.5rem; margin-bottom: 1rem; }
.about-page li { margin-bottom: 0.5rem; line-height: 1.5; }

/* === ERROR === */

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60dvh;
  text-align: center;
}

.error-page h1 { font-size: 3rem; margin-bottom: 0.5rem; }

/* === FOOTER === */

.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.site-footer a { color: var(--muted); margin: 0 0.25rem; }
.site-footer a:hover { color: var(--text); }
.site-footer p { margin-top: 0.5rem; }

/* === PWA STANDALONE MODE === */

@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top); }
}
