/* ============================================================
   Activities in your Area – Mobile-First Design
   ============================================================ */
:root {
  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --secondary: #ec4899;
  --gradient: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
  --gradient-soft: linear-gradient(135deg, rgba(124,58,237,.12), rgba(236,72,153,.12));
  --bg: #f6f5fb;
  --card: #ffffff;
  --text: #1e1b2e;
  --text-2: #6b6685;
  --text-3: #9c97b5;
  --border: #e8e5f3;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 4px 20px rgba(30, 27, 46, .08);
  --shadow-lg: 0 12px 40px rgba(30, 27, 46, .16);
  --nav-h: calc(64px + env(safe-area-inset-bottom, 0px));
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  overscroll-behavior-y: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  min-height: 100dvh;
}

.hidden { display: none !important; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* ============ Splash ============ */
.screen {
  position: fixed; inset: 0;
  max-width: 520px; margin: 0 auto;
  display: flex; flex-direction: column;
  z-index: 50;
}
.splash {
  background: var(--gradient);
  align-items: center; justify-content: center;
  color: #fff; text-align: center; gap: 18px;
}
.splash-logo { font-size: 64px; filter: drop-shadow(0 6px 16px rgba(0,0,0,.25)); }
.splash-title { font-size: 32px; line-height: 1.15; font-weight: 800; letter-spacing: -.5px; }
.splash-title span { font-weight: 400; font-size: 22px; opacity: .9; }

.spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.spinner.dark { border-color: rgba(124,58,237,.2); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Onboarding ============ */
#onboarding { background: var(--bg); z-index: 45; }
.ob-slide {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 32px;
  animation: fadeIn .4s ease;
}
.ob-emoji {
  font-size: 88px; margin-bottom: 28px;
  background: var(--gradient-soft);
  width: 180px; height: 180px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.ob-slide h2 { font-size: 26px; font-weight: 800; margin-bottom: 12px; letter-spacing: -.4px; }
.ob-slide p { color: var(--text-2); max-width: 300px; }
.ob-footer { padding: 24px 32px calc(24px + env(safe-area-inset-bottom, 0px)); }
.ob-dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; }
.ob-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: all .25s; }
.ob-dot.active { width: 24px; border-radius: 4px; background: var(--primary); }
.ob-skip { position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); right: 20px; background: none; border: none; color: var(--text-3); font-size: 15px; font-weight: 600; }

/* ============ Auth ============ */
#auth { background: var(--bg); z-index: 40; overflow-y: auto; }
.auth-hero {
  background: var(--gradient);
  color: #fff; text-align: center;
  padding: calc(48px + env(safe-area-inset-top, 0px)) 24px 40px;
  border-radius: 0 0 32px 32px;
}
.auth-hero .logo { font-size: 44px; }
.auth-hero h1 { font-size: 26px; font-weight: 800; margin-top: 8px; letter-spacing: -.4px; }
.auth-hero p { opacity: .85; font-size: 14px; margin-top: 4px; }
.auth-body { padding: 24px 24px 48px; }
.auth-tabs {
  display: flex; background: #edeaf7; border-radius: 14px; padding: 4px; margin-bottom: 24px;
}
.auth-tab {
  flex: 1; padding: 10px; border: none; background: none; border-radius: 11px;
  font-weight: 700; font-size: 15px; color: var(--text-2); transition: all .2s;
}
.auth-tab.active { background: #fff; color: var(--primary); box-shadow: var(--shadow); }
.auth-note {
  background: var(--gradient-soft); border-radius: var(--radius-sm);
  padding: 14px 16px; font-size: 14px; color: var(--text-2); margin-top: 16px; text-align: center;
}

/* ============ Forms ============ */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text);
  outline: none; transition: border-color .2s;
  appearance: none;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.field-hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px;
  border: none; border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 700;
  transition: transform .1s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 6px 18px rgba(124,58,237,.35); }
