:root{color-scheme:dark;--cream:#fff3de;--brown:#73513d;--mint:#b9e5d5;--coral:#f4b5a9;--board-size:min(calc(100vw - 28px),408px,calc(100svh - 311px - max(6px,env(safe-area-inset-top)) - max(5px,env(safe-area-inset-bottom))));font-family:'Zen Maru Gothic','Noto Sans TC',sans-serif;font-weight:700;color:var(--cream)}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none}body{background:#30251f url('../assets/kitchen-night.png') center 64%/cover no-repeat;touch-action:manipulation}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer}button:disabled{opacity:.5;cursor:default}button:focus-visible,a:focus-visible{outline:3px solid #b8eee2;outline-offset:3px}a{color:inherit;text-decoration:none}.shell{width:min(100%,472px);height:100svh;margin:auto;padding:max(6px,env(safe-area-inset-top)) 14px max(5px,env(safe-area-inset-bottom));display:flex;flex-direction:column;align-items:center;justify-content:center;user-select:none;-webkit-user-select:none;background:linear-gradient(#2419131c,#31231a04)}.header{width:100%;flex:none}.topline{height:42px;display:flex;align-items:center;justify-content:space-between}.brand{font-size:15px;letter-spacing:1px;text-shadow:0 2px 5px #20110d}.top-actions{display:flex;gap:7px}.round-btn{width:42px;height:42px;flex:none;padding:0;border:1px solid #d7af81;border-radius:50%;color:#fff1d8;background:#60422bbb;box-shadow:0 3px 0 #33231e66;font-size:20px;display:inline-flex;justify-content:center;align-items:center}.round-btn.off{color:#b59b82}.round-btn:active{transform:translateY(2px)}h1{margin:1px 0 9px;text-align:center;font-size:38px;line-height:1.3;font-weight:900;letter-spacing:2px;color:#fff0d8;text-shadow:0 3px #734631,2px 0 #734631,-2px 0 #734631,0 -2px #734631,0 6px 12px #20141370;white-space:nowrap}h1 span{color:#fac0b8}h1 i{font-size:25px;font-style:normal;color:#bce9d9;vertical-align:4px;margin-left:3px}.hud{display:flex;align-items:stretch;gap:8px;height:63px;max-width:408px;margin:auto}.moves-box,.score-box,.goal-box{border:1px solid #e5ba91;box-shadow:0 3px 0 #51342577;border-radius:13px;background:linear-gradient(#fff3deeF,#f5dec4ef);color:var(--brown)}.moves-box{width:68px;text-align:center;padding:5px 3px 4px;flex:none}.moves-box>span,.score-box>span{font-size:9px;letter-spacing:1px;display:block}.moves-box strong{display:block;font-size:31px;line-height:1.2;font-weight:900;color:#936248;font-variant-numeric:tabular-nums}.moves-box.danger strong{color:#c66962;animation:blink 1s infinite}.score-box{width:78px;text-align:center;flex:none;padding:6px 3px 4px}.score-box strong{font-size:19px;line-height:1.15;font-weight:900;display:block;font-variant-numeric:tabular-nums}.score-box small{display:block;font-size:8px;white-space:nowrap;margin-top:3px;color:#a77955}.goal-box{flex:1;min-width:0;padding:4px 7px 5px}.goal-heading{display:flex;justify-content:space-between;font-size:8px;letter-spacing:.5px;color:#947156;line-height:1.3}.goal-heading span:first-child{font-size:10px;color:#7b5842}.goals{display:flex;gap:7px;justify-content:center;height:40px}.goal{display:flex;align-items:center;gap:2px;position:relative;min-width:54px}.goal img{height:33px;width:33px;object-fit:contain;filter:drop-shadow(0 1px 1px #8c613233)}.goal strong{font-size:20px;color:#a16650;min-width:23px;text-align:center;font-weight:900}.goal.done strong{font-size:19px;color:#558c72}.goal.done img{filter:drop-shadow(0 0 4px #9fe1ba)}.play-area{position:relative;flex:none;margin-top:13px;width:var(--board-size);max-width:100%}.board-tray{position:relative;width:100%;aspect-ratio:1;border:3px solid #ce9b75;border-radius:23px;padding:9px;background:linear-gradient(135deg,#e9c9a5,#bc8864);box-shadow:inset 0 1px 0 #fff1d9,0 6px 0 #754b34,0 10px 20px #1d0f1140;isolation:isolate}.board{width:100%;height:100%;position:relative;border:1px solid #c6a47e;border-radius:13px;background:#fff2dc;overflow:hidden;touch-action:none}.board::before{content:'';position:absolute;inset:0;pointer-events:none;background-image:linear-gradient(#d9baa93d 1px,transparent 1px),linear-gradient(90deg,#d9baa93d 1px,transparent 1px);background-size:calc(100% / 7) calc(100% / 7)}.tile{position:absolute;left:0;top:0;width:calc(100% / 7);height:calc(100% / 7);padding:2px;border:0;border-radius:12px;background:none;color:#85503d;touch-action:none;transition:transform .26s cubic-bezier(.22,.74,.2,1.1),opacity .16s;will-change:transform;z-index:1;outline-offset:-4px}.tile::before{position:absolute;inset:3px;content:'';background:#e9d3bc28;border:2px solid transparent;border-radius:12px;transition:background .15s,border .15s}.tile:nth-of-type(even)::before{background:#e4c7ac18}.tile img{position:relative;width:96%;height:96%;object-fit:contain;filter:drop-shadow(0 2px 1px #79513030);pointer-events:none;transition:filter .15s;transform-origin:center}.tile.selected{z-index:4}.tile.selected::before{border-color:#dc9985;background:#ffd1b866;box-shadow:inset 0 0 7px #ffbc8b70}.tile.selected img{transform:scale(1.09)}.tile.hinted img{animation:none}.tile.hinted::before{border-color:#83b79b;background:#c2e9ca55}.tile.clearing{z-index:6;pointer-events:none;opacity:0;transition:opacity .17s;transform:var(--place) scale(.2)!important}.tile.clearing img{filter:brightness(1.6) drop-shadow(0 0 6px #ffe5b5)}.tile.activated{animation:power-activate .17s ease-in}.tile.created img{animation:special-born .45s ease-out}.tile.rainbow::before{border-color:#f1c672;background:radial-gradient(#fff8d7,#cbefe066);box-shadow:0 0 8px #ffd19080}.tile.bomb::before{border-color:#e7a89d;background:#ffe2dd50}.power-mark{position:absolute;right:1px;bottom:0;min-width:15px;height:16px;line-height:14px;font-size:13px;font-weight:900;display:none;background:#fff3d9;border:1px solid #d1a074;border-radius:6px;color:#b27750;box-shadow:0 1px 3px #68412935;pointer-events:none}.tile.row .power-mark,.tile.column .power-mark,.tile.bomb .power-mark,.tile.rainbow .power-mark{display:block}.tile.bomb .power-mark{color:#b96971}.tile.rainbow .power-mark{color:#709f8c}#particles{position:absolute;inset:0;width:100%;height:100%;z-index:10;pointer-events:none}.chain{position:absolute;top:43%;left:0;width:100%;text-align:center;font-size:26px;line-height:1.25;font-weight:900;color:#fff7d8;text-shadow:0 3px #b17468,2px 0 #9b5e51,-2px 0 #9b5e51,0 -1px #9b5e51,0 0 18px #ffd883;z-index:12;pointer-events:none;opacity:0}.chain.show{animation:chain-pop .9s both}.board-tray.shuffle{animation:shuffle .38s ease-out}.status{height:27px;display:flex;align-items:center;justify-content:center;font-size:10px;text-shadow:0 2px 4px #372015;color:#ffe9c8;letter-spacing:.4px;white-space:nowrap}.meimei-note{width:100%;max-width:365px;display:flex;align-items:center;justify-content:center;position:relative;height:43px;margin:-2px 0 5px;pointer-events:none}.meimei-note img{width:54px;height:54px;object-fit:contain;filter:drop-shadow(0 2px 2px #29191680);align-self:flex-end}.meimei-note p{font-size:10px;line-height:1.55;color:#78553f;background:#fff2dceF;padding:6px 9px;max-width:275px;min-height:29px;margin:0 0 1px;border:1px solid #ce9e7a;border-radius:10px 10px 10px 0;box-shadow:0 2px 5px #26130e22}.meimei-note.react img{animation:chef .4s}.footer{width:100%;max-width:390px;flex:none}.control-row{display:flex;justify-content:center;gap:9px;align-items:center}.btn{height:46px;padding:0 15px;border:1px solid #ffedda;border-radius:14px;font-size:13px;letter-spacing:.3px;color:#70503b;font-weight:900;box-shadow:0 4px 0 #57392877,0 4px 8px #22110d22;touch-action:manipulation;transition:transform .1s}.btn:active{transform:translateY(3px);box-shadow:0 1px 0 #57392877}.btn.mint{background:linear-gradient(#d1f1e1,#a9dcc5)}.btn.coral{background:linear-gradient(#ffd6c5,#efb0a3)}.btn.cream{background:linear-gradient(#fff4df,#ebd0af)}.btn span{font-size:18px;vertical-align:-1px;padding-right:3px}.control-row .btn:first-child{flex:1;max-width:155px}.control-row .btn:nth-child(2){flex:1;max-width:132px}.game-links{display:flex;align-items:center;justify-content:center;gap:9px;font-size:10px;color:#eed1ae;height:42px}.game-links>a,.game-links>button{display:flex;align-items:center;justify-content:center;min-height:42px;white-space:nowrap}.game-links button{border:0;padding:0;background:none;color:inherit;font-size:10px}.desktop-note{display:none}.modal{position:fixed;inset:0;background:#25181d89;backdrop-filter:blur(6px);padding:22px;z-index:30;display:flex;justify-content:center;align-items:center}.modal[hidden]{display:none}.panel{color:#78563f;background:linear-gradient(145deg,#fff5e5,#f4dfc6);border:3px solid #e3b18c;outline:1px solid #fff2dc;outline-offset:4px;border-radius:26px;width:min(100%,352px);padding:24px 22px 21px;text-align:center;box-shadow:0 12px 60px #180d1466;max-height:calc(100svh - 50px);overflow-y:auto;animation:panel-in .25s ease-out;position:relative}.panel h2{font-size:27px;font-weight:900;line-height:1.3;color:#855842;margin:0 0 11px}.panel p{font-size:12px;line-height:1.8;margin:10px 0 15px}.panel .btn{width:100%;display:block;font-size:15px;margin-top:12px}.intro-art{height:106px;position:relative;margin:4px auto 14px;width:218px}.intro-art>img{width:78px;height:78px;object-fit:contain;position:absolute;bottom:4px;filter:drop-shadow(0 4px 4px #a6744244);animation:intro-bob 2.8s infinite}.intro-art>img:nth-child(1){left:0;transform:rotate(-10deg);animation-delay:-.6s}.intro-art>img:nth-child(2){left:59px;bottom:11px;z-index:2;animation-delay:-1.5s}.intro-art>img:nth-child(3){right:0;transform:rotate(12deg);animation-delay:-2s}.intro-art::after{content:'✦';position:absolute;right:8px;top:-5px;font-size:24px;color:#b1c9ac}.intro-sub{color:#a57859;font-size:11px;letter-spacing:1px;margin:0 0 3px}.intro-targets{border-top:1px solid #ddbea0;border-bottom:1px solid #ddbea0;padding:9px 0;display:flex;gap:10px;justify-content:center;align-items:center;margin:12px 0}.intro-targets img{width:34px;height:34px;object-fit:contain}.intro-targets span{font-size:12px;display:flex;align-items:center;gap:3px}.intro-targets strong{font-size:20px;line-height:1.2;color:#b57359}.intro-targets .steps{font-size:10px;color:#a88264;display:block;border-left:1px solid #ddbea0;padding-left:12px}.intro-targets .steps strong{display:block;font-size:24px;color:#8f6c4e}.hint-note{font-size:10px!important;color:#a48262;line-height:1.6!important;margin:11px 0 0!important}.text-btn{border:0;background:none;color:#ad8060;padding:10px;min-height:42px;font-size:11px;text-decoration:underline;text-underline-offset:4px}.close{position:absolute;right:8px;top:6px;height:40px;width:40px;border:0;background:none;font-size:26px;color:#a57e60}.result-art{width:76px;height:76px;object-fit:contain}.result-score{color:#bc7b66;font-size:42px;line-height:1;font-weight:900;margin:13px 0 5px}.stars{font-size:27px;letter-spacing:7px;color:#dca456;text-shadow:0 2px 0 #a9764555;margin:10px 0}.stars span{color:#d6c2a7}.result-stats{display:flex;justify-content:space-around;border-top:1px solid #dfbea0;border-bottom:1px solid #dfbea0;padding:12px 0;margin:15px 0;font-size:10px;color:#a27c5d}.result-stats strong{display:block;color:#815b40;font-size:19px;font-weight:900}.mini-goals{display:flex;justify-content:center;gap:13px;margin:10px 0}.mini-goals span{display:flex;align-items:center;font-size:11px}.mini-goals img{width:29px;height:29px}.collection-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px 5px;margin:20px -9px}.collection-grid figure{margin:0}.collection-grid img{display:block;width:58px;height:58px;object-fit:contain;margin:0 auto 5px}.collection-grid figcaption{font-size:9px;line-height:1.5}.collection-grid small{font-size:9px;color:#a57b5c}.collection-grid .locked img{filter:grayscale(1);opacity:.3}.collection-grid .locked{color:#b29a80}.legend-row{display:flex;align-items:center;text-align:left;gap:10px;padding:8px 0;border-bottom:1px solid #ddbea070}.legend-row .legend{width:43px;height:43px;flex:none;border:1px solid #ddb28d;border-radius:10px;display:flex;align-items:center;justify-content:center;background:#fff1d9;font-size:23px;color:#b68564}.legend-row .legend img{height:39px;width:39px;object-fit:contain}.legend-row p{margin:0;font-size:11px;line-height:1.65}.legend-row strong{color:#a46b54}.ratings{display:flex;gap:6px}.ratings button{flex:1;min-height:44px;font-size:15px;color:#9d7154;background:#fff8eb;border:1px solid #d9b79a;border-radius:10px}.ratings button.selected{background:#bde3cc;border-color:#7aac90;color:#437d61}.panel label{display:block;text-align:left;font-size:11px;margin:17px 0 7px}.panel textarea{width:100%;min-height:77px;resize:none;border:1px solid #d8b99c;border-radius:12px;background:#fff9ee;color:#7d5a42;padding:11px;font:inherit;font-size:12px;user-select:text;-webkit-user-select:text}.modal-nav{display:flex;justify-content:center;gap:15px;margin-top:7px;font-size:11px;color:#a27a59}.modal-nav a{padding:12px 0;min-height:44px}.recap{font-size:10px!important;color:#ad8464!important}.record{background:#b6debe;color:#4f7c5d;border-radius:16px;padding:4px 10px;display:inline-block;font-size:10px;letter-spacing:1px}#toast{position:fixed;left:50%;bottom:38px;transform:translate(-50%,15px);opacity:0;pointer-events:none;background:#fff1dc;color:#7c543f;padding:10px 16px;border:1px solid #d5aa85;border-radius:16px;box-shadow:0 5px 18px #21111750;z-index:60;font-size:11px;white-space:nowrap;transition:.18s}#toast.show{transform:translate(-50%,0);opacity:1}@keyframes panel-in{from{opacity:0;transform:translateY(12px) scale(.95)}to{opacity:1;transform:none}}@keyframes intro-bob{50%{translate:0 -5px}}@keyframes special-born{0%{transform:scale(.5);filter:brightness(1.8)}60%{transform:scale(1.2)}100%{transform:scale(1)}}@keyframes power-activate{50%{filter:brightness(1.8)}}@keyframes chain-pop{0%{opacity:0;transform:scale(.7) translateY(8px)}15%,65%{opacity:1;transform:scale(1)}100%{opacity:0;transform:translateY(-19px)}}@keyframes shuffle{25%{transform:rotate(-1.6deg)}55%{transform:rotate(1.6deg)}80%{transform:rotate(-.8deg)}}@keyframes hint-pop{50%{transform:scale(1.08) rotate(-5deg)}}@keyframes blink{50%{opacity:.6}}@keyframes chef{50%{transform:rotate(-6deg) scale(1.08)}}@media(min-width:850px){.shell{border-left:1px solid #ddae7c22;border-right:1px solid #ddae7c22;background:linear-gradient(#241b1222,#31231a11)}.desktop-note{display:block;position:fixed;top:24%;right:calc(50% + 282px);width:230px;text-shadow:0 2px 8px #21110d}.desktop-note h2{font-size:37px;line-height:1.5;font-weight:900;margin:0 0 23px;letter-spacing:2px;color:#ffeace}.desktop-note h2 span{color:#f4bdb2}.desktop-note p{font-size:12px;line-height:2;letter-spacing:.7px}.note-line{height:2px;width:35px;background:#bd996c;margin:20px 0}.desktop-note .small{font-size:10px;color:#d7baa0}}@media(max-height:720px){:root{--board-size:min(calc(100vw - 28px),408px,calc(100svh - 311px - max(6px,env(safe-area-inset-top)) - max(5px,env(safe-area-inset-bottom))))}.shell{justify-content:flex-start}.topline{height:39px}.round-btn{width:40px;height:40px}h1{font-size:32px;margin:1px 0 7px}.hud{height:58px}.moves-box strong{font-size:29px}.goals{height:36px}.goal img{height:29px;width:29px}.score-box strong{font-size:18px}.play-area{margin-top:11px}.meimei-note{height:37px;margin-bottom:5px}.meimei-note img{height:48px;width:48px}.btn{height:44px}.game-links{height:41px}.panel{padding:21px 20px 18px}.intro-art{height:82px;margin-bottom:11px}.intro-art>img{width:70px;height:70px}.panel h2{font-size:25px}.panel p{margin-bottom:10px}}@media(max-height:590px){:root{--board-size:min(calc(100vw - 26px),calc(100svh - 280px - max(6px,env(safe-area-inset-top)) - max(5px,env(safe-area-inset-bottom))))}.topline{height:34px}.brand{font-size:13px}h1{font-size:27px;margin-bottom:5px}.round-btn{height:36px;width:36px}.hud{height:54px}.goal-heading{font-size:7px}.moves-box strong{font-size:25px}.score-box strong{font-size:16px}.goal strong{font-size:18px}.goals{height:32px}.goal img{height:27px;width:27px}.play-area{margin-top:9px}.status{height:24px;font-size:9px}.meimei-note{height:32px;margin:0 0 5px}.meimei-note img{height:39px;width:39px}.meimei-note p{font-size:9px}.game-links{height:37px}.game-links>a,.game-links>button{min-height:37px}.btn{height:42px;font-size:12px;padding:0 11px}.panel{max-height:calc(100svh - 35px);padding:19px}.intro-art{height:65px}.intro-art>img{height:56px;width:56px}.intro-targets{margin:8px 0}.hint-note{font-size:9px!important}}@media(prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}.tile{will-change:auto}}@media print{body{overflow:visible;height:auto}.footer,.top-actions,.modal,.desktop-note{display:none!important}}

.legal{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.feedback-output{min-height:138px!important;font-size:10px!important;line-height:1.6}.feedback-output[hidden]{display:none}.result-actions{display:flex;justify-content:center;gap:0}.result-actions .text-btn{padding:8px 7px;font-size:10px}

.result-panel{padding:20px}.result-panel .result-art{width:58px;height:58px}.result-panel .stars{font-size:22px;line-height:1.2;margin:6px 0}.result-panel .result-score{font-size:36px;margin:8px 0 4px}.result-panel .recap{font-size:9px!important;line-height:1.5;margin:5px 0}.result-panel .result-stats{margin:8px 0;padding:8px 0}.result-panel .result-stats strong{font-size:18px}.result-panel h2{font-size:24px;margin-bottom:9px}.result-panel .btn{margin-top:10px}.result-panel .result-actions .text-btn{min-height:42px}.result-panel>p:not(.recap){font-size:11px;margin:7px 0 9px}

/* Shared 44px feedback key stays above the title at every mobile height. */
.shell .topline{min-height:46px}
.shell h1{margin-top:7px}

/* Endless orders keep the header height unchanged, including three-ingredient orders. */
.goal-heading #level{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 38px);font-size:9px}
.goals.three-goals{gap:3px}.goals.three-goals .goal{min-width:0;flex:1;gap:1px}.goals.three-goals .goal img{width:27px;height:27px}.goals.three-goals .goal strong{font-size:17px;min-width:18px}
.kitchen-stamps{display:flex;align-items:center;justify-content:center;gap:9px;margin:10px 0 8px;padding:9px 0;border-top:1px solid #d9b58d66;border-bottom:1px solid #d9b58d66}
.stamp-dots{display:flex;gap:3px;flex:none}.stamp-dots>span{display:grid;place-items:center;width:15px;height:15px;border-radius:50%;border:1px solid #c9ad89;background:#e8d5bd;color:#af8a61;font-size:14px;line-height:1}.stamp-dots>span.filled{background:#b7ddc5;border-color:#82af94;color:#477b61;font-size:10px}
.panel .kitchen-stamps p{font-size:10px;line-height:1.5;margin:0;text-align:left;color:#815f43}.kitchen-stamps small{display:block;color:#a08564;font-size:8px}
.near-gap{font-size:16px;color:#946f52;margin:4px 0 7px;line-height:1.1}.near-gap strong{font-size:27px}.near-gap.near{color:#bc786b}.near-gap.near strong{font-size:34px}
.order-progress{height:5px;background:#e6cbb0;border-radius:8px;overflow:hidden;margin:6px auto 10px;width:78%}.order-progress span{height:100%;display:block;background:linear-gradient(90deg,#91cdb8,#bde3bd);border-radius:8px}
.result-objectives{display:flex;justify-content:center;gap:13px;margin:7px 0}.result-objectives>span{display:grid;grid-template-columns:27px auto;column-gap:3px;align-items:center;font-size:10px;color:#775538}.result-objectives img{width:27px;height:27px;grid-row:span 2;object-fit:contain}.result-objectives small{font-size:9px;color:#a47b58}.result-panel .kitchen-stamps{margin:8px 0;padding:7px 0}.result-panel .result-objectives+.result-score{margin-top:8px}
@media(max-width:390px){.panel .kitchen-stamps p{font-size:9px}.kitchen-stamps{gap:7px}.stamp-dots{gap:2px}.stamp-dots>span{width:14px;height:14px}.result-objectives{gap:9px}}

/* 0.4.1: keep the current board while opening the official homepage. */
.panel>.site-home{display:flex;align-items:center;justify-content:center;min-height:44px;margin:4px 0 -4px;text-decoration:underline;touch-action:manipulation}.site-home span{margin-left:3px}.shell[inert] .footer{visibility:hidden}

.game-links{height:44px}.game-links>.site-home{min-height:44px}
@media(max-height:730px){.play-area{margin-top:3px}.status{height:23px}.meimei-note{margin-bottom:1px}}

.site-home{min-width:44px}

/* 0.4.2: readable swaps and special powers, within the existing board footprint. */
.tile.row::before{border-color:#81ad94;background:repeating-linear-gradient(0deg,#bce5cc60 0 4px,#edf7e720 4px 9px)}
.tile.column::before{border-color:#db9d88;background:repeating-linear-gradient(90deg,#f5bdaa60 0 4px,#ffedd920 4px 9px)}
.tile.row .power-mark{border-color:#83a78b;background:#e1f1d8;color:#4c8067}
.tile.column .power-mark{border-color:#cc9584;background:#ffe3d6;color:#a46252}
.tile.bomb .power-mark{border-color:#cb8d98;background:#fbd7de;color:#a75267}
.tile.row .power-mark,.tile.column .power-mark{min-width:18px;font-size:15px}

/* Small food grids explain the special recipes without adding new artwork. */
.control-row .help-button{min-width:62px;padding:0 12px}.help-recipes{text-align:left}.help-recipe{padding:14px 0;border-top:1px solid #dcb99688}.help-recipe h3{font-size:13px;line-height:1.6;margin:0 0 10px;color:#80553f}.panel .help-recipe p{font-size:11px;line-height:1.8;margin:9px 0 0}.help-food-grid{display:grid;grid-template-columns:repeat(var(--help-columns),27px);gap:3px;flex:none}.help-food-grid>span{width:27px;height:27px;border-radius:7px;border:1px solid #d8b99d;background:#fffbf2;display:grid;place-items:center}.help-food-grid .empty-cell{background:#e8d7c333;border-color:#ddc6aa66}.help-food-grid img{width:23px;height:23px;object-fit:contain}.recipe-result,.recipe-shapes{display:flex;align-items:center;justify-content:center;gap:8px;color:#a67d5c}.recipe-power{display:grid;place-items:center;width:35px;height:35px;border-radius:10px;background:#d9eddd;border:1px solid #a9c8af;color:#547c63;font-size:22px;flex:none}.recipe-god{width:39px;height:39px;object-fit:contain}.recipe-shapes figure{margin:0}.recipe-shapes figcaption{font-size:10px;text-align:center;margin-top:5px}.special-pairs{font-size:11px;line-height:1.8;margin:10px 0 0}.special-pairs dt{font-weight:900;color:#885b43;margin-top:9px}.special-pairs dd{margin:0;color:#987152}.kitchen-stamps small{line-height:1.7}.help-recipes .help-recipe:last-child{padding-bottom:0}
.tile.swap-good img{animation:swap-good .18s ease-out}
.tile.swap-miss::before{border-color:#ba8d76;background:#e6cbb755}
.tile.swap-miss img{animation:swap-miss .18s ease-out}
.goal.just-done strong{animation:goal-done .48s ease-out}
.score-box.score-pop strong{animation:score-pop .3s ease-out}
#match-effects{position:absolute;inset:0;overflow:hidden;border-radius:20px;pointer-events:none;z-index:9}
.wave-score{position:absolute;display:block;color:#fff7df;font-weight:900;font-size:18px;white-space:nowrap;text-shadow:0 2px #996d54,1px 0 #996d54,-1px 0 #996d54,0 -1px #996d54,0 0 9px #eabb8b;animation:wave-score .65s ease-out both;pointer-events:none}
.wave-score.big{font-size:23px;color:#fff1ac;text-shadow:0 2px #a26c59,1px 0 #a26c59,-1px 0 #a26c59,0 -1px #a26c59,0 0 12px #e9c177}
.power-ray{position:absolute;pointer-events:none;opacity:0;animation:power-ray .34s ease-out both}
.power-ray.row{top:var(--ray-y);left:0;width:100%;height:6px;background:linear-gradient(90deg,transparent,#bdebd3,#fff8c9,#bdebd3,transparent);box-shadow:0 0 9px #91cdb8;transform:translateY(-50%)}
.power-ray.column{left:var(--ray-x);top:0;height:100%;width:6px;background:linear-gradient(transparent,#f5bca8,#fff8c9,#f5bca8,transparent);box-shadow:0 0 9px #efa68e;transform:translateX(-50%)}
.power-ray.bomb{left:var(--ray-x);top:var(--ray-y);height:calc(var(--cell-size) * 3);width:calc(var(--cell-size) * 3);border:3px solid #f4b7ca;border-radius:50%;background:radial-gradient(transparent 40%,#fff3d966 60%,transparent 72%);transform:translate(-50%,-50%);animation:bomb-ray .34s ease-out both}
.power-ray.rainbow{inset:12px;border:2px solid #cfebc2;border-radius:13px;background:radial-gradient(ellipse at center,transparent 45%,#ffd57a33);box-shadow:inset 0 0 20px #ffd57a44;animation:power-ray .34s ease-out both}
.chain[data-intensity="big"]{color:#fff3b6;text-shadow:0 3px #b17468,2px 0 #9b5e51,-2px 0 #9b5e51,0 -1px #9b5e51,0 0 22px #ffd883}
.chain[data-intensity="sweet"]{color:#efffdf}
@keyframes swap-good{50%{transform:scale(1.12)}100%{transform:scale(1)}}
@keyframes swap-miss{20%,70%{transform:rotate(-7deg)}45%{transform:rotate(7deg)}100%{transform:none}}
@keyframes goal-done{35%{transform:scale(1.3);color:#397355}100%{transform:none}}
@keyframes score-pop{40%{transform:scale(1.12);color:#bd775e}100%{transform:none}}
@keyframes wave-score{0%{opacity:0;transform:translate(-50%,0) scale(.85)}18%,65%{opacity:1;transform:translate(-50%,-7px) scale(1)}100%{opacity:0;transform:translate(-50%,-22px) scale(1)}}
@keyframes power-ray{0%{opacity:0}20%{opacity:.9}100%{opacity:0}}
@keyframes bomb-ray{0%{opacity:0;transform:translate(-50%,-50%) scale(.35)}30%{opacity:.9}100%{opacity:0;transform:translate(-50%,-50%) scale(1.1)}}
@media(prefers-reduced-motion:reduce){.tile.swap-good img,.tile.swap-miss img,.goal.just-done strong,.score-box.score-pop strong{animation:none!important}#match-effects{display:none}.chain.show{animation:none!important;opacity:1}}

.shell>.mm-cinema-progress{font-size:11px;padding:3px 7px;margin:0 4px;line-height:1.5}

/* 0.5.2: reserve the actual height of membership, challenge and footer rows. */
.shell > :not(.play-area){flex-shrink:0}
.play-area{flex:0 1 auto;min-height:0;height:calc(min(calc(100vw - 28px),408px) + 27px);width:min(100%,408px);display:flex;flex-direction:column;align-items:center}
.board-tray{flex:1 1 auto;min-height:0;height:0;width:auto;max-width:100%;aspect-ratio:1}
.status{flex:0 0 27px;width:100%}
.shell>.member-bar span{color:var(--cream);text-shadow:0 1px 3px #201413}
#toast{transition:opacity .18s,transform .18s}
@media(max-height:730px){.status{flex-basis:23px}.play-area{height:calc(min(calc(100vw - 28px),408px) + 23px)}}
/* Wide short screens keep a usable board and let the controls scroll into view. */
@media(max-height:480px){html,body{height:auto;min-height:100%;overflow-y:auto;overflow-x:hidden}.shell{height:auto;min-height:100svh}.play-area{flex:none}}

/* Reserve a full row for Meimei and keep the playing surface square. */
.meimei-note {
  flex: 0 0 auto;
  min-height: 50px;
  height: auto;
  margin: 0 0 5px;
}

.meimei-note img {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  align-self: center;
}

.meimei-note p { min-width: 0; }
.round-btn { width: 44px; height: 44px; }
.topline { min-height: 44px; }
.brand { display: inline-flex; align-items: center; min-height: 44px; }
.btn, .text-btn, .result-panel .result-actions .text-btn,
.game-links > a, .game-links > button { min-height: 44px; }
.panel .close { min-width: 44px; min-height: 44px; }
.footer { width: 100%; }
#toast { max-width: min(280px, calc(100vw - 16px)); white-space: normal; }

@media (max-width: 590px), (max-height: 500px) and (orientation: landscape) {
  html, body { height: auto; min-height: 100%; overflow-y: auto; overflow-x: hidden; }
  .shell {
    height: auto;
    min-height: 100svh;
    padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
             max(5px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .play-area {
    flex: none;
    height: auto;
    width: min(100%, 432px);
    margin-top: 9px;
  }

  .board-tray {
    flex: none;
    width: 100%;
    height: auto;
    padding: 4px;
    border-width: 2px;
    border-radius: 17px;
  }

  .board { border-radius: 12px; }
  .tile { padding: 0; }
  .status {
    flex: none;
    height: auto;
    min-height: 24px;
    padding: 3px 2px;
    text-align: center;
    white-space: normal;
  }
}

@media (max-width: 590px) and (orientation: portrait) {
  .shell { justify-content: center; }
  .hud { max-width: 432px; }
  .game-links { min-height: 44px; }
}

@media (max-height: 500px) and (orientation: landscape) and (min-width: 650px) {
  .shell {
    --board-width: min(428px, calc(100svh - 39px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    display: grid;
    width: min(100%, 824px);
    grid-template-columns: minmax(0, 372px) var(--board-width);
    grid-template-rows: auto auto auto 1fr;
    gap: 0 18px;
    align-content: center;
    align-items: center;
    justify-items: center;
  }

  .shell > * { grid-column: 1; }
  .shell .play-area { grid-column: 2; grid-row: 1 / span 4; width: 100%; }
  .shell .header { grid-row: 1; padding-top: 4px; }
  .shell .meimei-note { grid-row: 2; margin-top: 8px; }
  .shell .footer { grid-row: 3; }
  .desktop-note { display: none; }
  .header h1 { font-size: clamp(29px, 4.2vw, 40px); }
}

@media (max-width: 590px) and (max-height: 760px) and (orientation: portrait) {
  .header h1 { font-size: 30px; margin-bottom: 5px; }
  .hud { height: 55px; }
  .goals { height: 34px; }
  .play-area { margin-top: 7px; }
  .status { min-height: 22px; }
  .meimei-note { min-height: 44px; margin-bottom: 3px; }
  .meimei-note img { flex-basis: 44px; width: 44px; height: 44px; }
}

/* Keep the board readable when a food image has not reached the device. */
.food-fallback {
  display: inline-grid;
  place-items: center;
  aspect-ratio: 1;
  width: 72%;
  border: 1px solid #c9a481;
  border-radius: 50%;
  color: #65432d;
  background: #f5dcba;
  font: 800 16px/1 system-ui, sans-serif;
}
.goal .food-fallback { width: 27px; flex: none; }
.food-fallback:has(+ img:not([hidden])), img[data-match-food][hidden] { display: none; }
