.bakery-switch {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin: 0 0 1rem;
}
.bakery-switch button, .bakery-button, .bakery-recipe-tile, button.bakery-treat {
  min-height: 48px;
  border: 2px solid #b7a0d4;
  border-radius: .95rem;
  background: #fff;
  color: #34264f;
  font-weight: 800;
  padding: .55rem .8rem;
  box-shadow: 0 3px 0 #e2d1ef;
}
.bakery-switch button[aria-pressed="true"], .bakery-palette button[aria-pressed="true"] {
  background: #d4f6ed;
  border-color: #258479;
  box-shadow: 0 3px 0 #82c9b8;
}
.bakery {
  --bakery-ink: #392854;
  color: var(--bakery-ink);
  background: #fffdf7;
  border: 2px solid #e8cfaa;
  border-radius: 1.5rem;
  padding: clamp(.75rem, 3vw, 1.35rem);
  text-align: center;
}
.bakery-card {
  border-radius: 1.1rem;
  background: linear-gradient(110deg, #fff4c4, #e1f7ed);
  padding: .85rem;
  margin-bottom: 1rem;
}
.bakery-card h2 { margin: .12rem 0 .4rem; }
.bakery-card h2:focus { outline: none; }
.bakery-recipe { margin: 0; color: #704173; font-weight: 800; }
.bakery-directions { margin: .4rem auto .8rem; font-weight: 700; }
.bakery-stage {
  position: relative;
  isolation: isolate;
  min-height: clamp(12rem, 42vw, 19rem);
  border: 3px solid #71bba6;
  border-radius: 1.2rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  padding: 1rem .5rem;
  background: #f8d197 url('/game-art/happy-kitchen-scene.webp') center 62% / cover no-repeat;
}
.bakery-stage-portion, .bakery-stage-decorate, .bakery-stage-done {
  padding-inline: .2rem;
}
.bakery-stage-choose {
  display: block;
  min-height: 0;
  padding: 0;
  background: #d5f5e9;
}
.bakery-kitchen-picture {
  display: block;
  width: 100%;
  height: auto;
  max-height: 27rem;
  object-fit: contain;
}
.bakery-menu {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.4rem), 1fr));
  gap: .65rem;
}
.bakery-recipe-tile {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: .45rem;
  padding-inline: .4rem;
  background: #fff8e9;
}
.bakery-recipe-tile:nth-child(3n + 2) { background: #f9eaff; }
.bakery-recipe-tile:nth-child(3n) { background: #e4f8f3; }
.bakery-recipe-tile span { font-size: clamp(2.6rem, 9vw, 4rem); }
.bakery-art { font-size: clamp(3rem, 13vw, 6rem); line-height: 1.05; }
.bakery-bowl { position: relative; }
.bakery-bowl[data-filling="true"]::after {
  content: '';
  position: absolute;
  background: #ffe2ac;
  border-radius: 50%;
  left: 15%;
  top: 21%;
  width: 64%;
  height: 18%;
  transform: rotate(-9deg);
}
/* Keep the touch gesture inside the bowl so the rest of the kitchen still scrolls. */
.bakery-stir-bowl {
  position: relative;
  width: min(76%, 13rem);
  aspect-ratio: 1;
  margin: .2rem auto;
  border: .55rem solid #fef2d8;
  border-radius: 50%;
  background: repeating-radial-gradient(ellipse at 48% 52%, #e8a662 2%, #ffda95 13%, #efb372 20%);
  box-shadow: 0 5px 0 #8c573f, inset 0 1px 12px #9d623c;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.bakery-stir-bowl.stirring { cursor: grabbing; }
.bakery-stir-bowl:focus-visible { outline: 3px solid #5d2880; outline-offset: 4px; }
.bakery-stir-spoon {
  position: absolute;
  display: grid;
  place-items: center;
  width: 100%;
  height: 50%;
  top: 0;
  pointer-events: none;
  font-size: clamp(2.2rem, 10vw, 3.85rem);
  transform-origin: 50% 100%;
  transform: rotate(var(--spoon-angle, 0rad));
}
.bakery-counter, .bakery-stars {
  margin: 0;
  padding: .3rem .75rem;
  border-radius: 1rem;
  background: #fffcf3;
  font-weight: 800;
}
.bakery-tray {
  display: grid;
  width: 100%;
  gap: clamp(.35rem, 2vw, .85rem);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: .55rem;
  border: clamp(4px, 1vw, 8px) solid #83bfc2;
  border-radius: clamp(1rem, 5vw, 2.25rem);
  background: #fffdfa;
  box-shadow: 0 5px 0 #568b8a, inset 0 0 0 2px #cce7e0;
}
.bakery-treat {
  position: relative;
  display: grid;
  place-items: center;
  padding: .25rem;
  min-height: clamp(6.3rem, 25vw, 11rem);
  border-radius: .75rem;
  background: #fefaff;
  font-size: clamp(2.65rem, 12vw, 6.5rem);
  line-height: 1;
}
.bakery-tray-whole { grid-template-columns: minmax(0, 1fr); }
.bakery-tray-whole .bakery-treat { min-height: clamp(7rem, 31vw, 14rem); }
.bakery-chocolate { filter: sepia(.65) saturate(1.15) brightness(.74); }
.bakery-tray-count { font-size: 1rem; }
.bakery-toppings {
  position: absolute;
  display: grid;
  grid-template-columns: repeat(3, max-content);
  justify-content: center;
  align-content: center;
  inset: 18% 0 8%;
  gap: .1em;
  font-size: clamp(.9rem, 4.5vw, 1.7rem);
  pointer-events: none;
  filter: drop-shadow(0 1px 1px #40221f70);
}
.bakery-tray-whole .bakery-toppings { font-size: clamp(1.2rem, 6vw, 2rem); }
.bakery-pot {
  position: relative;
  width: min(68%, 15rem);
  text-align: center;
  font-size: clamp(5rem, 22vw, 9rem);
  border-bottom: .7rem solid #384051;
  border-radius: 0 0 2rem 2rem;
  background: radial-gradient(ellipse at 50% 100%, #ffd26e 6%, #ee815a 32%, transparent 62%);
}
.bakery-steam {
  position: absolute;
  top: -.2em;
  right: .05em;
  font-size: .42em;
  animation: bakery-steam .8s ease-in-out infinite alternate;
}
@keyframes bakery-steam { to { transform: translateY(-.45em) rotate(12deg); } }
.bakery-oven {
  width: min(100%, 40rem);
  height: min(92%, 13rem);
  position: absolute;
  bottom: .55rem;
  border: .55rem solid #43536a;
  border-top-width: 2rem;
  border-radius: 1rem;
  background: #293445;
}
.bakery-oven::before {
  content: '●  ●  ●';
  color: #ffe4aa;
  position: absolute;
  top: -1.6rem;
  right: .6rem;
  font: 1rem sans-serif;
}
.bakery-stage-oven .bakery-tray, .bakery-stage-baking .bakery-tray { width: min(92%, 46rem); z-index: 1; }
.bakery-stage-oven .bakery-treat, .bakery-stage-baking .bakery-treat { min-height: clamp(4.5rem, 18vw, 7rem); }
.bakery-stage-baking .bakery-oven { animation: bakery-heat 2.6s ease-out both; }
.bakery-stage-baking .bakery-treat { animation: bakery-toast 2.6s ease-out both; }
.bakery-stars { font-size: 1.35rem; order: -1; }
.bakery-pop { animation: bakery-pop .24s ease-out; }
.bakery-controls, .bakery-palette { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; }
.bakery-controls:not(:empty) { margin-top: .85rem; }
.bakery-palette { flex-basis: 100%; margin-bottom: .35rem; }
.bakery-main { background: #ffc85a; border-color: #bb7824; box-shadow: 0 3px 0 #e8a344; }
.bakery-feedback { margin: .7rem 0 0; font-weight: 700; }
.bakery-feedback:empty { margin: 0; }
@keyframes bakery-heat { to { background: #9b4d25; box-shadow: inset 0 0 2rem #ffc052; } }
@keyframes bakery-toast { to { background: #f8c379; } }
@keyframes bakery-pop { 50% { transform: rotate(-8deg) scale(1.07); } }
@media (prefers-reduced-motion: reduce) {
  .bakery-pop, .bakery-steam, .bakery-stage-baking .bakery-oven, .bakery-stage-baking .bakery-treat { animation: none; }
}
