/* ==========================================================================
   v10 popups — same Western animated color-block look as the menus and kitchen.
   Cream panel with a thick white keyline, violet title ribbon, round red close,
   green main button, violet second button, white tiles. Scrollbars are hidden:
   the panel is dragged anywhere to scroll (see enableDragScroll in main.js).
   ========================================================================== */
#stage .overlay{background:#24154fd9;backdrop-filter:none;font-family:var(--x-font);}
#stage .modal{--m-paper:#fff6e3;--m-tile:#ffffff;--m-edge:#ecd3a4;--m-ink:#4a2a12;--m-soft:#8b6238;
 border:4px solid #fff;border-radius:30px;background:var(--m-paper);color:var(--m-ink);
 box-shadow:0 8px 0 var(--x-violet-3),0 20px 44px #0008;scrollbar-width:none;overscroll-behavior:contain;touch-action:pan-y;}
#stage .modal::-webkit-scrollbar,#stage .modal .journal-scroll::-webkit-scrollbar{display:none;}
#stage .modal .journal-scroll{padding-right:0;scrollbar-width:none;overscroll-behavior:contain;touch-action:pan-y;}
#stage .modal :is(p,small,.modal-subtitle,.inline-note,.section-label,.pause-instructions,.help-tips,.journal-footnote){color:var(--m-soft);text-shadow:none;}
#stage .modal :is(h2,h3,b,strong){color:var(--m-ink);text-shadow:none;}
#stage .modal h2{font-weight:1000;letter-spacing:.5px;}

/* Title ribbon and close button */
#stage .modal>.dialog-title,#stage :is(.level-modal,.shop-modal,.upgrade-modal,.chest-modal,.result-modal)>.dialog-title{
 border:0;border-radius:24px 24px 20px 20px;background:linear-gradient(var(--x-violet-1),var(--x-violet-2));box-shadow:0 5px 0 var(--x-violet-3);
 color:#fff;font-weight:1000;letter-spacing:2px;text-shadow:none;-webkit-text-stroke:5px var(--x-violet-3);paint-order:stroke fill;}
#stage .modal>.dialog-title>span{color:#fff;}
#stage .result-modal>.dialog-title{background:linear-gradient(var(--x-orange-1),var(--x-orange-2));box-shadow:0 5px 0 var(--x-orange-3);-webkit-text-stroke-color:var(--x-orange-3);}
#stage .modal .modal-close{border:3px solid #fff;border-radius:50%;background:linear-gradient(#ff7b62,#f0492f);box-shadow:0 4px 0 #9c2413;color:#fff;}
#stage .modal .modal-close:active{transform:translateY(3px);box-shadow:0 1px 0 #9c2413;}
#stage .modal .modal-close>svg{filter:none;}

/* Buttons */
#stage .modal :is(.primary,.secondary,.plate-danger,.journal-claim){position:relative;border:3px solid #fff;border-radius:999px;font-family:var(--x-font);font-weight:1000;letter-spacing:1px;color:#fff;text-shadow:none;
 -webkit-text-stroke:4px var(--btn-edge);paint-order:stroke fill;background:linear-gradient(var(--btn-1),var(--btn-2));box-shadow:0 6px 0 var(--btn-edge),0 10px 14px #0003;}
#stage .modal .primary,#stage .modal .journal-claim.ready{--btn-1:var(--x-green-1);--btn-2:var(--x-green-2);--btn-edge:var(--x-green-3);}
#stage .modal .secondary{--btn-1:var(--x-violet-1);--btn-2:var(--x-violet-2);--btn-edge:var(--x-violet-3);}
#stage .modal :is(.plate-danger,.reset-progress.secondary){--btn-1:#ff7b62;--btn-2:#f0492f;--btn-edge:#9c2413;}
#stage .modal :is(.primary,.secondary,.plate-danger,.journal-claim):active:not(:disabled){transform:translateY(5px);box-shadow:0 1px 0 var(--btn-edge);}
#stage .modal :is(.primary,.secondary,.plate-danger,.journal-claim):disabled{--btn-1:#d9d2c6;--btn-2:#bdb4a5;--btn-edge:#8d8475;opacity:1;filter:none;color:#fff;}
#stage .modal :is(.primary,.secondary,.plate-danger)>svg{filter:drop-shadow(0 2px 0 var(--btn-edge));}
#stage .modal :is(.primary,.secondary,.plate-danger)>.utility-icon{filter:none;}
#stage .modal .text-button{border:0;background:none;box-shadow:none;color:var(--x-violet-2);font-family:var(--x-font);font-weight:900;text-decoration:underline;text-underline-offset:4px;-webkit-text-stroke:0;}
#stage .modal .modal-actions{background:linear-gradient(#fff6e300,var(--m-paper) 26%);border:0;box-shadow:none;}
#stage .modal .inline-note{font-weight:700;}

/* Generic white tiles */
#stage .modal :is(.level-facts,.level-rules,.stage-picker button,.booster,.upgrade-card,.upgrade-compare>div,.setting-rows>button,.treasure-item,.district-preview,.district-stages button,.city-stats>div,
 .help-steps>div,.help-tips,.result-stats,.result-rewards>div,.result-details,.first-reward,.unlock-notice,.plate-action,.plate-choice,.plate-preview,.pause-instructions,.selection-note,.keyboard-guide,
 .journal-card,.journal-summary>div,.recipe-card,.record-row,.achievement-card,.chapter-record,.node-record){
 border:0;border-radius:20px;background:var(--m-tile);box-shadow:0 4px 0 var(--m-edge);color:var(--m-ink);}
#stage .modal button:is(.booster,.upgrade-card,.treasure-item,.plate-action,.plate-choice):active:not(:disabled),#stage .modal :is(.stage-picker,.district-stages,.setting-rows)>button:active:not(:disabled){transform:translateY(3px);box-shadow:0 1px 0 var(--m-edge);}

/* ---------------- Level popup ---------------- */
#stage .modal .mobile-level-title{font-weight:1000;color:var(--m-ink);letter-spacing:2px;}
#stage .modal .stage-picker button{font-family:var(--x-font);font-weight:900;}
#stage .modal .stage-picker button>span{color:var(--m-ink);}
#stage .modal .stage-picker button.selected{background:linear-gradient(var(--x-orange-1),#ffb347);box-shadow:0 5px 0 var(--x-orange-3),0 0 0 3px #fff;}
#stage .modal .stage-picker button.selected :is(span,small){color:#5a2a05;}
#stage .modal .stage-picker button:disabled{background:#ebe3d5;box-shadow:0 4px 0 #cfc4b0;opacity:1;filter:none;}
#stage .modal .level-facts>div{border-color:#f1e2c4;}
#stage .modal .level-facts b{font-weight:1000;}
#stage .modal .menu-mini{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:6px;width:100%;max-width:none;height:auto;}
#stage .modal .menu-mini>:is(svg,.iced-drink){width:48px;height:48px;flex:none;}
#stage .modal .level-rules{background:#fff3c9;box-shadow:0 4px 0 #f0cf7a;}
#stage .modal .level-rules>b{font-size:15px;line-height:20px;color:#a35b00;font-weight:1000;}
#stage .modal .level-rules>div{margin:6px 0;flex-wrap:wrap;gap:6px;}
#stage .modal .level-rules span{border:0;border-radius:12px;padding:4px 10px;background:#fff;color:var(--m-ink);box-shadow:0 2px 0 #f0cf7a;font-size:14px;line-height:20px;font-weight:800;white-space:normal;}
#stage .modal .section-label{font-weight:900;color:var(--m-ink);}
#stage .modal .section-label>span{color:var(--m-soft);font-weight:700;}
#stage .modal .booster{font-family:var(--x-font);}
#stage .modal .booster.chosen{background:linear-gradient(#e9ffc4,#c8f08a);box-shadow:0 5px 0 var(--x-green-3),0 0 0 3px #fff;}
#stage .modal .booster:disabled{background:#ebe3d5;box-shadow:0 4px 0 #cfc4b0;opacity:1;filter:none;}
#stage .modal .booster>span{display:inline-flex;align-items:center;gap:4px;padding:2px 10px 2px 6px;border:0;border-radius:12px;background:var(--x-violet-2);color:#fff;font-weight:900;}
#stage .modal .booster>span>svg{position:static;width:18px;height:18px;margin:0;}
#stage .modal .selection-note{background:#e9ffc4;box-shadow:0 3px 0 #b6dd77;}

