/* ============================================================
   SmileWave — Design System & Components
   smilewave.zerowic.com | ZeroWic

   Dark background always. Warm colours only. Never cold.
   ============================================================ */

/* --- CSS Variables (Brand Palette) --- */
:root {
  /* Primary */
  --sw-orange: #FF6B00;
  --sw-yellow: #FFB400;
  --sw-white: #FFFFFF;
  --sw-bg: #1a1a1a;

  /* Supporting */
  --sw-tagline: #FFAA66;
  --sw-grey: #AAAAAA;
  --sw-surface: #242424;
  --sw-surface-hover: #2e2e2e;

  /* Gradient */
  --sw-gradient: linear-gradient(90deg, #FF6B00, #FFB400);

  /* Typography */
  --font-family: 'Nunito', sans-serif;
  --fw-light: 300;
  --fw-regular: 400;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* Spacing (8px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Sizing */
  --nav-height: 64px;
  --tap-target: 48px;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-full: 9999px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 200ms;
  --duration-slow: 400ms;
}


/* ============================================================
   RESET & BASE
   ============================================================ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-weight: var(--fw-regular);
  color: var(--sw-white);
  background-color: var(--sw-bg);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

a {
  color: var(--sw-orange);
  text-decoration: none;
  transition: opacity var(--duration) var(--ease);
}

a:hover { opacity: 0.8; }

img, svg { display: block; max-width: 100%; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

ul, ol { list-style: none; }

::selection {
  background: rgba(255, 107, 0, 0.3);
  color: var(--sw-white);
}

/* Safe area insets for notched devices */
@supports (padding: env(safe-area-inset-bottom)) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}


/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.text-hero {
  font-size: 3rem;
  font-weight: var(--fw-bold);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.text-title {
  font-size: 1.5rem;
  font-weight: var(--fw-semibold);
  line-height: 1.3;
}

.text-section {
  font-size: 1.125rem;
  font-weight: var(--fw-semibold);
  line-height: 1.4;
}

.text-body {
  font-size: 1rem;
  font-weight: var(--fw-regular);
  line-height: 1.5;
}

.text-hint {
  font-size: 0.75rem;
  font-weight: var(--fw-light);
  color: var(--sw-grey);
  line-height: 1.4;
}

.text-tagline {
  font-size: 1rem;
  font-weight: var(--fw-light);
  color: var(--sw-tagline);
}

.text-gradient {
  background: var(--sw-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-center { text-align: center; }
.text-grey { color: var(--sw-grey); }
.text-orange { color: var(--sw-orange); }
.text-warm { color: var(--sw-tagline); }

/* Brand wordmark */
.wordmark {
  font-weight: var(--fw-bold);
  text-transform: lowercase;
}

.wordmark-wave {
  font-weight: var(--fw-regular);
}


/* ============================================================
   LAYOUT
   ============================================================ */

#app {
  min-height: 100vh;
  min-height: 100dvh;
}

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--sp-5);
  padding-bottom: calc(var(--nav-height) + var(--sp-6) + env(safe-area-inset-bottom, 0px));
  animation: fadeIn var(--duration-slow) var(--ease);
}

.screen--no-nav {
  padding-bottom: var(--sp-6);
}

.screen--fullscreen {
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.screen__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) 0;
  margin-bottom: var(--sp-4);
}

.screen__content {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   APP LOADER
   ============================================================ */

.app-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--sw-bg);
}

.app-loader__logo {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.05); }
}


/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--tap-target);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--border-radius);
  font-weight: var(--fw-semibold);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--sw-gradient);
  color: var(--sw-bg);
  box-shadow: 0 4px 16px rgba(255, 107, 0, 0.3);
}

.btn--primary:hover {
  box-shadow: 0 6px 24px rgba(255, 107, 0, 0.4);
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(255, 107, 0, 0.3);
}

