:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #2e171c;
  background: #faf5f6;
  --accent: #83223c;
  --muted: #70525a;
}
* { box-sizing: border-box; }
body { margin: 0; }
.frame { width: min(1200px, calc(100% - 80px)); margin-inline: auto; }
.layout {
  display: grid;
  grid-template-columns: minmax(290px, .77fr) minmax(0, 1fr);
  grid-template-areas: "intro wheel" "controls wheel";
  column-gap: clamp(36px, 6.5vw, 104px);
  align-content: center;
  min-height: 100svh;
  padding-block: clamp(22px, 5vh, 64px);
}
.intro { grid-area: intro; align-self: end; }
h1 {
  font-family: Georgia, serif;
  font-size: clamp(3.5rem, 7.1vw, 7rem);
  line-height: .91;
  letter-spacing: -.068em;
  font-weight: 700;
  margin: 0;
}
.intro p {
  max-width: 26rem;
  font-size: 1.125rem;
  line-height: 1.5;
  margin: 24px 0 0;
  color: var(--muted);
}
.controls { grid-area: controls; align-self: start; padding-top: 25px; }
button {
  display: block;
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 6px;
  padding: 14px 20px;
  background: var(--accent);
  color: #fff9f7;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .16s ease, transform .16s ease;
}
button:hover:not([aria-disabled="true"]) { background: #691830; }
button:active:not([aria-disabled="true"]) { transform: scale(.985); }
button[aria-disabled="true"] { cursor: progress; background: #70525a; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.receipt-feed {
  --receipt-width: min(calc(100% - 20px), 410px);
  position: relative;
  padding-bottom: 7px;
  /* Hide the paper above the printer slot while leaving room for its shadow. */
  clip-path: inset(0 -12px -12px);
}
.receipt-feed::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  left: 50%;
  width: var(--receipt-width);
  height: 3px;
  transform: translateX(-50%);
  background: #4e1a28;
  border-radius: 0 0 2px 2px;
}
.result {
  --receipt-paper: #fffdf6;
  position: relative;
  width: var(--receipt-width);
  margin: 0 auto;
  padding: 16px clamp(14px, 3vw, 24px) 14px;
  background: var(--receipt-paper);
  filter: drop-shadow(0 2px 3px #48142724); /* taste-skill-ignore: paper shadow */
  font-family: ui-monospace, Menlo, Consolas, monospace; /* taste-skill-ignore: receipt typography */
  transform: translateY(calc(-100% - 14px));
}
.result.is-printed {
  transform: translateY(0);
  animation: print-receipt 680ms cubic-bezier(.23, 1, .32, 1) both;
}
@keyframes print-receipt {
  from { transform: translateY(calc(-100% - 14px)); }
  32%, 41% { transform: translateY(-58%); }
  69%, 77% { transform: translateY(-20%); }
  to { transform: translateY(0); }
}
.result::after {
  content: "";
  position: absolute;
  top: 100%;
  inset-inline: 0;
  height: 7px;
  background: var(--receipt-paper);
  mask: radial-gradient(circle at 50% 100%, transparent 4px, #000 4.5px) center bottom / 12px 100% repeat-x; /* taste-skill-ignore: perforated paper edge */
}
.result h2 {
  margin: 0;
  padding-bottom: 11px;
  border-bottom: 1px dashed #b79e9c;
  font-size: 1.125rem;
  text-align: center;
}
.result dl { margin: 0; }
.result dl div {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 14px;
  padding-block: 7px;
}
.result dl div:first-child { padding-top: 12px; }
.result dl div:last-child { padding-bottom: 4px; }
dt { color: var(--muted); font-size: .875rem; }
dd { margin: 0; font-size: .9375rem; font-weight: 650; line-height: 1.35; text-align: right; overflow-wrap: anywhere; }
dd.empty { color: var(--muted); font-weight: 400; }
.source-status { color: var(--muted); font-size: .875rem; margin: 16px 0 0; min-height: 1.3em; }
.source-status:empty { display: none; }
.wheel-stage {
  --wheel-top: 27px;
  position: relative;
  grid-area: wheel;
  align-self: center;
  justify-self: center;
  width: min(100%, 600px, calc(100svh - 110px));
  padding-top: var(--wheel-top);
}
.winning-illustration {
  position: absolute;
  top: calc(50% + var(--wheel-top) / 2);
  left: 50%;
  aspect-ratio: 1;
  background-repeat: no-repeat;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 7px 5px #39181e42); /* taste-skill-ignore: floating food illustration */
}
.winning-dish {
  z-index: 3;
  width: 53%;
  background-image: url("assets/dishes.png");
  background-size: 500% 400%;
  transform: translate(-50%, -50%) scale(.58);
  transition: transform 220ms cubic-bezier(.4, 0, 1, 1) 100ms, opacity 180ms ease 100ms;
}
.wheel-stage.is-revealed .winning-dish {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  transition: transform 340ms cubic-bezier(.23, 1, .32, 1), opacity 220ms ease;
}
.winning-extra {
  z-index: 2;
  width: 31%;
  background-image: url("assets/accompaniments.png");
  background-size: 400% 400%;
  transform: translate(-50%, -50%) scale(.48);
  transition: transform 250ms cubic-bezier(.4, 0, 1, 1), opacity 170ms ease;
}
.winning-side { --spread: -150%; }
.winning-salad { --spread: 50%; }
.wheel-stage.is-revealed .winning-extra.has-icon {
  transform: translate(var(--spread), -34%) scale(1);
  opacity: 1;
  transition: transform 340ms cubic-bezier(.23, 1, .32, 1) 80ms, opacity 220ms ease 80ms;
}
.wheel-stage.is-dimmed .wheel-frame { opacity: .27; }
/* The shading belongs to the physical wheel and its hardware. */
.wheel-frame {
  --wheel-inset: clamp(8px, 1.23vw, 16px);
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #542431;
  background: linear-gradient(151deg, #995260 0%, #632837 34%, #431a27 72%, #2e111a 100%); /* taste-skill-ignore */
  border: 1px solid #562636;
  box-shadow: inset 0 3px 2px #eeabb380, inset 0 -4px 3px #2a0f1a9c, /* taste-skill-ignore */
    0 4px 0 #351721, 0 11px 20px #48142729, 0 24px 44px #48142720;
  transition: opacity 180ms ease;
}
.wheel-frame::after {
  content: "";
  position: absolute;
  inset: 1.2%;
  border: 1px solid #e9b8998a;
  border-radius: 50%;
  pointer-events: none;
}
.wheel-rotor {
  /* Clip the bounds of the rotating canvas without clipping the pointer. */
  position: absolute;
  inset: var(--wheel-inset);
  overflow: hidden;
  border-radius: 50%;
}
#wheel {
  display: block;
  width: 100%;
  height: auto;
  transform: rotate(0rad);
}
.wheel-hub {
  position: absolute;
  width: 15%;
  aspect-ratio: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border: 1px solid #674134;
  background: linear-gradient(145deg, #fff1cd, #d7a879 42%, #f5dbad 62%, #85513b); /* taste-skill-ignore */
  border-radius: 50%;
  box-shadow: 0 3px 9px #2e10198c, inset 0 1px 1px #fff7e5, inset 0 -2px 3px #51302480; /* taste-skill-ignore */
}
.wheel-hub::before {
  content: "";
  width: 76%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 39% 28%, #a65064, #76223b 62%, #481624); /* taste-skill-ignore */
  border: 1px solid #674134;
  box-shadow: inset 0 1px 2px #ffe1d28a; /* taste-skill-ignore */
}
.wheel-hub::after {
  content: "";
  position: absolute;
  width: 44%;
  aspect-ratio: 1;
  border: 1px solid #f3ce9ea8;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px #601e34, inset 0 0 0 5px #f3ce9e7a; /* taste-skill-ignore */
}
.pointer-mount {
  position: absolute;
  z-index: 1;
  top: -4.75%;
  left: 50%;
  width: clamp(24px, 6.3%, 39px);
  height: 12%;
  transform: translateX(-50%);
  filter: drop-shadow(0 3px 2px #35162270); /* taste-skill-ignore */
}
.pointer-mount::after {
  content: "";
  position: absolute;
  top: 19%;
  left: 50%;
  width: 24%;
  aspect-ratio: 1;
  border: 1px solid #70412a;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(140deg, #fff4d8, #ba8558); /* taste-skill-ignore */
}
.pointer {
  display: block;
  height: 100%;
  transform-origin: 50% 19%;
  background: linear-gradient(105deg, #ad7250 0%, #fce2ae 36%, #e0ab75 65%, #a35e3e 100%); /* taste-skill-ignore */
  clip-path: polygon(26% 0, 74% 0, 96% 10%, 98% 23%, 89% 35%, 54% 100%, 46% 100%, 11% 35%, 2% 23%, 4% 10%);
}
@media (max-width: 750px) {
  .frame { width: calc(100% - 36px); }
  .layout {
    max-width: 430px;
    min-height: auto;
    grid-template-columns: 1fr;
    grid-template-areas: "intro" "wheel" "controls";
    padding-block: clamp(12px, 2.6svh, 24px) 12px;
  }
  h1 { font-size: clamp(2.15rem, 9.7vw, 3.5rem); letter-spacing: -.06em; text-align: center; }
  h1 br { display: none; }
  .intro p { display: none; }
  .wheel-stage {
    --wheel-top: 17px;
    width: min(100%, clamp(148px, calc(100svh - 322px), 430px));
    margin-top: 9px;
  }
  .controls { padding-top: 14px; }
  button { min-height: 48px; padding-block: 10px; }
  .result { padding-block: 12px 9px; }
  .result h2 { padding-bottom: 7px; font-size: 1rem; }
  .result dl div { gap: 8px; padding-block: 5px; }
  .result dl div:first-child { padding-top: 8px; }
  .result dl div:last-child { padding-bottom: 3px; }
  .source-status { margin-top: 8px; }
}
@media (max-width: 360px) {
  .wheel-stage { width: min(100%, clamp(148px, calc(100svh - 342px), 430px)); }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
  .result.is-printed { animation: none; }
  .wheel-frame, .winning-illustration, .wheel-stage.is-revealed .winning-illustration { transition: none; }
  .wheel-stage.is-revealed .winning-extra.has-icon { transition: none; }
}
