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

:root {
  --cream: #FFF8F0;
  --warm-orange: #FF8C42;
  --deep-orange: #E85D04;
  --rich-brown: #5C4033;
  --berry-red: #D90429;
  --berry-pink: #EF476F;
  --pot-brown: #3D2914;
  --liquid-orange: #FF6B35;
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  background: 
    repeating-linear-gradient(
      45deg,
      #FFF8F0 0px,
      #FFF8F0 20px,
      #FFF3E6 20px,
      #FFF3E6 40px
    );
  min-height: 100vh;
  color: var(--rich-brown);
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Header */
.app-header {
  text-align: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, var(--warm-orange), var(--deep-orange));
  color: white;
  box-shadow: 0 4px 20px rgba(232, 93, 4, 0.3);
}

.app-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
  animation: titleBounce 0.6s ease-out;
}

.app-subtitle {
  font-size: 1.1rem;
  opacity: 0.95;
  margin-top: 0.5rem;
  font-weight: 600;
}

@keyframes titleBounce {
  0% { transform: scale(0.8); opacity: 0; }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 768px) {
  .main-content {
    flex-direction: row;
    align-items: flex-start;
  }
}

/* Ingredient Shelf */
.ingredient-shelf {
  background: linear-gradient(145deg, #FFF, #FFF8F0);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 
    0 4px 15px rgba(92, 64, 51, 0.1),
    inset 0 1px 0 rgba(255,255,255,0.8);
  border: 2px solid rgba(92, 64, 51, 0.1);
}

@media (min-width: 768px) {
  .ingredient-shelf {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 1rem;
  }
}

.ingredient-category {
  margin-bottom: 1rem;
}

.ingredient-category:last-child {
  margin-bottom: 0;
}

.category-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--deep-orange);
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.category-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ingredient-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 50px;
  border: 2px solid var(--warm-orange);
  background: white;
  color: var(--rich-brown);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.ingredient-chip:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 140, 66, 0.3);
  background: var(--warm-orange);
  color: white;
}

.ingredient-chip.in-pot {
  background: var(--deep-orange);
  color: white;
  border-color: var(--deep-orange);
  opacity: 0.7;
}

.ingredient-chip .remove-x {
  margin-left: 0.25rem;
  font-weight: 700;
}

/* Kitchen Area */
.kitchen-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.kitchen-area.shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px) rotate(-1deg); }
  50% { transform: translateX(10px) rotate(1deg); }
  75% { transform: translateX(-10px) rotate(-1deg); }
}

/* Cooking Pot */
.pot-container {
  position: relative;
  width: 240px;
  height: 200px;
  margin: 1rem 0;
}

.cooking-pot {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 140px;
  background: linear-gradient(145deg, #4A3728, var(--pot-brown));
  border-radius: 0 0 90px 90px;
  box-shadow: 
    0 8px 25px rgba(61, 41, 20, 0.4),
    inset 0 -10px 30px rgba(0,0,0,0.3),
    inset 0 10px 20px rgba(255,255,255,0.1);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.pot-container:hover .cooking-pot {
  transform: translateX(-50%) rotate(-2deg);
}

.pot-container.cooking .cooking-pot {
  animation: potWobble 0.3s ease-in-out infinite;
}

@keyframes potWobble {
  0%, 100% { transform: translateX(-50%) rotate(-1deg); }
  50% { transform: translateX(-50%) rotate(1deg); }
}

.pot-liquid {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  height: 80px;
  background: linear-gradient(180deg, var(--liquid-orange), #FF4500);
  border-radius: 0 0 80px 80px;
  opacity: 0.9;
}

.pot-handle {
  position: absolute;
  top: 30px;
  width: 25px;
  height: 50px;
  background: linear-gradient(90deg, #3D2914, #5C4033);
  border-radius: 10px;
}

.pot-handle.left {
  left: 15px;
  transform: rotate(-15deg);
}

.pot-handle.right {
  right: 15px;
  transform: rotate(15deg);
}

/* Bubbles */
.bubbles-container {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  height: 80px;
  pointer-events: none;
}

.bubble {
  position: absolute;
  bottom: 0;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: bubbleRise 2s ease-in-out infinite;
}

@keyframes bubbleRise {
  0% { transform: translateY(0) scale(1); opacity: 0.6; }
  50% { opacity: 0.8; }
  100% { transform: translateY(-60px) scale(0.5); opacity: 0; }
}

/* Pot Ingredients */
.pot-ingredients {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pot-ingredient {
  position: absolute;
  font-size: 1.5rem;
  animation: floatIngredient 2s ease-in-out infinite;
  cursor: pointer;
  pointer-events: all;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: transform 0.2s;
}

.pot-ingredient:hover {
  transform: scale(1.3);
}

@keyframes floatIngredient {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-8px) rotate(5deg); }
}

/* Steam */
.steam-container {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 60px;
  pointer-events: none;
}

.steam-particle {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  animation: steamRise 3s ease-out infinite;
}

@keyframes steamRise {
  0% { 
    transform: translateX(-50%) translateY(0) scale(0.5); 
    opacity: 0.6; 
  }
  100% { 
    transform: translateX(calc(-50% + var(--drift, 20px))) translateY(-80px) scale(1.5); 
    opacity: 0; 
  }
}

.steam-particle:nth-child(1) { --drift: -30px; left: 30%; }
.steam-particle:nth-child(2) { --drift: 20px; left: 50%; }
.steam-particle:nth-child(3) { --drift: -10px; left: 70%; }
.steam-particle:nth-child(4) { --drift: 30px; left: 40%; }
.steam-particle:nth-child(5) { --drift: -20px; left: 60%; }
.steam-particle:nth-child(6) { --drift: 10px; left: 45%; }

/* Fire Effect */
.fire-container {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 60px;
  pointer-events: none;
}

.fire-particle {
  position: absolute;
  bottom: 0;
  width: 40px;
  height: 60px;
  background: linear-gradient(to top, #FF4500, #FF8C00, #FFD700);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: fireFlicker 0.3s ease-in-out infinite alternate;
  filter: blur(2px);
}

@keyframes fireFlicker {
  0% { transform: scaleY(1) scaleX(1); opacity: 0.8; }
  100% { transform: scaleY(1.2) scaleX(0.9); opacity: 1; }
}

.pot-container.on-fire .cooking-pot {
  box-shadow: 
    0 8px 25px rgba(255, 69, 0, 0.6),
    inset 0 -10px 30px rgba(0,0,0,0.3),
    0 0 40px rgba(255, 140, 0, 0.4);
}

/* Cook Button */
.cook-button {
  padding: 1rem 2.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  font-family: 'Bricolage Grotesque', sans-serif;
  background: linear-gradient(145deg, var(--berry-red), #B80020);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 
    0 6px 0 #8B0000,
    0 8px 20px rgba(217, 4, 41, 0.4);
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cook-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 0 #8B0000,
    0 10px 25px rgba(217, 4, 41, 0.5);
}

.cook-button:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 
    0 2px 0 #8B0000,
    0 4px 10px rgba(217, 4, 41, 0.4);
}

.cook-button:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.cook-button.cooking {
  animation: pulse 0.5s ease-in-out infinite;
}

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

/* Idea Card */
.idea-card {
  background: white;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 
    0 10px 40px rgba(92, 64, 51, 0.15),
    0 2px 10px rgba(92, 64, 51, 0.1);
  max-width: 500px;
  width: 100%;
  animation: cardSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid rgba(255, 140, 66, 0.2);
}

@keyframes cardSlideUp {
  0% { transform: translateY(30px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.idea-header {
  text-align: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px dashed rgba(255, 140, 66, 0.3);
}

.idea-name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--deep-orange);
  margin-bottom: 0.25rem;
}

.idea-tagline {
  font-size: 1rem;
  font-style: italic;
  color: var(--rich-brown);
  opacity: 0.8;
}

.idea-pitch {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--rich-brown);
  margin-bottom: 1rem;
}

.idea-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.meta-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--deep-orange);
  font-weight: 700;
}

.meta-value {
  font-size: 0.9rem;
  font-weight: 600;
}

.idea-ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(255, 140, 66, 0.1);
  border-radius: 10px;
}

.ingredient-tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: white;
  border-radius: 20px;
  border: 1px solid rgba(255, 140, 66, 0.3);
}