.btn-outline { background: var(--card); color: var(--primary); border: 1.5px solid var(--primary); }
.btn-ghost { background: #edeaf7; color: var(--text); }
.btn-danger-ghost { background: #fdeaea; color: var(--danger); }
.btn-sm { width: auto; padding: 9px 16px; font-size: 14px; border-radius: 12px; }

/* Chips (Kategorien, Filter) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 100px;
  background: var(--card); border: 1.5px solid var(--border);
  font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: all .15s;
}
.chip.active { background: var(--gradient); border-color: transparent; color: #fff; }
.chip-static {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 100px;
  background: var(--gradient-soft); color: var(--primary-dark);
  font-size: 12.5px; font-weight: 700;
}

/* Slider */
input[type=range] {
  width: 100%; accent-color: var(--primary); height: 32px;
}

/* ============ App Layout ============ */
.app-header {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 20;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 20px 12px;
  background: rgba(246,245,251,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.app-header h1 { font-size: 21px; font-weight: 800; letter-spacing: -.4px; }
.header-sub { font-size: 12.5px; color: var(--text-2); }
.header-action {
  border: none; background: var(--card); box-shadow: var(--shadow);
  width: 40px; height: 40px; border-radius: 13px; font-size: 18px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.view {
  padding: calc(76px + env(safe-area-inset-top, 0px)) 16px calc(var(--nav-h) + 20px);
  min-height: 100dvh;
}

/* ============ Bottom Nav ============ */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 30;
  height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255,255,255,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: flex; align-items: stretch;
}
.nav-btn {
  flex: 1; border: none; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--text-3); position: relative;
}
.nav-btn.active { color: var(--primary); }
.nav-icon { font-size: 21px; filter: grayscale(1) opacity(.55); transition: filter .2s; }
.nav-btn.active .nav-icon { filter: none; }
.nav-label { font-size: 10.5px; font-weight: 700; }
.nav-create-circle {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--gradient); color: #fff;
  font-size: 30px; font-weight: 400; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(124,58,237,.4);
  margin-top: -22px;
  border: 4px solid var(--bg);
}
.nav-badge {
  position: absolute; top: 8px; right: calc(50% - 22px);
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 800;
  min-width: 17px; height: 17px; border-radius: 100px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ============ Swipe-Deck ============ */
.deck-wrap { position: relative; height: calc(100dvh - 76px - var(--nav-h) - 108px - env(safe-area-inset-top, 0px)); min-height: 380px; }
.deck-card {
  position: absolute; inset: 0;
  background: var(--card); border-radius: 24px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
  touch-action: none;
  will-change: transform;
  user-select: none; -webkit-user-select: none;
}
.deck-card.behind-1 { transform: translateY(14px) scale(.955); filter: brightness(.985); }
.deck-card.behind-2 { transform: translateY(28px) scale(.91); filter: brightness(.97); }
.deck-card.animate-out { transition: transform .35s ease, opacity .35s ease; }
.deck-card.snap-back { transition: transform .3s cubic-bezier(.2,.9,.3,1.2); }

.card-hero {
  background: var(--gradient);
  min-height: 140px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; position: relative; gap: 4px; padding: 18px;
}
.card-hero .cat-emoji { font-size: 52px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.2)); }
.card-hero .cat-name { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; opacity: .9; }
.card-distance {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255,255,255,.22); backdrop-filter: blur(6px);
  padding: 5px 12px; border-radius: 100px;
  font-size: 13px; font-weight: 700;
}
.card-body { flex: 1; padding: 18px 20px; overflow-y: auto; }
.card-title { font-size: 22px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 8px; }
.card-meta { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.card-meta-row { display: flex; align-items: center; gap: 9px; font-size: 14.5px; color: var(--text-2); }
.card-meta-row .ico { width: 20px; text-align: center; flex-shrink: 0; }
.card-desc { font-size: 14.5px; color: var(--text-2); white-space: pre-wrap; }
.card-creator {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-top: 1px solid var(--border);
}
.card-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 20px 14px; }

.stamp {
  position: absolute; top: 26px;
  padding: 8px 18px; border-radius: 12px;
  font-size: 24px; font-weight: 900; letter-spacing: 2px;
  border: 4px solid; transform: rotate(-14deg);
  opacity: 0; pointer-events: none; z-index: 5;
}
.stamp-yes { left: 18px; color: var(--success); border-color: var(--success); }
.stamp-no { right: 18px; color: var(--danger); border-color: var(--danger); transform: rotate(14deg); }

.deck-actions {
  display: flex; justify-content: center; align-items: center; gap: 22px;
  padding: 16px 0 4px;
}
.deck-action {
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); background: var(--card);
  transition: transform .1s;
}
.deck-action:active { transform: scale(.9); }
.deck-action.no { width: 58px; height: 58px; font-size: 24px; color: var(--danger); }
.deck-action.info { width: 46px; height: 46px; font-size: 20px; color: var(--warning); }
.deck-action.yes { width: 58px; height: 58px; font-size: 26px; color: var(--success); }

