/* Modern CSS Reset & Variables */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Enhanced Pink Color Palette */
  --primary-50: #fef7ff;
  --primary-100: #fce7f3;
  --primary-200: #fbcfe8;
  --primary-300: #f8a5c2;
  --primary-400: #f472b6;
  --primary-500: #ec4899;
  --primary-600: #db2777;
  --primary-700: #be185d;
  --primary-800: #9d174d;
  --primary-900: #831843;
  
  /* Neutral Colors */
  --neutral-50: #fafafa;
  --neutral-100: #f5f5f5;
  --neutral-200: #e5e5e5;
  --neutral-300: #d4d4d4;
  --neutral-400: #a3a3a3;
  --neutral-500: #737373;
  --neutral-600: #525252;
  --neutral-700: #404040;
  --neutral-800: #262626;
  --neutral-900: #171717;
  
  /* Semantic Colors */
  --background: var(--primary-50);
  --surface: rgba(255, 255, 255, 0.8);
  --surface-hover: rgba(255, 255, 255, 0.95);
  --text-primary: var(--neutral-800);
  --text-secondary: var(--neutral-600);
  --text-muted: var(--neutral-500);
  --border: rgba(219, 39, 119, 0.1);
  --border-strong: rgba(219, 39, 119, 0.2);
  
  /* Typography */
  --font-sans: 'Jua', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Fredoka One', 'Poppins', var(--font-sans);
  --font-title: 'Cherry Bomb One', var(--font-display);
  --font-subtitle: 'Pangolin', var(--font-sans);
  
  /* Spacing Scale */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(219, 39, 119, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(219, 39, 119, 0.1), 0 2px 4px -1px rgba(219, 39, 119, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(219, 39, 119, 0.1), 0 4px 6px -2px rgba(219, 39, 119, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(219, 39, 119, 0.1), 0 10px 10px -5px rgba(219, 39, 119, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(219, 39, 119, 0.25);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Base Styles */
html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  animation: background-breathe 20s ease-in-out infinite;
}

@keyframes background-breathe {
  0%, 100% {
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
  }
  20% {
    background: linear-gradient(145deg, var(--primary-50) 5%, var(--primary-100) 95%);
  }
  40% {
    background: linear-gradient(125deg, var(--primary-50) 10%, var(--primary-100) 90%);
  }
  60% {
    background: linear-gradient(155deg, var(--primary-50) 8%, var(--primary-100) 92%);
  }
  80% {
    background: linear-gradient(115deg, var(--primary-50) 12%, var(--primary-100) 88%);
  }
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at 15% 80%, rgba(244, 114, 182, 0.15) 0%, transparent 65%),
    radial-gradient(ellipse at 85% 15%, rgba(219, 39, 119, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 40% 40%, rgba(248, 165, 194, 0.1) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 85%, rgba(236, 72, 153, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 25% 25%, rgba(251, 207, 232, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 90% 60%, rgba(244, 114, 182, 0.06) 0%, transparent 40%);
  pointer-events: none;
  z-index: -1;
  animation: mesh-gradient-flow 25s ease-in-out infinite;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at 60% 10%, rgba(244, 114, 182, 0.1) 0%, transparent 55%),
    radial-gradient(ellipse at 10% 70%, rgba(219, 39, 119, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(248, 165, 194, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 30% 90%, rgba(236, 72, 153, 0.06) 0%, transparent 45%),
    radial-gradient(ellipse at 75% 75%, rgba(251, 207, 232, 0.09) 0%, transparent 40%),
    radial-gradient(ellipse at 5% 35%, rgba(244, 114, 182, 0.07) 0%, transparent 35%);
  pointer-events: none;
  z-index: -1;
  animation: mesh-gradient-flow-reverse 30s ease-in-out infinite;
  animation-delay: -8s;
}

@keyframes mesh-gradient-flow {
  0%, 100% {
    background: 
      radial-gradient(ellipse at 15% 80%, rgba(244, 114, 182, 0.15) 0%, transparent 65%),
      radial-gradient(ellipse at 85% 15%, rgba(219, 39, 119, 0.12) 0%, transparent 60%),
      radial-gradient(ellipse at 40% 40%, rgba(248, 165, 194, 0.1) 0%, transparent 55%),
      radial-gradient(ellipse at 70% 85%, rgba(236, 72, 153, 0.08) 0%, transparent 50%),
      radial-gradient(ellipse at 25% 25%, rgba(251, 207, 232, 0.12) 0%, transparent 45%),
      radial-gradient(ellipse at 90% 60%, rgba(244, 114, 182, 0.06) 0%, transparent 40%);
  }
  16% {
    background: 
      radial-gradient(ellipse at 25% 75%, rgba(244, 114, 182, 0.12) 0%, transparent 62%),
      radial-gradient(ellipse at 80% 20%, rgba(219, 39, 119, 0.14) 0%, transparent 58%),
      radial-gradient(ellipse at 50% 35%, rgba(248, 165, 194, 0.11) 0%, transparent 57%),
      radial-gradient(ellipse at 75% 80%, rgba(236, 72, 153, 0.09) 0%, transparent 52%),
      radial-gradient(ellipse at 20% 30%, rgba(251, 207, 232, 0.1) 0%, transparent 47%),
      radial-gradient(ellipse at 85% 55%, rgba(244, 114, 182, 0.07) 0%, transparent 42%);
  }
  33% {
    background: 
      radial-gradient(ellipse at 35% 70%, rgba(244, 114, 182, 0.1) 0%, transparent 60%),
      radial-gradient(ellipse at 75% 25%, rgba(219, 39, 119, 0.11) 0%, transparent 56%),
      radial-gradient(ellipse at 60% 30%, rgba(248, 165, 194, 0.13) 0%, transparent 59%),
      radial-gradient(ellipse at 80% 75%, rgba(236, 72, 153, 0.07) 0%, transparent 48%),
      radial-gradient(ellipse at 15% 35%, rgba(251, 207, 232, 0.09) 0%, transparent 43%),
      radial-gradient(ellipse at 80% 50%, rgba(244, 114, 182, 0.08) 0%, transparent 38%);
  }
  50% {
    background: 
      radial-gradient(ellipse at 45% 65%, rgba(244, 114, 182, 0.13) 0%, transparent 58%),
      radial-gradient(ellipse at 70% 30%, rgba(219, 39, 119, 0.09) 0%, transparent 54%),
      radial-gradient(ellipse at 70% 25%, rgba(248, 165, 194, 0.1) 0%, transparent 61%),
      radial-gradient(ellipse at 85% 70%, rgba(236, 72, 153, 0.1) 0%, transparent 46%),
      radial-gradient(ellipse at 10% 40%, rgba(251, 207, 232, 0.11) 0%, transparent 41%),
      radial-gradient(ellipse at 75% 45%, rgba(244, 114, 182, 0.06) 0%, transparent 36%);
  }
  66% {
    background: 
      radial-gradient(ellipse at 55% 60%, rgba(244, 114, 182, 0.11) 0%, transparent 56%),
      radial-gradient(ellipse at 65% 35%, rgba(219, 39, 119, 0.13) 0%, transparent 52%),
      radial-gradient(ellipse at 80% 20%, rgba(248, 165, 194, 0.08) 0%, transparent 63%),
      radial-gradient(ellipse at 90% 65%, rgba(236, 72, 153, 0.08) 0%, transparent 44%),
      radial-gradient(ellipse at 5% 45%, rgba(251, 207, 232, 0.1) 0%, transparent 39%),
      radial-gradient(ellipse at 70% 40%, rgba(244, 114, 182, 0.09) 0%, transparent 34%);
  }
  83% {
    background: 
      radial-gradient(ellipse at 65% 55%, rgba(244, 114, 182, 0.14) 0%, transparent 54%),
      radial-gradient(ellipse at 60% 40%, rgba(219, 39, 119, 0.1) 0%, transparent 50%),
      radial-gradient(ellipse at 90% 15%, rgba(248, 165, 194, 0.12) 0%, transparent 65%),
      radial-gradient(ellipse at 95% 60%, rgba(236, 72, 153, 0.06) 0%, transparent 42%),
      radial-gradient(ellipse at 0% 50%, rgba(251, 207, 232, 0.08) 0%, transparent 37%),
      radial-gradient(ellipse at 65% 35%, rgba(244, 114, 182, 0.07) 0%, transparent 32%);
  }
}

@keyframes mesh-gradient-flow-reverse {
  0%, 100% {
    background: 
      radial-gradient(ellipse at 60% 10%, rgba(244, 114, 182, 0.1) 0%, transparent 55%),
      radial-gradient(ellipse at 10% 70%, rgba(219, 39, 119, 0.08) 0%, transparent 50%),
      radial-gradient(ellipse at 80% 30%, rgba(248, 165, 194, 0.12) 0%, transparent 60%),
      radial-gradient(ellipse at 30% 90%, rgba(236, 72, 153, 0.06) 0%, transparent 45%),
      radial-gradient(ellipse at 75% 75%, rgba(251, 207, 232, 0.09) 0%, transparent 40%),
      radial-gradient(ellipse at 5% 35%, rgba(244, 114, 182, 0.07) 0%, transparent 35%);
  }
  20% {
    background: 
      radial-gradient(ellipse at 70% 15%, rgba(244, 114, 182, 0.12) 0%, transparent 53%),
      radial-gradient(ellipse at 15% 65%, rgba(219, 39, 119, 0.1) 0%, transparent 48%),
      radial-gradient(ellipse at 75% 35%, rgba(248, 165, 194, 0.1) 0%, transparent 58%),
      radial-gradient(ellipse at 25% 85%, rgba(236, 72, 153, 0.08) 0%, transparent 43%),
      radial-gradient(ellipse at 70% 70%, rgba(251, 207, 232, 0.07) 0%, transparent 38%),
      radial-gradient(ellipse at 10% 30%, rgba(244, 114, 182, 0.09) 0%, transparent 33%);
  }
  40% {
    background: 
      radial-gradient(ellipse at 80% 20%, rgba(244, 114, 182, 0.08) 0%, transparent 51%),
      radial-gradient(ellipse at 20% 60%, rgba(219, 39, 119, 0.12) 0%, transparent 46%),
      radial-gradient(ellipse at 70% 40%, rgba(248, 165, 194, 0.14) 0%, transparent 56%),
      radial-gradient(ellipse at 20% 80%, rgba(236, 72, 153, 0.07) 0%, transparent 41%),
      radial-gradient(ellipse at 65% 65%, rgba(251, 207, 232, 0.11) 0%, transparent 36%),
      radial-gradient(ellipse at 15% 25%, rgba(244, 114, 182, 0.06) 0%, transparent 31%);
  }
  60% {
    background: 
      radial-gradient(ellipse at 90% 25%, rgba(244, 114, 182, 0.11) 0%, transparent 49%),
      radial-gradient(ellipse at 25% 55%, rgba(219, 39, 119, 0.09) 0%, transparent 44%),
      radial-gradient(ellipse at 65% 45%, rgba(248, 165, 194, 0.11) 0%, transparent 54%),
      radial-gradient(ellipse at 15% 75%, rgba(236, 72, 153, 0.09) 0%, transparent 39%),
      radial-gradient(ellipse at 60% 60%, rgba(251, 207, 232, 0.08) 0%, transparent 34%),
      radial-gradient(ellipse at 20% 20%, rgba(244, 114, 182, 0.08) 0%, transparent 29%);
  }
  80% {
    background: 
      radial-gradient(ellipse at 95% 30%, rgba(244, 114, 182, 0.09) 0%, transparent 47%),
      radial-gradient(ellipse at 30% 50%, rgba(219, 39, 119, 0.11) 0%, transparent 42%),
      radial-gradient(ellipse at 60% 50%, rgba(248, 165, 194, 0.13) 0%, transparent 52%),
      radial-gradient(ellipse at 10% 70%, rgba(236, 72, 153, 0.06) 0%, transparent 37%),
      radial-gradient(ellipse at 55% 55%, rgba(251, 207, 232, 0.1) 0%, transparent 32%),
      radial-gradient(ellipse at 25% 15%, rgba(244, 114, 182, 0.07) 0%, transparent 27%);
  }
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
}

/* Header */
.header {
  text-align: center;
  margin-bottom: var(--space-16);
  margin-top: var(--space-8);
}

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

.title {
  font-family: var(--font-title);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: var(--space-2);
  
  background: linear-gradient(
    135deg,
    var(--primary-600) 0%,
    var(--primary-500) 30%,
    var(--primary-400) 60%,
    #f97316 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  
  position: relative;
  display: inline-block;
}

.title-icon {
  display: inline-block;
  font-size: 0.8em;
  margin-right: var(--space-3);
  animation: bounce 2s forwards;
  -webkit-text-fill-color: initial;
  color: var(--primary-600);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.subtitle {
  font-family: var(--font-subtitle);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: var(--space-12);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Stats */
.stats {
  display: flex;
  justify-content: center;
  gap: var(--space-12);
  margin-bottom: var(--space-8);
}

.stat-item {
  text-align: center;
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  min-width: 120px;
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-600);
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Main Content */
.main {
  position: relative;
  padding-bottom: 6rem;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-20);
  text-align: center;
}

.loading-state.hidden {
  display: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--primary-200);
  border-top: 4px solid var(--primary-500);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
  margin-bottom: var(--space-4);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-state p {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Items Grid */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--space-6);
  padding: var(--space-4) 0;
  min-height: 40vh;
  align-items: center;
  justify-content: center;
}

/* When empty state is the only child, center it */
.items-grid:has(.empty-state),
.items-grid-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Item Cards */
.item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 120px;
}

.item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-500), #f97316);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-spring);
}

.item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.item:hover::before {
  transform: scaleX(1);
}

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

.item:active {
  transform: translateY(-2px);
  transition: transform var(--transition-fast);
}

/* Item Image Container */
.item-image-container {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  background: var(--primary-100);
}

.item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-xl);
  transition: transform var(--transition-normal), filter var(--transition-normal);
}

.item:hover .item-image {
  transform: scale(1.05);
  filter: blur(6px) hue-rotate(var(--hue-rotation, 0deg)) !important;
}

/* Item Content */
.item-content {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
  
  /* Ensure text doesn't overflow */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Spoiler Effect */
.spoiler .spoiler-text {
  background: var(--text-primary);
  color: transparent;
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  transition: all var(--transition-normal);
  position: relative;
  user-select: none;
  cursor: pointer;
}

.spoiler:hover .spoiler-text {
  background: var(--primary-100);
  color: var(--text-primary);
  text-shadow: 0 0 8px var(--primary-400);
}

.item-description {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
  line-height: 1.4;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-20);
  color: var(--text-secondary);
  min-height: 40vh;
  grid-column: 1 / -1;
  width: 100%;
}

.empty-state h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 600;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
  background: linear-gradient(
    135deg,
    var(--primary-600) 0%,
    var(--primary-500) 50%,
    var(--primary-400) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.empty-state p {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Error State */
.error-state {
  text-align: center;
  padding: var(--space-20);
  color: var(--text-secondary);
}

.error-state h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

.error-state p {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.error-state button {
  background: var(--primary-500);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-6);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-md);
}

.error-state button:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* Congratulations Popup */
.congratulations-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: var(--surface);
  border: 2px solid var(--primary-200);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-2xl);
  z-index: 10000;
  opacity: 0;
  transition: all var(--transition-spring);
  text-align: center;
  min-width: 300px;
  max-width: 400px;
  backdrop-filter: blur(20px);
}

.congratulations-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.congratulations-popup.hide {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
}

.popup-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.popup-icon {
  font-size: 3rem;
  animation: celebration 0.6s ease-in-out;
}

@keyframes celebration {
  0%, 20%, 60%, 100% {
    transform: translateY(0) scale(1);
  }
  40% {
    transform: translateY(-10px) scale(1.1);
  }
  80% {
    transform: translateY(-5px) scale(1.05);
  }
}

.popup-content h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.popup-content p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: var(--space-4) var(--space-3);
  }
  
  .stats {
    gap: var(--space-6);
  }
  
  .stat-item {
    min-width: 100px;
    padding: var(--space-4);
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
  
  .items-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  
  .item {
    padding: var(--space-4);
    gap: var(--space-3);
  }
  
  .item-image-container {
    width: 60px;
    height: 60px;
  }
  
  .item-name {
    font-size: 1.125rem;
  }
}