/* ---------------- Upgrade workshop ---------------- */
#stage .modal .shop-grid{border:0;border-radius:22px;background:#ffe2b3;box-shadow:inset 0 4px 0 #f3c98a;}
#stage .modal .upgrade-card{font-family:var(--x-font);overflow:visible;}
#stage .modal .upgrade-card.recommended{box-shadow:0 5px 0 var(--x-orange-3),0 0 0 4px var(--x-orange-1);}
#stage .modal .upgrade-card:disabled{background:#f1ebe0;opacity:1;filter:none;}
#stage .modal .upgrade-art{border:0;background:none;box-shadow:none;}
#stage .modal .upgrade-art>svg{filter:drop-shadow(0 4px 0 #0000001a);}
#stage .modal .upgrade-art>span{border:2px solid #fff;border-radius:12px;background:var(--x-violet-2);color:#fff;font-weight:900;box-shadow:0 2px 0 var(--x-violet-3);}
#stage .modal .upgrade-art{position:relative;}
#stage .modal .upgrade-art>span{position:absolute;top:-4px;left:-24px;right:auto;bottom:auto;transform:none;margin:0;padding:1px 8px;font-size:13px;line-height:18px;}
#stage .modal .upgrade-card>b{align-self:center;margin:6px 0 0;font-weight:1000;text-align:center;}
#stage .modal .upgrade-value{color:var(--m-ink);font-weight:900;}
#stage .modal .upgrade-price{border:3px solid #fff;border-radius:999px;background:linear-gradient(var(--x-green-1),var(--x-green-2));box-shadow:0 4px 0 var(--x-green-3);color:#fff;font-weight:1000;
 -webkit-text-stroke:3px var(--x-green-3);paint-order:stroke fill;text-shadow:none;}
#stage .modal .upgrade-card:disabled .upgrade-price{background:linear-gradient(#d9d2c6,#bdb4a5);box-shadow:0 4px 0 #8d8475;-webkit-text-stroke-color:#8d8475;}
#stage .modal .journal-shortcut .upgrade-price{background:linear-gradient(var(--x-violet-1),var(--x-violet-2));box-shadow:0 4px 0 var(--x-violet-3);-webkit-text-stroke-color:var(--x-violet-3);}
#stage .modal .upgrade-compare>div{background:#fff;}
#stage .modal .upgrade-compare>div:last-child{background:linear-gradient(#e9ffc4,#c8f08a);box-shadow:0 4px 0 var(--x-green-3);}
#stage .modal .upgrade-compare>svg{color:var(--x-orange-2);}

/* ---------------- Settings ---------------- */
#stage .modal .setting-rows{border:0;background:none;box-shadow:none;}
#stage .modal .setting-rows>button{font-family:var(--x-font);font-weight:900;}
#stage .modal .setting-rows>button>span:first-child>svg{color:var(--x-violet-2);}
#stage .modal .setting-rows>button>svg{color:#c9a56e;}
#stage .modal .setting-rows>button.reset-progress{color:#c2331c;}
#stage .modal .setting-rows>button.reset-progress svg{color:#f0492f;}
#stage .modal .toggle{border:3px solid #fff;border-radius:999px;background:#cfc4b0;box-shadow:0 2px 0 #a99c84;}
#stage .modal .toggle.on{background:var(--x-green-2);box-shadow:0 2px 0 var(--x-green-3);}
#stage .modal .toggle:after,#stage .modal .toggle:before{background:#fff;border:0;box-shadow:0 2px 0 #0002;}
#stage .modal .legal-links a,#stage .modal .legal-settings-links a{color:var(--x-violet-2);font-weight:900;}

/* ---------------- Street, district, treasure ---------------- */
#stage .modal .district-preview b{font-weight:1000;}
#stage .modal .district-preview>div{display:grid;grid-template-columns:repeat(3,34px);justify-content:center;align-content:center;gap:2px 2px;text-align:center;}
#stage .modal .district-preview>div>:is(b,p){grid-column:1/-1;margin:0;}
#stage .modal .district-preview>div>.star{width:34px;height:34px;}
#stage .modal .district-preview>div>.star>svg{width:100%;height:100%;}
#stage .modal .city-growth{display:flex;align-items:center;justify-content:center;gap:2px;overflow:visible;}
#stage .modal .city-growth>.building-art{width:86px;height:86px;flex:none;}
#stage .modal .city-growth>.utility-icon{width:22px;height:22px;flex:none;}
#stage .modal .district-stages button{font-family:var(--x-font);}
#stage .modal .district-stages button>b{font-weight:1000;font-size:26px;}
#stage .modal .district-stages button:disabled{background:#ebe3d5;box-shadow:0 4px 0 #cfc4b0;opacity:1;}
#stage .modal .city-growth>svg.utility-icon{color:var(--x-orange-2);}
#stage .modal .city-stats strong{font-weight:1000;}
#stage .modal .treasure-item{font-family:var(--x-font);}
#stage .modal .treasure-item b{font-weight:1000;}
#stage .modal .chest-rewards>*,#stage .modal .first-reward{font-weight:1000;}
#stage .modal .language-choice{border:3px solid #fff;border-radius:20px;background:linear-gradient(var(--x-violet-1),var(--x-violet-2));box-shadow:0 5px 0 var(--x-violet-3);color:#fff;font-family:var(--x-font);font-weight:1000;}
#stage .modal .language-choice :is(b,span,small){color:#fff;}

/* ---------------- Help ---------------- */
#stage .modal .help-steps>div>b{font-weight:1000;color:var(--x-violet-2);}
#stage .modal .help-tips{background:#fff;}
#stage .modal .keyboard-guide kbd,#stage .modal kbd{border:0;border-radius:8px;background:var(--x-violet-2);color:#fff;box-shadow:0 2px 0 var(--x-violet-3);}

/* ---------------- Result ---------------- */
#stage .modal .result-cat{filter:none;}
#stage .modal .result-perfect{border:3px solid #fff;border-radius:18px;background:linear-gradient(var(--x-orange-1),#ffb347);box-shadow:0 4px 0 var(--x-orange-3);color:#5a2a05;font-weight:1000;}
#stage .modal .result-perfect span{color:#5a2a05;}
#stage .modal .result-rewards>div>b{font-weight:1000;}
#stage .modal .result-details>summary{font-weight:900;color:var(--x-violet-2);}
#stage .modal .result-stats{box-shadow:none;background:none;}
#stage .modal .result-stats>div{border-color:#f1e2c4;}
#stage .modal .result-journal{border:0;border-radius:18px;background:#fff3c9;box-shadow:0 4px 0 #f0cf7a;color:var(--m-ink);font-family:var(--x-font);font-weight:900;}
#stage .modal .result-journal:active{transform:translateY(3px);box-shadow:0 1px 0 #f0cf7a;}
#stage .modal .unlock-notice{background:#e9ffc4;box-shadow:0 3px 0 #b6dd77;color:#2f6a0c;font-weight:900;}
#stage .modal .first-reward{background:#fff3c9;box-shadow:0 3px 0 #f0cf7a;}

/* ---------------- Pause and plates ---------------- */
#stage .modal .pause-toggles .text-button{text-decoration:none;}
#stage .modal .pause-instructions{background:#fff;}
#stage .modal .plate-preview h2{font-weight:1000;}
#stage .modal .plate-action,#stage .modal .plate-choice{font-family:var(--x-font);font-weight:900;}
#stage .modal .plate-action:disabled{background:#ebe3d5;box-shadow:0 4px 0 #cfc4b0;opacity:1;}
#stage .modal .plate-lock{background:#fff;}
#stage .modal .plate-match{font-weight:900;color:var(--x-green-3);}

