/* -- Whittaker Quest Design System -- */
/* 8-bit pixel art aesthetic with modern usability */

:root {
  --bg: #1a1a2e;
  --bg-surface: #16213e;
  --bg-card: #0f3460;
  --text: #e8e8e8;
  --text-dim: #a0a0b0;
  --text-bright: #ffffff;
  --accent: #e94560;
  --accent-glow: #ff6b81;
  --gold: #ffd700;
  --xp-blue: #53c1de;
  --success: #4ade80;
  --warning: #fbbf24;
  --error: #ef4444;

  --forest-primary: #2d6a4f;
  --forest-secondary: #40916c;
  --desert-primary: #c77f32;
  --desert-secondary: #e0a84c;
  --ice-primary: #4fa8c9;
  --ice-secondary: #7ec8e3;
  --volcano-primary: #c0392b;
  --volcano-secondary: #e74c3c;

  --font-pixel: 'Press Start 2P', monospace;
  --font-ui: system-ui, -apple-system, sans-serif;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  --border: 2px solid #3a3a5c;
  --border-accent: 2px solid var(--accent);
  --radius: 4px;
}

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

html {
  font-size: 16px;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
}

h1, h2, h3 {
  font-family: var(--font-pixel);
  color: var(--text-bright);
  line-height: 1.6;
}

h1 { font-size: 1.25rem; }
h2 { font-size: 1rem; }
h3 { font-size: 0.75rem; }

.pixel-art {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.card {
  background: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.btn {
  font-family: var(--font-pixel);
  font-size: 0.625rem;
  padding: var(--space-sm) var(--space-md);
  border: var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--bg-surface);
  color: var(--text);
  transition: background 0.1s;
  text-decoration: none;
  display: inline-block;
}

.btn:hover { background: var(--bg-card); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-bright);
}
.btn-primary:hover { background: var(--accent-glow); }

.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg);
}

.xp-bar {
  height: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--xp-blue);
  border-radius: 2px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: var(--xp-blue);
  transition: width 0.5s ease;
}

.coins {
  color: var(--gold);
  font-family: var(--font-pixel);
  font-size: 0.75rem;
}

.quest-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid #2a2a4c;
}

.quest-item.completed {
  opacity: 0.6;
}

.quest-item.completed .quest-name {
  text-decoration: line-through;
}

.quest-checkbox {
  width: 24px;
  height: 24px;
  border: var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
}

.quest-checkbox.checked {
  background: var(--success);
  border-color: var(--success);
}

.badge {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
}

.badge-pending { background: var(--bg-surface); color: var(--text-dim); }
.badge-submitted { background: var(--xp-blue); color: var(--bg); }
.badge-completed { background: var(--success); color: var(--bg); }
.badge-verified { background: var(--gold); color: var(--bg); }

.kid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  padding: var(--space-lg);
}

.kid-card {
  text-align: center;
  padding: var(--space-lg);
  cursor: pointer;
  transition: transform 0.1s;
}

.kid-card:hover {
  transform: scale(1.05);
  border-color: var(--accent);
}

.kid-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-sm);
}

@media (max-width: 600px) {
  h1 { font-size: 1rem; }
  h2 { font-size: 0.75rem; }
  .kid-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Reward popup animation */
@keyframes fadeUp {
  0% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-50%, -100%); }
}

.reward-popup {
  pointer-events: none;
}

/* App header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: var(--border);
}

.quest-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: var(--border);
}

.text-dim { color: var(--text-dim); font-size: 0.875rem; }

/* Photo modal */
dialog {
  background: var(--bg);
  border: var(--border-accent);
  border-radius: var(--radius);
  color: var(--text);
  max-width: 90vw;
  width: 400px;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.modal-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-top: var(--space-md);
}