.btn--secondary {
  background: var(--sw-surface);
  color: var(--sw-white);
  border: 1px solid var(--sw-surface-hover);
}

.btn--secondary:hover {
  background: var(--sw-surface-hover);
}

.btn--ghost {
  color: var(--sw-orange);
  background: transparent;
}

.btn--ghost:hover {
  background: rgba(255, 107, 0, 0.1);
}

.btn--full {
  width: 100%;
}

.btn--large {
  min-height: 56px;
  padding: var(--sp-4) var(--sp-8);
  font-size: 1.125rem;
  border-radius: var(--border-radius);
}

.btn--round {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  padding: 0;
  font-size: 0;
}

.btn--capture {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--sw-white);
  border: 4px solid var(--sw-surface-hover);
  box-shadow: 0 0 0 4px var(--sw-white), 0 4px 24px rgba(0,0,0,0.4);
  transition: transform 0.15s var(--ease);
}

.btn--capture:active {
  transform: scale(0.9);
}

.btn:disabled, .btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Google sign-in button */
.btn--google {
  background: var(--sw-white);
  color: #333;
  font-weight: var(--fw-semibold);
  gap: var(--sp-3);
}

.btn--google:hover {
  background: #f0f0f0;
}

.btn--google svg {
  width: 20px;
  height: 20px;
}


/* ============================================================
   INPUTS
   ============================================================ */

.input-group {
  margin-bottom: var(--sp-4);
}

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: var(--fw-semibold);
  color: var(--sw-grey);
  margin-bottom: var(--sp-2);
}

.input {
  width: 100%;
  min-height: var(--tap-target);
  padding: var(--sp-3) var(--sp-4);
  background: var(--sw-surface);
  border: 1px solid transparent;
  border-radius: var(--border-radius-sm);
  color: var(--sw-white);
  font-size: 1rem;
  transition: border-color var(--duration) var(--ease);
}

.input:focus {
  border-color: var(--sw-orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.15);
}

.input::placeholder {
  color: rgba(170, 170, 170, 0.6);
}


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

.card {
  background: var(--sw-surface);
  border-radius: var(--border-radius);
  padding: var(--sp-4);
  transition: background var(--duration) var(--ease);
}

.card:hover {
  background: var(--sw-surface-hover);
}

.card--flat {
  background: transparent;
  border: 1px solid var(--sw-surface-hover);
}

.card + .card {
  margin-top: var(--sp-3);
}


/* ============================================================
   AVATAR
   ============================================================ */

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--sw-gradient);
  color: var(--sw-bg);
  font-weight: var(--fw-bold);
  font-size: 1.25rem;
  text-transform: uppercase;
  flex-shrink: 0;
}

.avatar--sm { width: 32px; height: 32px; font-size: 0.875rem; }
.avatar--lg { width: 64px; height: 64px; font-size: 1.75rem; }
.avatar--xl { width: 96px; height: 96px; font-size: 2.5rem; }

.avatar--photo {
  background: none;
  overflow: hidden;
}

.avatar--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* ============================================================
   BADGES
   ============================================================ */

.badge-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--sw-surface);
  border-radius: var(--border-radius);
}

.badge-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.badge-icon--locked {
  filter: grayscale(1) brightness(0.4);
}

.badge-icon--lg {
  width: 72px;
  height: 72px;
}

.badge-name {
  font-weight: var(--fw-semibold);
  font-size: 1rem;
}

.badge-desc {
  font-size: 0.875rem;
  color: var(--sw-grey);
  margin-top: 2px;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}

.badge-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4);
  background: var(--sw-surface);
  border-radius: var(--border-radius);
  text-align: center;
}

.badge-grid-item__name {
  font-size: 0.75rem;
  font-weight: var(--fw-semibold);
}

.badge-grid-item--locked .badge-grid-item__name {
  color: var(--sw-grey);
}