.idea-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.action-btn {
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn.save {
  background: linear-gradient(145deg, var(--warm-orange), var(--deep-orange));
  color: white;
}

.action-btn.save.saved {
  background: linear-gradient(145deg, #22C55E, #16A34A);
}

.action-btn.cook-again {
  background: linear-gradient(145deg, var(--berry-pink), var(--berry-red));
  color: white;
}

.action-btn.clear {
  background: #F3F4F6;
  color: var(--rich-brown);
}

.action-btn.share {
  background: #1DA1F2;
  color: white;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Saved Drawer */
.saved-drawer {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
}

.drawer-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: var(--deep-orange);
  color: white;
  border: none;
  padding: 0.75rem 0.5rem;
  border-radius: 10px 0 0 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: -4px 0 15px rgba(232, 93, 4, 0.3);
  transition: all 0.2s ease;
}

.drawer-toggle:hover {
  padding-right: 0.75rem;
}

.drawer-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.drawer-content {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border-radius: 16px 0 0 16px;
  padding: 1.25rem;
  width: 260px;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  animation: drawerSlide 0.3s ease-out;
}

@keyframes drawerSlide {
  0% { transform: translateY(-50%) translateX(20px); opacity: 0; }
  100% { transform: translateY(-50%) translateX(0); opacity: 1; }
}

.drawer-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--deep-orange);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(255, 140, 66, 0.2);
}

.drawer-empty {
  font-size: 0.9rem;
  color: var(--rich-brown);
  opacity: 0.7;
  text-align: center;
  padding: 1rem;
}

.saved-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.saved-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  background: rgba(255, 140, 66, 0.1);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.saved-item:hover {
  background: rgba(255, 140, 66, 0.2);
}

.saved-info {
  cursor: pointer;
  flex: 1;
}

.saved-name {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--rich-brown);
}

.saved-ingredients {
  font-size: 0.85rem;
}

.saved-delete {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--berry-red);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.saved-delete:hover {
  opacity: 1;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(145deg, var(--rich-brown), #3D2914);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1000;
  box-shadow: 0 6px 20px rgba(61, 41, 20, 0.4);
}

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

/* Footer */
.app-footer {
  background: linear-gradient(145deg, var(--rich-brown), #3D2914);
  color: rgba(255, 255, 255, 0.9);
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

@media (min-width: 640px) {
  .app-footer {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link {
  color: var(--berry-pink);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s;
}

.footer-link:hover {
  color: white;
}

/* Mobile Responsiveness */
@media (max-width: 767px) {
  .app-title {
    font-size: 2.25rem;
  }
  
  .app-subtitle {
    font-size: 0.95rem;
  }
  
  .pot-container {
    transform: scale(0.9);
  }
  
  .saved-drawer {
    top: auto;
    bottom: 80px;
    transform: none;
  }
  
  .drawer-toggle {
    top: auto;
    transform: none;
  }
  
  .drawer-content {
    top: auto;
    bottom: 0;
    transform: none;
    max-height: 300px;
  }
  
  @keyframes drawerSlide {
    0% { transform: translateX(20px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
  }
}