/* ===== CSS VARIABLES ===== */
:root {
  --c-orange: #ff9800;
  --c-orange-dark: #f57c00;
  --c-green: #66bb6a;
  --c-green-dark: #43a047;
  --c-red: #ef5350;
  --c-brown: #5d4037;
  --c-gray: #78909c;
  --c-gray-dark: #546e7a;
  --c-bg-inactive: #e8e8e8;
  --c-text-muted: #999;
  --radius-pill: 50px;
  --radius-card: 16px;
  --radius-round: 50%;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 3px 8px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.3);
  --touch-min: 44px; /* minimum touch target */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-overshoot: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Reset and base font inherited from shared/variables.css */

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

/* ===== PHASE BAR ===== */
.phase-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.phase-dot {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  min-height: var(--touch-min);
  background: var(--c-bg-inactive);
  color: var(--c-text-muted);
  transition: all 0.4s;
}
.phase-dot.active {
  background: var(--c-orange);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.4);
}
.phase-dot.done {
  background: var(--c-green);
  color: #fff;
}
.phase-connector {
  width: 20px;
  height: 2px;
  background: #ddd;
  border-radius: 1px;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  min-height: var(--touch-min);
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    filter 0.15s;
  box-shadow: var(--shadow-md);
}
.btn:active {
  transform: scale(0.95) !important;
  filter: brightness(1.1);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  filter: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--c-orange), var(--c-orange-dark));
  color: #fff;
}
.btn-secondary {
  background: linear-gradient(135deg, var(--c-gray), var(--c-gray-dark));
  color: #fff;
}
.btn-go-home {
  background: linear-gradient(135deg, var(--c-green), var(--c-green-dark));
  color: #fff;
}
.btn-cook {
  background: linear-gradient(135deg, #ff5722, #e64a19);
  color: #fff;
}

/* ===== PAGE CONTAINER ===== */
.page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  animation: page-enter 0.4s ease-out;
}
@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== SHARED PROGRESS DOTS (phase & cooking steps) ===== */
.progress-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 6px 16px;
}
.progress-dot {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: var(--c-bg-inactive);
  transition: all 0.4s;
  flex-shrink: 0;
}
.progress-dot.active {
  background: var(--c-orange);
  box-shadow: 0 2px 10px rgba(255, 152, 0, 0.5);
  transform: scale(1.1);
}
.progress-dot.done {
  background: var(--c-green);
}
.progress-dot.just-done {
  animation: dot-pop 0.5s var(--ease-bounce);
}
@keyframes dot-pop {
  0% {
    transform: scale(1.1);
  }
  50% {
    transform: scale(1.4);
  }
  100% {
    transform: scale(1);
  }
}
.progress-line {
  width: 24px;
  height: 3px;
  background: #e0e0e0;
  border-radius: 2px;
  flex-shrink: 0;
  transition: background 0.4s;
}
.progress-line.done {
  background: var(--c-green);
}

/* ===== SHARED ANIMATIONS ===== */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-in {
  animation: fade-in 0.4s ease-out;
}

@keyframes bounce-in {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}
@keyframes add-pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes flame-dance {
  0% {
    transform: translateY(0) scaleY(1);
  }
  100% {
    transform: translateY(-4px) scaleY(1.15);
  }
}
@keyframes steam-rise {
  0% {
    transform: translateY(0) scale(0.8);
    opacity: 0;
  }
  30% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(-30px) scale(1.5);
    opacity: 0;
  }
}

/* Step slide-in */
.step-inner {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: step-slide-in 0.4s ease-out;
}
@keyframes step-slide-in {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== CELEBRATION OVERLAY ===== */
.celebration-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 200;
}
.celebration-overlay.active {
  display: flex;
}

.celeb-card {
  background: linear-gradient(135deg, #fff9c4, #fff176);
  border-radius: 24px;
  padding: 24px 32px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: bounce-in 0.5s var(--ease-overshoot);
  max-width: 360px;
  width: 90%;
}
.celeb-card .dish-result {
  font-size: 4rem;
  margin-bottom: 8px;
}
.celeb-card h2 {
  font-size: 1.4rem;
  color: #e65100;
  margin-bottom: 4px;
}
.celeb-card p {
  font-size: 0.95rem;
  color: #795548;
  margin-bottom: 10px;
}
.celeb-card .stars {
  font-size: 2rem;
  margin-bottom: 12px;
  animation: star-dance 1s ease-in-out infinite alternate;
}
@keyframes star-dance {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.1);
  }
}
.celeb-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Confetti */
.confetti {
  position: fixed;
  z-index: 250;
  pointer-events: none;
}
@keyframes confetti-fall {
  from {
    transform: translateY(-10vh) rotate(0deg);
    opacity: 1;
  }
  to {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

/* ===== OVERLAY BACKDROP ===== */
.overlay-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 300;
}
.overlay-backdrop.active {
  display: flex;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 360px) {
  .phase-dot {
    font-size: 0.7rem;
    padding: 5px 10px;
    gap: 2px;
  }
  .phase-connector {
    width: 12px;
  }
  .btn {
    padding: 8px 18px;
    font-size: 0.9rem;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .page {
    animation: none;
  }
}
