:root {
  font-family: system-ui, -apple-system, 'Hiragino Kaku Gothic ProN', sans-serif;
  color: #2a2328;
  background: #fff;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; -webkit-tap-highlight-color: transparent; }
button {
  font: inherit;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: #f3f4f6;
  color: #2a2328;
  padding: 8px 12px;
  touch-action: manipulation;
}
button:disabled { opacity: .5; }
button:focus-visible, a:focus-visible { outline: 3px solid #876950; outline-offset: 2px; }
[hidden] { display: none !important; }
main { max-width: 450px; margin: auto; padding: 2px 8px max(8px, env(safe-area-inset-bottom)); }
.companion { display: flex; align-items: center; gap: 8px; min-height: 60px; }
.companion > img { width: 52px; height: 52px; object-fit: contain; }
.companion > div { flex: 1; min-width: 0; }
.companion span { font-size: 11px; color: #6e626a; }
.companion p { font-size: 13px; line-height: 1.5; margin: 2px 0; }
.companion button { flex: none; width: 44px; padding: 0; }
#stage {
  position: relative;
  height: clamp(320px, calc(100svh - 180px), 690px);
  overflow: hidden;
  border-radius: 8px;
  background: #fcfaf5;
}
canvas { display: block; width: 100%; height: calc(100% - 88px); }
.hud { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; justify-content: space-between; font-size: 13px; }
.hud strong { font-variant-numeric: tabular-nums; }
.recipe { position: absolute; left: 12px; top: 42px; right: 12px; display: flex; align-items: center; gap: 8px; font-size: 11px; }
.recipe > span { flex: none; padding-right: 3px; }
.recipe > div { display: flex; gap: 3px; }
.recipe i { width: 16px; height: 20px; border-radius: 4px; border: 1px solid #bea68d; display: block; }
.recipe i.current { outline: 2px solid #775843; outline-offset: 1px; }
.recipe strong { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; }
#aim { position: absolute; top: 24%; height: 46%; width: 2px; border-left: 2px dashed #a58c6e70; pointer-events: none; }
#drag {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  height: 76px;
  touch-action: none;
  background: #f0eee9;
  border-radius: 8px;
  overflow: hidden;
  user-select: none;
}
#hint { position: absolute; top: 9px; left: 6px; right: 6px; text-align: center; font-size: 12px; color: #655647; margin: 0; pointer-events: none; }
#thumb { position: absolute; top: 37px; width: 44px; height: 27px; background: #9d8062; border: 3px solid #fff; border-radius: 14px; transform: translateX(-50%); pointer-events: none; }
#drag.active { background: #e7e0d6; }
#overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #fff; padding: 16px; }
.panel { width: 100%; max-width: 320px; max-height: 100%; overflow: auto; padding: 8px; text-align: center; }
.panel h1 { font-size: 18px; line-height: 1.5; margin: 8px 0; }
.panel img { display: block; width: 64px; height: 64px; margin: 0 auto; object-fit: contain; }
.panel p { font-size: 13px; line-height: 1.65; margin: 8px 0; }
.panel #summary { font-size: 12px; color: #6e626a; }
.panel button { width: 100%; min-height: 48px; font-weight: 700; margin-top: 8px; }
#best { font-size: 12px; color: #6e626a; }
#save-note { color: #a13549; }
.controls { display: flex; gap: 6px; padding-top: 8px; }
.controls button { flex: 1; min-width: 0; font-size: 13px; padding: 8px 4px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.controls:has(#serve:disabled) { visibility: hidden; }
.controls i { width: 14px; height: 14px; border: 1px solid #bea68d; border-radius: 50%; }
.vanilla { background: #fff0cf; }
.berry { background: #ee9da9; }
.controls [aria-pressed=true] { background: #e7e9ed; font-weight: 700; }
.controls #serve { font-weight: 700; }
.help { font-size: 12px; line-height: 1.7; color: #6e626a; margin: 4px 2px; }
.help summary { padding: 12px 0; min-height: 44px; }
.help p { margin: 6px 0; }
.game-nav-header .game-sound-toggle { width: 44px; height: 44px; min-width: 44px; }
@media (max-width: 350px) {
  .recipe { gap: 4px; }
  .recipe i { width: 13px; }
  .recipe > div { gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