@media (max-width: 480px) {
  .header {
    margin-bottom: var(--space-12);
  }
  
  .stats {
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
  }
  
  .stat-item {
    width: 100%;
    max-width: 200px;
  }
  
  .congratulations-popup {
    margin: var(--space-4);
    width: calc(100% - var(--space-8));
    min-width: auto;
  }
}

/* Biting Interface Styles */
.biting-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.biting-overlay.show {
  opacity: 1;
  visibility: visible;
}

.biting-overlay.hide {
  opacity: 0;
  visibility: hidden;
}

.biting-container {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
  text-align: center;
  transform: translateY(20px) scale(0.95);
  transition: all var(--transition-spring);
  position: relative;
}

.biting-overlay.show .biting-container {
  transform: translateY(0) scale(1);
}

.biting-container.completion-animation {
  animation: completion-bounce 1s ease-out;
}

@keyframes completion-bounce {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.05); }
  100% { transform: translateY(0) scale(1); }
}

.close-button {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: var(--neutral-200);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  color: var(--text-secondary);
  z-index: 1;
}

.close-button:hover {
  background: var(--neutral-300);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.close-button:active {
  transform: rotate(90deg) scale(0.95);
}

.close-button svg {
  width: 20px;
  height: 20px;
}

.biting-header {
  margin-bottom: var(--space-6);
  margin-top: var(--space-4);
}

.biting-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.biting-item-name {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-600);
  margin-bottom: var(--space-3);
}