/* Badge unlock animation */
@keyframes badgeUnlock {
  0%   { transform: scale(0) rotate(-30deg); opacity: 0; }
  50%  { transform: scale(1.2) rotate(5deg); opacity: 1; }
  70%  { transform: scale(0.95) rotate(-2deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.badge-unlock {
  animation: badgeUnlock 0.6s var(--ease) forwards;
}


/* ============================================================
   PROGRESS BAR
   ============================================================ */

.progress {
  width: 100%;
  height: 8px;
  background: var(--sw-surface);
  border-radius: var(--border-radius-full);
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  background: var(--sw-gradient);
  border-radius: var(--border-radius-full);
  transition: width 0.6s var(--ease);
  min-width: 2px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-2);
  font-size: 0.875rem;
}

.progress-label__current {
  font-weight: var(--fw-semibold);
}

.progress-label__target {
  color: var(--sw-grey);
}


/* ============================================================
   BOTTOM NAVIGATION
   ============================================================ */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--sw-surface);
  border-top: 1px solid var(--sw-surface-hover);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--sp-2) var(--sp-3);
  color: var(--sw-grey);
  font-size: 0.625rem;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: color var(--duration) var(--ease);
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  min-width: 64px;
}

.bottom-nav__item svg {
  width: 24px;
  height: 24px;
  transition: color var(--duration) var(--ease);
}

.bottom-nav__item--active {
  color: var(--sw-orange);
}

.bottom-nav__item--camera {
  position: relative;
  margin-top: -12px;
}

.bottom-nav__item--camera .nav-camera-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--sw-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(255, 107, 0, 0.3);
}

.bottom-nav__item--camera svg {
  width: 28px;
  height: 28px;
  color: var(--sw-bg);
}


/* ============================================================
   LEADERBOARD
   ============================================================ */

.leaderboard-tabs {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.leaderboard-tab {
  flex: 1;
  padding: var(--sp-3);
  text-align: center;
  font-weight: var(--fw-semibold);
  font-size: 0.875rem;
  color: var(--sw-grey);
  background: var(--sw-surface);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.leaderboard-tab--active {
  color: var(--sw-bg);
  background: var(--sw-gradient);
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--border-radius-sm);
  transition: background var(--duration) var(--ease);
}

.leaderboard-row:hover {
  background: var(--sw-surface);
}

.leaderboard-row--self {
  background: rgba(255, 107, 0, 0.08);
  border: 1px solid rgba(255, 107, 0, 0.2);
}

.leaderboard-rank {
  width: 32px;
  text-align: center;
  font-weight: var(--fw-bold);
  font-size: 1rem;
  color: var(--sw-grey);
}

.leaderboard-rank--gold { color: #FFB400; }
.leaderboard-rank--silver { color: #C0C0C0; }
.leaderboard-rank--bronze { color: #CD7F32; }

.leaderboard-info {
  flex: 1;
  min-width: 0;
}

.leaderboard-name {
  font-weight: var(--fw-semibold);
  font-size: 0.9375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-points {
  font-weight: var(--fw-bold);
  font-size: 0.9375rem;
  color: var(--sw-orange);
  white-space: nowrap;
}

.leaderboard-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  color: var(--sw-grey);
  font-size: 0.75rem;
}

.leaderboard-divider::before,
.leaderboard-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sw-surface-hover);
}


/* ============================================================
   CAMERA SCREEN
   ============================================================ */

.camera-container {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 50;
}

.camera-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror front camera */
}

.camera-ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--sp-5);
  padding-bottom: calc(var(--sp-8) + env(safe-area-inset-bottom, 0px));
  z-index: 51;
}

.camera-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.camera-instruction {
  text-align: center;
  font-size: 1.125rem;
  font-weight: var(--fw-semibold);
  color: var(--sw-white);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  padding: var(--sp-4);
}

.camera-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
}

