:root {
  --yolk: #ffc533;
  --yolk-deep: #f7a40c;
  --crust: #3b1a0c;
  --crust-soft: #6b4636;
  --flour: #fff8e6;
  --plate: #ffffff;
  --tomato: #dd3a1c;
  --herb: #1f7a4d;
  --line: #ead9b4;
  --display: "Fredoka", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--flour);
  color: var(--crust);
  font: 400 1rem/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--crust); outline-offset: 3px; }
.small { font-size: 0.9rem; color: var(--crust-soft); margin: 0; }

/* Title */
.title {
  min-height: 100dvh;
  background: linear-gradient(160deg, var(--yolk) 0%, var(--yolk-deep) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.25rem; padding: 2rem 1.25rem; text-align: center;
}
.title .logo { width: min(64vw, 17rem); filter: drop-shadow(0 10px 0 rgba(59, 26, 12, 0.14)); }
.title .chefrow { max-width: 26rem; text-align: left; }
.title .small { max-width: 24rem; color: var(--crust); }

/* Chef */
.chefrow { display: flex; align-items: center; gap: 0.9rem; }
.chef {
  flex: none; width: 4.75rem; height: 4.75rem; border-radius: 50%; overflow: hidden;
  border: 4px solid var(--yolk); background: #fff;
  transition: border-color 0.12s, transform 0.08s;
}
.title .chef { border-color: var(--crust); }
.chef img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chef.hit { border-color: var(--tomato); }
[data-heat="1"] #chef { border-color: var(--yolk-deep); }
[data-heat="2"] #chef { border-color: var(--tomato); box-shadow: 0 0 0 4px var(--yolk); }
.line {
  margin: 0; font: 600 1.05rem/1.35 var(--display);
  background: var(--plate); border: 3px solid var(--crust); border-radius: 18px; padding: 0.6rem 0.9rem;
}

/* Buttons */
.yes {
  font: 700 1.1rem var(--display); color: var(--flour); background: var(--tomato);
  border: 3px solid var(--crust); border-radius: 999px; padding: 0.65rem 1.5rem;
  box-shadow: 0 4px 0 var(--crust);
}
.yes:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--crust); }
.yes:disabled { opacity: 0.6; }
.quiet {
  font: 600 0.98rem var(--display); background: none; border: 0; padding: 0.6rem 0.5rem;
  text-decoration: underline; text-decoration-color: var(--yolk-deep); text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }

/* Kitchen */
.kitchen { max-width: 44rem; margin: 0 auto; padding: 0 1rem calc(2.5rem + env(safe-area-inset-bottom)); }
.bar { display: flex; align-items: center; gap: 0.9rem; padding: 0.9rem 0; }
.bar img { border-radius: 10px; border: 2px solid var(--crust); }
.tabs { display: flex; background: var(--plate); border: 3px solid var(--crust); border-radius: 999px; padding: 3px; }
.tabs button {
  font: 600 1rem var(--display); border: 0; background: none; border-radius: 999px; padding: 0.4rem 1.3rem;
}
.tabs button[aria-selected="true"] { background: var(--yolk); }

section[role="tabpanel"] { display: grid; gap: 1.1rem; }

.scope { width: 100%; height: 3.5rem; border-radius: 14px; background: var(--crust); display: block; }

