@font-face{font-family:Nunito;src:url('./assets/fonts/nunito-latin.woff2') format('woff2');font-weight:400 900;font-style:normal;font-display:swap}
:root{--bg:#f8f3e9;--ink:#172e50;--muted:#687386;--line:#d9d9cf;--hot:#264e9d;--soft:#edf0f6;color-scheme:light}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;height:100%;background:var(--bg);color:var(--ink);font-family:Nunito,ui-rounded,"Hiragino Sans","Yu Gothic","PingFang SC","Malgun Gothic",system-ui,sans-serif}body{display:flex;flex-direction:column;height:100dvh;overflow:hidden}button,select,textarea{font:inherit}button{cursor:pointer;color:inherit}button:disabled{cursor:default}a{color:inherit}button:focus-visible,a:focus-visible,select:focus-visible,textarea:focus-visible,canvas:focus-visible{outline:3px solid #e17948;outline-offset:3px}[hidden],.hide{display:none!important}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;clip:rect(0,0,0,0);overflow:hidden;white-space:nowrap}
.app-header{flex:none;height:59px;display:flex;align-items:center;gap:18px;padding:5px 22px;border-bottom:1px solid #d4cbbb;background:#fbf7ef;z-index:6}.brand{display:flex;align-items:center;gap:8px;text-decoration:none;font-size:18px;font-weight:900;white-space:nowrap}.brand svg{color:var(--hot)}h1{font-size:20px;font-weight:900;letter-spacing:-.4px;line-height:1.2;margin:0;padding-inline-start:18px;border-inline-start:1px solid #a8acaf;min-width:0}.header-tools{display:flex;gap:7px;align-items:center;margin-inline-start:auto}.icon-button{display:flex;align-items:center;justify-content:center;width:37px;height:37px;background:#fffaf2;border:1px solid #c6c7c8;border-radius:12px;font-size:21px;font-weight:800;flex-shrink:0;line-height:1}.icon-button:hover{background:#e7edf7}.language-select{display:flex;align-items:center;position:relative;max-width:150px}.language-select select{appearance:none;border:1px solid #c6c7c8;border-radius:12px;background:#fffaf2;color:var(--ink);height:37px;padding:0 30px 0 12px;font-size:13px;font-weight:800;max-width:150px;cursor:pointer}.language-select>span:last-child{position:absolute;inset-inline-end:10px;pointer-events:none;font-weight:900;top:5px}.language-select:dir(rtl) select{padding:0 12px 0 30px}
.game-app{display:flex;flex:1;flex-direction:column;min-height:0}.top{flex:none;padding:12px 20px 0;background:var(--bg)}.steps{display:flex;justify-content:center;gap:20px;list-style:none;padding:0;margin:0 auto;max-width:650px}.steps li{display:flex;gap:8px;align-items:center;font-size:13px;font-weight:800;line-height:1.3;color:#7d8390;min-width:0}.steps b{width:25px;height:25px;display:inline-flex;align-items:center;justify-content:center;background:#fdfaf4;border:1px solid #b3b7c0;border-radius:50%;font-size:13px;flex-shrink:0}.steps .active{color:var(--hot)}.steps .active b{color:white;background:var(--hot);border-color:var(--hot);box-shadow:0 0 0 3px #264e9d13}.steps .done{color:var(--hot)}.steps .done b{background:#e6ebf1;border-color:#c3cddd}#guide{flex:none;text-align:center;font-size:13px;font-weight:800;padding:10px 20px;line-height:1.45;min-height:39px;background:var(--bg)}
#stageBox{flex:1;position:relative;min-height:160px;touch-action:none;overflow:hidden;background:#dcc5a2}#stageBox canvas{position:absolute;inset:0;display:block;touch-action:none;user-select:none;-webkit-user-select:none}#meter{position:absolute;inset-inline-start:12px;top:12px;z-index:3;border:1px solid #e3ddd4;background:#fffaf0ed;border-radius:13px;padding:7px 11px;font-size:12px;font-weight:700;line-height:1.6;pointer-events:none;box-shadow:0 3px 15px #5d421518;max-width:calc(100% - 24px)}#meter:empty{display:none}#meter b{color:var(--hot);font-weight:900;unicode-bidi:isolate;direction:ltr;display:inline-block}#viewBtns{position:absolute;inset-inline-end:10px;bottom:10px;z-index:4;display:grid;grid-template-columns:repeat(2,33px);gap:5px}#viewBtns button{width:33px;height:31px;border:1px solid #bdc0bf;border-radius:10px;background:#fffaf0ed;color:var(--ink);font-weight:800;font-size:16px;padding:0;touch-action:manipulation}#viewBtns button:hover{background:#e7edf7}#viewBtns button[data-v="0"]{grid-column:span 2;width:auto}#boot-state{position:absolute;inset:0;z-index:5;display:flex;align-items:center;justify-content:center;flex-direction:column;background:#f7f2e8;text-align:center;padding:30px;font-size:15px}.boot-spinner{width:30px;height:30px;border:3px solid #d8dfea;border-top-color:var(--hot);border-radius:50%;animation:spin 1s linear infinite}
#foot{flex:none;display:flex;flex-direction:column;gap:8px;padding:9px 20px max(6px,env(safe-area-inset-bottom));background:#faf6ec;border-top:1px solid #ded6c8}.row{display:flex;gap:10px}.btn{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;border:1px solid #bac3cd;border-radius:12px;padding:11px 15px;background:#fffcf5;color:var(--ink);font-size:15px;font-weight:900;line-height:1.35;touch-action:manipulation;box-shadow:0 2px 0 #b7b9bb;transition:background .15s,transform .15s;text-align:center}.btn.go{background:var(--hot);color:#fff;border-color:var(--hot);box-shadow:0 3px 0 #173676}.btn:hover{background:#e8eef7}.btn.go:hover{background:#1a3b7c}.btn:active{transform:translateY(2px);box-shadow:none}.btn:disabled{opacity:.4;box-shadow:none}.btn.secondary{flex:0 1 28%;font-size:13px}#navRow{max-width:770px;width:100%;margin-inline:auto}.tray{display:flex;gap:9px;overflow-x:auto;overflow-y:hidden;padding:3px 2px 7px;scrollbar-width:thin;scrollbar-color:#bdc9d9 transparent;touch-action:pan-x;max-width:100%;scroll-snap-type:x proximity;justify-content:safe center}.it{position:relative;flex:0 0 91px;min-width:0;min-height:87px;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:3px;padding:5px 5px 6px;border:1px solid #e0d7c9;border-radius:14px;background:#fffaf1;color:var(--ink);box-shadow:0 2px 0 #c6c3bb;font:inherit;scroll-snap-align:center}.it.sel{border:2px solid #2d59b5;background:#edf2fa;padding:4px 4px 5px;box-shadow:0 2px 0 #2d59b5}.it.sel::after{content:'✓';position:absolute;inset-inline-end:-3px;top:-3px;display:flex;align-items:center;justify-content:center;width:19px;height:19px;background:var(--hot);border:2px solid #fff9ed;border-radius:50%;color:#fff;font-size:11px;font-weight:900}.ingredient-icon{display:block;width:48px;height:48px;flex-shrink:0;background-image:url('./assets/ingredient-atlas-ui-v2.webp');background-size:500% 400%;background-repeat:no-repeat}.ingredient-label{font-size:11px;font-weight:800;line-height:1.2;max-width:100%;overflow-wrap:anywhere;text-align:center}.privacy-button{align-self:center;border:0;background:none;font-size:10px;color:#677185;min-height:22px;padding:1px 10px;text-decoration:underline;text-underline-offset:3px}
#toast{position:fixed;left:50%;top:135px;transform:translateX(-50%);z-index:30;background:#173158ed;color:#fff;font-size:13px;font-weight:800;line-height:1.5;text-align:center;max-width:calc(100% - 30px);padding:10px 17px;border-radius:14px;opacity:0;transition:opacity .2s;pointer-events:none}#toast.on{opacity:1}#res{position:fixed;inset:0;pointer-events:none;display:flex;align-items:flex-end;justify-content:center;z-index:8;padding:12px 16px max(16px,env(safe-area-inset-bottom))}#res .card{pointer-events:auto;overflow:auto;max-height:66dvh;width:100%;max-width:440px;background:#fffaf0f5;border:1px solid #d4d5d1;border-radius:23px;padding:19px 20px 20px;text-align:center;box-shadow:0 15px 60px #19283733;backdrop-filter:blur(16px)}.result-mark{font-size:10px;font-weight:900;letter-spacing:2px;color:#7283a0;margin-bottom:6px}#res .nm{font-size:23px;line-height:1.3;font-weight:900;overflow-wrap:anywhere}#res .stars{font-size:29px;color:#d58b2b;letter-spacing:3px;margin-top:5px}#res .say{color:var(--hot);font-size:14px;font-weight:900;line-height:1.5;margin:5px 0 8px}#res .pr{font-size:11px;line-height:1.7;color:var(--muted);margin:0 0 15px}#res .row{gap:8px}.result-secondary{margin-top:10px}.result-secondary .btn{font-size:12px;min-height:38px;background:#f4f0e6;border-color:#ddd7ca;box-shadow:none}
dialog{width:calc(100% - 32px);max-width:510px;max-height:85dvh;overflow:auto;background:var(--bg);color:var(--ink);border:1px solid #d5d3c8;border-radius:23px;padding:31px 28px;box-shadow:0 20px 80px #101b3140}dialog::backdrop{background:#172a4666;backdrop-filter:blur(5px)}dialog[open]{animation:arrive .2s ease both}dialog h2{font-size:26px;line-height:1.3;font-weight:900;letter-spacing:-.5px;margin:10px 0 18px}dialog p,dialog li{font-size:13px;line-height:1.9}dialog a{color:var(--hot);text-underline-offset:3px}.dialog-close{position:absolute;top:7px;inset-inline-end:9px;border:0;background:none;font-size:27px;width:41px;height:41px;color:var(--muted)}.dialog-kicker{font-size:10px;letter-spacing:2px;font-weight:900;color:var(--hot)}dialog>.btn{width:100%;margin-top:17px}.help-steps{list-style:none;margin:0;padding:0}.help-steps li{margin-bottom:13px}.help-tip{padding:13px 16px;border-radius:12px;background:#e9edf4;font-size:12px}#share-fallback-text{width:100%;padding:12px;resize:vertical;background:#fffaf0;border:1px solid #c8cdd1;border-radius:12px;color:var(--ink);font-size:14px;line-height:1.7}
@media(min-width:1000px){#foot{gap:8px}.tray{gap:11px}.it{flex-basis:98px;min-height:91px}.ingredient-icon{width:51px;height:51px}#navRow{max-width:640px}.app-header{padding-inline:30px}.top{padding-top:11px}}
@media(max-width:640px){.app-header{height:50px;padding-inline:12px;gap:8px}.brand span{display:none}.brand svg{width:25px;height:25px}h1{font-size:17px;border:0;padding:0;letter-spacing:-.5px}.header-tools{gap:5px}.icon-button{width:32px;height:32px;min-height:32px;border-radius:10px;font-size:19px}.desktop-tool{display:none}.language-select{max-width:103px}.language-select select{max-width:103px;height:32px;padding-inline-start:8px;padding-inline-end:23px;font-size:11px;border-radius:10px}.language-select>span:last-child{inset-inline-end:7px;top:3px}.top{padding:10px 12px 0}.steps{justify-content:space-between;gap:7px}.steps li{font-size:10px;gap:5px}.steps b{width:20px;height:20px;font-size:11px}.steps li span{line-height:1.1;overflow-wrap:anywhere}#guide{font-size:12px;padding:9px 16px;min-height:43px}#foot{padding:8px 12px max(4px,env(safe-area-inset-bottom));gap:7px}.tray{gap:7px;justify-content:flex-start}.it{flex-basis:76px;min-height:83px;padding:4px 4px 5px}.it.sel{padding:3px 3px 4px}.ingredient-icon{width:43px;height:43px}.ingredient-label{font-size:10px;line-height:1.25}.btn{font-size:14px;min-height:43px;padding:10px 12px}.btn.secondary{flex-basis:31%;font-size:12px}#viewBtns{inset-inline-end:7px;bottom:7px;grid-template-columns:repeat(2,30px);gap:4px}#viewBtns button{width:30px;height:29px;font-size:14px}#meter{top:8px;inset-inline-start:8px;font-size:10px;max-width:calc(100% - 16px);padding:6px 9px;border-radius:11px}.privacy-button{min-height:18px;font-size:9px}#res .card{padding:17px 16px;max-height:70dvh}#res .nm{font-size:21px}#res .say{font-size:13px}dialog{padding:30px 22px}dialog h2{font-size:24px}}
@media(max-width:359px){h1{font-size:15px}.app-header{padding-inline:10px;gap:6px}.language-select,.language-select select{max-width:89px}.header-tools{gap:4px}.steps li{font-size:9px;gap:4px}.steps b{width:18px;height:18px;font-size:10px}.steps{gap:5px}#guide{font-size:11px;padding-inline:12px}.it{flex-basis:71px}.ingredient-label{font-size:10px}.btn.secondary{font-size:11px}}
@media(max-height:560px){.app-header{height:45px}.top{padding-top:6px}.steps b{width:19px;height:19px}#guide{padding-block:5px;min-height:27px}#foot{gap:5px;padding-top:5px}.it{min-height:64px;flex-basis:82px}.ingredient-icon{width:34px;height:34px}.ingredient-label{font-size:10px}.btn{min-height:35px;padding-block:7px}.privacy-button{display:none}#stageBox{min-height:120px}}
@keyframes spin{to{transform:rotate(360deg)}}@keyframes arrive{from{opacity:.5;transform:translateY(7px)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
/* Game-first workspace: controls use the side rail on larger screens. */
:root{--control-rail:208px}
.app-header{height:44px;padding:4px 14px;gap:12px}.brand{font-size:15px}h1{font-size:17px;padding-inline-start:12px}.icon-button{width:32px;height:32px;font-size:19px;border-radius:9px}.language-select select{height:32px}.language-select>span:last-child{top:3px}
.game-app{position:relative;min-width:0}.play-status{position:absolute;inset-block-start:8px;inset-inline:10px;z-index:4;display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:4px 8px;pointer-events:none}.play-status .top{padding:6px 9px;border-radius:11px;background:#fbf7efed;border:1px solid #d4cbbb80}.steps{gap:12px}.steps li{font-size:11px;gap:5px}.steps b{width:21px;height:21px;font-size:11px}#guide{padding:7px 10px;min-height:0;max-width:100%;font-size:12px;line-height:1.35;background:#fbf7efed;border:1px solid #d4cbbb80;border-radius:11px}#stageBox{min-width:0}#meter{top:auto;bottom:10px;max-width:calc(100% - 90px)}
#foot{padding:6px 10px max(4px,env(safe-area-inset-bottom));gap:5px}.tray{gap:6px;padding:2px 2px 5px}.it{flex-basis:74px;min-height:66px;border-radius:10px;padding:3px}.it.sel{padding:2px}.ingredient-icon{width:37px;height:37px}.ingredient-label{font-size:10px;line-height:1.15}.btn{min-height:40px;padding:8px 10px;font-size:13px}#navRow{max-width:none}.btn.secondary{font-size:12px}.privacy-button{min-height:15px;padding-block:0;font-size:9px}
.is-embedded .brand,.is-embedded .app-header h1{display:none}
@media(min-width:900px){
 .game-app{display:grid;grid-template-columns:minmax(0,1fr) var(--control-rail);grid-template-rows:minmax(0,1fr)}
 #stageBox{grid-column:1;grid-row:1;min-height:0}
 .play-status{inset-inline-end:calc(var(--control-rail) + 10px)}
 #foot{grid-column:2;grid-row:1;min-height:0;overflow:hidden;border-top:0;border-inline-start:1px solid #ded6c8;padding:10px;gap:8px}
 #panel{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin}
 .tray{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;justify-content:stretch;gap:7px;overflow:visible;padding:3px 2px 7px;scroll-snap-type:none}
 .it{width:100%;min-height:76px;flex-basis:auto;padding:4px}.it.sel{padding:3px}.ingredient-icon{width:41px;height:41px}.ingredient-label{font-size:11px;line-height:1.15}
 #navRow{display:grid;grid-template-columns:1fr;gap:7px}.privacy-button{min-height:20px;font-size:10px}
 .is-embedded .app-header{position:absolute;inset-block-start:8px;inset-inline-end:10px;width:calc(var(--control-rail) - 20px);height:auto;padding:0;border:0;background:transparent;z-index:6}
 .is-embedded .header-tools{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;width:100%;margin:0}
 .is-embedded .language-select{grid-column:1/-1;width:100%;max-width:none}.is-embedded .language-select select{width:100%;max-width:none}
 .is-embedded .header-tools .icon-button{width:100%}
 .is-embedded #foot{padding-block-start:92px}
 #res{inset-block:52px 0;inset-inline:auto 0;width:var(--control-rail);padding:8px;align-items:flex-start;justify-content:flex-start}
 .is-embedded #res{inset-block-start:90px}
 #res .card{width:100%;max-height:100%;padding:12px 7px;border:0;border-radius:0;box-shadow:none;backdrop-filter:none;background:var(--bg)}
 #res .nm{font-size:20px}#res .stars{font-size:25px;letter-spacing:1px}#res .say{font-size:13px}#res .pr{font-size:10px}
 #res .row{display:grid;grid-template-columns:1fr;gap:7px}#res .result-secondary{grid-template-columns:1fr}
}
@media(max-width:899px){
 .app-header{height:40px;padding-inline:10px;gap:8px}.brand span{display:none}.brand svg{width:24px;height:24px}h1{font-size:16px;border:0;padding:0}.header-tools{gap:5px}.desktop-tool{display:none}.language-select,.language-select select{max-width:108px}.language-select select{font-size:11px;padding-inline-start:8px;padding-inline-end:23px}.language-select>span:last-child{inset-inline-end:7px}
 .is-embedded .app-header{height:37px}.is-embedded .header-tools{margin-inline-start:auto}
 .play-status{flex-direction:column;gap:4px;inset-inline:8px}.play-status .top{padding:4px 7px}.steps{gap:9px}.steps li{font-size:10px;gap:4px}.steps b{width:18px;height:18px;font-size:10px}#guide{font-size:11px;padding:5px 8px;max-width:100%}
 #foot{gap:4px}.tray{justify-content:flex-start}.btn.secondary{flex-basis:29%;font-size:11px}#viewBtns{inset-inline-end:7px;bottom:7px;grid-template-columns:repeat(2,29px);gap:4px}#viewBtns button{width:29px;height:28px;font-size:14px}
}
@media(max-width:359px){.app-header{gap:5px;padding-inline:8px}h1{font-size:14px}.language-select,.language-select select{max-width:89px}.steps{gap:6px}.steps li{font-size:9px}.ingredient-label{font-size:10px}.it{flex-basis:70px}#foot{padding-inline:8px}}

/* Phone / iPad viewport and readable, scrollable ranking sheets. */
#app{min-height:0}dialog{max-width:calc(100% - 16px);max-height:calc(100dvh - 16px);overflow:auto}dialog td{overflow-wrap:anywhere}dialog input{font-size:16px}
@media(max-height:380px) and (min-width:600px){.app-header{height:36px}.top{padding-top:3px}#guide{padding-block:3px;min-height:22px}#stageBox{min-height:80px}.it{min-height:48px;flex-basis:70px}.ingredient-icon{height:27px;width:27px}#foot{padding-block:3px;gap:3px}#navRow .btn{min-height:30px;padding-block:4px}}