/* ============ Cards / Listen ============ */
.list-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
  margin-bottom: 12px;
}
.list-card-top { display: flex; gap: 12px; align-items: flex-start; }
.list-emoji {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  background: var(--gradient-soft);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.list-title { font-weight: 800; font-size: 16px; letter-spacing: -.2px; }
.list-sub { font-size: 13px; color: var(--text-2); margin-top: 1px; }
.list-right { margin-left: auto; text-align: right; flex-shrink: 0; }

.status-badge {
  display: inline-block; padding: 4px 10px; border-radius: 100px;
  font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
}
.status-pending { background: #fef3c7; color: #b45309; }
.status-accepted { background: #d1fae5; color: #047857; }
.status-declined { background: #fee2e2; color: #b91c1c; }
.status-past { background: #e5e7eb; color: #4b5563; }

.req-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-top: 1px solid var(--border); margin-top: 10px;
}
.req-actions { display: flex; gap: 8px; margin-left: auto; }
.req-btn {
  width: 38px; height: 38px; border-radius: 12px; border: none; font-size: 16px;
}
.req-accept { background: #d1fae5; color: #047857; }
.req-decline { background: #fee2e2; color: #b91c1c; }

.card-btn-row { display: flex; gap: 8px; margin-top: 12px; }
.card-btn-row .btn { flex: 1; }

/* Segment-Control */
.segment {
  display: flex; background: #edeaf7; border-radius: 14px; padding: 4px; margin-bottom: 16px;
}
.segment button {
  flex: 1; padding: 9px; border: none; background: none; border-radius: 11px;
  font-weight: 700; font-size: 14px; color: var(--text-2); transition: all .2s;
}
.segment button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow); }

/* ============ Avatare ============ */
.avatar {
  border-radius: 50%; background: var(--gradient-soft);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--primary); overflow: hidden; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 36px; height: 36px; font-size: 14px; }
.avatar-md { width: 48px; height: 48px; font-size: 18px; }
.avatar-xl { width: 96px; height: 96px; font-size: 36px; }

.stars { color: var(--warning); font-size: 13px; letter-spacing: 1px; }

/* ============ Chat ============ */
.chat-thread {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 0;
}
.bubble {
  max-width: 78%; padding: 10px 14px; border-radius: 18px;
  font-size: 15px; white-space: pre-wrap; word-break: break-word;
}
.bubble.me { align-self: flex-end; background: var(--gradient); color: #fff; border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; background: var(--card); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.bubble-time { font-size: 10.5px; opacity: .65; margin-top: 3px; text-align: right; }

.chat-input-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 35;
  display: flex; gap: 10px; align-items: flex-end;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,.94); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
.chat-input-bar textarea {
  flex: 1; border: 1.5px solid var(--border); border-radius: 20px;
  padding: 11px 16px; outline: none; resize: none; max-height: 110px;
  background: var(--bg);
}
.chat-send {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--gradient); color: #fff; font-size: 18px; flex-shrink: 0;
}

/* ============ Bottom Sheet ============ */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(20, 16, 34, .5);
  animation: fadeIn .25s ease;
}
.sheet {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 61;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  max-height: 92dvh; overflow-y: auto;
  padding: 10px 20px calc(28px + env(safe-area-inset-bottom, 0px));
  animation: slideUp .3s cubic-bezier(.2, .9, .3, 1);
}
.sheet-handle {
  width: 42px; height: 5px; border-radius: 3px;
  background: var(--border); margin: 6px auto 16px;
}
.sheet h2 { font-size: 20px; font-weight: 800; letter-spacing: -.3px; margin-bottom: 14px; }
@keyframes slideUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============ Empty State ============ */
.empty {
  text-align: center; padding: 56px 32px; color: var(--text-2);
}
.empty .empty-emoji { font-size: 56px; margin-bottom: 14px; }
.empty h3 { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 14px; max-width: 280px; margin: 0 auto 18px; }

/* ============ Toast ============ */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%;
  transform: translateX(-50%);
  z-index: 80; max-width: 90%;
  background: #26203d; color: #fff;
  padding: 12px 20px; border-radius: 100px;
  font-size: 14.5px; font-weight: 600; text-align: center;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============ Profil ============ */
.profile-head {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 0 20px; text-align: center;
}
.profile-head h2 { font-size: 22px; font-weight: 800; margin-top: 12px; }
.avatar-edit { position: relative; }
.avatar-edit-btn {
  position: absolute; bottom: 0; right: 0;
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--bg); background: var(--gradient); color: #fff; font-size: 14px;
}
.section-title {
  font-size: 13px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-3); margin: 22px 4px 10px;
}

/* Star-Rating Input */
.star-input { display: flex; gap: 8px; justify-content: center; font-size: 38px; margin: 10px 0 18px; }
.star-input button { background: none; border: none; filter: grayscale(1) opacity(.4); transition: all .15s; font-size: inherit; }
.star-input button.lit { filter: none; transform: scale(1.08); }

.skeleton-center { display: flex; justify-content: center; padding: 48px 0; }
