/* ── Variables ─────────────────────────────────────────── */
:root {
  --primary: #FF6B35;
  --primary-dark: #E85A2A;
  --secondary: #F7931E;
  --accent: #00B4D8;
  --success: #06D6A0;
  --bg: #FAFAFA;
  --bg-secondary: #F0F0F0;
  --text: #1A1A1A;
  --text-secondary: #6B6B6B;
  --card-bg: #FFFFFF;
  --card-border: rgba(0, 0, 0, 0.08);
  --shadow: rgba(0, 0, 0, 0.06);
  --shadow-hover: rgba(0, 0, 0, 0.12);
  --radius: 16px;
  --radius-lg: 24px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Category colors - vibrant, non-purple palette */
  --cat-creative: 251, 146, 60;
  --cat-with-friend: 14, 165, 233;
  --cat-with-partner: 244, 63, 94;
  --cat-solo-adventure: 6, 182, 212;
  --cat-self-care: 234, 179, 8;
  --cat-learning: 59, 130, 246;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F0F0F;
    --bg-secondary: #1A1A1A;
    --text: #F5F5F5;
    --text-secondary: #A0A0A0;
    --card-bg: #1A1A1A;
    --card-border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.5);
  }
}

/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* ── App Shell ────────────────────────────────────────── */
.app {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.25rem;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .app {
    padding: 0 2rem;
  }
}

@media (min-width: 1024px) {
  .app {
    max-width: 1100px;
  }
}

/* ── Header ───────────────────────────────────────────── */
.header {
  text-align: center;
  padding: 2.5rem 0 1rem;
}

.logo-container {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.logo-icon {
  color: var(--primary);
  flex-shrink: 0;
}

.logo {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

.tagline {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  line-height: 1.4;
}

@media (min-width: 768px) {
  .header {
    padding: 3rem 0 1.5rem;
  }
  
  .logo {
    font-size: 2.25rem;
  }
  
  .tagline {
    font-size: 1rem;
  }
}

/* ── Filter Bar ───────────────────────────────────────── */
.filter-bar-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.filter-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  flex-shrink: 0;
  border: 2px solid var(--card-border);
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 3px var(--shadow);
  z-index: 10;
}

.filter-nav-btn:hover {
  background: var(--bg-secondary);
  color: var(--text);
  border-color: var(--text-secondary);
  box-shadow: 0 2px 6px var(--shadow-hover);
}

.filter-nav-btn:active {
  transform: scale(0.95);
}

.filter-nav-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.filter-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.filter-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.75rem 0 1.5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  flex: 1;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 0.5rem;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  flex-shrink: 0;
  border: 2px solid transparent;
  border-radius: 100px;
  padding: 0.625rem 1.125rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  background: var(--card-bg);
  color: var(--text-secondary);
  box-shadow: 0 1px 3px var(--shadow);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
}

.filter-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow-hover);
  border-color: var(--card-border);
}

.filter-pill:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.filter-pill.active {
  color: #fff;
  box-shadow: 0 4px 12px var(--pill-shadow);
  border-color: transparent;
}

.filter-pill svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

@media (min-width: 1024px) {
  .filter-nav-btn {
    display: none;
  }
  
  .filter-bar {
    flex-direction: column;
    gap: 0.625rem;
    padding: 0;
    overflow-x: visible;
    overflow-y: auto;
    max-height: calc(100vh - 300px);
    scrollbar-width: thin;
    scroll-snap-type: none;
  }
  
  .filter-bar::-webkit-scrollbar {
    display: block;
    width: 6px;
  }
  
  .filter-bar::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .filter-bar::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 3px;
  }
  
  .filter-bar::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
  }
  
  .filter-pill {
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
    width: 100%;
    justify-content: flex-start;
  }
}

/* ── Main ─────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.card-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

@media (min-width: 1024px) {
  .content-wrapper {
    flex-direction: row;
    gap: 2rem;
    align-items: flex-start;
  }
  
  .filter-bar-container {
    width: 220px;
    flex-shrink: 0;
  }
  
  .card-area {
    flex: 1;
    max-width: 640px;
  }
}

.prompt {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  text-align: center;
  transition: opacity 0.3s ease;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .prompt {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
  }
}

/* ── Action Card ──────────────────────────────────────── */
.action-card {
  width: 100%;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  box-shadow: 0 2px 8px var(--shadow), 0 1px 2px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  width: fit-content;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}

