@import url("effects.css");

:root {
  color-scheme: light;
  --ink:#283e33; --deep:#19463b; --green:#275e4d; --muted:#5c6656;
  --paper:#fff9e9; --ground:#f1ead6; --line:#d3c6a6; --cream:#f8eed5;
  --accent:#a74937; --accent-hover:#8a392b; --gold:#f2c879;
  --shadow:0 12px 30px #46372a13;
  font-family: system-ui, "Microsoft JhengHei", "PingFang HK", "Noto Sans CJK TC", sans-serif;
  color:var(--ink); background:var(--ground); font-size:16px;
}
* {box-sizing:border-box}
body {margin:0; min-width:300px; background:radial-gradient(ellipse at top,#f7f0de 0,transparent 65%),var(--ground)}
button,select,input {font:inherit}
button,select {cursor:pointer}
button:focus-visible,select:focus-visible,input:focus-visible,summary:focus-visible {outline:3px solid #a34a36; outline-offset:3px}
button:disabled {cursor:default; opacity:.46}
img {max-width:100%}
h1,h2,h3,p {margin:0}
h1,h2,strong {font-weight:800}
p {line-height:1.6}
.topbar {background:var(--deep); border-bottom:4px solid #d6a45e;color:var(--paper)}
.top-inner {max-width:1240px;min-height:75px;margin:auto;padding:0 25px;display:flex;justify-content:space-between;align-items:center;gap:18px}
.brand {display:flex;align-items:center;gap:9px;background:none;border:0;color:#fff3d3;text-align:left;padding:5px 0; font-size:1.22rem;font-weight:850;line-height:1.17;white-space:nowrap}
.brand img {width:42px;height:39px;transform:rotate(-13deg)}
.brand small {display:block;font-size:.56rem;letter-spacing:.2em;color:#e6bc80;margin-top:5px}
.topbar nav,.actions {display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.topbar nav button {color:#f8efdb;background:none;border:1px solid transparent;border-radius:7px;font-weight:700;padding:8px 12px;white-space:nowrap}
.topbar nav button:hover,.topbar nav button[aria-current] {background:#396454;border-color:#668374}
#nav-total {display:inline-grid;place-items:center;background:#eac786;color:#304c3f;font-size:.74rem;padding:1px 5px;border-radius:4px;margin-left:2px;min-width:18px}
main {max-width:1240px;margin:auto;padding:26px 25px 48px}
main:focus {outline:none}
.btn,.choice {display:inline-flex;justify-content:center;align-items:center;gap:6px;min-height:42px;border:1px solid #adba9e;border-radius:7px;padding:9px 15px;color:var(--deep);background:#f9f2de;font-weight:750;line-height:1.2;text-align:center}
.btn:hover:not(:disabled),.choice:hover:not(:disabled) {background:#e9e8cd;border-color:#73927d}
.btn.primary {background:var(--accent);color:#fff6dc;border-color:#843e32;box-shadow:0 3px 0 #74392c}
.btn.primary:hover:not(:disabled) {background:var(--accent-hover)}
.btn.small {padding:6px 11px;min-height:35px}
.plain,.inline {background:none;border:0;padding:7px 3px;text-decoration:underline;text-underline-offset:4px;color:var(--green);font-weight:740}
.inline {padding:0 0 0 4px}
.eyebrow {color:#375e4c;font-weight:800;letter-spacing:.085em;font-size:.82rem}
.eyebrow span {display:inline-block;width:9px;height:9px;border-radius:50%;background:#bd674e;margin-right:5px}
.paper {background:var(--paper);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow)}
.hero {display:grid;grid-template-columns: .89fr 1.11fr;min-height:470px;border:1px solid #a4ad91;border-radius:14px;background:var(--paper);overflow:hidden;box-shadow:var(--shadow)}
.hero-copy {padding:clamp(27px,4.8vw,68px);display:flex;flex-direction:column;justify-content:center}
.hero h1 {font-size:clamp(3.1rem,6.2vw,6rem);line-height:.98;letter-spacing:-.055em;margin:17px 0 19px;color:var(--deep)}
.hero h1 span {display:block;color:var(--accent)}
.hero-desc {font-size:clamp(1rem,1.6vw,1.2rem);max-width:23em;color:#505b49;margin-bottom:23px}
.hero .btn {min-height:49px;padding-inline:20px}
.hero-tally {font-size:.85rem;margin-top:24px;color:#596658;white-space:nowrap}
.hero-tally strong {color:var(--deep)}
.hero-tally span {margin-inline:6px}
.hero-art {position:relative;isolation:isolate;min-height:280px;background:#a1a88c;overflow:hidden;border-left:1px solid #a4ad91}
.stall {position:absolute;width:100%;height:100%;object-fit:cover;object-position:center}
.hero-iron {position:absolute;width:61%;left:19%;bottom:13%;filter:drop-shadow(0 11px 9px #4d322438)}
.hero-waffle {position:absolute;width:39%;left:43%;bottom:31%;transform:rotate(-19deg);filter:drop-shadow(3px 9px 2px #50342e47)}
.stall-sign {position:absolute;right:9%;top:17%;transform:rotate(6deg);background:#f8dfa6;border:3px double #9c523d;box-shadow:2px 4px #4e503c51;border-radius:2px;padding:8px 11px;text-align:center;font-weight:850;font-size:.69rem;color:#81523c}
.stall-sign span {display:block;color:#9d4535;font-size:clamp(1rem,2.3vw,1.75rem);line-height:1.12;margin-top:4px}
.home-note {margin-top:17px;display:flex;align-items:center;justify-content:space-between;gap:15px;padding:16px 22px;background:#e7e9d2;border:1px solid #bec8a8;border-radius:9px}
.home-note h2 {font-size:1.02rem;margin-bottom:2px}
.home-note p {color:#52604e;font-size:.89rem}
.home-note .btn {flex-shrink:0}
.work-top,.page-heading {display:flex;align-items:center;justify-content:space-between;gap:15px;margin:0 0 16px}
.work-top h1,.page-heading h1 {font-size:clamp(1.75rem,3.4vw,2.55rem);line-height:1.15;letter-spacing:-.04em}
.page-heading p {color:var(--muted);margin-top:6px}
.step-strip {display:grid;grid-template-columns:repeat(5,1fr);border:1px solid #b8bea3;background:#e8e9d3;border-radius:8px;overflow:hidden;margin-bottom:16px}
.step-strip button {border:0;border-right:1px solid #bec4a9;background:transparent;color:var(--ink);padding:9px 4px;font-weight:780;white-space:nowrap;min-height:43px}
.step-strip button:last-child {border-right:0}
.step-strip button.current {background:var(--green);color:#fef1d0}
.step-strip button:focus-visible {outline-offset:-4px}
.step-strip button:not(.current):hover {background:#d4e0c0}
.step-strip button span {display:inline-grid;place-items:center;font-size:.76rem;border-radius:50%;background:#c8d4b7;color:#264737;width:20px;height:20px;margin-right:5px}
.step-strip button.current span {background:var(--gold)}
.workspace {display:grid;grid-template-columns:1.03fr .97fr;gap:16px;align-items:stretch}
.bench,.controls {border:1px solid #b7b796;background:var(--paper);border-radius:11px;overflow:hidden;box-shadow:var(--shadow);min-width:0}
.bench {display:grid;grid-template-rows:auto 1fr auto;background:#dce2c7}
.bench-header,.bench-footer {display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 15px;background:#f8efd7;font-size:.86rem;font-weight:750}
.bench-header {border-bottom:1px solid #c2c5a5}
.bench-footer {border-top:1px solid #bfa782;color:#354c40}
.live-tag {background:#d8e1c1;color:#325843;padding:3px 8px;border-radius:4px;font-size:.75rem}
.bench-art {display:grid;place-items:center;position:relative;min-height:280px;isolation:isolate;overflow:hidden;
 background:repeating-linear-gradient(90deg,transparent 0 43px,#879c826a 43px 44px),
 repeating-linear-gradient(0deg,#d5dfbf 0 37px,#9ab296 37px 38px)}
.bench-window {position:absolute;top:10%;left:12%;width:76%;height:51%;z-index:-1;border:6px solid #6d8a73;border-radius:3px;
 background:linear-gradient(90deg,transparent 48%,#6d8a73 48% 51%,transparent 51%),linear-gradient(0deg,#a9a48b,#ebc28f 45%,#f8d99d)}
.tabletop {position:absolute;z-index:-1;bottom:0;height:34%;width:100%;background:repeating-linear-gradient(176deg,#d9a16e 0 29px,#be8b5b 29px 31px);border-top:7px solid #a77356}
.bowl {width:66%;max-width:340px;align-self:end;margin-bottom:5%;filter:drop-shadow(0 6px 3px #7352384a)}
.bowl svg {display:block;width:100%;max-height:260px}
.bowl.stirring {animation:stir .32s ease}
.mold {position:absolute;bottom:14%;width:64%;max-width:330px;height:65%;max-height:230px;transform-origin:50% 71%;--flame-opacity:0;--flame-color:#e3a058}
.mold.flipped {transform:scaleX(-1)}
.mold.turning {animation:turn-mold .37s ease-out}
.mold.flipped.turning {animation:turn-mold-reverse .37s ease-out}
.mold[data-flame="1"] {--flame-opacity:.53;--flame-color:#f4c26d}
.mold[data-flame="2"] {--flame-opacity:.84;--flame-color:#f1a24a}
.mold[data-flame="3"] {--flame-opacity:1;--flame-color:#ed7846}
.mold-base,.mold-lid {position:absolute;left:9%;width:68%;border:4px solid #253a31;border-radius:46% 43% 42% 40%;background:
 radial-gradient(ellipse at 50% 50%,#263a32 0 29%,#768573 31% 36%,transparent 38%) 0 0/22% 39%,#545f51;
 box-shadow:1px 8px #34473b,5px 13px #5f6e575e}
.mold-base {height:37%;bottom:20%;z-index:2;transform:rotate(-7deg)}
.mold-lid {height:36%;bottom:52%;transform:skewX(12deg) rotate(-19deg);z-index:1;transition:transform .2s,bottom .2s;filter:brightness(.92)}
.mold-base::after,.mold-lid::after {content:"";display:block;position:absolute;width:53%;height:21%;background:#866041;border:3px solid #38382a;border-radius:3px 9px 9px 3px;left:90%;top:43%;transform:rotate(-6deg);box-shadow:0 3px #36372878}
.mold-lid::after {transform:rotate(-13deg)}
.mold.shut .mold-lid {bottom:24%;transform:rotate(-7deg);z-index:3;background:linear-gradient(0deg,#384e41,#6e7c68);border-bottom:7px solid #314036}
.batter-pool {position:absolute;width:58%;height:73%;left:17%;top:13%;border-radius:49%;background:#e8b562;border:2px solid #9c693d;box-shadow:inset 0 4px #f6d08c}
.batter-pool[data-pour="1"] {width:20%;height:45%;left:31%;top:29%}
.batter-pool[data-pour="2"] {width:41%;height:56%;left:25%;top:20%}
.batter-pool[data-pour="4"] {width:98%;height:103%;left:-3%;top:4%;transform:rotate(8deg);border-radius:39% 48% 39% 52%}
.filling-display {position:absolute;inset:12% 11%;display:flex;justify-content:center;align-items:center;gap:1%}
.fill-glyph {width:calc(14% + var(--n) * 1.7%);display:block}
.fill-glyph svg {width:100%}
.burner {position:absolute;left:2%;width:84%;height:23%;bottom:5%;border-radius:11px;border:4px solid #34473c;background:#61735d;box-shadow:0 8px #4b473b;display:flex;justify-content:space-around}
.burner i {width:19%;height:78%;margin-top:-11%;opacity:var(--flame-opacity);background:var(--flame-color);border-radius:65% 34% 58% 17%;transform:rotate(-40deg);box-shadow:0 0 13px #edaa6b}
.steam {position:absolute;inset:0;display:flex;gap:12%;justify-content:center;opacity:var(--flame-opacity)}
.steam i {width:7%;height:24%;border-left:3px solid #fff3d2;border-radius:60%;transform:rotate(16deg)}
.controls {display:flex;flex-direction:column;gap:13px;padding:17px}
.controls h2 {font-size:1.38rem;line-height:1.2}
.controls header p {color:var(--muted);font-size:.87rem;margin-top:4px}
.controls footer {display:flex;justify-content:space-between;gap:7px;margin-top:auto;padding-top:12px;border-top:1px solid #dfd7bd}
.amount-grid {display:grid;grid-template-columns:1fr 1fr;gap:8px}
.amount {min-width:0;display:flex;align-items:center;justify-content:space-between;gap:4px;padding:5px 7px;background:#f3ecd6;border:1px solid #ddd0af;border-radius:7px}
.ingredient {display:flex;align-items:center;gap:3px;font-size:.86rem;white-space:nowrap}
.ingredient svg {width:33px;height:33px;flex-shrink:0}
.stepper {display:flex;align-items:center;gap:3px}
.stepper button {background:#fff9e6;border:1px solid #bdc4a6;border-radius:5px;color:#2a5747;padding:0;min-width:31px;height:35px;font-weight:800;font-size:1.1rem}
.stepper button:hover:not(:disabled) {background:#e2e7c8}
.stepper output {font-weight:850;min-width:16px;text-align:center;font-variant-numeric:tabular-nums}
.guide-tip {background:#e7ebd1;color:#344f3e;padding:6px 9px;border-left:3px solid #86a07d;border-radius:4px;font-size:.83rem}
.mix-control {display:flex;align-items:baseline;gap:5px;flex-wrap:wrap}
.mix-control strong {font-size:2.4rem;line-height:1.05;font-variant-numeric:tabular-nums}
.mix-control .actions {margin-left:auto}
.choices,.cook-tools {display:flex;gap:6px;flex-wrap:wrap}
.choice {flex:1;padding-inline:8px;white-space:nowrap}
.choice[aria-pressed=true] {background:#d7e2c3;border-color:#6e9278;box-shadow:inset 0 -2px #92a787;color:#234b3d}
.pour-choices .choice {flex-direction:column;min-height:61px}
.pour-icon {position:relative;width:34px;height:15px;border:1px solid #9b9379;border-radius:60%;background:#e6dfc1}
.pour-icon::after {content:"";position:absolute;width:calc(var(--pour) * 25%);height:calc(var(--pour) * 20%);left:50%;top:50%;transform:translate(-50%,-50%);background:#d99954;border-radius:50%}
.control-label {font-size:.81rem;font-weight:800;margin-bottom:4px}
.cook-timer {display:flex;gap:9px;align-items:center;background:#eee9d0;border:1px solid #d5ccad;border-radius:8px;padding:7px 8px;flex-wrap:wrap}
.cook-timer > div {margin-right:auto;min-width:90px}
.cook-timer strong {font-size:1.42rem;font-variant-numeric:tabular-nums}
.cook-timer small {display:block;font-size:.75rem;color:#586551}
.cook-timer label,.retry-controls label {font-weight:700;font-size:.84rem;display:flex;align-items:center;gap:5px}
select {max-width:100%;color:var(--deep);background:var(--paper);border:1px solid #a2ab8d;border-radius:5px;min-height:35px;padding:3px 6px}
.cook-tools .btn {flex:1}
.cook-tools span {background:#dfe5c9;padding:1px 6px;border-radius:5px}
.btn.stop {border-color:#ac7156;background:#f4dbc0;color:#783f32}
.result {display:grid;grid-template-columns:1.05fr .95fr;overflow:hidden}
.result-visual {display:grid;place-items:center;min-height:365px;position:relative;isolation:isolate;overflow:hidden;
 background:radial-gradient(ellipse at center,#fff2c1 0 27%,#edce90 30%,#d7aa6e 70%);border-right:1px solid #d7c49d}
.result-visual::before {content:"";position:absolute;inset:8%;border:1px solid #9c77567a;border-radius:10px;z-index:-1;background:repeating-linear-gradient(0deg,transparent 0 25px,#99633a14 25px 26px)}
.result-copy {padding:clamp(18px,4vw,50px);align-self:center}
.result-copy h1 {font-size:clamp(1.75rem,4vw,3rem);line-height:1.15;margin:8px 0;color:var(--deep)}
.field-note {color:#5c5342;margin:7px 0 18px}
.retry-controls {display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-top:16px}
.result .replay {font-size:.84rem;margin-top:10px}
.still-figure,.effect-figure {width:100%;display:grid;place-items:center;filter:drop-shadow(0 7px 4px #713f3035)}
.still-figure svg,.effect-figure svg {width:min(78%,330px);overflow:visible}
.progress-block {text-align:right;min-width:135px;white-space:nowrap}
.progress-block strong {color:var(--green);font-size:1.26rem}
progress {display:block;height:10px;width:100%;accent-color:#608c68;margin-top:5px}
.filters {display:flex;gap:6px;flex-wrap:wrap;margin-bottom:14px}
.filters .choice {flex:0 0 auto;min-height:36px;font-size:.85rem;padding-inline:11px}
.card-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:9px}
.sample {position:relative;border:1px solid #c4c5a5;background:#e8e8cf;text-align:left;color:#314d42;border-radius:8px;min-width:0;padding:9px 11px;display:flex;flex-direction:column}
.sample:hover {border-color:#5f826a;box-shadow:0 2px 9px #324d3526}
.sample.unlocked {background:#fff5dc}
.sample-number {position:absolute;top:8px;left:9px;color:#69745f;font-size:.73rem;font-weight:750}
.sample-art {height:78px;display:grid;place-items:center}
.sample-art svg {height:77px;max-width:100%}
.sample strong {font-size:.91rem}
.sample small {color:#68715d;font-size:.73rem}
.silhouette {position:relative;width:100px;display:grid;place-items:center;margin:auto}
.silhouette img {width:82%;opacity:.37;filter:grayscale(1) sepia(.32) hue-rotate(50deg) brightness(.65)}
.silhouette b {position:absolute;font-size:1.48rem;color:#f6eed6;text-shadow:1px 2px #637460}
.history-list {display:grid;gap:7px}
.history-row {display:grid;grid-template-columns:72px 1fr auto;gap:12px;align-items:center;padding:7px 12px;background:var(--paper);border-radius:8px;border:1px solid var(--line)}
.history-art svg {width:66px;display:block}
.history-row h2 {font-size:1rem}
.history-row p {font-size:.78rem;color:var(--muted)}
.empty {padding:23px}
.empty h2 {font-size:1.12rem;margin-bottom:4px}
.setting-list {max-width:620px}
.setting-list label {display:flex;justify-content:space-between;align-items:center;gap:12px;padding:16px}
.setting-list label+label {border-top:1px solid var(--line)}
.setting-list small {display:block;color:var(--muted);margin-top:4px}
.setting-list input {width:22px;height:22px;accent-color:var(--green)}
.save-warning {padding:8px 12px;border:1px solid #bb775a;background:#f8dfc5;margin-bottom:10px;border-radius:6px;font-size:.88rem}
dialog {color:var(--ink);border:1px solid #a2ae90;border-radius:12px;background:var(--paper);box-shadow:0 20px 70px #22382c73;width:min(560px,calc(100% - 22px));max-height:calc(100% - 22px);padding:17px}
dialog::backdrop {background:#17312db8}
.detail-title {display:flex;justify-content:space-between;align-items:flex-start;gap:6px}
.detail-title h2 {font-size:1.55rem;margin-top:3px}
.detail-visual {height:115px;display:grid;place-items:center;background:#efe3c5;border:1px solid #dbcdac;border-radius:7px;margin:9px 0}
.detail-visual svg {width:150px;height:113px}
dialog h3 {font-size:.95rem}
.recipe-sheet {margin:7px 0 9px}
.recipe-sheet div {display:grid;grid-template-columns:49px 1fr;gap:6px;padding:4px 0;border-bottom:1px solid #e7dfc8;font-size:.85rem}
.recipe-sheet dt {color:var(--green);font-weight:750}
.recipe-sheet dd {margin:0}
.timeline {font-size:.87rem;color:var(--green)}
.timeline summary {cursor:pointer;font-weight:750}
.timeline ol {margin:4px 0;padding-left:24px;max-height:170px;overflow:auto}
@media (min-width:850px) {
  .workspace {grid-template-columns:1.07fr .93fr}
  .controls {padding:20px}
  .amount {padding-inline:10px}
  .ingredient {font-size:.95rem}
  .stepper button {min-width:36px}
}
@media (max-width:790px) {
  .top-inner {padding-inline:14px;min-height:58px}
  main {padding:16px 14px 30px}
  .hero {min-height:370px}
  .hero-copy {padding:24px}
  .workspace {grid-template-columns:.84fr 1.16fr;gap:10px}
  .bench-art {min-height:225px}
  .controls {padding:12px;gap:9px}
  .bench-header,.bench-footer {padding:7px 9px}
}
@media (max-width:610px) {
  .top-inner {flex-wrap:wrap;gap:0;padding-block:5px;justify-content:center}
  .brand {flex-basis:100%;justify-content:center;font-size:1rem;padding:0 0 3px}
  .brand img {width:31px;height:28px}
  .brand small {display:none}
  .topbar nav {justify-content:center;gap:4px}
  .topbar nav button {padding:6px 8px;font-size:.85rem}
  main {padding:12px 10px 26px}
  .hero {grid-template-columns:1fr}
  .hero-copy {padding:20px}
  .hero h1 {font-size:clamp(2.65rem,10vw,3.7rem);margin:9px 0 12px}
  .hero h1 span {display:inline}
  .hero-desc {margin-bottom:14px}
  .hero-tally {margin-top:13px}
  .hero-art {min-height:235px;border-left:0;border-top:1px solid #a4ad91}
  .hero-iron {width:51%;left:24%}
  .hero-waffle {width:35%;left:43%}
  .home-note {align-items:flex-start;flex-direction:column;padding:12px;margin-top:10px}
  .work-top,.page-heading {margin-bottom:9px}
  .step-strip {margin-bottom:8px}
  .step-strip button {font-size:.81rem}
  .step-strip button span {width:16px;height:16px;font-size:.62rem;margin-right:3px}
  .workspace {grid-template-columns:1fr}
  .bench-art {min-height:155px;max-height:170px}
  .bowl {width:44%;max-width:230px;margin-bottom:0}
  .bowl svg {max-height:150px}
  .mold {width:50%;max-width:245px}
  .amount-grid {gap:6px}
  .amount {padding:4px}
  .ingredient svg {width:26px}
  .stepper button {min-width:31px}
  .result {grid-template-columns:1fr}
  .result-visual {min-height:210px;border-right:0;border-bottom:1px solid #d7c49d}
  .still-figure svg,.effect-figure svg {width:min(67%,230px)}
  .card-grid {grid-template-columns:repeat(auto-fit,minmax(101px,1fr))}
  .page-heading {align-items:flex-start}
  .page-heading p {font-size:.85rem}
  .progress-block {min-width:77px}
  .history-row {grid-template-columns:45px 1fr auto;gap:7px;padding:6px}
  .history-art svg {width:45px}
  .history-row .btn {padding-inline:5px;font-size:.78rem}
}
@media (max-height:520px) and (orientation:landscape) and (min-width:611px) {
  .top-inner {min-height:45px}
  .brand img {width:31px;height:30px}
  .brand {font-size:1rem}
  .brand small {display:none}
  main {padding-top:7px}
  .work-top {margin-bottom:4px}
  .work-top h1 {font-size:1.3rem;line-height:1.1}
  .work-top .plain {padding-block:2px}
  .topbar nav button {padding-block:5px}
  .step-strip {margin-bottom:7px}
  .step-strip button {min-height:31px;padding-block:4px}
  .workspace {gap:8px}
  .bench-art {min-height:164px}
  .controls {padding:6px 9px;gap:5px}
  .controls h2 {font-size:1.08rem}
  .controls header p {margin-top:1px;font-size:.77rem}
  .controls footer {padding-top:4px}
  .controls .btn,.controls .choice {min-height:34px;padding-block:5px;font-size:.81rem}
  .cook-timer {padding:3px 5px}
  .controls .guide-tip {padding-block:3px;font-size:.76rem}
  .result-visual {min-height:270px}
}
@media (max-width:355px) {
  .amount-grid {grid-template-columns:1fr}
  .mix-control .actions {margin-left:0}
  .hero h1 {font-size:2.4rem}
}
