
:root{font-family:'Hiragino Maru Gothic ProN','Yu Gothic','Malgun Gothic',system-ui,sans-serif;color:#684b3f;background:#f5ead5;font-synthesis:none;font-weight:700}*{box-sizing:border-box}body{margin:0;background:repeating-linear-gradient(90deg,#fff7e51a 0 36px,#e7d6ba33 36px 38px)}button,select,a{ -webkit-tap-highlight-color:transparent}button,select{font:inherit;color:inherit;cursor:pointer}button{touch-action:manipulation}button:focus-visible,a:focus-visible,select:focus-visible{outline:3px solid #348c89;outline-offset:4px}button:disabled{cursor:default}button:hover:not(:disabled){filter:brightness(1.035)}button:active:not(:disabled){transform:translateY(3px)}[hidden]{display:none!important}header{max-width:1240px;margin:auto;display:flex;align-items:center;justify-content:space-between;padding:20px 28px;gap:12px}.brand{color:#805448;font-size:20px;letter-spacing:.04em;text-decoration:none}.settings{display:flex;gap:8px}.settings button,.settings select{background:#fff8eb;border:1px solid #d9c7ac;border-radius:20px;padding:8px 12px;font-size:12px}.game{max-width:1180px;margin:0 auto 30px;display:grid;grid-template-columns:minmax(0,1.7fr) minmax(270px,1fr);gap:30px;padding:8px 20px}.kitchen{position:relative;min-width:0}.status{display:flex;justify-content:space-between;font-size:13px;letter-spacing:.12em;padding:0 18px 10px}.scene-wrap{position:relative;border-radius:46% 46% 22px 22px;overflow:hidden;background:#dde5cf;border:5px solid #fff8e7;box-shadow:0 8px 0 #d9c6aa77}#scene{width:100%;display:block}.score-tag{position:absolute;right:20px;top:36px;background:#fff4cd;border:2px dashed #d6af66;border-radius:50%;width:100px;height:100px;display:flex;justify-content:center;align-items:center;flex-wrap:wrap;align-content:center;transform:rotate(9deg);box-shadow:0 3px 0 #ae906a30}.score-tag span:first-child{width:100%;text-align:center;font-size:10px}.score-tag strong{font-size:38px;line-height:1.1}.score-tag span:last-child{font-size:12px}.clue{text-align:center;padding:20px 12px 5px}h1{font-size:22px;line-height:1.5;margin:7px 0}.advance{display:block;margin:15px auto;background:#77a9a0;color:white;border:0;border-bottom:5px solid #54877f;border-radius:22px;padding:13px 26px;min-width:220px;min-height:52px;box-shadow:0 4px 0 #dac6a4}.advance small{display:block;font-size:11px;opacity:.9;margin-top:2px}.order{align-self:center;background:#fffaf0;border-radius:14px 14px 30px 30px;padding:24px 25px 20px;box-shadow:0 7px 0 #d8c4a5;position:relative;border-top:9px solid #cf7b65}.order:before{content:'';position:absolute;inset:8px 10px auto;border-top:2px dotted #dfccb6}.order-title{text-align:center;margin-bottom:20px}.eyebrow{font-size:10px;letter-spacing:.25em;color:#ae8a70}h2{font-size:23px;margin:7px 0}.dots{color:#c88f65;font-size:13px}#feedback{text-align:center;min-height:25px;margin-top:18px;font-size:15px;color:#b76e51}.primary{background:#cd7961;color:#fffaf0;border:0;border-bottom:4px solid #a45c49;border-radius:17px;min-height:50px;padding:12px 24px;font-size:16px}#next{width:100%;margin-top:8px}.steam{animation:steam 2.5s infinite ease-in-out;transform-origin:center}.food-bounce{animation:pop .45s ease-out}.tool{animation:chop 1.4s infinite ease-in-out;transform-origin:420px 320px}@keyframes steam{0%,100%{opacity:.15;transform:translateY(8px)}50%{opacity:.7;transform:translateY(-10px)}}@keyframes pop{0%{transform:translateY(-15px);opacity:.3}100%{transform:translateY(0);opacity:1}}@keyframes chop{0%,100%{transform:rotate(-4deg)}40%{transform:rotate(3deg)}}#results{max-width:760px;margin:25px auto;text-align:center;background:#fff8e9;padding:35px 25px;border-radius:35px;border:3px solid #dfcaa8}#results h1{font-size:30px}.result-score{font-size:70px;color:#c9775d;line-height:1.3}.result-score small{font-size:20px}.result-list{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;margin:20px 0}.result-dish{width:125px;font-size:12px}.result-dish svg{width:100%;height:100px}.result-dish strong{display:block;font-size:22px;margin:7px}.result-actions{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;margin-top:24px}.secondary{background:#fff9ed;border:2px solid #d9c4a5;border-radius:17px;padding:12px 20px;min-height:48px}#results a{color:#728d79;display:inline-block;margin-top:25px}#results p{font-size:12px}.close{float:right;border:0;border-radius:50%;font-size:25px;background:#eee1c9;width:40px;height:40px}dialog{max-width:600px;width:94%;border:0;border-radius:20px;padding:20px;color:#684b3f;background:#fff8e9}dialog::backdrop{background:#493a3188}#share-image{width:100%;display:block}#download{display:inline-block;margin:15px;color:#7a8870}#save-note{font-size:13px}@media(min-width:1100px){.game{gap:50px}.scene-wrap{margin-top:5px}}@media(max-width:700px){header{padding:12px 15px}.brand{font-size:14px}.settings{gap:4px}.settings button,.settings select{font-size:10px;padding:7px}.game{display:flex;flex-direction:column;gap:12px;padding:0 12px;margin-bottom:20px}.status{font-size:10px;padding:4px 8px 7px}.scene-wrap{border-width:3px;border-radius:42% 42% 20px 20px}#scene{max-height:285px}.score-tag{width:75px;height:75px;right:14px;top:20px}.score-tag strong{font-size:29px}.score-tag span:first-child{font-size:8px}.clue{padding:12px 5px 0}h1{font-size:17px;margin:5px 0}.advance{margin:10px auto 0;padding:9px 18px;min-height:47px;font-size:13px;min-width:205px}.advance small{font-size:9px}.order{width:100%;padding:14px 12px 12px;border-top-width:5px;box-shadow:0 4px 0 #d8c4a5}.order-title{margin:0 0 10px}.order-title .eyebrow,.dots{display:none}h2{font-size:16px;margin:0}#feedback{margin-top:10px;min-height:18px;font-size:13px}#next{margin-top:6px;min-height:44px;padding:8px}#results{margin:10px 12px;padding:24px 14px}.result-dish{width:90px}.result-score{font-size:56px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}

/* Keep the score seal outside the arched window instead of clipping it. */
.scene-wrap{overflow:visible}#scene{border-radius:inherit}.secondary:disabled{opacity:.45}
/* Animate the cooking action briefly; do not repaint an idle quiz forever. */
.steam,.tool{animation-iteration-count:2}
/* Automatic cooking close-up: the kitchen owns the screen. */
header{max-width:1400px;padding:12px 24px}.game{display:block;max-width:1250px;padding:0 18px;margin-bottom:10px;position:relative}.kitchen{width:100%}.scene-wrap{border-radius:30px;max-height:none;margin:0}.scene-wrap #scene{height:min(66vh,650px);width:100%;border-radius:25px;background:#e6c89f}.status{padding:4px 12px 9px}.score-tag{top:18px;right:24px;width:100px;height:100px}.clue{position:absolute;left:12%;right:12%;bottom:128px;padding:5px 10px;border-radius:15px;background:#fff7e9e8;pointer-events:none}.clue h1{font-size:19px;margin:2px}.advance{background:#d27a5f;border-bottom-color:#a85945;border-radius:28px;width:330px;min-height:66px;margin:12px auto 0;font-size:24px;box-shadow:0 5px 0 #d5bea0}.order{position:absolute;right:30px;top:90px;width:370px;z-index:5;box-shadow:0 10px 40px #6b4c3d40}.order .close{float:none;display:block;width:auto;height:auto;min-height:38px;font-size:12px;background:#eee4d1;border-radius:12px;padding:8px;margin:0 0 15px auto}.order:before{pointer-events:none}.order-title{margin-bottom:13px}.brand{pointer-events:none}.steam,.tool,.food-bounce{animation:none!important}
@media(max-width:700px){header{padding:10px 12px}.game{padding:0 8px}.scene-wrap #scene{height:61vh;min-height:360px;max-height:600px;object-fit:cover}.score-tag{width:72px;height:72px;right:9px;top:12px}.scene-wrap{border-radius:22px;overflow:hidden}#scene{border-radius:18px!important}.clue{left:4%;right:4%;bottom:116px;padding:6px}.clue h1{font-size:15px;line-height:1.35}.advance{font-size:23px;min-height:62px;width:85%;margin:10px auto}.order{position:fixed;top:auto;right:8px;left:8px;bottom:12px;width:auto;padding:15px 13px;max-height:50vh;overflow:auto}.order .close{margin-bottom:8px}.order-title{margin-bottom:8px}#feedback{margin-top:8px}#next{min-height:48px}}
@media(max-width:700px){.scene-wrap #scene{height:56vh;min-height:340px;max-height:510px}}
#cooking-canvas{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;border-radius:inherit}.score-tag{z-index:2}
#cooking-canvas{transform:translateZ(0);will-change:transform}
/* Cream-soda kitchen: tactile controls and continuous visual response. */
#cooking-3d{position:absolute;inset:0;width:100%;height:100%;border-radius:inherit;touch-action:manipulation}.scene-wrap{border:6px solid #fff7e6;border-radius:32px;box-shadow:0 8px 0 #d7b68d,0 18px 45px #ab805b20;overflow:hidden}.scene-wrap #scene{height:66vh;min-height:420px;max-height:680px}.clue{background:#fff9eae8;box-shadow:0 4px 14px #8a5d3d13;bottom:133px}.clue h1{font-size:17px}.score-tag{background:#fff0b4;border:3px solid #e6bd6f;box-shadow:0 5px 0 #c5995740;animation:seal-bob 3s ease-in-out infinite}.advance{position:relative;box-shadow:0 7px 0 #a95d46,0 12px 20px #ad7b5130;border-bottom:0;background:linear-gradient(#f2a080,#df8062);text-shadow:0 2px 0 #ba6b51;font-size:25px;letter-spacing:.04em;animation:buzzer-breathe 2.4s ease-in-out infinite;transition:transform .12s,filter .12s}.advance:active:not(:disabled){transform:translateY(6px) scale(.96);box-shadow:0 2px 0 #a95d46}.advance:disabled{animation:none;opacity:.65}.order:not([hidden]){animation:panel-pop .4s cubic-bezier(.2,1.5,.4,1) both}.order{border-top-color:#7fae9b;background:#fffaf0ee;backdrop-filter:blur(8px);box-shadow:0 14px 50px #6f48374a}.score-fly{position:absolute;left:48%;top:50%;font-size:46px;font-weight:900;color:#ed946a;text-shadow:0 3px #fff4cf;pointer-events:none;z-index:10;animation:score-flight .9s ease-in forwards}.primary{transition:transform .15s}.model-error .scene-wrap:after{content:'☁';position:absolute;inset:35%;font-size:80px;color:#fff9e5}.status{color:#8d6753}
@keyframes seal-bob{50%{transform:translateY(-5px) rotate(5deg)}}@keyframes buzzer-breathe{50%{filter:brightness(1.06)}}@keyframes panel-pop{from{opacity:0;transform:translateY(30px) scale(.93)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes score-flight{0%{opacity:0;transform:translate(0,20px) scale(.7)}20%{opacity:1;transform:translate(0,-20px) scale(1.2)}100%{opacity:0;transform:translate(240px,-330px) scale(.4)}}
@media(max-width:700px){.scene-wrap #scene{height:59vh;min-height:390px;max-height:600px}.scene-wrap{border-width:4px;border-radius:26px}.clue{bottom:125px;left:4%;right:4%;padding:7px 10px}.clue h1{font-size:13px}.score-tag{width:68px;height:68px;top:13px;right:12px}.score-tag strong{font-size:28px}.advance{min-height:67px;width:84%;margin-top:13px}.order{bottom:16px;max-height:49vh}.order-title h2{font-size:17px}.score-fly{font-size:34px}}
@media(prefers-reduced-motion:reduce){.advance,.score-tag,.order,.score-fly{animation:none!important}}
.result-dish img{width:100%;height:100px;object-fit:cover;border-radius:18px;box-shadow:0 3px 0 #d6b995}
/* Pulse an overlay instead of filtering the entire moving button. */
.advance{animation:none;filter:none}.advance:before{content:'';position:absolute;inset:-6px;border:2px solid #f2b18f;border-radius:inherit;pointer-events:none;animation:buzzer-halo 2.2s ease-in-out infinite}@keyframes buzzer-halo{0%,100%{opacity:.1;transform:scale(.99)}50%{opacity:.65;transform:scale(1.025)}}
.lightweight-3d .scene-wrap,.lightweight-3d #cooking-3d{border-radius:0;box-shadow:none}.lightweight-3d .scene-wrap{overflow:visible}.lightweight-3d .order{backdrop-filter:none}.lightweight-3d .score-tag{animation:light-bob 3s ease-in-out infinite;box-shadow:none}.lightweight-3d .advance{box-shadow:0 6px 0 #a95d46}.lightweight-3d .clue{box-shadow:none}@keyframes light-bob{50%{transform:rotate(5deg)}}
#cooking-motion{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;object-fit:fill}

@media(prefers-reduced-motion:reduce){.advance:before{animation:none!important}}

/* Mobile: preserve the pastel kitchen without continuously compositing the UI. */
body.mobile-kitchen *,
body.mobile-kitchen *::before,
body.mobile-kitchen *::after {
  animation: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.mobile-kitchen .scene-wrap {
  background: #f1ddbc;
  isolation: isolate;
  overflow: visible;
}
body.mobile-kitchen #scene {
  visibility: hidden;
}
body.mobile-kitchen #cooking-background,
body.mobile-kitchen #cooking-motion {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: fill;
  pointer-events: none;
}
body.mobile-kitchen #cooking-background { z-index: 0; }
body.mobile-kitchen #cooking-motion { z-index: 1; }
body.mobile-kitchen .score-tag {
  transform: rotate(5deg);
  z-index: 2;
}
body.mobile-kitchen .advance::before { display: none; }
body.mobile-kitchen .advance,
body.mobile-kitchen .primary {
  transition: transform .1s ease, opacity .12s ease;
}

body.mobile-kitchen button:active:not(:disabled) {
  transform: translateY(2px) scale(.98);
}
body.mobile-kitchen .order:not([hidden]) {
  animation: mobile-answer-reveal .16s ease-out both !important;
}
body.mobile-kitchen .score-fly {
  animation: mobile-score-reveal .65s ease-out both !important;
}

body.mobile-kitchen .kitchen-loading::after {
  content: '• • •';
  position: absolute;
  left: 50%;
  bottom: 8px;
  z-index: 2;
  color: #fff8e5;
  background: #805c4640;
  border-radius: 20px;
  padding: 0 9px 3px;
  font-size: 19px;
  line-height: 1;
  transform: translateX(-50%);
  pointer-events: none;
}
@keyframes mobile-answer-reveal {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes mobile-score-reveal {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-18px); }
}
@media (prefers-reduced-motion: reduce) {
  body.mobile-kitchen .order:not([hidden]),
  body.mobile-kitchen .score-fly { animation: none !important; }
  body.mobile-kitchen button { transition: none; }
}

/* Clues sit inside the cooking view; the buzzer follows it directly. */
.clue { bottom: 14px; z-index: 2; }
@media (max-width: 700px) { .clue { bottom: 12px; } }

/* Scene captions appear briefly without showing progress counters. */
.clue h1 { overflow-wrap: anywhere; }
.result-time { display: block; font-size: 11px; line-height: 1.5; }
#dish-spelling, .result-spelling { display: block; font-size: 11px; line-height: 1.5; color: #8e6f58; }

/* Build a word on the kitchen ticket, without revealing empty character slots. */
.order {
  width: min(560px, calc(100% - 40px));
  top: auto;
  bottom: 100px;
  right: 30px;
  padding: 16px 18px 18px;
}
.order-title { text-align: left; margin: 0 0 8px; padding-right: 100px; }
.order-title h2 { font-size: 17px; }
.order .close {
  position: absolute;
  top: 10px;
  right: 12px;
  min-height: 28px;
  padding: 4px 8px;
  margin: 0;
  font-size: 10px;
}
#answer-word {
  min-height: 44px;
  margin: 7px 0 12px;
  border-bottom: 2px solid #dfcbb0;
  font-size: 30px;
  line-height: 1.35;
  letter-spacing: .04em;
}
#typed-word { white-space: pre-wrap; overflow-wrap: anywhere; }
.word-caret {
  display: inline-block;
  width: 3px;
  height: .9em;
  margin-left: 5px;
  border-radius: 2px;
  background: #bd775e;
  vertical-align: -.05em;
}
.advance.answer-hidden { visibility: hidden; pointer-events: none; }
.sr-only.input-error-notice {
  position: absolute;
  left: 50%;
  bottom: 100px;
  width: max-content;
  max-width: calc(100% - 32px);
  height: auto;
  margin: 0;
  padding: 7px 14px;
  clip-path: none;
  white-space: normal;
  transform: translateX(-50%);
  border-radius: 14px;
  background: #f7e1d6;
  color: #9c5947;
  font-size: 14px;
  z-index: 6;
  pointer-events: none;
}
#kana-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kana-key {
  min-width: 0;
  min-height: 64px;
  border: 2px solid #ddc5a6;
  border-bottom: 4px solid #c5a482;
  border-radius: 16px;
  background: #fff8e9;
  font-size: 32px;
  line-height: 1;
  padding: 10px;
}
.kana-key.rejected { background: #e8e1d6; color: #a99d8b; border-color: #d4cabc; text-decoration: line-through; }
#feedback:empty { display: none; }
.result-dish img, .result-dish svg { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 700px) {
  .order { left: 8px; right: 8px; bottom: 12px; width: auto; padding: 13px 14px 14px; max-height: 38vh; }
  .order-title h2 { font-size: 14px; }
  #answer-word { min-height: 35px; margin: 4px 0 8px; font-size: 26px; }
  #kana-keys { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .kana-key { min-height: 46px; font-size: 27px; padding: 7px; }
}