/* ---------------- Journal ---------------- */
#stage .modal .journal-tabs{border:0;border-radius:999px;background:#f0dcb6;box-shadow:inset 0 3px 0 #dcc294;}
#stage .modal .journal-tabs>button{border:0;border-radius:999px;background:none;box-shadow:none;color:var(--m-soft);font-family:var(--x-font);font-weight:900;}
#stage .modal .journal-tabs>button:is(.selected,[aria-selected="true"]){background:linear-gradient(var(--x-orange-1),var(--x-orange-2));box-shadow:0 3px 0 var(--x-orange-3),0 0 0 3px #fff;color:#fff;-webkit-text-stroke:3px var(--x-orange-3);paint-order:stroke fill;}
#stage .modal .journal-progress,#stage .modal .journal-progress-track{border:0;border-radius:999px;background:#e9d5ae;box-shadow:none;}
#stage .modal :is(.journal-progress,.journal-progress-track,.achievement-track)>i{border-radius:999px;background:linear-gradient(var(--x-green-1),var(--x-green-2));}
#stage .modal .journal-claim{font-size:15px;}

/* The ribbon already says it. */
#stage .language-modal>h2{display:none;}

/* ==========================================================================
   Wordless popups (level, result, pause): a picture and a number say it.
   The sentences stay in the page for screen readers (.w-sr).
   Green = go, violet = other places, orange = picked, red = fell short, grey = locked.
   ========================================================================== */
#stage .modal .w-sr{position:absolute !important;width:1px !important;height:1px !important;margin:-1px !important;padding:0 !important;overflow:hidden !important;clip:rect(0,0,0,0) !important;clip-path:inset(50%) !important;white-space:nowrap !important;border:0 !important;}
#stage .modal .w-title{display:inline-flex;align-items:center;justify-content:center;gap:6px;}
#stage .modal .w-title>b{color:#fff;font-size:34px;line-height:1;font-weight:1000;font-variant-numeric:tabular-nums;}
#stage .modal .w-title>svg{width:36px;height:36px;flex:none;}
#stage .modal .w-title>.utility-icon{width:30px;height:30px;}

#stage .modal .w-chip{display:inline-flex;align-items:center;gap:6px;min-width:0;color:var(--m-ink);}
#stage .modal .w-chip>svg{flex:none;}
#stage .modal .w-chip>b{font-size:22px;line-height:1;font-weight:1000;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--m-ink);}

/* ---- Level: three stages, goal and guests, menu, rules, helpers, go ---- */
#stage .modal .w-stages{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:8px 0 12px;}
#stage .modal .w-stage{position:relative;display:grid;justify-items:center;align-content:center;gap:3px;min-height:104px;padding:8px 4px;border:0;border-radius:20px;background:#fff;box-shadow:0 5px 0 var(--m-edge);
 font-family:var(--x-font);color:var(--m-ink);-webkit-text-stroke:0;}
#stage .modal .w-stage>b{font-size:32px;line-height:1;font-weight:1000;font-variant-numeric:tabular-nums;}
#stage .modal .w-stars{display:flex;align-items:center;justify-content:center;height:24px;}
#stage .modal .w-stars>svg{width:22px;height:22px;margin:0 -1px;}
#stage .modal .w-stage:not(.done) .w-stars>.icon-star{filter:grayscale(1) opacity(.5);}
#stage .modal .w-stage>em{display:inline-flex;align-items:center;gap:2px;height:24px;font-style:normal;font-weight:1000;font-size:16px;line-height:1;color:var(--m-soft);}
#stage .modal .w-stage>em>svg{width:22px;height:22px;}
#stage .modal .w-stage>em.done{width:24px;justify-content:center;border-radius:50%;background:var(--x-green-2);color:#fff;box-shadow:0 2px 0 var(--x-green-3);}
#stage .modal .w-stage>em.done>svg{width:15px;height:15px;}
#stage .modal .w-stage.selected{background:linear-gradient(var(--x-orange-1),#ffb347);box-shadow:0 5px 0 var(--x-orange-3),0 0 0 3px #fff;}
#stage .modal .w-stage.selected>em:not(.done){color:#5a2a05;}
#stage .modal .w-stage:active{transform:translateY(3px);box-shadow:0 2px 0 var(--m-edge);}

#stage .modal .w-facts{display:flex;justify-content:space-evenly;align-items:center;gap:10px;padding:10px 12px;border-radius:20px;background:#fff;box-shadow:0 4px 0 var(--m-edge);}
#stage .modal .w-facts .w-chip>svg{width:46px;height:46px;}
#stage .modal .w-facts .w-chip>b{font-size:32px;}
#stage .modal .w-menu{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin:10px 0 0;padding:8px;border-radius:20px;background:#fff;box-shadow:0 4px 0 var(--m-edge);}
#stage .modal .w-menu>:is(svg,.iced-drink){width:48px;height:48px;flex:none;}
#stage .modal .w-rules{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin:10px 0 0;padding:8px 10px;border-radius:20px;background:#fff3c9;box-shadow:0 4px 0 #f0cf7a;}
#stage .modal .w-rules .w-chip{padding:3px 12px 3px 5px;border-radius:18px;background:#fff;box-shadow:0 2px 0 #f0cf7a;}
#stage .modal .w-rules .w-chip:not(:has(b)){padding-right:5px;}
#stage .modal .w-rules .w-chip>svg{width:36px;height:36px;}

#stage .modal .w-boosters{display:flex;justify-content:center;gap:10px;margin:14px 0 0;}
#stage .modal .w-booster{position:relative;flex:1 1 0;max-width:124px;min-width:0;display:grid;justify-items:center;align-content:start;gap:4px;padding:8px 4px 10px;border:0;border-radius:20px;background:#fff;box-shadow:0 5px 0 var(--m-edge);
 font-family:var(--x-font);color:var(--m-ink);-webkit-text-stroke:0;}
#stage .modal .w-booster>svg{width:64px;height:64px;}
#stage .modal .w-booster .w-chip{gap:3px;height:28px;}
#stage .modal .w-booster .w-chip>svg{width:26px;height:26px;}
#stage .modal .w-booster .w-chip>b{font-size:17px;}
#stage .modal .w-cost{display:inline-flex;align-items:center;gap:3px;padding:2px 10px 2px 6px;border-radius:12px;background:var(--x-violet-2);color:#fff;font-weight:1000;font-size:15px;line-height:20px;}
#stage .modal .w-cost>svg{width:18px;height:18px;}
#stage .modal .w-booster.chosen{background:linear-gradient(#e9ffc4,#c8f08a);box-shadow:0 5px 0 var(--x-green-3),0 0 0 3px #fff;}
#stage .modal .w-booster:active:not(:disabled){transform:translateY(3px);box-shadow:0 2px 0 var(--m-edge);}
#stage .modal .w-booster:disabled{background:#ebe3d5;box-shadow:0 4px 0 #cfc4b0;opacity:1;filter:none;}
#stage .modal .w-booster:disabled>svg{filter:grayscale(1) opacity(.5);}
#stage .modal .w-booster:disabled .w-cost{background:#a79d8c;}
#stage .modal :is(.w-lock,.w-on){position:absolute;right:-5px;top:-7px;width:30px;height:30px;display:grid;place-items:center;border-radius:50%;pointer-events:none;}
#stage .modal .w-lock>svg{width:26px;height:26px;filter:drop-shadow(0 2px 0 #0003);}
#stage .modal .w-on{border:3px solid #fff;background:var(--x-green-2);color:#fff;box-shadow:0 3px 0 var(--x-green-3);}
#stage .modal .w-on>svg{width:15px;height:15px;}