.pads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; }
.pad {
  position: relative; text-align: left; min-height: 5.6rem; padding: 0.7rem 0.8rem;
  background: var(--plate); border: 3px solid var(--crust); border-radius: 20px;
  box-shadow: 0 5px 0 var(--crust);
  display: flex; flex-direction: column; justify-content: space-between; gap: 0.3rem;
  transition: background-color 0.18s;
}
.pad:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--crust); }
.pad strong { font: 600 1.1rem/1.15 var(--display); }
.pad span { font-size: 0.86rem; color: var(--crust-soft); line-height: 1.25; }
.pad.taught span { color: var(--herb); font-weight: 600; }
.pad.hit { background: var(--yolk); transition: none; }
.pad.teaching { background: #ffe9a8; outline: 3px dashed var(--tomato); outline-offset: 3px; }

.teach {
  background: var(--plate); border: 3px solid var(--crust); border-radius: 22px; padding: 1rem 1.1rem;
  display: grid; gap: 0.6rem;
}
.teach .step { margin: 0; font-size: 0.9rem; font-weight: 600; color: var(--crust-soft); }
.object { font: 600 1.1rem var(--display); display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.object input {
  font: 600 1.1rem var(--display); width: 9.5rem; padding: 0.3rem 0.6rem;
  border: 3px solid var(--crust); border-radius: 12px; background: var(--flour);
}
.tally { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.count span { display: inline-block; }
.pips { display: flex; gap: 0.45rem; }
.pips i { width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 3px solid var(--crust); background: var(--flour); }
.pips i.on { background: var(--tomato); }
.count { margin: 0; font: 700 1.9rem/1.1 var(--display); font-variant-numeric: tabular-nums; }

.settings { display: grid; gap: 1rem; padding-top: 1.1rem; border-top: 2px solid var(--line); }
.field { display: grid; gap: 0.4rem; font-weight: 600; border: 0; padding: 0; margin: 0; min-width: 0; }
.field legend { padding: 0; margin-bottom: 0.4rem; }
.field .small { font-weight: 400; }
select {
  font: 600 1rem var(--display); padding: 0.5rem 0.7rem; border: 3px solid var(--crust); border-radius: 12px;
  background: var(--plate); max-width: 16rem;
}
input[type="range"] { width: 100%; max-width: 22rem; accent-color: var(--tomato); }
.segments { display: inline-flex; border: 3px solid var(--crust); border-radius: 999px; padding: 3px; background: var(--plate); width: fit-content; }
.segments label { position: relative; }
.segments input { position: absolute; opacity: 0; inset: 0; }
.segments span { display: block; font: 600 0.98rem var(--display); padding: 0.35rem 1rem; border-radius: 999px; cursor: pointer; }
.segments input:checked + span { background: var(--yolk); }
.segments input:focus-visible + span { outline: 3px solid var(--crust); outline-offset: 2px; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 600; }
.check input { width: 1.25rem; height: 1.25rem; margin-top: 0.1rem; accent-color: var(--tomato); flex: none; }

/* Hand */
.stage {
  position: relative; width: 100%; aspect-ratio: 4 / 3; max-height: 62dvh; margin: 0 auto;
  background: var(--crust); border: 3px solid var(--crust); border-radius: 22px; overflow: hidden;
  display: grid; place-items: center;
}
.stage video, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage video { object-fit: fill; transform: scaleX(-1); }
.stage .yes { position: relative; z-index: 1; margin: 1rem; }
.readout { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.readout div { background: var(--plate); border: 3px solid var(--crust); border-radius: 16px; padding: 0.5rem 0.9rem; }
.readout .label { display: block; font-size: 0.85rem; color: var(--crust-soft); font-weight: 600; }
.readout strong { font: 700 1.5rem/1.2 var(--display); }

/* Hit marks and praise (feel.js). Hard shapes with a dark edge, so they show on the pale page. */
.fx { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 10; }
.fx i { position: absolute; display: block; }
.star {
  background: var(--crust);
  clip-path: polygon(50% 0, 59.2% 27.8%, 85.4% 14.6%, 72.2% 40.8%, 100% 50%, 72.2% 59.2%, 85.4% 85.4%, 59.2% 72.2%,
    50% 100%, 40.8% 72.2%, 14.6% 85.4%, 27.8% 59.2%, 0 50%, 27.8% 40.8%, 14.6% 14.6%, 40.8% 27.8%);
}
.star::after { content: ""; position: absolute; inset: 13%; background: #fff3c4; clip-path: inherit; }
.spark { width: 18px; height: 7px; border-radius: 4px; background: var(--tomato); border: 2px solid var(--crust); }
.spark.pale { background: var(--yolk); }
.bit { width: 11px; height: 15px; border-radius: 3px; border: 2px solid var(--crust); }
.bit.tomato { background: var(--tomato); } .bit.yolk { background: var(--yolk); }
.bit.herb { background: var(--herb); } .bit.plate { background: var(--plate); }

@media (max-width: 420px) {
  .pads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chef { width: 4rem; height: 4rem; }
  .line { font-size: 0.98rem; }
}
@media (prefers-reduced-motion: reduce) {
  .chef, .pad { transition: none; }
}