.biting-instruction {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.biting-food-container {
  margin: var(--space-8) 0;
  position: relative;
  display: flex;
  justify-content: center;
}

.food-image-wrapper {
  position: relative;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-normal);
}

.bite-mask-svg {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

.food-image-wrapper.clickable-food {
  cursor: pointer;
  border: 4px solid transparent;
}

.food-image-wrapper.clickable-food:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-400);
}

.food-image-wrapper.clickable-food:active {
  transform: scale(0.98);
}

.biting-food-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
  border-radius: 50%;
  background: transparent;
  /* Ensure the image is visible by default */
  opacity: 1;
  mask: none !important;
  -webkit-mask: none !important;
}

.food-image-wrapper.bite-animation {
  animation: bite-shake 0.5s ease-in-out;
}

.biting-food-image.bite-animation {
  animation: bite-flash 0.5s ease-in-out;
}

@keyframes bite-shake {
  0%, 100% { 
    transform: scale(1) rotate(0deg); 
  }
  10% { 
    transform: scale(0.98) rotate(-1deg); 
  }
  25% { 
    transform: scale(0.92) rotate(-3deg); 
    filter: brightness(0.9);
  }
  40% { 
    transform: scale(0.88) rotate(2deg); 
    filter: brightness(0.8);
  }
  55% { 
    transform: scale(0.92) rotate(-1deg); 
    filter: brightness(0.9);
  }
  70% { 
    transform: scale(0.96) rotate(1deg); 
    filter: brightness(0.95);
  }
  85% { 
    transform: scale(0.99) rotate(-0.5deg); 
  }
}