.camera-flip {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.camera-flip svg {
  width: 24px;
  height: 24px;
  color: var(--sw-white);
}

.camera-close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.camera-remaining {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  margin-top: var(--sp-2);
}


/* ============================================================
   RESULT OVERLAY
   ============================================================ */

.result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.92);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: var(--sp-6);
  animation: fadeIn var(--duration-slow) var(--ease);
}

.result-points {
  font-size: 4rem;
  font-weight: var(--fw-bold);
  background: var(--sw-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: slideUp 0.5s var(--ease);
}

.result-message {
  font-size: 1.125rem;
  text-align: center;
  margin: var(--sp-4) 0 var(--sp-8);
  max-width: 300px;
  line-height: 1.6;
}

.result-actions {
  display: flex;
  gap: var(--sp-3);
  width: 100%;
  max-width: 320px;
}

.result-actions .btn {
  flex: 1;
}


/* ============================================================
   SHARE PHOTO BUILDER
   ============================================================ */

.share-preview {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.share-preview canvas {
  width: 100%;
  display: block;
}

.share-formats {
  display: flex;
  gap: var(--sp-2);
  justify-content: center;
  margin: var(--sp-4) 0;
}

.share-format {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--border-radius-full);
  font-size: 0.8125rem;
  font-weight: var(--fw-semibold);
  color: var(--sw-grey);
  background: var(--sw-surface);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.share-format--active {
  color: var(--sw-bg);
  background: var(--sw-gradient);
}

.share-message-input {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}


/* ============================================================
   MAP
   ============================================================ */

.map-container {
  width: 100%;
  height: 400px;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.map-container--full {
  height: calc(100vh - var(--nav-height) - 120px);
  height: calc(100dvh - var(--nav-height) - 120px);
}

/* Leaflet dark theme overrides */
.leaflet-container {
  background: var(--sw-bg) !important;
}

.leaflet-control-zoom a {
  background: var(--sw-surface) !important;
  color: var(--sw-white) !important;
  border-color: var(--sw-surface-hover) !important;
}

.leaflet-popup-content-wrapper {
  background: var(--sw-surface) !important;
  color: var(--sw-white) !important;
  border-radius: var(--border-radius-sm) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}

.leaflet-popup-tip {
  background: var(--sw-surface) !important;
}

.leaflet-popup-close-button {
  color: var(--sw-grey) !important;
}

/* Smile dot marker */
.smile-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sw-orange);
  border: 2px solid var(--sw-yellow);
  box-shadow: 0 0 8px rgba(255, 107, 0, 0.4);
}

.smile-dot--anon {
  background: var(--sw-grey);
  border-color: var(--sw-grey);
  box-shadow: none;
}


/* ============================================================
   SETTINGS
   ============================================================ */

.settings-list {
  display: flex;
  flex-direction: column;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4);
  border-bottom: 1px solid var(--sw-surface);
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}

.settings-item:hover {
  background: var(--sw-surface);
}

.settings-item__left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.settings-item__icon {
  width: 24px;
  height: 24px;
  color: var(--sw-orange);
}

.settings-item__label {
  font-weight: var(--fw-semibold);
  font-size: 0.9375rem;
}

.settings-item__chevron {
  width: 20px;
  height: 20px;
  color: var(--sw-grey);
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle__track {
  position: absolute;
  inset: 0;
  background: var(--sw-surface-hover);
  border-radius: var(--border-radius-full);
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}

.toggle__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sw-white);
  transition: transform var(--duration) var(--ease);
}

.toggle input:checked + .toggle__track {
  background: var(--sw-orange);
}

.toggle input:checked + .toggle__track::after {
  transform: translateX(20px);
}


/* ============================================================
   TOAST MESSAGES
   ============================================================ */

.toast-container {
  position: fixed;
  top: var(--sp-5);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
  width: calc(100% - var(--sp-10));
  max-width: 400px;
}