.badge svg {
  flex-shrink: 0;
}

.card-title {
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
}

.card-desc {
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (min-width: 768px) {
  .action-card {
    padding: 2.25rem;
    gap: 1.5rem;
  }
  
  .badge {
    font-size: 0.875rem;
    padding: 0.625rem 1.125rem;
  }
  
  .card-title {
    font-size: 1.875rem;
  }
  
  .card-desc {
    font-size: 1.125rem;
  }
}

/* ── Buttons ──────────────────────────────────────────── */
.actions-row {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  margin-top: 1.5rem;
}

.btn {
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  font-family: inherit;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:active {
  transform: scale(0.98);
}

.btn-complete {
  flex: 1;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
  font-weight: 700;
}

.btn-complete:hover {
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
  transform: translateY(-2px);
}

.btn-shuffle {
  width: 56px;
  height: 56px;
  padding: 0;
  background: var(--card-bg);
  color: var(--text-secondary);
  border-radius: var(--radius);
  flex-shrink: 0;
  border: 2px solid var(--card-border);
  box-shadow: 0 1px 3px var(--shadow);
}

.btn-shuffle:hover {
  background: var(--bg-secondary);
  color: var(--text);
  border-color: var(--text-secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow-hover);
}

.btn-share {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--card-bg);
  color: var(--text);
  font-size: 1rem;
  border: 2px solid var(--card-border);
  box-shadow: 0 1px 3px var(--shadow);
  font-weight: 600;
}

.btn-share:hover {
  background: var(--bg-secondary);
  border-color: var(--text-secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow-hover);
}

@media (min-width: 768px) {
  .actions-row {
    margin-top: 2rem;
    gap: 1rem;
  }
  
  .btn {
    font-size: 1.0625rem;
    min-height: 52px;
  }
  
  .btn-shuffle {
    width: 60px;
    height: 60px;
  }
}

/* ── Completed State ──────────────────────────────────── */
.completed-state {
  width: 100%;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: cardIn 0.4s ease;
}

.completed-badge {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  background: rgba(6, 214, 160, 0.1);
  color: var(--success);
  border: 2px solid rgba(6, 214, 160, 0.2);
}

.completed-icon {
  flex-shrink: 0;
}

.completed-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.completed-badge strong {
  display: block;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.3;
}

.completed-badge span {
  font-size: 0.9375rem;
  font-weight: 500;
  opacity: 0.85;
  line-height: 1.4;
}

@media (min-width: 768px) {
  .completed-state {
    margin-top: 2rem;
    gap: 1rem;
  }
  
  .completed-badge {
    padding: 1.5rem 1.75rem;
  }
  
  .completed-badge strong {
    font-size: 1.25rem;
  }
  
  .completed-badge span {
    font-size: 1rem;
  }
}

/* ── Stats Bar ────────────────────────────────────────── */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem 0 2.5rem;
  margin-top: auto;
}

.stat {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stat-icon {
  color: var(--primary);
  flex-shrink: 0;
}

.stat-content {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}

.stat-divider {
  width: 2px;
  height: 48px;
  background: var(--card-border);
  border-radius: 1px;
}

@media (min-width: 768px) {
  .stats-bar {
    gap: 3rem;
    padding: 2.5rem 0 3rem;
  }
  
  .stat {
    gap: 1rem;
  }
  
  .stat-icon {
    width: 28px;
    height: 28px;
  }
  
  .stat-value {
    font-size: 2rem;
  }
  
  .stat-label {
    font-size: 0.875rem;
  }
  
  .stat-divider {
    height: 56px;
  }
}

/* ── Confetti ─────────────────────────────────────────── */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1000;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall var(--fall-duration) cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(var(--rotation)) scale(0.4);
    opacity: 0;
  }
}

/* ── Utilities ────────────────────────────────────────── */
.hidden {
  display: none !important;
}

/* ── Toast ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  padding: 0.875rem 1.75rem;
  border-radius: 100px;
  font-size: 0.9375rem;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2000;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: calc(100vw - 2rem);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 768px) {
  .toast {
    font-size: 1rem;
    padding: 1rem 2rem;
  }
}