@keyframes bite-flash {
  0%, 100% { 
    filter: brightness(1) contrast(1) saturate(1); 
  }
  15% { 
    filter: brightness(1.1) contrast(1.1) saturate(1.1); 
  }
  30% { 
    filter: brightness(0.8) contrast(1.2) saturate(0.8) hue-rotate(10deg); 
  }
  50% { 
    filter: brightness(1.3) contrast(1.3) saturate(1.4) hue-rotate(-5deg); 
  }
  70% { 
    filter: brightness(1.1) contrast(1.1) saturate(1.2); 
  }
}

.food-image-wrapper.food-disappear {
  animation: food-disappear 1s ease-in-out forwards;
}

@keyframes food-disappear {
  0% { 
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  50% { 
    transform: scale(0.8) rotate(180deg);
    opacity: 0.5;
  }
  100% { 
    transform: scale(0) rotate(360deg);
    opacity: 0;
  }
}

.bite-overlay-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
  z-index: 2;
}

.bite-chart {
  width: 100%;
  height: 100%;
  filter: none;
  background: transparent;
}

.visual-bite {
  fill: rgba(255, 255, 255, 0.9);
  stroke: rgba(219, 39, 119, 0.4);
  stroke-width: 1;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.2));
}

.bite-section {
  opacity: 0;
  transform: scale(0) rotate(-10deg);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

.bite-section.animate-in {
  opacity: 1;
  transform: scale(1) rotate(0deg);
  animation: cookie-bite-appear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cookie-bite-appear {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-10deg);
    filter: drop-shadow(0px 0px 0px rgba(0, 0, 0, 0));
  }
  30% {
    opacity: 0.7;
    transform: scale(0.7) rotate(-5deg);
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.2));
  }
  60% {
    opacity: 0.9;
    transform: scale(1.05) rotate(2deg);
    filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.4));
  }
  80% {
    opacity: 1;
    transform: scale(0.98) rotate(-1deg);
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.35));
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
  }
}

