/* ==========================================================================
   PHASE 3 — The Hearth Kitchen
   ========================================================================== */
.kitchen-window.ceremony-window { max-width: 760px; padding: 22px 20px; }
@media (max-width: 767px) {
  .modal-backdrop:has(> .kitchen-window) { padding: 0; }
  .kitchen-window.ceremony-window { max-width: none; width: 100%; min-height: 100%; max-height: none; border-radius: 0; border: none; padding: 16px 14px 28px 14px; }
}

.k-steps {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  list-style: none;
  margin: 0 0 12px 0;
  padding: 0;
  counter-reset: kstep;
}
.k-steps li {
  flex: 1 1 0;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  color: #A08A76;
  padding-top: 6px;
  border-top: 4px solid #E2D3BF;
  border-radius: 2px;
}
.k-steps li.done { color: #244A3D; border-top-color: #4F8A6E; }
.k-steps li.on { color: #8F2432; border-top-color: #E89B48; }
@media (max-width: 420px) { .k-steps li { font-size: 0; } .k-steps li.on { font-size: 13px; } }

.k-head h3 { font-family: var(--font-display); font-size: 27px; color: #2B1E17; margin: 0 0 4px 0; line-height: 1.15; }
.k-head p { font-family: var(--font-prose); font-size: 16px; color: #4F382E; margin: 0 0 12px 0; line-height: 1.5; }
.k-notes { background: #FFF7E8; border: 1px dashed #C48A3A; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }
.k-notes p { font-family: var(--font-prose); font-size: 15px; color: #4F382E; margin: 3px 0; }

.k-tag {
  display: inline-block;
  margin: 3px 4px 0 0;
  padding: 1px 8px;
  border-radius: 9999px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
}
.k-tag-comfort { background: #F6DCC4; color: #7A3F18; }
.k-tag-clarity { background: #D5E8EE; color: #23505E; }
.k-tag-courage { background: #F3CACF; color: #7A1A27; }
.k-tag-wonder { background: #E3D6F0; color: #4E2D78; }

/* Recipe book */
.k-book { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.k-recipe {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  background: #FAF6EE;
  border: 1.5px solid #D6C2AC;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.k-recipe:hover, .k-recipe:focus-visible { border-color: #8F2432; box-shadow: 0 4px 14px rgba(143, 36, 50, 0.18); outline: none; }
.k-recipe-dish { font-size: 30px; line-height: 1; }
.k-recipe strong { font-family: var(--font-ui); font-size: 16px; color: #2B1E17; }
.k-recipe-blurb { font-family: var(--font-prose); font-size: 14px; line-height: 1.4; color: #6E5446; }
.k-cooked { font-family: var(--font-ui); font-size: 13px; color: #244A3D; margin-top: 2px; }
.k-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: #E89B48;
  color: #1F1612;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
}
.k-badge-fav { top: auto; bottom: 8px; background: #8F2432; color: #FFF; }

/* Workbench */
.k-workbench { display: grid; grid-template-columns: 1fr 1.3fr; gap: 14px; align-items: center; }
@media (max-width: 600px) { .k-workbench { grid-template-columns: 1fr; } }
.k-vessel { position: relative; width: 100%; max-width: 260px; margin: 0 auto; transition: transform 0.2s ease; }
.k-vessel-svg { display: block; width: 100%; height: auto; }
.k-vessel.is-target { transform: scale(1.06); filter: drop-shadow(0 0 14px rgba(232, 155, 72, 0.8)); }
.k-vessel.is-splash { animation: kSplash 0.4s ease; }
.k-in { position: absolute; left: 0; right: 0; top: 4%; display: flex; justify-content: center; gap: 4px; pointer-events: none; }
.k-floating { font-size: 26px; animation: kBob 2.2s ease-in-out infinite; }
.k-shelf-label { display: block; font-family: var(--font-ui); font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #7A5B4C; margin: 6px 0 6px 0; }
.k-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.k-ing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1.5px solid #C4AC94;
  background: #F4ECE1;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: #2B1E17;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.k-ing .k-ing-icon { font-size: 26px; line-height: 1.1; }
.k-ing.is-core { border-style: dashed; }
.k-ing.is-added { background: #E6F1EA; border: 2px solid #244A3D; opacity: 0.85; }
.k-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  font-size: 38px;
  transform: translate(-50%, -50%) scale(1.1);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
}

.k-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.k-go {
  margin-left: auto;
  border: none;
  border-radius: 9999px;
  padding: 13px 24px;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
  color: #1F1612;
  background: linear-gradient(135deg, #E89B48 0%, #D27623 100%);
  cursor: pointer;
}
.k-go[disabled] { opacity: 0.5; cursor: not-allowed; }
.k-back, .k-ghost-btn {
  border: 1px solid #7A5B4C;
  background: transparent;
  border-radius: 9999px;
  padding: 10px 16px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  color: #2B1E17;
  cursor: pointer;
}
.k-turns { font-family: var(--font-ui); font-size: 15px; font-weight: 700; color: #7A5B4C; }

/* Stir */
.k-stir-zone {
  position: relative;
  width: min(300px, 80vw);
  aspect-ratio: 1 / 1;
  margin: 6px auto 0 auto;
  touch-action: none;
  cursor: grab;
  border-radius: 50%;
  background: radial-gradient(circle, #F4E7D4 0%, #EADBC4 70%, rgba(234, 219, 196, 0) 71%);
}
.k-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.k-ring-bg { fill: none; stroke: #E2D3BF; stroke-width: 6; }
.k-ring-fg { fill: none; stroke: #E89B48; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 0.1s linear; }
.k-stir-zone.is-done .k-ring-fg { stroke: #4F8A6E; }
.k-vessel-lg { position: absolute; left: 14%; right: 14%; top: 26%; max-width: none; pointer-events: none; }
.k-stir-zone.is-stirring .k-fill { animation: kSwirl 0.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.k-spoon { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; font-size: 34px; transform-origin: 50% 50%; transform: translateY(-42%); pointer-events: none; }

/* Heat */
.k-heat { margin: 4px 0 0 0; }
.k-heat-track {
  position: relative;
  height: 26px;
  border-radius: 9999px;
  background: linear-gradient(90deg, #6E8FA3 0%, #E9C46A 50%, #E07A2E 75%, #5A1E10 100%);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
}
.k-heat-zone {
  position: absolute;
  top: -5px;
  bottom: -5px;
  border-radius: 8px;
  border: 3px solid #FFF3C4;
  box-shadow: 0 0 14px rgba(255, 230, 150, 0.9);
  background: rgba(255, 240, 180, 0.35);
}
.k-heat-needle {
  position: absolute;
  top: -10px;
  bottom: -10px;
  width: 6px;
  margin-left: -3px;
  border-radius: 3px;
  background: #2B1E17;
  box-shadow: 0 0 0 2px #FFF;
}
.k-heat-labels { display: flex; justify-content: space-between; font-family: var(--font-ui); font-size: 13px; color: #7A5B4C; margin-top: 6px; }
.k-oven {
  position: relative;
  width: 180px;
  height: 120px;
  margin: 16px auto 0 auto;
  border-radius: 80px 80px 10px 10px;
  background: #3A2A22;
  border: 6px solid #6B5A50;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.k-oven-glow { position: absolute; inset: 0; background: radial-gradient(circle at 50% 80%, #FFB347 0%, #E0601C 50%, rgba(0, 0, 0, 0) 80%); opacity: 0.2; }
.k-oven-dish { position: relative; font-size: 44px; }
.k-heat-result { font-family: var(--font-prose); font-size: 17px; min-height: 26px; text-align: center; margin: 12px 0 0 0; }
.k-heat-result.is-perfect { color: #244A3D; font-weight: 600; }
.k-heat-result.is-good { color: #6E4933; }
.k-heat-result.is-early, .k-heat-result.is-late { color: #8F2432; }
.k-stop { margin: 0 auto; font-size: 18px; padding: 15px 34px; }

/* Plate / garnish */
.k-plate-wrap { display: flex; justify-content: center; cursor: pointer; outline: none; }
.k-plate {
  position: relative;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFFFFF 0%, #F3EBDD 55%, #D9C4A4 56%, #EFE4D2 70%, #C9B08E 100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}
.k-plate.has-art { background: none; box-shadow: none; overflow: hidden; border-radius: 18px; width: min(320px, 80vw); height: auto; }
.k-plate.has-art img { width: 100%; display: block; border-radius: 18px; }
.k-plate-dish { font-size: 96px; line-height: 1; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.2)); }
.k-sprinkles i { position: absolute; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #FFF6DA; box-shadow: 0 0 6px rgba(255, 220, 140, 0.9); animation: kSprinkle 0.5s ease; }
.k-steam { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; }
.k-steam b { display: block; width: 8px; height: 30px; border-radius: 8px; background: rgba(255, 255, 255, 0.8); filter: blur(3px); animation: kSteam 2.4s ease-in-out infinite; }
.k-steam b:nth-child(2) { animation-delay: 0.6s; }
.k-steam b:nth-child(3) { animation-delay: 1.2s; }

/* Serve */
.k-serve { text-align: center; padding: 6px 0; }
.k-serve-portrait { position: relative; width: 168px; height: 168px; margin: 0 auto 12px auto; }
.k-serve-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; border-radius: 50%; border: 4px solid #D49B35; box-shadow: 0 0 24px rgba(232, 155, 72, 0.5); }
.k-serve.is-radiant .k-serve-portrait img { box-shadow: 0 0 40px rgba(255, 210, 120, 0.95); }
.k-serve.is-huddled .k-serve-portrait img { filter: saturate(0.75); border-color: #8FA6B5; }
.k-serve-dish { position: absolute; right: -10px; bottom: -6px; font-size: 48px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3)); animation: kServe 0.6s ease; }
.k-serve-line { font-family: var(--font-handwritten); font-size: 27px; line-height: 1.3; color: #2B1E17; max-width: 520px; margin: 0 auto 10px auto; }
.k-hearts { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.k-hearts-pop { font-family: var(--font-ui); font-size: 22px; font-weight: 800; color: #B52F42; animation: kHeart 0.9s ease; }
.k-hearts-total { font-family: var(--font-ui); font-size: 15px; font-weight: 600; color: #6E4933; }
.k-fav-note { font-family: var(--font-prose); font-size: 16px; font-weight: 600; color: #8F2432; margin: 8px 0 0 0; }

@keyframes kSplash { 0% { transform: scale(1); } 40% { transform: scale(1.06) rotate(-1.5deg); } 100% { transform: scale(1); } }
@keyframes kBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes kSwirl { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(0.9); } }
@keyframes kSprinkle { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes kSteam { 0% { opacity: 0; transform: translateY(10px) scaleY(0.6); } 40% { opacity: 0.9; } 100% { opacity: 0; transform: translateY(-26px) scaleY(1.2); } }
@keyframes kServe { from { opacity: 0; transform: translate(30px, 20px) scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes kHeart { 0% { opacity: 0; transform: scale(0.4); } 50% { opacity: 1; transform: scale(1.3); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .k-floating, .k-steam b, .k-stir-zone.is-stirring .k-fill, .k-hearts-pop, .k-serve-dish { animation: none; }
}

/* Bonus rituals after cooking */
.extra-ritual-note { font-family: var(--font-prose); font-size: 16px; color: #244A3D; background: #E6F1EA; border-radius: 10px; padding: 10px 14px; margin: 10px 0; text-align: center; }
.ceremony-window.is-extra-ritual .need-tags,
.ceremony-window:has(.extra-ritual-note) .need-tags { display: none !important; }

/* Tall dialogs: centre when they fit, start at the top when they do not (flex centring used to push the top off-screen, unreachable) */
.modal-backdrop { align-items: flex-start; }
.modal-backdrop > * { margin-top: auto; margin-bottom: auto; flex-shrink: 0; }

/* Painted dishes */
.k-recipe-img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 9px; margin-bottom: 4px; }
.k-book { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.k-plate.has-art { position: relative; }
.k-plate.has-art .k-sprinkles i { z-index: 2; }
.k-plate.has-art .k-steam { top: 6%; z-index: 2; }
.k-plate-done { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 4px 12px; border-radius: 9999px; background: rgba(31, 22, 18, 0.8); color: #FFE7BF; font-family: var(--font-ui); font-size: 14px; font-weight: 700; white-space: nowrap; }
.k-serve-dish-img { width: 74px; height: 74px; border-radius: 50%; object-fit: cover; border: 3px solid #FFF4DE; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35); }
.k-oven-img { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 18px rgba(255, 170, 70, 0.6); }
