body:has(.dough-game) { margin: 0; background: #fcf8f1; }
.dough-game {
  --ink: #493549;
  --plum: #674879;
  --mint: #d8ebe3;
  --cream: #fff9ee;
  max-width: 1050px;
  margin: auto;
  padding: 16px 24px 48px;
  color: var(--ink);
  font-family: var(--ui2-font-family);
}
.dough-game * { box-sizing: border-box; }
.dough-game [hidden] { display: none !important; }
.db-skip { position: fixed; top: -100px; left: 12px; z-index: 10000; background: white; padding: 12px; }
.db-skip:focus { top: 12px; }
.db-back { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-size: 14px; }
.db-intro {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 30px;
  padding: 18px;
  background: #fff8ef;
  border: 1px solid #eadbcc;
  border-radius: 27px;
}
.db-intro img { width: 100%; height: auto; display: block; border-radius: 18px; }
.db-intro-copy { padding: 10px 12px 10px 0; }
.db-intro h1 { font-size: clamp(29px, 4vw, 46px); letter-spacing: -.04em; line-height: 1.14; margin: 0 0 12px; }
.db-intro p { margin: 0 0 15px; line-height: 1.55; }
.db-rules { display: grid; gap: 9px; padding: 0; list-style: none; margin: 18px 0; font-size: 14px; }
.db-rules li { display: flex; align-items: center; gap: 9px; }
.db-dot, .db-bar { display: inline-block; flex: 0 0 18px; height: 14px; border-radius: 10px; background: #cbb3e1; border: 1px solid #9172a5; }
.db-dot { flex-basis: 14px; margin: 0 2px; }
.db-bar { background: #edbbc7; border-color: #ad748a; }
.dough-game button {
  min-height: 46px;
  padding: 10px 18px;
  color: var(--ink);
  background: #fffaf7;
  border: 1px solid #c9b4c8;
  border-radius: 13px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.dough-game button:focus-visible, .db-back:focus-visible { outline: 3px solid #79568e; outline-offset: 3px; }
.dough-game .db-primary { width: 100%; background: #efccd7; box-shadow: 0 3px 0 #caa8bd; }
.dough-game .db-primary:hover { background: #eac0ce; }
.db-intro .db-small { font-size: 12px; margin: 13px 0 0; color: #6e566b; }
.db-game { width: min(100%, 640px); margin: 0 auto; scroll-margin-top: 94px; }
.db-round { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.db-round p { margin: 0 0 4px; color: var(--plum); font-size: 12px; font-weight: 750; }
.db-round h2 { font-size: clamp(20px, 4vw, 28px); line-height: 1.15; margin: 0; }
.db-stage { background: var(--mint); border: 1px solid #afccbf; border-radius: 24px; padding: 12px; box-shadow: 0 5px 0 #bfd9ca; }
.db-dough {
  width: 124px;
  height: 84px;
  margin: 0 auto 10px;
  border-radius: 46% 46% 42% 42%;
  overflow: hidden;
  background: #f8dfae;
  transform-origin: bottom center;
  transition: transform 150ms ease, filter 150ms ease;
}
.db-dough img { display: block; width: 200%; height: auto; transform: translate(-25%, -34%); }
.db-dough[data-feedback="hit"] { transform: scale(1.06,.95); filter: saturate(1.24); }
.db-dough[data-feedback="hold"] { transform: scale(1.11,.89); }
.db-score { display: flex; justify-content: space-between; gap: 5px; font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; padding: 4px 2px 8px; }
.db-track { height: 78px; background: var(--cream); border: 1px solid #c5b1c8; border-radius: 13px; overflow: hidden; position: relative; }
.db-timing, .db-line { position: absolute; top: 8px; bottom: 8px; left: 18%; }
.db-timing { width: calc(var(--window, 24px) * 2); transform: translateX(-50%); border-radius: 8px; background: #e8dcef; }
.db-line { width: 2px; background: #674879; z-index: 1; }
.db-line::before, .db-line::after { position: absolute; content: ""; left: -3px; width: 8px; height: 4px; border-radius: 3px; background: #674879; }
.db-line::after { bottom: 0; }
.db-cue { position: absolute; left: calc(18% - 9px); top: 29px; height: 18px; border-radius: 12px; border: 1px solid #79568e; background: #ba9cd4; box-shadow: inset 0 2px 0 #ffffff90; }
.db-cue.db-hold { background: #e9a9bd; border-color: #a96885; }
.db-hold::before, .db-hold::after { content: ""; position: absolute; top: 3px; bottom: 3px; width: 2px; border-radius: 2px; background: #854b68; }
.db-hold::before { left: 8px; }
.db-hold::after { right: 8px; }
.db-cue.is-held { background: #ffdba6; }
.db-feedback { min-height: 20px; text-align: center; color: var(--plum); font-weight: 750; margin: 8px 0; font-size: 13px; line-height: 20px; }
.dough-game .db-pad { width: 100%; min-height: 72px; background: #f3c7d4; border: 1px solid #b58a9e; box-shadow: 0 4px 0 #bb8fa4; border-radius: 19px; font-size: 20px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.dough-game .db-pad.is-down { background: #e8b2c5; transform: translateY(3px); box-shadow: 0 1px 0 #bb8fa4; }
.db-help { text-align: center; margin: 15px 0 0; color: #66536a; font-size: 12px; }
.db-panel { width: min(100%, 590px); margin: 14px auto; padding: 26px; background: #f4eaf4; border: 1px solid #dcc9df; border-radius: 22px; }
.db-bread { position: relative; width: 126px; height: 99px; overflow: hidden; border-radius: 36px; margin: 0 0 14px; }
.db-bread img { position: absolute; width: 512px; max-width: none; height: auto; top: -168px; left: -383px; }
.db-panel h2 { margin: 0; font-size: 25px; }
.db-panel p { margin: 11px 0 19px; }
.db-actions { display: flex; gap: 10px; }
.db-actions button { flex: 1; }
@media (max-width: 680px) {
  .dough-game { padding: 10px 14px 32px; }
  .db-intro { grid-template-columns: 1fr; gap: 12px; padding: 12px; }
  .db-intro-copy { padding: 2px 4px 4px; }
  .db-intro p { font-size: 14px; }
  .db-intro .db-small { font-size: 12px; }
  .db-rules { margin: 12px 0 15px; font-size: 13px; }
  .db-game { scroll-margin-top: 72px; }
}
@media (max-height: 600px) {
  .db-dough { width: 88px; height: 61px; }
  .db-round { margin-bottom: 7px; }
  .db-track { height: 64px; }
  .db-cue { top: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .db-dough { transition: none; scale: 1 !important; transform: none !important; }
}