/* ---- Buttons: one big green go button, square violet side buttons ---- */
#stage .modal .w-actions{display:flex;align-items:center;justify-content:center;gap:14px;margin:20px 0 8px;}
#stage .modal .w-row{display:flex;align-items:center;justify-content:center;gap:14px;}
#stage .modal .w-square{flex:none;width:72px;height:72px;min-width:0;min-height:0;padding:0;border-radius:24px;display:grid;place-items:center;-webkit-text-stroke:0;}
#stage .modal .w-square>svg{width:42px;height:42px;}
#stage .modal .w-square>.utility-icon{width:36px;height:36px;}
#stage .modal .w-go{flex:1 1 0;max-width:230px;min-width:0;height:76px;min-height:0;padding:0 18px;display:flex;align-items:center;justify-content:center;gap:10px;font-size:22px;}
#stage .modal .w-go>svg{width:46px;height:46px;flex:none;}
#stage .modal .w-go>em{display:inline-flex;align-items:center;gap:3px;font-style:normal;font-size:22px;line-height:1;font-weight:1000;font-variant-numeric:tabular-nums;}
#stage .modal .w-go>em>svg{width:24px;height:24px;}
#stage .modal .w-go>em.short{-webkit-text-stroke:0;padding:4px 10px 4px 12px;border-radius:14px;background:#f0492f;color:#fff;}
#stage .modal .w-journal{position:relative;flex:none;width:72px;height:72px;padding:0;border:0;border-radius:24px;display:grid;place-items:center;background:#fff3c9;box-shadow:0 5px 0 #f0cf7a;-webkit-text-stroke:0;}
#stage .modal .w-journal>svg{width:46px;height:46px;}
#stage .modal .w-journal>b{position:absolute;right:-7px;top:-7px;min-width:26px;height:26px;padding:0 6px;border:2px solid #fff;border-radius:13px;background:#f0492f;color:#fff;font-size:14px;line-height:22px;font-weight:1000;}
#stage .modal .w-journal:active{transform:translateY(3px);box-shadow:0 2px 0 #f0cf7a;}

/* ---- Result ---- */
#stage .result-modal .result-stars .star>svg{width:46px;height:46px;}
#stage .result-modal .result-stars .star:nth-child(2)>svg{width:58px;height:58px;}
#stage .result-modal .result-stars{display:flex;align-items:flex-end;justify-content:center;gap:4px;margin:6px 0 10px;}
#stage .result-modal .result-perfect{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:auto;min-height:0;margin:0 auto 8px;padding:4px 16px 4px 8px;font-size:22px;line-height:1;}
#stage .result-modal .result-perfect>svg{width:40px;height:40px;}
#stage .result-modal .result-perfect>span>i{display:inline-flex;align-items:center;gap:3px;font-style:normal;font-weight:1000;}
#stage .result-modal .result-perfect>span>i>svg{width:26px;height:26px;}
#stage .modal .w-miss{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin:10px 0 4px;}
#stage .modal .w-miss .w-chip{padding:6px 14px 6px 8px;border-radius:20px;background:#fff;box-shadow:0 4px 0 var(--m-edge);}
#stage .modal .w-miss .w-chip>svg{width:40px;height:40px;}
#stage .modal .w-miss .w-chip>b{font-size:24px;}
#stage .modal .w-miss .w-chip.good>b{color:var(--x-green-3);}
#stage .modal .w-miss .w-chip.bad{background:#ffe1da;box-shadow:0 4px 0 #f0492f;}
#stage .modal .w-miss .w-chip.bad>b{color:#c32a12;}
#stage .modal .w-stats{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 16px;margin:12px 0 0;padding:10px;border-radius:20px;background:#fff;box-shadow:0 4px 0 var(--m-edge);}
#stage .modal .w-stats .w-chip{gap:4px;}
#stage .modal .w-stats .w-chip>svg{width:32px;height:32px;}
#stage .modal .w-stats .w-chip>b{font-size:19px;}
#stage .modal .w-unlock{display:flex;align-items:center;justify-content:center;gap:10px;margin:12px 0 0;padding:8px;border-radius:20px;background:#e9ffc4;box-shadow:0 4px 0 #b6dd77;}
#stage .modal .w-unlock>svg{flex:none;}

/* ---- Pause ---- */
#stage .modal .w-pause{display:grid;justify-items:center;gap:18px;width:100%;margin:20px 0 10px;}
#stage .modal .w-pause>.w-go{flex:none;width:100%;max-width:260px;height:84px;}
#stage .modal .w-pause>.w-go>svg{width:48px;height:48px;}
#stage .modal .w-pause .w-square>.prop-art{width:52px;height:52px;}
#stage .modal .w-pause .w-square:disabled>svg{filter:grayscale(1) opacity(.6);}
#stage .modal .pause-toggles.w-row{margin:0;padding:0;border:0;}
#stage .modal .w-toggle{position:relative;flex:none;width:60px;height:60px;min-width:0;min-height:0;padding:0;border:3px solid #fff;border-radius:50%;display:grid;place-items:center;
 background:linear-gradient(var(--x-green-1),var(--x-green-2));box-shadow:0 4px 0 var(--x-green-3);color:#fff;-webkit-text-stroke:0;}
#stage .modal .w-toggle>svg{width:30px;height:30px;}
#stage .modal .w-toggle.off{background:linear-gradient(#d9d2c6,#bdb4a5);box-shadow:0 4px 0 #8d8475;}
#stage .modal .w-toggle.off::after{content:"";position:absolute;left:50%;top:50%;width:44px;height:5px;border-radius:3px;background:#f0492f;box-shadow:0 0 0 1.5px #fff;transform:translate(-50%,-50%) rotate(-45deg);}
#stage .modal .w-toggle:active{transform:translateY(3px);box-shadow:0 1px 0 var(--x-green-3);}
#stage .modal .w-howto{display:flex;align-items:center;justify-content:center;gap:4px;margin:6px 0 4px;padding:6px 10px;border-radius:18px;background:#fff;box-shadow:0 4px 0 var(--m-edge);}
#stage .modal .w-howto>svg{flex:none;}
#stage .modal .w-howto .tutorial-arrow{display:grid;place-items:center;color:var(--m-soft);}

/* ==========================================================================
   Wordless workshop and settings: same rules as the popups above.
   Dots = rank, "8 → 10" = now and next, coin pill = price, red square = wipes something.
   ========================================================================== */
/* ---- Upgrade workshop ---- */
#stage .modal .w-wallet{display:flex;justify-content:center;margin:6px 0 12px;}
#stage .modal .w-wallet .w-chip{padding:4px 18px 4px 6px;border-radius:22px;background:#fff;box-shadow:0 4px 0 var(--m-edge);}
#stage .modal .w-wallet .w-chip>svg{width:36px;height:36px;}
#stage .modal .w-wallet .w-chip>b{font-size:26px;}
#stage .modal .shop-grid.w-shop{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 12px;margin:0;padding:14px 12px 16px;}
#stage .modal .w-up{position:relative;display:grid;justify-items:center;align-content:start;gap:6px;min-width:0;min-height:0;margin:0;padding:8px 6px 12px;border:0;border-radius:22px;background:#fff;box-shadow:0 5px 0 var(--m-edge);
 font-family:var(--x-font);color:var(--m-ink);-webkit-text-stroke:0;opacity:1;filter:none;}
