/* ============================================================
   Cubs Play — Cub's Kitchen
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&display=swap');

:root {
  --color-dark:  #4a2c12;
  --color-card:  #ffffff;
  --color-accent:#ff7a3d;
  --color-accent2:#ffb74d;
  --color-bubble:#fff3e0;
  --font: 'Baloo 2', 'Comic Sans MS', 'Segoe UI', system-ui, sans-serif;
}

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

body {
  font-family: var(--font);
  min-height: 100vh;
  color: var(--color-dark);
  background:
    radial-gradient(circle at 18% 12%, #ffe8c7 0%, transparent 45%),
    radial-gradient(circle at 85% 8%, #ffe0d0 0%, transparent 40%),
    linear-gradient(180deg, #ffd9a8 0%, #ffb877 55%, #ff9e5e 100%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ---------------------------------------------------- Site header / footer */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; background: rgba(255,255,255,0.88);
  backdrop-filter: blur(8px); box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  position: sticky; top: 0; z-index: 50;
}
.sh-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--color-dark); font-weight: 800; font-size: 1.2rem; }
.sh-brand img { height: 38px; width: auto; }
.sh-back { text-decoration: none; color: var(--color-dark); font-weight: 700; background: #fff; padding: 8px 14px; border-radius: 999px; box-shadow: 0 3px 8px rgba(0,0,0,0.12); font-size: 0.95rem; }
.sh-back:hover { background: var(--color-accent2); }

.site-footer {
  margin-top: 30px; padding: 18px; display: flex; gap: 18px;
  align-items: center; justify-content: center; color: #6b3f1c; font-weight: 600;
  background: rgba(255,255,255,0.55);
}
.site-footer a { color: #6b3f1c; }

/* ----------------------------------------------------------- App container */
.app-container { max-width: 640px; margin: 0 auto; padding: 18px 16px 8px; }
.app-container > header { text-align: center; margin-bottom: 14px; }
.app-container > header h1 {
  font-size: clamp(1.7rem, 6vw, 2.6rem); color: #fff;
  text-shadow: 0 3px 0 #d96a2c, 0 6px 14px rgba(0,0,0,0.25); letter-spacing: 1px;
}

/* --------------------------------------------------------------- Kitchen */
.kitchen {
  background: var(--color-card); border-radius: 28px; padding: 16px 16px 20px;
  box-shadow: 0 18px 40px rgba(120, 60, 20, 0.25); border: 4px solid #fff;
}

/* Customer + order bubble */
.order-card { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.customer { position: relative; flex-shrink: 0; }
.customer-face {
  font-size: 3.2rem; display: block; line-height: 1;
  animation: customerBob 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 5px rgba(0,0,0,0.15));
}
@keyframes customerBob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-5px) rotate(2deg); } }