/* Crumb animation for cookie bite effect */
@keyframes crumb-fall {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  20% {
    opacity: 0.9;
    transform: translate(calc(var(--end-x) - 40%), calc(var(--end-y) - 40%)) rotate(90deg) scale(0.8);
  }
  60% {
    opacity: 0.5;
    transform: translate(calc(var(--end-x) - 40%), calc(var(--end-y) - 40%)) rotate(180deg) scale(0.6);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--end-x) - 40%), calc(var(--end-y) - 40%)) rotate(270deg) scale(0.2);
  }
}

.bite-prompt {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 2px solid var(--primary-400);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: var(--primary-600);
  font-size: 0.9rem;
  pointer-events: none;
  transition: all var(--transition-normal);
  animation: bite-prompt-pulse 2s ease-in-out infinite;
}

@keyframes bite-prompt-pulse {
  0%, 100% { 
    transform: translateX(-50%) scale(1);
    opacity: 0.9;
  }
  50% { 
    transform: translateX(-50%) scale(1.1);
    opacity: 1;
  }
}

.bite-emoji {
  font-size: 1.2rem;
  animation: bite-emoji-wiggle 2s ease-in-out infinite;
}

@keyframes bite-emoji-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-15deg); }
  75% { transform: rotate(15deg); }
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .biting-container {
    padding: var(--space-6);
    margin: var(--space-4);
  }
  
  .biting-item-name {
    font-size: 1.8rem;
  }
  
  .food-image-wrapper {
    width: 250px;
    height: 250px;
  }
  
  .close-button {
    width: 36px;
    height: 36px;
    top: var(--space-3);
    right: var(--space-3);
  }
  
  .close-button svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 480px) {
  .biting-title {
    font-size: 1.3rem;
  }
  
  .biting-item-name {
    font-size: 1.6rem;
  }
  
  .biting-instruction {
    font-size: 1rem;
  }
  
  .food-image-wrapper {
    width: 220px;
    height: 220px;
  }
  
  .bite-prompt {
    font-size: 0.8rem;
    padding: var(--space-1) var(--space-3);
  }
}