#stage .modal .w-up:active:not(:disabled){transform:translateY(3px);box-shadow:0 2px 0 var(--m-edge);}
#stage .modal .w-up-art{display:grid;place-items:center;height:72px;}
#stage .modal .w-up-art>svg{width:72px;height:72px;filter:drop-shadow(0 4px 0 #0000001a);}
#stage .modal .w-dots{display:flex;align-items:center;justify-content:center;gap:6px;}
#stage .modal .w-dots>i{width:14px;height:14px;border-radius:50%;background:#e6ddcd;box-shadow:inset 0 2px 0 #00000014;}
#stage .modal .w-dots>i.on{background:var(--x-orange-2);box-shadow:0 2px 0 var(--x-orange-3);}
#stage .modal .w-dots>i.next{background:var(--x-green-1);box-shadow:0 2px 0 var(--x-green-3);animation:w-pulse .6s ease-in-out infinite alternate;}
#stage .modal .w-up-facts{display:grid;justify-items:center;align-content:center;gap:3px;min-height:48px;}
#stage .modal .w-fact{display:inline-flex;align-items:center;gap:4px;font-size:18px;line-height:1;font-weight:1000;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--m-ink);}
#stage .modal .w-fact svg{width:24px;height:24px;flex:none;}
#stage .modal .w-fact>.utility-icon{width:13px;height:13px;color:var(--m-soft);}
#stage .modal :is(.w-fact,.w-compare-row)>b{font-weight:1000;color:var(--m-ink);}
#stage .modal :is(.w-fact,.w-compare-row)>b.up{color:var(--x-green-3);}
#stage .modal .w-pair{display:inline-flex;align-items:center;}
#stage .modal .w-pair>svg+svg{margin-left:-6px;}
#stage .modal .w-up-facts .w-chip.gate{gap:3px;}
#stage .modal .w-up-facts .w-chip.gate>svg{width:28px;height:28px;}
#stage .modal .w-up-facts .w-chip.gate>b{font-size:20px;color:#7d7466;}
#stage .modal .w-price{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:104px;height:40px;padding:0 14px;border:3px solid #fff;border-radius:999px;
 background:linear-gradient(var(--x-green-1),var(--x-green-2));box-shadow:0 4px 0 var(--x-green-3);color:#fff;font-size:20px;line-height:1;font-weight:1000;font-variant-numeric:tabular-nums;}
#stage .modal .w-price>svg{width:24px;height:24px;flex:none;}
#stage .modal .w-price>b{color:#fff;font-weight:1000;-webkit-text-stroke:4px var(--x-green-3);paint-order:stroke fill;}
#stage .modal .w-up.short .w-price{background:linear-gradient(#d9d2c6,#bdb4a5);box-shadow:0 4px 0 #8d8475;}
#stage .modal .w-up.short .w-price>b{-webkit-text-stroke-color:#8d8475;}
#stage .modal .w-up.max{background:linear-gradient(#f6ffe3,#e2f6ba);box-shadow:0 5px 0 #b6dd77;}
#stage .modal .w-up.max .w-price{min-width:0;width:40px;padding:0;}
#stage .modal .w-up.max .w-price>svg{width:20px;height:20px;}
#stage .modal .w-up.locked{background:#ebe3d5;box-shadow:0 4px 0 #cfc4b0;}
#stage .modal .w-up.locked .w-up-art>svg{filter:grayscale(1) opacity(.5);}
#stage .modal .w-up.locked .w-dots{visibility:hidden;}
#stage .modal .w-up.locked .w-price{min-width:0;width:40px;padding:0;background:#fff;box-shadow:0 4px 0 #cfc4b0;}
#stage .modal .w-up.recommended{box-shadow:0 5px 0 var(--x-orange-3),0 0 0 4px var(--x-orange-1);}
#stage .modal .w-tip{position:absolute;left:-8px;top:-10px;width:40px;height:40px;pointer-events:none;filter:drop-shadow(0 2px 0 #0003);}
#stage .modal .w-tip>svg{width:40px;height:40px;}
#stage .modal .w-up.fresh{animation:w-pop .5s ease-out;}
#stage .modal .w-up.fresh .w-dots>i.on:last-of-type,#stage .modal .w-up.fresh .w-dots>i.on:has(+i:not(.on)){animation:w-pulse .35s ease-in-out 4 alternate;}
#stage .modal .w-links{margin:16px 0 6px;}
#stage .modal .w-links .w-square>svg{width:46px;height:46px;}

/* ---- Upgrade confirm ---- */
#stage .modal .w-up-hero{display:grid;justify-items:center;gap:12px;margin:10px 0 14px;}
#stage .modal .w-up-hero>svg{width:128px;height:128px;filter:drop-shadow(0 6px 0 #0000001a);}
#stage .modal .w-up-hero .w-dots{gap:9px;}
#stage .modal .w-up-hero .w-dots>i{width:20px;height:20px;}
#stage .modal .w-compare{display:grid;gap:10px;}
#stage .modal .w-compare-row{display:flex;align-items:center;justify-content:center;gap:12px;padding:10px 14px;border-radius:20px;background:#fff;box-shadow:0 4px 0 var(--m-edge);
 font-size:32px;line-height:1;font-weight:1000;font-variant-numeric:tabular-nums;white-space:nowrap;}
#stage .modal .w-compare-row svg{width:44px;height:44px;flex:none;}
#stage .modal .w-compare-row>.utility-icon{width:26px;height:26px;color:var(--x-orange-2);}

/* ---- Settings ---- */
#stage .modal .w-settings{display:grid;justify-items:center;gap:18px;margin:16px 0 10px;}
#stage .modal .w-sound{gap:22px;}
#stage .modal .w-sound .w-toggle{width:72px;height:72px;}
#stage .modal .w-sound .w-toggle>svg{width:36px;height:36px;}
#stage .modal .w-sound .w-toggle.off::after{width:54px;height:6px;}
#stage .modal .w-save{display:grid;justify-items:center;gap:12px;width:100%;padding:12px 10px 16px;border-radius:22px;background:#ffe2b3;box-shadow:inset 0 4px 0 #f3c98a;}
#stage .modal .w-loot{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px 14px;padding:6px 14px;border-radius:18px;background:#fff;box-shadow:0 3px 0 var(--m-edge);}
#stage .modal .w-loot .w-chip{gap:4px;}
#stage .modal .w-loot .w-chip>svg{width:30px;height:30px;}
#stage .modal .w-loot .w-chip>b{font-size:20px;}
#stage .modal .w-loot>.utility-icon{width:28px;height:28px;flex:none;color:var(--x-violet-2);}
#stage .modal .w-danger{border:3px solid #fff;background:linear-gradient(#ff8a6e,#f0492f);box-shadow:0 5px 0 #9c2413;color:#fff;}
#stage .modal .w-danger:active{transform:translateY(3px);box-shadow:0 2px 0 #9c2413;}
#stage .modal .w-danger>.utility-icon{width:34px;height:34px;color:#fff;}
#stage .modal .legal-settings-links{display:flex;flex-wrap:wrap;justify-content:center;gap:8px 10px;margin:14px 0 4px;}
#stage .modal .legal-settings-links a{min-height:36px;padding:2px 14px;border-radius:18px;background:#fff;box-shadow:0 3px 0 var(--m-edge);font-size:14px;text-decoration:none;}
#stage .modal .legal-settings-links a>svg{display:none;}

/* ---- Wipe / restore confirm: what the save holds, and where it goes ---- */
#stage .modal .w-wipe{display:flex;align-items:center;justify-content:center;gap:10px;margin:18px 0 6px;}
#stage .modal .w-wipe .w-loot{flex-direction:column;align-items:flex-start;gap:6px;padding:10px 16px;}
#stage .modal .w-wipe .w-loot .w-chip>svg{width:36px;height:36px;}
#stage .modal .w-wipe .w-loot .w-chip>b{font-size:24px;}
#stage .modal .w-wipe>.utility-icon{width:56px;height:56px;flex:none;color:#f0492f;}
#stage .modal :is(.w-wipe,.w-swap)>.tutorial-arrow{display:grid;place-items:center;color:var(--x-orange-2);}
#stage .modal .w-swap{display:grid;justify-items:center;gap:8px;margin:18px 0 6px;}
#stage .modal .w-swap>.tutorial-arrow.down{transform:rotate(90deg);}
#stage .modal .w-swap .w-loot.new{background:linear-gradient(#f6ffe3,#e2f6ba);box-shadow:0 3px 0 #b6dd77;}
#stage .modal .w-swap .w-loot.old{background:#ffe1da;box-shadow:0 3px 0 #f0492f;}
#stage .modal .w-swap .w-loot.old .w-chip>b{color:#c32a12;text-decoration:line-through;}
#stage .modal.reset-modal .w-actions+.w-row{margin:18px 0 8px;}
#stage .modal .w-title.big>svg{width:48px;height:48px;}
@keyframes w-pop{0%{transform:scale(.9)}55%{transform:scale(1.06)}100%{transform:scale(1)}}
@keyframes w-pulse{from{transform:scale(1)}to{transform:scale(1.35)}}