.order-bubble {
  position: relative; flex: 1;
  background: linear-gradient(180deg, #fff8ee 0%, #ffeede 100%);
  border: 2px solid #ffd9b3; border-radius: 16px; padding: 10px 12px;
}
.order-bubble::before {
  content: ''; position: absolute; left: -10px; top: 26px;
  border: 8px solid transparent; border-right-color: #ffd9b3;
}
.order-title { font-weight: 800; font-size: clamp(1rem, 4vw, 1.25rem); margin-bottom: 8px; }
.order-items { display: flex; flex-wrap: wrap; gap: 8px; }
.order-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: #fff; border: 2px solid #ffd9b3; border-radius: 999px;
  padding: 4px 10px 4px 8px; font-weight: 700; font-size: 0.85rem; position: relative;
  transition: all 0.2s;
}
.chip-emoji { font-size: 1.1rem; }
.chip-check { color: #43c463; font-weight: 900; opacity: 0; transform: scale(0); transition: all 0.25s; margin-left: 2px; }
.order-chip.done { background: #e7f9ee; border-color: #66e08a; }
.order-chip.done .chip-check { opacity: 1; transform: scale(1.2); }

/* --------------------------------------------------------------- Plate */
.plate-wrap { position: relative; margin-bottom: 14px; }
.plate {
  position: relative; width: 100%; height: 230px;
  display: flex; flex-direction: column-reverse; align-items: center; justify-content: flex-start;
  padding-bottom: 6px;
}
.plate.round { display: block; }

/* the counter the food sits on */
.counter-top {
  height: 16px; border-radius: 10px;
  background: linear-gradient(180deg, #d7b38c, #b98c5e);
  box-shadow: inset 0 2px 3px rgba(255,255,255,0.4), 0 4px 8px rgba(0,0,0,0.12);
}

/* generic food pieces */
.food-base, .food-layer { flex-shrink: 0; }
.food-layer { position: relative; display: flex; align-items: center; justify-content: center; }
.layer-emoji, .ing-emoji, .chip-emoji { pointer-events: none; }
.food-layer.pop, .pz-top.pop, .pz-coat.pop { animation: dropIn 0.3s cubic-bezier(.18,.89,.32,1.4); }
@keyframes dropIn { 0% { transform: translateY(-16px) scale(0.7); opacity: 0; } 100% { transform: translateY(0) scale(1); opacity: 1; } }

/* ---- Burger ---- */
.bun-bottom {
  width: 168px; height: 30px; border-radius: 6px 6px 14px 14px;
  background: linear-gradient(180deg, #f0b462, #e09a3f);
  box-shadow: inset 0 -4px 6px rgba(0,0,0,0.12);
}
.bun-top {
  width: 176px; height: 56px; border-radius: 90px 90px 16px 16px;
  background: linear-gradient(180deg, #f6c074, #e6a14a);
  position: relative; box-shadow: inset 0 4px 6px rgba(255,255,255,0.35);
  display: flex; align-items: flex-start; justify-content: center; gap: 14px; padding-top: 14px;
}
.bun-top .sesame { width: 8px; height: 12px; background: #fff4d8; border-radius: 50%; transform: rotate(-15deg); box-shadow: 0 0 0 1px rgba(0,0,0,0.05); }
.bun-top .sesame:nth-child(2) { transform: translateY(-4px) rotate(10deg); }

.food-layer.band {
  width: 156px; height: 22px; border-radius: 8px; margin-top: 2px;
  box-shadow: inset 0 -3px 4px rgba(0,0,0,0.12);
}
.food-layer.band .layer-emoji { font-size: 0.95rem; opacity: 0.9; }
.food-layer.band.ruffle { border-radius: 12px; height: 18px; clip-path: polygon(0 0,5% 70%,10% 0,15% 70%,20% 0,25% 70%,30% 0,35% 70%,40% 0,45% 70%,50% 0,55% 70%,60% 0,65% 70%,70% 0,75% 70%,80% 0,85% 70%,90% 0,95% 70%,100% 0,100% 100%,0 100%); }

/* ---- Sundae ---- */
.cup {
  width: 120px; height: 60px; border-radius: 8px 8px 40px 40px;
  background: linear-gradient(180deg, #d7ecff, #a9d4f5);
  border: 3px solid #fff; box-shadow: inset 0 4px 8px rgba(255,255,255,0.5), 0 4px 8px rgba(0,0,0,0.1);
}
.food-layer.scoop {
  width: 76px; height: 64px; border-radius: 50%; margin-bottom: -26px;
  box-shadow: inset -6px -8px 10px rgba(0,0,0,0.12), inset 6px 6px 10px rgba(255,255,255,0.5);
}
.food-layer.scoop .layer-emoji { display: none; }
.food-layer.topper {
  width: auto; height: auto; margin-bottom: -6px; font-size: 1.8rem;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
}
.food-layer.topper .layer-emoji { font-size: 1.8rem; }

/* ---- Cupcake ---- */
.wrapper {
  width: 110px; height: 60px;
  background: repeating-linear-gradient(90deg, #f7b2b2 0 10px, #ef9a9a 10px 20px);
  clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 -6px 8px rgba(0,0,0,0.12);
}
.food-layer.frosting {
  width: 130px; height: 56px; border-radius: 60px 60px 24px 24px; margin-bottom: -8px;
  box-shadow: inset 0 6px 8px rgba(255,255,255,0.4), inset 0 -6px 8px rgba(0,0,0,0.12);
}
.food-layer.frosting .layer-emoji { display: none; }

/* ---- Pizza (round) ---- */
.plate.round { height: 250px; }
.pizza-base {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 210px; height: 210px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #f3cf94 0%, #e2b06a 70%, #cf9b53 100%);
  box-shadow: 0 8px 14px rgba(0,0,0,0.15), inset 0 0 0 10px #e9bf7c;
}
.pz-coat {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 184px; height: 184px; border-radius: 50%;
}
.pz-coat.coat-sauce  { background: radial-gradient(circle, #e5563f 0%, #d2452f 100%); opacity: 0.92; }
.pz-coat.coat-cheese { background: radial-gradient(circle, #ffe07a 0%, #ffd24d 100%); opacity: 0.85; mix-blend-mode: multiply; }
.pz-top {
  position: absolute; transform: translate(-50%, -50%);
  font-size: 1.5rem; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.25));
}

/* --------------------------------------------------------------- Tray */
.tray {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.ingredient {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #fff8f0; border: 2px solid #ffd9b3; border-radius: 16px;
  padding: 8px 4px 6px; cursor: pointer; font-family: var(--font);
  box-shadow: 0 4px 0 #f0c89a; transition: transform 0.1s;
}
.ingredient:hover { transform: translateY(-2px); }
.ingredient.tapped { animation: tap 0.25s ease; }
@keyframes tap { 0% { transform: scale(1); } 40% { transform: scale(0.9); } 100% { transform: scale(1); } }
.ing-emoji { font-size: 1.8rem; }
.ing-label { font-size: 0.72rem; font-weight: 700; color: #7a4a22; }

/* --------------------------------------------------------------- Actions */
.actions { display: flex; gap: 12px; justify-content: center; }
.serve-btn {
  font-family: var(--font); font-weight: 800; font-size: 1.15rem; color: #fff;
  border: none; cursor: pointer; padding: 14px 26px; border-radius: 999px;
  background: linear-gradient(180deg, #ff9f4d, #ff7a1a);
  box-shadow: 0 6px 0 #d9620d, 0 8px 18px rgba(255,122,26,0.4); transition: transform 0.1s;
}
.serve-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 #d9620d; }
.clear-btn {
  font-family: var(--font); font-weight: 700; font-size: 1rem; color: #8a5a32;
  border: 2px solid #ffd9b3; background: #fff; cursor: pointer;
  padding: 12px 18px; border-radius: 999px; box-shadow: 0 4px 0 #f0c89a; transition: transform 0.1s;
}
.clear-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #f0c89a; }

/* ------------------------------------------------------------------- HUD */
.hud { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px auto 0; flex-wrap: wrap; }
.hud-pill {
  background: rgba(255,255,255,0.92); border-radius: 999px; padding: 8px 18px;
  font-weight: 800; color: var(--color-dark); box-shadow: 0 4px 10px rgba(0,0,0,0.12); font-size: 1.05rem;
}
#coins-pill.bump { animation: coinBump 0.5s ease; }
@keyframes coinBump { 0% { transform: scale(1); } 35% { transform: scale(1.22); background: #fff4cc; } 100% { transform: scale(1); } }
.icon-btn {
  background: rgba(255,255,255,0.92); border: none; cursor: pointer;
  width: 46px; height: 46px; border-radius: 50%; font-size: 1.4rem; box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
.icon-btn:active { transform: scale(0.92); }

/* --------------------------------------------------------- Result modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(74, 44, 18, 0.5);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; }
.result-modal {
  background: #fff; border-radius: 28px; padding: 28px 26px; text-align: center;
  max-width: 340px; width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  border: 5px solid var(--color-accent2); animation: pop 0.4s cubic-bezier(.18,.89,.32,1.28);
}
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.result-face { font-size: 4rem; display: block; line-height: 1; }
.stars { margin: 6px 0 4px; }
.rstar { font-size: 2.2rem; filter: grayscale(1) opacity(0.35); display: inline-block; }
.rstar.on { filter: none; animation: starPop 0.4s ease both; }
@keyframes starPop { 0% { transform: scale(0) rotate(-30deg); } 70% { transform: scale(1.4); } 100% { transform: scale(1); } }
.result-modal h2 { color: var(--color-accent); font-size: 1.6rem; margin: 6px 0; }
.coins-won { font-weight: 800; font-size: 1.3rem; color: #e6a000; margin-bottom: 16px; }
.next-btn { margin-top: 4px; }

/* ----------------------------------------------------------- About card */
.about-app { max-width: 640px; margin: 22px auto 0; padding: 0 16px; }
.ab-card { background: rgba(255,255,255,0.94); border-radius: 22px; padding: 22px 24px; box-shadow: 0 10px 26px rgba(120,60,20,0.18); }
.ab-card h2 { color: var(--color-dark); margin-bottom: 10px; }
.ab-card p { color: #5a3a1c; line-height: 1.55; margin-bottom: 10px; font-weight: 500; }

@media (max-width: 420px) {
  .ing-emoji { font-size: 1.5rem; }
  .customer-face { font-size: 2.6rem; }
}