/* Remove old bite button styles */
.biting-controls,
.bite-button,
.cancel-button {
  display: none;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .title-icon {
    animation: none;
  }
  
  .loading-spinner {
    animation: none;
    border: 4px solid var(--primary-500);
  }
  
  .bite-emoji {
    animation: none;
  }
  
  .biting-food-image.bite-animation,
  .bite-button.bite-animation {
    animation: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --border: var(--primary-600);
    --border-strong: var(--primary-700);
    --surface: rgba(255, 255, 255, 1);
  }
}

/* Footer */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  background: transparent;
  z-index: 100;
}

.footer-content {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  padding-left: 3.5rem;
  padding-right: 3.5rem;
  background: rgba(248, 165, 194, 0.45);
  position: relative;
  overflow: hidden;
  box-shadow: 0 -2px 10px rgba(219, 39, 119, 0.1);
}

.footer-text {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 500;
}

.footer-version {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 0.25rem;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Confetti Effect */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  opacity: 0.9;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 1;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(var(--end-y)) translateX(var(--end-x)) rotate(var(--rotation));
    opacity: 0;
  }
}

@keyframes confetti-fireworks {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg) scale(0.3);
    opacity: 1;
  }
  20% {
    transform: translateY(calc(var(--explosion-y) - 50vh)) translateX(calc(var(--explosion-x) - 50vw)) rotate(calc(var(--rotation) * 0.3)) scale(1.2);
    opacity: 1;
  }
  40% {
    transform: translateY(calc(var(--explosion-y) - 50vh)) translateX(calc(var(--explosion-x) - 50vw)) rotate(calc(var(--rotation) * 0.6)) scale(1);
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(calc(var(--end-y) - 50vh)) translateX(calc(var(--end-x) - 50vw)) rotate(var(--rotation)) scale(0.5);
    opacity: 0;
  }
}