/* ==========================================================================
   Wordless street, treasure and plate popups: same rules as the popups above.
   Stars under a building = levels done there, key chip = keys held / keys needed,
   green heart chip = guests waiting for this dish, "+" = adds a topping.
   ========================================================================== */
#stage .modal .w-tier-stars{display:flex;align-items:center;justify-content:center;gap:1px;}
#stage .modal .w-tier-stars>i{display:grid;place-items:center;filter:grayscale(1) opacity(.35);}
#stage .modal .w-tier-stars>i.lit{filter:none;}
#stage .modal .w-tier-stars svg{display:block;width:30px;height:30px;}

/* ---- District: its building, its three levels ---- */
#stage .modal .w-district{display:grid;justify-items:center;margin:0 0 12px;}
#stage .modal .w-district>.building-art{width:170px;height:170px;}
#stage .modal .w-district>.w-tier-stars{margin-top:-12px;padding:4px 14px;border-radius:22px;background:#fff;box-shadow:0 4px 0 var(--m-edge);}
#stage .modal .w-district>.w-tier-stars svg{width:34px;height:34px;}
#stage .modal .w-district.locked>.building-art{filter:grayscale(1) opacity(.7);}
#stage .modal .w-stage:disabled{background:#ebe3d5;box-shadow:0 4px 0 #cfc4b0;opacity:1;filter:none;}
#stage .modal .w-stage:disabled>b{color:#a79d8c;}

/* ---- The whole street: stall -> shop -> restaurant, and three totals ---- */
#stage .modal .w-grow{display:flex;align-items:flex-end;justify-content:center;gap:0;margin:2px 0 14px;}
#stage .modal .w-grow-step{display:grid;justify-items:center;gap:0;min-width:0;}
#stage .modal .w-grow-step>.building-art{width:92px;height:92px;}
#stage .modal .w-grow-step .w-tier-stars svg{width:20px;height:20px;}
#stage .modal .w-grow>.tutorial-arrow{display:grid;place-items:center;align-self:center;color:var(--x-orange-2);}
#stage .modal .w-grow>.tutorial-arrow>svg{width:20px;height:20px;}
#stage .modal .w-city-stats{align-items:flex-end;padding:12px 8px;}
#stage .modal .w-city-stats .w-chip{flex-direction:column;gap:4px;}
#stage .modal .w-city-stats .w-chip>svg{width:54px;height:54px;}
#stage .modal .w-city-stats .w-chip>b{font-size:22px;}

/* ---- Treasure chests ---- */
#stage .modal .w-chests{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 12px;margin:0 0 14px;}
#stage .modal .w-chest{position:relative;display:grid;justify-items:center;align-content:center;gap:4px;min-width:0;min-height:148px;margin:0;padding:10px 6px 12px;border:0;border-radius:22px;
 background:#fff;box-shadow:0 5px 0 var(--m-edge);text-align:center;font-family:var(--x-font);color:var(--m-ink);-webkit-text-stroke:0;}
#stage .modal .w-chest>.chest-art{width:88px;height:88px;}
#stage .modal .w-chest .w-chip{flex-direction:row;gap:3px;height:32px;padding:0 12px 0 5px;border-radius:16px;background:#f3ecdf;}
#stage .modal .w-chest .w-chip>svg{width:28px;height:28px;}
#stage .modal .w-chest .w-chip>b{font-size:19px;}
#stage .modal .w-chest.ready{background:linear-gradient(#f6ffe3,#dff5b4);box-shadow:0 5px 0 var(--x-green-3),0 0 0 3px #fff;}
#stage .modal .w-chest.ready>.chest-art{animation:w-ready 1s ease-in-out infinite alternate;}
#stage .modal .w-chest.ready .w-chip{background:var(--x-green-2);box-shadow:0 2px 0 var(--x-green-3);}
#stage .modal .w-chest.ready .w-chip>b{color:#fff;}
#stage .modal .w-chest.locked{background:#ebe3d5;box-shadow:0 4px 0 #cfc4b0;}
#stage .modal .w-chest.locked>.chest-art{filter:grayscale(1) opacity(.6);}
#stage .modal .w-chest.locked .w-chip{background:#fff;}
#stage .modal .w-chest.claimed{background:linear-gradient(#f6ffe3,#e2f6ba);box-shadow:0 4px 0 #b6dd77;}
#stage .modal .w-chest.claimed>.chest-art{filter:saturate(.5) opacity(.7);}
#stage .modal .w-chest>em.done{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--x-green-2);color:#fff;box-shadow:0 2px 0 var(--x-green-3);}
#stage .modal .w-chest>em.done>svg{width:18px;height:18px;}
#stage .modal .w-chest:active{transform:translateY(3px);}
#stage .treasures-modal .w-wallet{margin-bottom:14px;}
#stage .treasures-modal .w-howto{width:max-content;max-width:100%;margin:0 auto 8px;padding:4px 16px 4px 8px;gap:6px;}
#stage .treasures-modal .w-howto>.building-art{width:52px;height:52px;}
#stage .treasures-modal .w-howto .tutorial-arrow>svg{width:20px;height:20px;}
#stage .treasures-modal .w-howto .w-chip>svg{width:34px;height:34px;}
#stage .chest-modal .chest-rewards.w-facts{margin:8px 0 0;}
@keyframes w-ready{from{transform:translateY(0) rotate(-3deg)}to{transform:translateY(-4px) rotate(3deg)}}

/* ---- Plates: pick one, change it, or throw it away ---- */
#stage .modal .w-plates{display:flex;flex-wrap:wrap;justify-content:center;gap:14px 12px;margin:10px 0 4px;}
#stage .modal .w-plate{position:relative;flex:0 0 calc(50% - 6px);display:grid;place-items:center;width:auto;min-width:0;min-height:118px;margin:0;padding:8px;border:0;border-radius:22px;background:#fff;box-shadow:0 5px 0 var(--m-edge);}
#stage .modal .w-plate>svg{width:88px;height:88px;}
#stage .modal .w-plate:active{transform:translateY(3px);box-shadow:0 2px 0 var(--m-edge);}
#stage .modal .w-no{position:absolute;left:-5px;top:-7px;min-width:30px;height:30px;padding:0 6px;display:grid;place-items:center;border:3px solid #fff;border-radius:15px;background:var(--x-violet-2);color:#fff;
 font-family:var(--x-font);font-style:normal;font-weight:1000;font-size:16px;line-height:1;}