.toast {
  background: var(--sw-surface);
  color: var(--sw-white);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--border-radius-sm);
  font-size: 0.875rem;
  font-weight: var(--fw-semibold);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  pointer-events: auto;
  animation: toastIn 0.3s var(--ease), toastOut 0.3s var(--ease) 2.7s forwards;
  border-left: 3px solid var(--sw-orange);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-16px); }
}


/* ============================================================
   OFFLINE BANNER
   ============================================================ */

.offline-banner {
  position: fixed;
  bottom: var(--nav-height);
  left: 0;
  right: 0;
  background: rgba(255, 107, 0, 0.9);
  color: var(--sw-bg);
  text-align: center;
  padding: var(--sp-2) var(--sp-4);
  font-size: 0.8125rem;
  font-weight: var(--fw-semibold);
  z-index: 90;
  transition: transform 0.3s var(--ease);
}

.offline-banner[hidden] {
  display: block;
  transform: translateY(100%);
}


/* ============================================================
   ONBOARDING
   ============================================================ */

.onboarding {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--sp-6);
  text-align: center;
}

.onboarding__logo {
  margin-bottom: var(--sp-8);
}

.onboarding__message {
  font-size: 1.25rem;
  font-weight: var(--fw-regular);
  line-height: 1.8;
  max-width: 320px;
  margin-bottom: var(--sp-10);
}

.onboarding__subtitle {
  font-size: 1rem;
  color: var(--sw-tagline);
  margin-top: var(--sp-3);
}


/* ============================================================
   CONFETTI OVERLAY
   ============================================================ */

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
}


/* ============================================================
   HERO SECTION (Dashboard)
   ============================================================ */

.hero-section {
  text-align: center;
  padding: var(--sp-8) 0;
}

.hero-number {
  font-size: 3.5rem;
  font-weight: var(--fw-bold);
  line-height: 1;
  margin-bottom: var(--sp-2);
  background: var(--sw-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-label {
  font-size: 1rem;
  color: var(--sw-grey);
}

.hero-label strong {
  color: var(--sw-white);
}


/* ============================================================
   POINTS COUNTER ANIMATION
   ============================================================ */

@keyframes countUp {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.points-animate {
  animation: countUp 0.4s var(--ease);
}


/* ============================================================
   DIVIDER
   ============================================================ */

.divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-4) 0;
  color: var(--sw-grey);
  font-size: 0.8125rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sw-surface-hover);
}


/* ============================================================
   HISTORY LIST
   ============================================================ */

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--sw-surface);
}

.history-item__left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-item__date {
  font-size: 0.875rem;
  font-weight: var(--fw-semibold);
}

.history-item__location {
  font-size: 0.75rem;
  color: var(--sw-grey);
}

.history-item__points {
  font-weight: var(--fw-bold);
  color: var(--sw-orange);
}


/* ============================================================
   EMPTY STATES
   ============================================================ */

.empty-state {
  text-align: center;
  padding: var(--sp-10) var(--sp-4);
  color: var(--sw-grey);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: var(--sp-4);
  opacity: 0.4;
}

.empty-state__message {
  font-size: 1rem;
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto;
}


/* ============================================================
   MODAL / DIALOG
   ============================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 110;
  animation: fadeIn 0.2s var(--ease);
}

.modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--sw-surface);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  padding: var(--sp-6);
  padding-bottom: calc(var(--sp-6) + env(safe-area-inset-bottom, 0px));
  z-index: 111;
  animation: slideUp 0.3s var(--ease);
  max-height: 80vh;
  max-height: 80dvh;
  overflow-y: auto;
}

.modal__handle {
  width: 40px;
  height: 4px;
  background: var(--sw-surface-hover);
  border-radius: 2px;
  margin: 0 auto var(--sp-5);
}


/* ============================================================
   ADMIN SPECIFIC
   ============================================================ */

.admin-header {
  background: var(--sw-surface);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--sw-surface-hover);
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.admin-stat {
  background: var(--sw-surface);
  border-radius: var(--border-radius);
  padding: var(--sp-4);
  text-align: center;
}