#stage .modal .w-empty{flex:1 1 100%;display:grid;place-items:center;min-height:118px;filter:grayscale(1) opacity(.45);}
#stage .modal .w-plate-hero{display:grid;justify-items:center;gap:0;margin:2px 0 12px;padding:6px 8px 12px;text-align:center;}
#stage .modal .w-plate-hero>svg{width:128px;height:128px;}
#stage .modal .w-match{display:flex;justify-content:center;margin:0;}
#stage .modal .w-match .w-chip{gap:4px;padding:3px 14px 3px 6px;border-radius:18px;background:var(--x-green-2);box-shadow:0 3px 0 var(--x-green-3);}
#stage .modal .w-match .w-chip>svg{width:30px;height:30px;}
#stage .modal .w-match .w-chip>b{font-size:22px;color:#fff;}
#stage .modal .w-match.no .w-chip{background:#cfc4b0;box-shadow:0 3px 0 #a79d8c;}
#stage .modal .w-match.no .w-chip>svg{filter:grayscale(1);}
#stage .modal .w-tiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:0 0 4px;}
#stage .modal .w-tile{position:relative;display:grid;place-items:center;min-width:0;min-height:84px;margin:0;padding:4px;border:0;border-radius:20px;background:#fff;box-shadow:0 5px 0 var(--m-edge);}
#stage .modal .w-tile>svg{width:56px;height:56px;}
#stage .modal .w-tile:active:not(:disabled){transform:translateY(3px);box-shadow:0 2px 0 var(--m-edge);}
#stage .modal .w-tile:disabled{background:#ebe3d5;box-shadow:0 4px 0 #cfc4b0;opacity:1;}
#stage .modal .w-tile:disabled>svg{filter:grayscale(1) opacity(.5);}
#stage .modal .w-tile:disabled>.w-plus{display:none;}
#stage .modal .w-tile.w-danger{border:3px solid #fff;background:linear-gradient(#ff8a6e,#f0492f);box-shadow:0 5px 0 #9c2413;color:#fff;}
#stage .modal .w-tile.w-danger>.utility-icon{width:38px;height:38px;color:#fff;}
#stage .modal .w-tile.w-danger:active{box-shadow:0 2px 0 #9c2413;}
#stage .modal .w-plus{position:absolute;left:-5px;top:-7px;width:28px;height:28px;display:grid;place-items:center;border:3px solid #fff;border-radius:50%;background:var(--x-green-2);color:#fff;
 box-shadow:0 2px 0 var(--x-green-3);font-family:var(--x-font);font-style:normal;font-weight:1000;font-size:20px;line-height:1;pointer-events:none;}
#stage .modal .plate-preview.w-wipe{margin:14px 0 6px;padding:12px 8px;gap:8px;}
#stage .modal .plate-preview.w-wipe>.food-art{width:104px;height:104px;}

/* ==========================================================================
   Wordless journal and handbook: same rules as the popups above.
   Journal tabs are pictures; a card = picture + number; the prize pill is the claim button.
   Handbook rows read left to right: this, then this, gives that.
   ========================================================================== */
#stage .journal-modal .journal-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:10px 0 12px;padding:5px;border-bottom:0;}
#stage .journal-modal .journal-tabs>button{display:grid;place-items:center;min-height:56px;padding:0;}
#stage .journal-modal .journal-tabs>button>svg{width:38px;height:38px;}
#stage .journal-modal .journal-tabs>button:not(.selected)>svg{filter:grayscale(.4) opacity(.7);}
#stage .modal .w-tally{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px 18px;margin:0 2px 12px;padding:8px 14px;border-radius:20px;background:#fff;box-shadow:0 4px 0 var(--m-edge);}
#stage .modal .w-tally .w-chip>svg{width:40px;height:40px;}
#stage .modal .w-tally .w-chip>b{font-size:26px;}
#stage .modal .w-tally.six{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));justify-items:start;gap:8px 4px;padding:10px 12px;}
#stage .modal .w-tally.six .w-chip{gap:4px;}
#stage .modal .w-tally.six .w-chip>svg{width:30px;height:30px;}
#stage .modal .w-tally.six .w-chip>b{font-size:17px;}

/* ---- Achievements ---- */
#stage .modal .w-achievements{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 12px;padding:0 2px 10px;}
#stage .modal .achievement-card{position:relative;display:grid;grid-template-columns:minmax(0,1fr);justify-items:center;align-content:start;gap:8px;min-width:0;margin:0;padding:12px 8px;border:0;border-radius:22px;background:#fff;box-shadow:0 5px 0 var(--m-edge);}
#stage .modal .w-badge{display:grid;place-items:center;height:60px;}
#stage .modal .w-badge>svg{width:58px;height:58px;}
#stage .modal .w-bar{position:relative;width:100%;height:26px;overflow:hidden;border-radius:13px;background:#e9d5ae;}
#stage .modal .w-bar>i{position:absolute;left:0;top:0;bottom:0;border-radius:13px;background:linear-gradient(var(--x-green-1),var(--x-green-2));}
#stage .modal .w-bar>b{position:absolute;inset:0;display:grid;place-items:center;font-size:15px;line-height:1;font-weight:1000;color:var(--m-ink);font-variant-numeric:tabular-nums;}
#stage .modal .w-claim{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-width:0;min-height:44px;margin:0;padding:0 6px;border:3px solid #fff;border-radius:22px;
 background:linear-gradient(#d9d2c6,#bdb4a5);box-shadow:0 4px 0 #8d8475;color:#fff;font-family:var(--x-font);font-weight:1000;font-size:17px;line-height:1;opacity:1;filter:none;-webkit-text-stroke:0;}
#stage .modal .w-claim>span:not(.w-sr){display:inline-flex;align-items:center;gap:3px;}
#stage .modal .w-claim svg{width:24px;height:24px;flex:none;}
#stage .modal .w-claim.ready{background:linear-gradient(var(--x-green-1),var(--x-green-2));box-shadow:0 4px 0 var(--x-green-3);}
#stage .modal .w-claim.ready:active{transform:translateY(3px);box-shadow:0 1px 0 var(--x-green-3);}
#stage .modal .w-claim.claimed{border-color:transparent;background:none;box-shadow:none;}
#stage .modal .w-claim.claimed>svg{box-sizing:border-box;width:32px;height:32px;padding:7px;border-radius:50%;background:var(--x-green-2);color:#fff;box-shadow:0 2px 0 var(--x-green-3);}
#stage .modal .achievement-card.claimable{background:linear-gradient(#f6ffe3,#dff5b4);box-shadow:0 5px 0 var(--x-green-3),0 0 0 3px #fff;}
#stage .modal .achievement-card.claimable .w-badge>svg{animation:w-ready 1s ease-in-out infinite alternate;}
#stage .modal .achievement-card.claimed{background:linear-gradient(#f6ffe3,#e2f6ba);box-shadow:0 4px 0 #b6dd77;}
#stage .modal .achievement-card.claimed .w-badge>svg{filter:saturate(.6) opacity(.75);}
#stage .modal .achievement-card.fresh{animation:w-pop .45s ease-out;}

/* ---- Recipes: dish, what goes in, what it sells for ---- */
#stage .modal .w-recipes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 12px;padding:0 2px 10px;}
#stage .modal .recipe-card{position:relative;display:grid;grid-template-columns:minmax(0,1fr);justify-items:center;align-content:start;gap:6px;min-width:0;margin:0;padding:10px 6px 12px;border:0;border-radius:22px;background:#fff;box-shadow:0 5px 0 var(--m-edge);}
#stage .modal .w-dish{position:relative;display:grid;place-items:center;width:92px;height:92px;}
#stage .modal .w-dish>:is(svg,.iced-drink){width:92px;height:92px;}
#stage .modal .w-parts{display:flex;align-items:center;justify-content:center;gap:2px;max-width:100%;min-height:38px;padding:2px 8px;border-radius:19px;background:#f3ecdf;}
#stage .modal .w-parts>svg{width:32px;height:32px;flex:none;}
#stage .modal .w-op{font-family:var(--x-font);font-style:normal;font-weight:1000;font-size:16px;line-height:1;color:var(--m-soft);}
#stage .modal .recipe-card .recipe-price{display:flex;align-items:center;justify-content:center;gap:8px;margin:0;padding:0;border:0;}
#stage .modal .recipe-card .recipe-price>b{display:inline-flex;align-items:center;gap:3px;font-size:22px;line-height:1;font-weight:1000;color:var(--m-ink);font-variant-numeric:tabular-nums;}
#stage .modal .recipe-card .recipe-price>b>svg{width:26px;height:26px;}
#stage .modal .recipe-card .w-chip.gate{gap:2px;padding:1px 9px 1px 3px;border-radius:14px;background:#fff;}
#stage .modal .recipe-card .w-chip.gate>svg{width:24px;height:24px;}
#stage .modal .recipe-card .w-chip.gate>b{font-size:17px;color:#7d7466;}
#stage .modal .recipe-card.locked{background:#ebe3d5;box-shadow:0 4px 0 #cfc4b0;}
#stage .modal .recipe-card.locked .w-dish>:is(svg,.iced-drink){filter:grayscale(1) opacity(.55);}
#stage .modal .recipe-card.locked .w-parts{background:#fff;}
#stage .modal .recipe-card.locked .w-parts>svg{filter:grayscale(1) opacity(.6);}
#stage .modal .recipe-card.locked .recipe-price>b{color:#a79d8c;}
#stage .modal .recipe-card.locked .recipe-price>b>svg{filter:grayscale(1) opacity(.7);}

/* ---- Records: totals, each street, each night ---- */
#stage .modal .chapter-record{margin:0 2px 12px;padding:10px 8px 12px;border:0;border-radius:22px;background:#fff;box-shadow:0 4px 0 var(--m-edge);}
#stage .modal .chapter-record.locked{background:#ebe3d5;box-shadow:0 4px 0 #cfc4b0;}
#stage .modal .chapter-record.locked .w-nodes{display:none;}
#stage .modal .w-chapter-head{display:flex;align-items:center;justify-content:center;gap:10px;margin:0 0 6px;}
#stage .modal .chapter-record.locked .w-chapter-head{margin:0;}
#stage .modal .w-chapter-head>svg{width:26px;height:26px;flex:none;}
#stage .modal .w-chapter-head>.chapter-icon{width:52px;height:52px;}
#stage .modal .chapter-record.locked .chapter-icon{filter:grayscale(1) opacity(.6);}
#stage .modal .w-chapter-head .w-chip>svg{width:28px;height:28px;}
#stage .modal .w-nodes{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;}
#stage .modal .w-node{display:grid;justify-items:center;align-content:start;gap:0;min-width:0;}
#stage .modal .w-node>.building-art{width:100%;max-width:60px;height:auto;aspect-ratio:1;}
#stage .modal .w-node.empty>.building-art{filter:grayscale(1) opacity(.55);}
#stage .modal .w-node .w-tier-stars svg{width:15px;height:15px;}
#stage .modal .w-perfect{display:inline-flex;align-items:center;gap:1px;margin-top:3px;font-family:var(--x-font);font-size:14px;line-height:1;font-weight:1000;color:var(--m-ink);filter:grayscale(1) opacity(.4);}
#stage .modal .w-perfect.earned{filter:none;}
#stage .modal .w-perfect>svg{width:18px;height:18px;}
#stage .modal .w-records{display:grid;gap:6px;padding:0 2px 10px;}
#stage .modal .record-row{display:flex;align-items:center;gap:8px;min-height:44px;margin:0;padding:6px 8px;border:0;border-radius:16px;background:#fff;box-shadow:0 3px 0 var(--m-edge);}
#stage .modal .record-row.no-record{min-height:38px;background:#f3ecdf;box-shadow:none;}
#stage .modal .record-row .w-chip{gap:2px;}
#stage .modal .record-row .w-chip>svg{width:20px;height:20px;}
#stage .modal .record-row .w-chip>b{font-size:15px;}
#stage .modal .record-row .w-chip.pin{flex:none;min-width:48px;}
#stage .modal .record-row .w-chip.pin>svg{width:24px;height:24px;}
#stage .modal .record-row .w-chip.pin>b{font-size:18px;}
#stage .modal .record-row.no-record .w-chip.pin{filter:grayscale(1) opacity(.55);}
#stage .modal .w-values{flex:1 1 0;min-width:0;display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;}
#stage .modal .w-mark{flex:none;width:28px;height:28px;display:grid;place-items:center;}
#stage .modal .w-mark.done{width:24px;height:24px;margin:0 2px;border-radius:50%;background:var(--x-green-2);color:#fff;box-shadow:0 2px 0 var(--x-green-3);}
#stage .modal .w-mark.done>svg{width:14px;height:14px;}
#stage .modal .w-mark.perfect>svg{width:28px;height:28px;}

/* ---- Handbook ---- */
#stage .modal .w-help{display:grid;gap:8px;margin:6px 0 0;}
#stage .modal .w-help .w-howto{flex-wrap:wrap;gap:3px;min-height:60px;margin:0;padding:6px 8px;}
#stage .modal .w-help .w-howto>svg{flex:none;}
#stage .modal .w-help .tutorial-arrow>svg{width:18px;height:18px;}
#stage .modal .w-help .w-chip{gap:2px;}
#stage .modal .w-help .w-chip>b{font-size:19px;}
#stage .modal .w-bin{flex:none;display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:linear-gradient(#ff8a6e,#f0492f);color:#fff;box-shadow:0 3px 0 #9c2413;}
#stage .modal .w-bin>svg{width:24px;height:24px;}

/* ==========================================================================
   Wordless notice (#toast.pictogram): a picture and a mark instead of a sentence.
   Green tick = done, red cross = did not work, lock + pin N = opens after level N.
   ========================================================================== */
#toast.pictogram{top:38%;bottom:auto;padding:10px 16px;border:4px solid #fff;border-radius:28px;background:#fff8e7;color:#5a3a1e;
 box-shadow:0 6px 0 #d9b98a,0 12px 20px #0005;font-size:0;line-height:0;}
#toast.pictogram .t-art{position:relative;display:inline-flex;align-items:center;gap:8px;}
#toast.pictogram .t-art>svg{width:44px;height:44px;flex:none;}
#toast.pictogram .t-art>.utility-icon{width:36px;height:36px;}
#toast.pictogram .t-mark{flex:none;display:grid;place-items:center;width:32px;height:32px;border:3px solid #fff;border-radius:50%;color:#fff;}
#toast.pictogram .t-mark>svg{width:16px;height:16px;}
#toast.pictogram .t-mark.ok{background:#62c21a;box-shadow:0 3px 0 #2f7d0a;}
#toast.pictogram .t-mark.bad{background:#f0492f;box-shadow:0 3px 0 #9c2413;}
#toast.pictogram .t-gate{display:inline-flex;align-items:center;gap:2px;padding:3px 12px 3px 6px;border-radius:18px;background:#fff;box-shadow:0 3px 0 #e2cfa8;font-style:normal;}
#toast.pictogram .t-gate>svg{width:24px;height:24px;flex:none;}
#toast.pictogram .t-gate>b{font:1000 22px/1 var(--x-font,system-ui);color:#5a3a1e;font-variant-numeric:tabular-nums;}

/* ---------------- Stage 2: a new dish on the level card ---------------- */
#stage .modal .w-menu>.w-new{position:relative;display:block;width:48px;height:48px;flex:none;}
#stage .modal .w-menu>.w-new>svg{width:48px;height:48px;}
#stage .modal .w-menu>.w-new>i{position:absolute;top:-7px;right:-7px;display:grid;place-items:center;width:22px;height:22px;filter:drop-shadow(0 2px 0 #c98a1f);}
#stage .modal .w-menu>.w-new>i>svg{width:22px;height:22px;}
#stage .modal .w-recipe{display:flex;align-items:center;justify-content:center;gap:8px;margin:10px 0 0;padding:6px 12px;border-radius:20px;background:#fff6d6;box-shadow:0 4px 0 #f0c869;}
#stage .modal .w-recipe>span{display:flex;align-items:center;gap:4px;}
#stage .modal .w-recipe>.w-recipe-star{display:grid;place-items:center;}
#stage .modal .w-recipe .tutorial-arrow{display:grid;place-items:center;color:var(--x-orange-2);}
/* A lemon cup in the plate list: the bin marks that it can only be poured away. */
#stage .modal .w-plate.w-cup>.w-no.w-bin{display:grid;place-items:center;color:#fff;background:#e2573c;}