.admin-stat__value {
  font-size: 1.75rem;
  font-weight: var(--fw-bold);
  color: var(--sw-orange);
}

.admin-stat__label {
  font-size: 0.75rem;
  color: var(--sw-grey);
  margin-top: var(--sp-1);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  padding: var(--sp-3);
  font-size: 0.75rem;
  color: var(--sw-grey);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--sw-surface-hover);
}

.admin-table td {
  padding: var(--sp-3);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--sw-surface);
}

.admin-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--border-radius-full);
  font-size: 0.6875rem;
  font-weight: var(--fw-semibold);
}

.admin-status--pending { background: rgba(255, 180, 0, 0.15); color: var(--sw-yellow); }
.admin-status--approved { background: rgba(255, 107, 0, 0.15); color: var(--sw-orange); }
.admin-status--deleted { background: rgba(170, 170, 170, 0.15); color: var(--sw-grey); }

.admin-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.admin-table__row--top10 {
  background: rgba(255, 107, 0, 0.06);
}

.admin-table__row--flagged td:first-child {
  border-left: 3px solid var(--sw-yellow);
}

.admin-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--border-radius-full);
  font-size: 0.6875rem;
  font-weight: var(--fw-semibold);
}
.admin-badge--awaiting_review { background: rgba(255, 180, 0, 0.15); color: var(--sw-yellow); }
.admin-badge--pending_cooloff { background: rgba(170, 170, 170, 0.15); color: var(--sw-grey); }
.admin-badge--approved { background: rgba(255, 107, 0, 0.15); color: var(--sw-orange); }
.admin-badge--deleted { background: rgba(255, 68, 68, 0.15); color: #ff4444; }


/* ============================================================
   LANDING PAGE (PUBLIC)
   ============================================================ */

.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--sp-6);
  text-align: center;
}

.landing__counter {
  margin: var(--sp-8) 0;
}

.landing__counter-number {
  font-size: 3rem;
  font-weight: var(--fw-bold);
  background: var(--sw-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing__counter-label {
  font-size: 1rem;
  color: var(--sw-grey);
  margin-top: var(--sp-2);
}

.landing__cta {
  margin-top: var(--sp-6);
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.landing__footer {
  margin-top: auto;
  padding-top: var(--sp-10);
  font-size: 0.75rem;
  color: var(--sw-grey);
}


/* ============================================================
   INVITE / REFERRAL
   ============================================================ */

.invite-link-box {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--sw-surface);
  border-radius: var(--border-radius-sm);
  padding: var(--sp-3);
}

.invite-link-box__url {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--sw-tagline);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-link-box__copy {
  padding: var(--sp-2) var(--sp-3);
  background: var(--sw-orange);
  color: var(--sw-bg);
  border-radius: var(--border-radius-sm);
  font-size: 0.75rem;
  font-weight: var(--fw-semibold);
  cursor: pointer;
}


/* ============================================================
   LANGUAGE PICKER
   ============================================================ */

.lang-list {
  display: flex;
  flex-direction: column;
}

.lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4);
  border-bottom: 1px solid var(--sw-surface);
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}

.lang-item:hover {
  background: var(--sw-surface);
}

.lang-item--active {
  color: var(--sw-orange);
}

.lang-item__check {
  width: 20px;
  height: 20px;
  color: var(--sw-orange);
}


/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.w-full { width: 100%; }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.hidden { display: none !important; }


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (min-width: 768px) {
  .screen__content {
    max-width: 640px;
  }

  .hero-number {
    font-size: 4.5rem;
  }

  .badge-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .admin-stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .map-container--full {
    height: calc(100vh - 160px);
  }
}

@media (min-width: 1024px) {
  .screen__content {
    max-width: 720px;
  }

  .landing {
    max-width: 800px;
    margin: 0 auto;
  }
}
