:root{
  --cream:#f6e7c8; --cream2:#efdcb4; --cream3:#e3c893;
  --jade:#3a9d78; --jade2:#246b52; --jade3:#6cc39a;
  --turq:#4fc1c9; --turq2:#2d8f98;
  --coral:#f2705c; --coral2:#c74b3b; --coral3:#f9a08e;
  --gold:#f5c242; --gold2:#d6961f;
  --ink:#2a1a1e; --ink2:#4a3337; --paper:#fff8ee;
  --font: "Trebuchet MS","Segoe UI",Verdana,"Helvetica Neue",Arial,sans-serif;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;background:#1a1216;overflow:hidden;overscroll-behavior:none;font-family:var(--font);color:var(--ink);touch-action:manipulation;-webkit-user-select:none;user-select:none}
/* --vvh follows the visible part of the page, so a sliding browser toolbar never hides the bar */
#app{position:fixed;left:0;top:0;right:0;bottom:0;height:var(--vvh,100%);
 display:flex;align-items:center;justify-content:center;background:
 radial-gradient(ellipse at 50% 30%,#2d2026 0%,#1a1216 70%);
 padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
/* the visual viewport, so a sliding browser toolbar never hides the bottom bar */
html{height:100%}
body{height:100dvh;min-height:100dvh}
#stage{position:relative;width:100%;height:100%;--bar-h:0px;--hud-h:0px}
#game{position:absolute;left:0;top:var(--hud-h);display:block;image-rendering:pixelated;image-rendering:crisp-edges;cursor:pointer;touch-action:none}
#game.grabbing{cursor:grabbing}
.hidden{display:none !important}

/* HUD */
#hud{position:absolute;left:0;right:0;top:0;display:flex;justify-content:space-between;align-items:flex-start;padding:6px 8px;pointer-events:none;gap:8px}
#hud > div{display:flex;gap:6px;align-items:center}
.hud-chip{background:rgba(42,26,30,.82);color:var(--paper);border:2px solid #000;border-radius:6px;padding:4px 9px;font-weight:700;font-size:14px;line-height:1;box-shadow:0 2px 0 rgba(0,0,0,.4);white-space:nowrap}
.hud-timer.warn{background:rgba(199,75,59,.92);animation:pulse .6s infinite alternate}
@keyframes pulse{from{transform:scale(1)}to{transform:scale(1.06)}}
.hud-ico{display:inline-block;width:10px;height:10px;margin-right:5px;vertical-align:-1px;border-radius:50%}
.hud-ico.clock{background:var(--turq);box-shadow:inset 0 0 0 2px #fff8ee}
.hud-ico.coin{background:var(--gold);box-shadow:inset 0 0 0 2px var(--gold2)}
.hud-earn{background:rgba(42,26,30,.82);border:2px solid #000;border-radius:6px;padding:4px 10px 6px;color:var(--paper);min-width:170px;box-shadow:0 2px 0 rgba(0,0,0,.4)}
.hud-earn-row{font-weight:800;font-size:15px;display:flex;justify-content:center;gap:4px;line-height:1}
.hud-earn-row #hud-earn{color:var(--gold)}
.hud-sep{opacity:.5}
.hud-bar{position:relative;height:8px;background:#000;border-radius:3px;margin-top:5px;overflow:visible}
#hud-bar-fill{height:100%;width:0;background:linear-gradient(90deg,var(--jade3),var(--gold));border-radius:3px;transition:width .3s}
.hud-star{position:absolute;top:-4px;width:14px;height:14px;transform:translateX(-7px);background:#5a4a30;clip-path:polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%)}
.hud-star.lit{background:var(--gold);filter:drop-shadow(0 0 2px #ffe08a)}
.hud-btn{pointer-events:auto;background:var(--coral);color:#fff;border:2px solid #000;border-bottom-width:4px;border-radius:6px;font-weight:900;font-size:14px;padding:4px 10px;cursor:pointer;font-family:var(--font)}
.hud-btn:active{border-bottom-width:2px;transform:translateY(2px)}
#hud-combo{background:rgba(58,157,120,.9)}
#hud-combo.hot{background:var(--coral);animation:pulse .4s infinite alternate}

/* Screens */
#screens{position:absolute;inset:0;pointer-events:none}
.screen{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:auto;
  box-sizing:border-box;
  padding:calc(var(--hud-h,0px) + 6px + env(safe-area-inset-top,0px))
          calc(8px + env(safe-area-inset-right,0px))
          calc(var(--bar-h,0px) + 6px + env(safe-area-inset-bottom,0px))
          calc(8px + env(safe-area-inset-left,0px));
  overflow:hidden}
.screen.dim{background:rgba(20,10,14,.55)}
/* only the top panel is live; the one beneath waits for it to close */
.screen.under{display:none}
.panel{background:var(--cream);border:3px solid var(--ink);border-radius:10px;box-shadow:0 6px 0 var(--ink),0 10px 30px rgba(0,0,0,.5);
  padding:16px 18px;max-width:min(92%,560px);max-height:100%;overflow:auto;position:relative;box-sizing:border-box;
  overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.panel.wide{max-width:min(96%,760px)}
.panel::before{content:"";position:absolute;inset:4px;border:2px dashed rgba(42,26,30,.18);border-radius:7px;pointer-events:none}
.pxtitle{display:block;margin:0 auto 8px;image-rendering:pixelated}
.pxtitle.left{margin-left:0}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;background:var(--jade);color:#fff;border:3px solid var(--ink);border-bottom-width:6px;border-radius:8px;font-weight:800;font-size:15px;padding:8px 16px;cursor:pointer;font-family:var(--font);text-shadow:0 1px 0 rgba(0,0,0,.35);min-height:40px;transition:transform .05s}
.btn:hover{filter:brightness(1.08)}
.btn:active{border-bottom-width:3px;transform:translateY(3px)}
.btn.coral{background:var(--coral)}
.btn.gold{background:var(--gold);color:var(--ink);text-shadow:none}
.btn.turq{background:var(--turq)}
.btn.ghost{background:var(--cream2);color:var(--ink);text-shadow:none}
.btn.small{font-size:13px;padding:5px 10px;min-height:32px;border-width:2px;border-bottom-width:4px}
.btn:disabled{opacity:.5;cursor:not-allowed;filter:grayscale(.4)}
.btn.big{font-size:19px;padding:10px 26px}
.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:center}
.row.between{justify-content:space-between}
.stack{display:flex;flex-direction:column;gap:10px}
p.lead{font-size:15px;line-height:1.35;margin:4px 0 10px}
.muted{opacity:.7}
.vi{color:var(--coral2);font-weight:700}

/* Title */
#title-ui{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;padding-bottom:7vh;gap:10px;pointer-events:auto}
#title-ui > div:first-child{display:flex;flex-direction:column;align-items:center}
#title-ui .tagline{background:rgba(42,26,30,.78);color:var(--paper);padding:6px 14px;border-radius:20px;font-size:14px;font-weight:700;border:2px solid #000}
.title-logo{image-rendering:pixelated;filter:drop-shadow(0 4px 0 rgba(0,0,0,.35));animation:bob 2.4s ease-in-out infinite}
@keyframes bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-5px)}}
.corner-btns{position:absolute;top:10px;right:10px;display:flex;gap:6px;pointer-events:auto}
.corner-btns.left{right:auto;left:10px}
.icon-btn{width:40px;height:40px;border-radius:8px;border:2px solid var(--ink);border-bottom-width:4px;background:var(--cream);font-weight:900;font-size:16px;cursor:pointer;display:flex;align-items:center;justify-content:center;font-family:var(--font)}
.icon-btn.off{background:#b9a98f;text-decoration:line-through;opacity:.8}

/* Map */
#map-ui{position:absolute;inset:0;pointer-events:none}
.map-node{position:absolute;pointer-events:auto;transform:translate(-50%,-50%);width:44px;height:44px;border-radius:50%;border:3px solid var(--ink);background:var(--gold);box-shadow:0 3px 0 var(--ink);cursor:pointer;display:flex;align-items:center;justify-content:center;font-weight:900;font-size:16px;color:var(--ink);font-family:var(--font)}
.map-node.locked{background:#8a7a6a;color:#e8dcc8;cursor:not-allowed;box-shadow:0 3px 0 #3a2f28}
.map-node.done{background:var(--jade3)}
.map-node.current{animation:nodepulse 1s infinite alternate;background:var(--coral);color:#fff}
@keyframes nodepulse{from{transform:translate(-50%,-50%) scale(1)}to{transform:translate(-50%,-50%) scale(1.12)}}
.map-node .stars{position:absolute;bottom:-14px;left:50%;transform:translateX(-50%);display:flex;gap:1px}
.map-node .stars i{width:10px;height:10px;background:#5a4a30;clip-path:polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%)}
.map-node .stars i.lit{background:var(--gold)}
.map-shop-label{position:absolute;transform:translate(-50%,-50%);pointer-events:none;background:rgba(255,248,238,.92);border:2px solid var(--ink);border-radius:6px;padding:3px 8px;font-weight:800;font-size:12px;white-space:nowrap;box-shadow:0 2px 0 var(--ink)}
.map-bottom{position:absolute;left:0;right:0;bottom:8px;display:flex;justify-content:center;gap:10px;pointer-events:auto;flex-wrap:wrap}
.map-top{position:absolute;left:10px;top:10px;display:flex;gap:8px;align-items:center;pointer-events:auto}
.coin-chip{background:rgba(42,26,30,.85);color:var(--gold);border:2px solid #000;border-radius:6px;padding:6px 10px;font-weight:900;font-size:14px}
.level-card{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);pointer-events:auto}

/* Upgrades */
.upg-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px;margin:8px 0}
.upg{background:var(--paper);border:2px solid var(--ink);border-radius:8px;padding:10px;display:flex;flex-direction:column;gap:6px;box-shadow:0 3px 0 var(--ink)}
.upg h4{margin:0;font-size:14px;display:flex;justify-content:space-between;align-items:center}
.upg p{margin:0;font-size:12px;line-height:1.3;opacity:.85;flex:1}
.upg.owned{background:#e6f4ec;border-color:var(--jade2)}
.upg .icon{width:36px;height:36px;image-rendering:pixelated;flex:none}
.upg .head{display:flex;gap:8px;align-items:center}
.tag{font-size:11px;font-weight:800;background:var(--gold);padding:2px 6px;border-radius:4px;border:1px solid var(--ink)}
.tag.owned{background:var(--jade3)}

/* Results */
.stat-grid{display:grid;grid-template-columns:1fr auto;gap:4px 14px;font-size:15px;margin:8px 0}
.stat-grid b{text-align:right;font-variant-numeric:tabular-nums}
.stars-big{display:flex;justify-content:center;gap:8px;margin:6px 0 10px}
.stars-big i{width:40px;height:40px;background:#8c7a60;clip-path:polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);transform:scale(.6);opacity:.5;transition:all .35s cubic-bezier(.3,1.6,.5,1)}
.stars-big i.lit{background:var(--gold);transform:scale(1);opacity:1;filter:drop-shadow(0 0 4px #ffe08a)}
.result-head{text-align:center}
.result-head .sub{font-weight:800;font-size:15px;color:var(--jade2)}
.result-head .sub.fail{color:var(--coral2)}

/* Settings */
.setting-row{display:flex;justify-content:space-between;align-items:center;padding:8px 0;border-bottom:1px solid rgba(42,26,30,.12);font-size:15px;font-weight:700}
.toggle{width:56px;height:30px;flex:none;border-radius:15px;border:2px solid var(--ink);background:#8d8276;position:relative;cursor:pointer}
.toggle::after{content:"";position:absolute;top:1px;left:2px;width:22px;height:22px;border-radius:50%;background:#fff;border:2px solid var(--ink);transition:left .15s}
.toggle.on{background:var(--jade3)}
.toggle.on::after{left:28px}

/* Tutorial */
#tut{position:absolute;left:50%;bottom:calc(var(--bar-h,56px) + 14px);transform:translateX(-50%);max-width:min(90vw,520px);background:var(--paper);border:3px solid var(--ink);border-radius:10px;padding:10px 14px;box-shadow:0 4px 0 var(--ink);pointer-events:auto;display:flex;gap:10px;align-items:center;z-index:5}
#tut img,#tut canvas{image-rendering:pixelated;flex:none}
#tut .txt{font-size:14px;line-height:1.35;font-weight:600}
#tut .txt b{color:var(--coral2)}
#tut .btn{margin-left:auto}

/* reduced motion: nothing pulses, nothing slides */
body.reduce-motion *{animation:none !important;transition:none !important}
@media (prefers-reduced-motion:reduce){ *{animation:none !important;transition:none !important} }
/* a story moment */
.panel.story{max-width:min(92%,460px);text-align:center}
.story-art{display:flex;justify-content:center;margin-bottom:4px}
.story-art canvas{image-rendering:pixelated}
.story-who{font-size:11.5px;font-weight:900;letter-spacing:.05em;text-transform:uppercase;color:#8a7a70;margin-bottom:2px}
.story-lines{text-align:left;margin:8px 2px}
.story-lines p{font-size:13.5px;line-height:1.45;margin:0 0 7px}

/* keyboard shortcuts */
.keys-box{margin:10px 0 6px;text-align:left}
.keys-list{display:flex;flex-direction:column;gap:3px;max-height:min(300px,calc(var(--stage-h,100vh) * 0.34));overflow:auto;padding-right:2px}
.keys-group{font-size:10.5px;font-weight:900;letter-spacing:.07em;color:#8a7a70;margin:6px 0 1px}
.key-row{display:flex;align-items:center;gap:7px}
.key-label{flex:1 1 auto;font-size:13px;font-weight:700;min-width:0}
.key-cap{flex:none;min-width:74px;min-height:34px;background:var(--paper);border:2px solid var(--ink);
  border-bottom-width:4px;border-radius:7px;font-family:inherit;font-size:13px;font-weight:900;cursor:pointer}
.key-cap.live{background:var(--gold);animation:pulse .7s infinite alternate}
.keys-note{font-size:12px;font-weight:700;color:var(--jade2);min-height:17px;margin:5px 0}

/* one action hierarchy: primary, management, utilities */
.btn.wide{width:100%;max-width:420px}
.primary-row{margin-top:12px}
.manage-row{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:10px}
.manage-row .btn{width:100%;min-height:50px;font-size:15px;padding:8px 10px}
.btn.cream{background:var(--cream2);color:var(--ink);text-shadow:none}
.util-row{display:flex;justify-content:center;gap:10px;margin-top:10px}
.icon-btn.util{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  min-width:62px;min-height:52px;padding:5px 8px;background:var(--cream2);color:var(--ink);
  border:2px solid var(--ink);border-bottom-width:4px;border-radius:9px;cursor:pointer;font-family:inherit}
.icon-btn.util:hover{filter:brightness(1.06)}
.icon-btn.util:active{border-bottom-width:2px;transform:translateY(2px)}
.icon-btn.util:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.ib-label{font-size:10.5px;font-weight:800;line-height:1}
.ib-tip{display:none;position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);
  background:var(--ink);color:var(--paper);font-size:11px;font-weight:700;padding:3px 8px;border-radius:6px;
  white-space:nowrap;pointer-events:none;z-index:6}
@media (hover:hover){
  .ib-label{display:none}
  .icon-btn.util{min-width:52px}
  .icon-btn.util:hover .ib-tip,.icon-btn.util:focus-visible .ib-tip{display:block}
}
.detail-row{display:flex;justify-content:flex-end;margin:2px 0 0}
.link-btn{background:none;border:none;padding:4px 2px;min-height:32px;font-family:inherit;font-size:12.5px;
  font-weight:800;color:var(--ink2);text-decoration:underline;cursor:pointer}
.link-btn:hover{color:var(--coral2)}
.link-btn:focus-visible{outline:3px solid var(--gold);outline-offset:2px;border-radius:5px}

/* the readiness checklist */
.check-list{display:flex;flex-direction:column;gap:2px;margin:6px 0}
.check{display:grid;grid-template-columns:18px 1fr auto;gap:6px;align-items:center;font-size:12.5px;
  padding:2px 4px;border-radius:5px}
.check.ok{color:var(--jade2)}
.chk-mark{font-weight:900;text-align:center}
.chk-label{font-weight:700}
.chk-val{font-size:11.5px;font-weight:800;color:var(--ink2);background:var(--cream2);border-radius:5px;padding:1px 6px}
.check.ok .chk-val{background:rgba(58,157,120,.16);color:var(--jade2)}
.ready-card.done{border-color:var(--jade2);background:rgba(58,157,120,.08)}

/* the between-service overview */
.hub-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;margin-bottom:10px}
.hub-branch{font-size:20px;font-weight:900;color:var(--coral2);line-height:1.1}
.hub-day{font-size:14px;font-weight:800;color:var(--ink2);margin-top:2px}
.hub-next{font-size:13.5px;font-weight:700;color:var(--ink2);margin-top:3px;max-width:42ch;line-height:1.3}
.coin-chip.big{font-size:15px;padding:7px 12px}
.hub-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.hub-stat{background:var(--paper);border:2px solid rgba(42,26,30,.25);border-radius:9px;padding:7px 9px;
  display:flex;flex-direction:column;gap:1px;min-width:0}
.hub-stat b{font-size:19px;line-height:1.05;color:var(--ink)}
.hub-stat span{font-size:11px;font-weight:800;color:var(--ink2);text-transform:uppercase;letter-spacing:.02em}
.hub-stat i{font-size:10.5px;font-style:normal;color:#8a7a70;line-height:1.25}
.hub-xp{height:9px;background:#d9c7a8;border:2px solid var(--ink);border-radius:6px;margin:8px 0 2px;overflow:hidden}
.hub-xp.small{height:7px;margin:6px 0 0}
.hub-xp i{display:block;height:100%;background:linear-gradient(90deg,var(--jade3),var(--gold))}
.hub-block{background:var(--paper);border:2px solid rgba(42,26,30,.25);border-radius:10px;padding:9px 11px;margin-top:10px}
.hub-kicker{font-size:10.5px;font-weight:900;letter-spacing:.09em;color:#8a7a70;margin-bottom:4px}
.dest-ttl{font-size:14.5px;font-weight:800;line-height:1.3}
.dest-row{display:flex;flex-wrap:wrap;gap:6px;margin-top:5px}
.dest-prog{font-size:11.5px;font-weight:700;background:var(--cream2);border-radius:6px;padding:3px 7px;color:var(--ink2)}
.dest-prog.ok{background:rgba(58,157,120,.18);color:var(--jade2)}
.hub-block.ready{border-color:var(--jade2);box-shadow:0 0 0 2px rgba(58,157,120,.25)}
.hub-block.ready .btn{margin-top:7px}
.rec-row{display:flex;gap:10px;align-items:flex-start}
.rec-row canvas{image-rendering:pixelated;flex:none}
.rec-txt{flex:1 1 auto;min-width:0}
.rec-name{font-size:15px;font-weight:900;color:var(--coral2)}
.rec-benefit{font-size:12px;font-weight:700;color:var(--ink2)}
.rec-why{font-size:12px;line-height:1.35;margin-top:3px;color:var(--ink);background:rgba(79,193,201,.14);
  border-radius:6px;padding:3px 7px}
.rec-side{display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex:none}
.rec-cost{font-weight:900;font-size:14px;color:#9a7f55}
.rec-cost.ok{color:var(--jade2)}
.rec-save{font-size:11px;font-weight:700;color:var(--ink2)}
.hub-more{margin-top:10px;text-align:center}
.hub-details{text-align:left;margin-top:8px}
.hub-details.hidden{display:none}
.hist-list{margin-top:8px}
.hist-row{display:grid;grid-template-columns:62px 54px 1fr 54px 84px;gap:4px;font-size:11.5px;
  padding:3px 4px;border-top:1px solid rgba(42,26,30,.12)}
.hist-row b{color:var(--jade2)}
.note-line.centre{text-align:center}
.branch-facts{display:flex;flex-direction:column;gap:5px;margin:8px 0}
.bf{background:var(--cream2);border-radius:7px;padding:5px 8px;font-size:12px;line-height:1.35}
.bf b{display:block;font-size:10.5px;letter-spacing:.05em;text-transform:uppercase;color:#8a7a70}
/* short notices, inside the frame and clear of the bottom bar */
#toasts{position:absolute;left:0;right:0;bottom:calc(var(--bar-h,56px) + 12px);display:flex;justify-content:center;
  pointer-events:none;z-index:7}
.toast{background:rgba(42,26,30,.94);color:var(--paper);border:2px solid #000;border-radius:999px;
  padding:7px 16px;font-size:13.5px;font-weight:800;box-shadow:0 3px 0 rgba(0,0,0,.45);
  animation:toastin .22s ease-out;max-width:86%;text-align:center;
  display:flex;align-items:center;gap:8px}
.toast canvas{image-rendering:pixelated;flex:none}
.toast.good{background:rgba(58,157,120,.96)}
.toast.gold{background:var(--gold);color:var(--ink);text-shadow:none}
.toast.big{font-size:15px;padding:9px 20px}
.toast.out{opacity:0;transform:translateY(6px);transition:opacity .3s, transform .3s}
@keyframes toastin{from{opacity:0;transform:translateY(10px) scale(.96)}to{opacity:1;transform:none}}
@media (max-width:620px){
  .hub-stats{grid-template-columns:repeat(2,1fr)}
  .hub-stat b{font-size:17px}
  .rec-row{flex-wrap:wrap}
  .rec-side{flex-direction:row;align-items:center;width:100%;justify-content:space-between}
  .manage-row{gap:6px}
  .manage-row .btn{font-size:13px;padding:6px 4px;min-height:52px}
  .util-row{gap:6px}
  .icon-btn.util{flex:1 1 0;min-width:0}
  .hist-row{grid-template-columns:52px 48px 1fr 44px;font-size:11px}
  .hist-row span:last-child{display:none}
}

/* recipe lessons */
#lesson-card{position:absolute;max-width:min(80vw,290px);background:var(--paper);border:3px solid var(--ink);
  border-radius:10px;padding:9px 11px 10px;box-shadow:0 4px 0 var(--ink),0 8px 22px rgba(0,0,0,.4);
  pointer-events:auto;z-index:8;display:flex;flex-direction:column;gap:6px}
.ls-head{display:flex;align-items:center;gap:7px}
.ls-n{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex:none;
  background:var(--gold);color:var(--ink);border:2px solid var(--ink);border-radius:50%;font-weight:900;font-size:13px}
.ls-title{font-size:11px;font-weight:800;letter-spacing:.03em;color:var(--ink2);text-transform:uppercase}
.ls-text{font-size:14px;line-height:1.35;font-weight:600;color:var(--ink)}
.ls-gesture{font-size:12px;font-weight:700;color:var(--jade2);background:rgba(58,157,120,.12);
  border-radius:6px;padding:3px 7px}
.ls-skip{align-self:flex-start;min-height:34px}
.lesson-panel{max-width:min(94vw,560px)}
.lesson-head{display:flex;gap:12px;align-items:flex-start;margin:4px 0 10px}
.lesson-head canvas{image-rendering:pixelated;flex:none}
.lesson-name{font-size:19px;font-weight:900;color:var(--coral2)}
.lesson-blurb{font-size:13px;line-height:1.4;margin-top:2px}
.lesson-sub{font-size:11px;font-weight:800;letter-spacing:.06em;color:var(--ink2);text-transform:uppercase;margin-bottom:4px}
.lesson-kit{margin-bottom:10px}
.kit-row{display:flex;flex-wrap:wrap;gap:6px}
.kit-item{display:flex;flex-direction:column;align-items:center;gap:1px;background:var(--cream2);
  border:2px solid rgba(42,26,30,.25);border-radius:8px;padding:5px 7px;min-width:72px}
.kit-item.wide{min-width:120px;align-items:flex-start}
.kit-item canvas{image-rendering:pixelated}
.kit-name{font-size:11px;font-weight:800;text-align:center}
.kit-note{font-size:10px;color:var(--ink2);text-align:center}
.kit-row.small .kit-item{min-width:60px;padding:4px 5px}
.lesson-verdict{text-align:center;font-size:15px;font-weight:800;color:var(--jade2);margin:8px 0 2px}
/* recipe book */
.recipe-book .shop-body{display:flex;flex-direction:column;gap:12px}
.rb-card{background:var(--paper);border:3px solid var(--ink);border-radius:10px;padding:10px 12px;
  display:flex;flex-direction:column;gap:8px}
.rb-top{display:flex;gap:10px;align-items:flex-start}
.rb-top canvas{image-rendering:pixelated;flex:none}
.rb-name{font-size:17px;font-weight:900;color:var(--coral2)}
.rb-blurb{font-size:12.5px;line-height:1.4}
.rb-state{font-size:11px;font-weight:800;color:var(--ink2);margin-top:3px}
.rb-state.done{color:var(--jade2)}
.rb-steps{font-size:13px;line-height:1.45;margin:0;padding-left:20px}
.rb-steps li{margin-bottom:3px}
.rb-need{font-size:12.5px;font-weight:700;color:var(--coral2);background:rgba(242,112,92,.12);border-radius:6px;padding:4px 8px}

/* Announcements */
.announce{position:absolute;left:50%;top:38%;transform:translate(-50%,-50%);pointer-events:none;text-align:center;animation:ann 2.2s forwards}
.announce .big{display:block;image-rendering:pixelated;filter:drop-shadow(0 3px 0 rgba(0,0,0,.5))}
@keyframes ann{0%{opacity:0;transform:translate(-50%,-40%) scale(.6)}15%{opacity:1;transform:translate(-50%,-50%) scale(1.05)}25%{transform:translate(-50%,-50%) scale(1)}80%{opacity:1}100%{opacity:0;transform:translate(-50%,-60%)}}

.kbd{font-size:11px;background:#fff;border:1px solid var(--ink);border-bottom-width:2px;border-radius:3px;padding:1px 5px;font-weight:700}
.help-list{font-size:13px;line-height:1.4;margin:6px 0 10px;padding-left:18px}
.help-list li{margin:3px 0}
@media (max-width:640px){
  .panel{padding:12px}
  .btn{font-size:14px;padding:7px 12px}
  .hud-chip{font-size:12px;padding:3px 7px}
  .hud-earn{min-width:120px;padding:3px 7px 5px}
  .hud-earn-row{font-size:13px}
  #tut .txt{font-size:12px} #tut{bottom:104px}
  .stat-grid{font-size:13px}
}

/* Portrait phones: gentle rotate hint */
#boot{position:absolute;inset:0;z-index:40;display:flex;align-items:center;justify-content:center;
  background:radial-gradient(ellipse at 50% 35%,#2d2026 0%,#15101a 75%);transition:opacity .35s}
#boot.gone{opacity:0;pointer-events:none}
.boot-inner{display:flex;flex-direction:column;align-items:center;gap:14px}
.boot-pot{width:54px;height:54px;border:4px solid var(--gold);border-top-color:transparent;border-radius:50%;animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.boot-text{color:var(--cream2);font-weight:800;font-size:15px;letter-spacing:.04em}
.boot-err{color:#ffb9ae;font-size:13px;max-width:78vw;text-align:center;line-height:1.45}
.title-bottom{display:flex;flex-direction:column;align-items:center;gap:8px}
.play-btn{font-size:22px;padding:12px 34px;min-width:200px}
.title-logo{animation-duration:3s}

/* journey map panel */
.journey{position:absolute;left:10px;bottom:52px;background:rgba(42,26,30,.86);border:2px solid #000;border-radius:8px;padding:8px 10px;color:var(--paper);pointer-events:auto;max-width:280px}
.j-title{font-weight:900;font-size:13px;color:var(--gold);margin-bottom:4px}
.j-row{font-size:12px;line-height:1.35}
.j-row b{color:var(--turq3)}
.map-shop-label.dim{opacity:.55;filter:grayscale(.5)}
.chapter-learn{background:var(--paper);border:2px solid var(--jade2);border-radius:6px;padding:6px 10px;font-size:13px;font-weight:600}
/* keyboard focus stays visible everywhere */
.btn:focus-visible,.icon-btn:focus-visible,.map-node:focus-visible,.toggle:focus-visible{outline:3px solid var(--gold);outline-offset:2px}

/* status strip shared by both screens */
#status-strip{position:absolute;left:0;right:0;bottom:0;display:flex;gap:6px;align-items:center;justify-content:center;
  padding:5px 8px calc(5px + env(safe-area-inset-bottom));background:rgba(26,16,22,.86);border-top:2px solid #000;
  pointer-events:auto;flex-wrap:wrap}
#st-chips{display:flex;gap:6px;align-items:center;justify-content:center;flex-wrap:wrap}
/* the workstation switcher a phone uses instead of the canvas tabs */
#panel-bar{display:flex;gap:6px;width:100%;justify-content:center;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
#panel-bar::-webkit-scrollbar{display:none}
#panel-bar.hidden{display:none}
.pan-btn{position:relative;flex:1 1 0;min-width:62px;min-height:48px;padding:5px 8px;background:#3f353c;color:#e4d8dd;
  border:3px solid #000;border-radius:9px;font-family:inherit;font-size:12px;font-weight:800;line-height:1.1;
  cursor:pointer;box-shadow:0 3px 0 #000;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}
.pan-btn[aria-pressed="true"]{background:var(--turq);color:#08343a;box-shadow:0 3px 0 #000,inset 0 0 0 2px rgba(255,255,255,.4)}
.pan-btn.takes{background:var(--jade);color:#fff;animation:pulse .9s infinite alternate}
.pan-btn.takes[aria-pressed="true"]{background:var(--turq);animation:none}
.pan-btn:active{transform:translateY(2px);box-shadow:0 1px 0 #000}
.pan-btn .pan-n{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:18px;padding:0 4px;
  background:var(--coral);color:#fff;border:2px solid #000;border-radius:9px;font-size:11px;font-weight:900}
.pan-btn .pan-n.zero{display:none}
.st-chip{display:flex;align-items:center;gap:5px;background:#3a2f36;color:#cbbfc4;border:2px solid #000;border-radius:6px;padding:3px 8px;font-size:11px;font-weight:700}
.st-chip b{font-size:13px;color:#8a7f86;min-width:10px;text-align:center}
.st-chip.on{background:#4a3f46;color:var(--paper)} .st-chip.on b{color:var(--gold)}
.st-chip.warn{background:var(--coral2);color:#fff;animation:pulse .8s infinite alternate} .st-chip.warn b{color:#fff}
/* big, labelled screen navigation with its keyboard shortcut printed on it */
#screen-nav{display:flex;gap:8px;margin-left:6px}
.nav-btn{display:flex;align-items:center;gap:8px;min-height:56px;min-width:118px;padding:6px 14px 6px 10px;
  background:#4a3f46;color:#e4d8dd;border:3px solid #000;border-radius:9px;font-family:inherit;font-size:14px;
  font-weight:800;line-height:1.08;text-align:left;cursor:pointer;box-shadow:0 3px 0 #000;transition:transform .07s}
.nav-btn kbd{display:flex;align-items:center;justify-content:center;width:26px;height:26px;flex:none;
  background:#2b2228;color:#cbbfc4;border:2px solid #000;border-radius:5px;font:inherit;font-size:14px;font-weight:800}
.nav-btn:hover{background:#5a4e55;color:#fff}
.nav-btn:active{transform:translateY(2px);box-shadow:0 1px 0 #000}
.nav-btn[aria-pressed="true"]{background:var(--gold);color:var(--ink);box-shadow:0 3px 0 #000,inset 0 0 0 2px rgba(255,255,255,.35)}
.nav-btn[aria-pressed="true"] kbd{background:var(--ink);color:var(--gold)}
.nav-btn.alert{animation:pulse .9s infinite alternate}
.nav-btn .nav-n{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:20px;padding:0 5px;
  background:var(--coral);color:#fff;border:2px solid #000;border-radius:10px;font-size:12px;font-weight:900;margin-left:2px}
.nav-btn .nav-n.zero{display:none}
.nav-btn[aria-pressed="true"] .nav-n{background:var(--coral2)}
@media (max-width:620px){
  .nav-btn{min-width:0;gap:5px;font-size:13px;padding:6px 8px;min-height:48px;flex:1 1 0;
    justify-content:center;text-align:center;white-space:nowrap}
  .nav-btn kbd{display:none}
  /* "Dining room" over two lines is a desktop luxury; a phone gets the one word that matters */
  .nav-lab{font-size:0}
  .nav-lab::before{content:attr(data-short);font-size:13px;font-weight:800}
  #screen-nav{flex:1 1 100%;gap:6px;margin-left:0;flex-wrap:nowrap}
  #status-strip{gap:5px;padding:4px 6px calc(4px + env(safe-area-inset-bottom))}
  /* The six counters shrink to badges. One row, never wrapping, and a FIXED height whatever is
     in it: a counter reaching zero must not resize the bar, because the bar's height is what
     sets the canvas height - the picture would jump every time a table was wiped. The ones at
     zero step out of the way, so what is left is exactly what needs a hand. */
  #st-chips{gap:3px;width:100%;flex-wrap:nowrap;height:28px;overflow:hidden}
  .st-chip{font-size:0;gap:0;padding:0 5px;min-height:26px;flex:0 0 auto}
  .st-chip::before{font-size:11px;font-weight:800;color:inherit}
  .st-chip b{font-size:13px;margin-left:3px}
  #st-queue::before{content:"Door"} #st-ready::before{content:"Order"} #st-cook::before{content:"Tickets"}
  #st-plate::before{content:"Trays"} #st-pay::before{content:"Pay"} #st-dirty::before{content:"Clean"}
  .hud-chip{font-size:12px;padding:3px 6px}
  #hud{padding:4px 4px;gap:4px;flex-wrap:nowrap}
  #hud > div{gap:4px;min-width:0}
  #hud-level{max-width:30vw;overflow:hidden;text-overflow:ellipsis}
  #hud-combo{display:none}
  .hud-earn{min-width:96px;padding:3px 7px 5px}
  .hud-earn-row{font-size:13px}
  .hud-btn{min-width:40px;min-height:32px;padding:4px 8px}
  .panel{padding:12px 12px;max-width:96%;max-height:100%}
  /* the opening tutorial reads as a line of text, not a column of single words */
  #tut{max-width:95vw;padding:8px 10px;gap:8px;flex-wrap:wrap}
  #tut canvas,#tut img{width:36px !important;height:auto !important;flex:none}
  #tut .txt{font-size:13.5px;line-height:1.3;flex:1 1 180px;min-width:0}
  #tut .btn{margin-left:auto;flex:0 0 auto;min-height:40px}
  .btn{min-height:48px}
  .btn.small{min-height:40px}
}
/* Below about 360px all six counters will not fit on one line, and wrapping them would cost the
   canvas a whole row. There the ones at zero stand down, leaving what needs a hand. */
@media (max-width:359px){
  .st-chip:not(.on){display:none}
  /* At 320px the HUD overflowed and carried the PAUSE button off the right edge, where it
     could not be pressed at all. The three groups are allowed to shrink, the branch name
     gives up the room first, and a 320px screen is a phone - it has no keys to print. */
  #hud{padding:3px;overflow:hidden}
  #hud > div{min-width:0}
  .hud-left{flex:0 1 auto;overflow:hidden}
  .hud-right{flex:0 0 auto}
  .hud-timer{flex:none}
  /* Three groups cannot all fit in 320px. The branch name goes: truncated to "Day 3 - Ho..."
     it told you nothing, and the hub says where you are. The clock, the takings, the coins and
     PAUSE are what you actually read mid-service, and they all stay. */
  #hud-level{display:none}
  .hud-btn kbd,.nav-btn kbd{display:none}
  /* the earnings bar shrinks rather than being sliced in half by the clip above */
  .hud-center{flex:1 1 auto;min-width:0;display:flex;justify-content:center;overflow:hidden}
  .hud-earn{min-width:0;max-width:100%;padding:2px 5px 4px}
  .hud-earn-row{font-size:12px}
  .hud-coins{padding:3px 5px}
}
/* the thin HUD a phone uses on its side */
body.hud-slim #hud{padding:2px 4px;gap:4px;flex-wrap:nowrap}
body.hud-slim .hud-chip{font-size:11px;padding:2px 6px;border-width:2px}
body.hud-slim .hud-earn{min-width:88px;padding:1px 6px 2px}
body.hud-slim .hud-earn-row{font-size:12px}
body.hud-slim .hud-bar{height:5px;margin-top:2px}
body.hud-slim .hud-star{width:10px;height:10px;top:-3px}
body.hud-slim .hud-btn{min-height:26px;padding:2px 8px;font-size:12px}
body.hud-slim #hud-level{max-width:26vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* a phone on its side: keep the bottom bar as thin as it can usefully be */
@media (max-height:460px) and (orientation:landscape){
  #st-chips{display:none}
  .nav-btn{min-height:44px;font-size:13px;padding:4px 10px;white-space:nowrap}
  /* height is the scarce axis here, so the labels lose their second line too */
  .nav-lab{font-size:0}
  .nav-lab::before{content:attr(data-short);font-size:13px;font-weight:800}
  #panel-bar .pan-btn{min-height:42px;font-size:11px}
  #hud{padding:3px 5px}
}
/* geographic map */
.city-dot{position:absolute;transform:translate(-50%,-50%);width:14px;height:14px;border-radius:50%;background:var(--coral);
  border:3px solid var(--ink);box-shadow:0 0 0 3px rgba(255,255,255,.6);pointer-events:auto}
.city-dot.locked{background:#8a8a8a}
.city-dot.done{background:var(--jade);box-shadow:0 0 0 3px rgba(255,255,255,.6),0 0 0 6px rgba(58,157,120,.45)}
.city-note{position:absolute;transform:translateY(-50%);background:rgba(58,157,120,.92);color:#fff;
  border:2px solid var(--ink);border-radius:5px;padding:2px 6px;font-size:10.5px;font-weight:800;
  white-space:nowrap;pointer-events:none}
.city-label{position:absolute;transform:translateY(-50%);background:rgba(255,248,238,.92);border:2px solid var(--ink);
  border-radius:5px;padding:2px 6px;font-size:11px;font-weight:800;white-space:nowrap;pointer-events:none}
.city-label.dim{opacity:.5}
.lvl-pack{position:absolute;display:flex;gap:6px;pointer-events:auto}
.lvl-pack.west{transform:translate(-100%,-50%)}
.lvl-pack.east{transform:translate(0,-50%)}
.lvl-badge{position:relative;width:30px;height:30px;border-radius:50%;border:3px solid var(--ink);background:var(--gold);
  font-weight:900;font-size:13px;color:var(--ink);cursor:pointer;font-family:var(--font);box-shadow:0 2px 0 var(--ink)}
.lvl-badge.locked{background:#9a9a9a;color:#ddd;cursor:not-allowed}
.lvl-badge.done{background:var(--jade3)}
.lvl-badge.current{background:var(--coral);color:#fff;animation:nodepulse 1s infinite alternate}
.lvl-badge .stars{position:absolute;bottom:-9px;left:50%;transform:translateX(-50%);display:flex;gap:1px}
.lvl-badge .stars i{width:7px;height:7px;background:#5a4a30;clip-path:polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%)}
.lvl-badge .stars i.lit{background:var(--gold)}
.journey-panel{position:absolute;pointer-events:auto;width:376px;background:rgba(42,26,30,.9);border:3px solid #000;border-radius:10px;
  padding:10px 12px;color:var(--paper);pointer-events:auto}
.j-head{font-weight:900;font-size:12px;letter-spacing:1px;color:var(--gold);margin-bottom:4px}
.j-title{font-weight:900;font-size:16px;color:var(--coral3);margin-bottom:5px}
.j-blurb{font-size:12px;line-height:1.4;margin:0 0 7px;opacity:.92}
.j-note{font-size:10px;opacity:.6;margin-top:7px;line-height:1.3}

/* ---------- the restaurant hub, shop and build mode ---------- */
.panel.hub .lead{margin:4px 0 8px}
.goal-card{background:#2b2228;border:3px solid #000;border-radius:10px;padding:10px 12px;margin:8px 0;text-align:left}
.goal-head{font-size:11px;font-weight:800;letter-spacing:.08em;color:#8a7f86}
.goal-title{font-size:17px;font-weight:800;color:var(--gold);margin-top:2px}
.goal-sub{font-size:13px;color:#cbbfc4;margin-top:1px}
.goal-bar{height:10px;background:#1a1016;border:2px solid #000;border-radius:5px;margin:7px 0 4px;overflow:hidden}
.goal-bar i{display:block;height:100%;background:linear-gradient(90deg,#d6961f,#f5c242)}
.goal-cost{font-size:12px;color:#e4d8dd}
.notice-row{background:#4a3f46;border:2px solid #000;border-radius:7px;padding:5px 9px;font-size:13px;color:var(--gold);margin:6px 0}
.advice{background:#3a2f36;border-left:4px solid var(--jade2);border-radius:5px;padding:7px 10px;margin:8px 0;font-size:13px;color:#e4d8dd;text-align:left}
.upg .cat{font-size:10px;font-weight:800;letter-spacing:.07em;color:#8a7f86;margin:2px 0 3px}
.btn.big{font-size:17px;padding:11px 22px;min-height:52px}

/* ============ interface pass: spacing, touch targets, states ============ */
.btn{min-height:48px;padding:10px 18px;font-size:15px;border-radius:9px;transition:transform .07s, filter .12s}
.btn.small{min-height:40px;padding:7px 13px;font-size:13px}
.btn.tiny{min-height:32px;padding:4px 9px;font-size:11px}
.btn.big{min-height:60px;padding:14px 26px;font-size:18px}
.btn:hover:not(:disabled){filter:brightness(1.08)}
.btn:active:not(:disabled){transform:translateY(2px)}
.btn:disabled{opacity:.45;cursor:not-allowed;filter:grayscale(.4)}
.btn:focus-visible{outline:3px solid var(--gold);outline-offset:3px}
.btn.ghost,.btn.quiet{background:var(--cream2);color:var(--ink);border-color:var(--ink);box-shadow:0 3px 0 #000;text-shadow:none}
.btn.ghost.on,.btn.quiet.on{background:var(--gold);color:var(--ink)}
.row{display:flex;gap:12px;flex-wrap:wrap;justify-content:center;margin-top:12px}
.row.tight{gap:8px;margin-top:0}
.row.between{justify-content:space-between;align-items:center;gap:12px;margin-top:0}
.primary-row{margin-top:16px}
.quiet-row{margin-top:14px;opacity:.9}
.quiet-row .btn{box-shadow:0 2px 0 #000}
.panel{padding:20px 22px}
.panel.wide{max-width:min(96%,760px)}
.panel .lead{margin:6px 0 10px}

/* hub */
.xp-box{background:#2b2228;border:2px solid #000;border-radius:8px;padding:7px 10px;margin:10px 0 4px;text-align:left}
.xp-head{font-size:12px;color:#cbbfc4}
.xp-head b{color:var(--gold)}
.xp-bar{height:9px;background:#1a1016;border:2px solid #000;border-radius:5px;margin-top:5px;overflow:hidden}
.xp-bar i{display:block;height:100%;background:linear-gradient(90deg,#246b52,#6cc39a)}
.fact-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:8px;margin:10px 0}
.fact{display:flex;justify-content:space-between;align-items:center;gap:8px;background:#3a2f36;border:2px solid #000;border-radius:7px;padding:7px 10px;font-size:13px;white-space:nowrap}
.fact span{color:#9a8f96}
.fact b{color:var(--paper)}
.menu-strip{display:flex;gap:10px;align-items:baseline;background:#2b2228;border:2px solid #000;border-radius:7px;padding:7px 10px;margin:8px 0;text-align:left}
.menu-label{font-size:10px;font-weight:800;letter-spacing:.08em;color:#8a7f86;flex:none}
.menu-names{font-size:13px;font-weight:700;color:var(--gold)}
.note-line{font-size:12px;color:#b5a9af;text-align:left;margin:6px 0}
.note-line.muted{color:#8a7f86}
.goal-wrap{margin-top:10px}
.goal-card{background:#2b2228;border:3px solid #000;border-radius:10px;padding:10px 12px;margin:0 0 8px;text-align:left}
.goal-head{font-size:10px;font-weight:800;letter-spacing:.09em;color:#8a7f86;margin-bottom:6px}
.goal-row{display:flex;gap:12px;align-items:center}
.goal-txt{flex:1;min-width:0}
.goal-title{font-size:16px;font-weight:800;color:var(--gold)}
.goal-sub{font-size:12px;color:#cbbfc4;margin-top:1px}
.goal-bar{height:9px;background:#1a1016;border:2px solid #000;border-radius:5px;margin:6px 0 4px;overflow:hidden}
.goal-bar i{display:block;height:100%;background:linear-gradient(90deg,#d6961f,#f5c242)}
.goal-cost{font-size:12px;color:#e4d8dd}
.goal-cost .ready{color:#6cc39a}
.item-art{image-rendering:pixelated;flex:none}
.shop-btn{background:var(--jade);color:#fff}
.shop-btn .shop-ico{color:var(--gold3,#fde38a);margin-right:6px}

/* shop: one fixed window, only the product list scrolls */
.panel.shop{width:min(96%,820px);max-width:none;height:min(100%,660px);display:flex;flex-direction:column;gap:0;overflow:hidden}
.shop-head{flex:none}
.panel.shop .xp-box{flex:none}
.shop-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 8px;flex:none}
.shop-tab{min-height:40px;padding:7px 14px;background:#3a2f36;color:#cbbfc4;border:2px solid #000;border-radius:8px;
  font-family:inherit;font-size:13px;font-weight:700;cursor:pointer}
.shop-tab:hover{background:#4a3f46;color:#fff}
.shop-tab.on{background:var(--gold);color:var(--ink)}
.shop-tab:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.shop-body{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;gap:9px;overflow-y:auto;padding:2px 4px 4px 2px}
.shop-empty{display:flex;align-items:center;justify-content:center;height:100%;min-height:160px;color:#9a8f96;font-size:14px;text-align:center;padding:0 20px}
.shop-card{display:flex;gap:12px;align-items:stretch;background:var(--paper);border:3px solid var(--ink);border-radius:10px;
  padding:10px 12px;text-align:left;flex:none;min-height:104px}
.shop-card.owned{opacity:.72}
.shop-card.locked{filter:grayscale(.5);opacity:.85}
.shop-art{width:60px;flex:none;display:flex;align-items:center;justify-content:center}
.shop-info{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center}
.shop-name{font-size:15px;font-weight:800;color:var(--ink);display:flex;align-items:center;gap:6px}
.lock-ico{font-size:13px;filter:grayscale(1)}
.shop-benefit{font-size:12px;font-weight:700;color:var(--jade2);margin-top:1px}
.shop-effect{font-size:12px;color:#5a4a50;margin-top:3px;line-height:1.3}
.shop-facts{font-size:11.5px;color:#6a5a60;margin-top:4px;line-height:1.35;border-left:3px solid var(--gold2);padding-left:7px}
.shop-own{font-size:11px;font-weight:700;color:#7a6a70;margin-top:3px}
.shop-req{font-size:11.5px;font-weight:700;color:#8a2f24;margin-top:4px}
.req-bar{height:6px;background:#e3d6c8;border:2px solid #8a2f24;border-radius:4px;margin-top:4px;max-width:220px;overflow:hidden}
.req-bar i{display:block;height:100%;background:#c8352e}
.shop-side{display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:6px;flex:none;min-width:104px}
.shop-side .btn.tiny{min-height:28px;font-size:10.5px;padding:3px 8px;opacity:.85}
.shop-side .btn.tiny.on{opacity:1}
.shop-price{font-size:15px;font-weight:800;color:#d6961f}
.locked-btn{background:#cfc6c2;color:#6a5a5e;border-color:#000;box-shadow:0 3px 0 #000;cursor:not-allowed}
.shop-lock{font-size:11px;font-weight:800;color:#8a2f24;background:#f0d8d0;border:2px solid #8a2f24;border-radius:5px;padding:2px 7px}
.shop-note{flex:none;margin:8px 0 0}
.shop-foot{flex:none}

/* a panel with a pinned heading and primary action, and a scrolling middle */
.panel.sheet{display:flex;flex-direction:column;gap:0;overflow:hidden;padding:12px 14px;
  width:min(94%,620px,var(--stage-w,100%));
  /* 100% of the .screen content box already excludes the HUD, the bottom bar and the safe areas */
  max-height:100%}
.sheet-head{flex:none;padding-bottom:6px}
.sheet-body{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;padding:2px 2px 8px;
  mask-image:linear-gradient(180deg,#000 0,#000 calc(100% - 10px),transparent 100%)}
.sheet-foot{flex:none;padding-top:8px;border-top:2px solid rgba(42,26,30,.16)}
.sheet-foot .row{margin-top:0}
.panel.sheet .result-head{margin-bottom:2px}
.panel.sheet .stars-big{margin:2px 0 0}

/* results extras */
.levelup{background:var(--jade2);color:#fff;border:3px solid #000;border-radius:9px;padding:8px 12px;margin:10px 0 4px;font-size:14px}
.unlock-row{margin:8px 0}
.unlock-head{font-size:10px;font-weight:800;letter-spacing:.09em;color:#8a7f86;margin-bottom:5px;text-align:left}
.unlock-strip{display:flex;gap:8px;flex-wrap:wrap}
.unlock-card{display:flex;flex-direction:column;align-items:center;gap:2px;background:#2b2228;border:2px solid #000;border-radius:8px;padding:6px 8px;min-width:80px}
.unlock-name{font-size:11px;font-weight:700;color:var(--paper);text-align:center;line-height:1.1}
.unlock-cost{font-size:11px;color:var(--gold)}

/* how to play */
.panel.how{max-width:min(96vw,880px)}
.how-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin:12px 0;max-height:min(460px,calc(var(--stage-h,100vh) * 0.54));overflow-y:auto;padding:2px}
.how-card{background:var(--paper);border:3px solid var(--ink);border-radius:10px;padding:10px;text-align:left}
.how-head{display:flex;align-items:center;gap:8px}
.how-num{width:26px;height:26px;flex:none;display:flex;align-items:center;justify-content:center;background:var(--coral2);color:#fff;
  border:2px solid var(--ink);border-radius:50%;font-weight:800;font-size:14px}
.how-title{font-size:15px;font-weight:800;color:var(--ink)}
.how-art{display:block;margin:8px auto 6px;background:#f0e6d4;border:2px solid #d7c6ab;border-radius:6px}
.how-text{font-size:12.5px;line-height:1.35;color:#4a3337;margin:0}
.how-keys{font-size:12.5px;color:#cbbfc4;background:#2b2228;border:2px solid #000;border-radius:8px;padding:8px 10px;text-align:left}
.how-keys kbd{display:inline-block;background:#1a1016;border:2px solid #000;border-radius:4px;padding:0 5px;margin:0 1px;font:inherit;font-size:11px;color:var(--gold)}

/* build drawer */
.build-panel{position:absolute;left:0;right:0;bottom:0;max-height:34%;pointer-events:auto;background:rgba(26,16,22,.96);
  border-top:3px solid #000;padding:8px 12px;display:flex;flex-direction:column;gap:7px}
.bp-head{font-size:13px;font-weight:800;letter-spacing:.07em;color:var(--gold)}
.bp-note{font-size:12px;color:#9a8f96;margin:0;text-align:left}
.bp-list{display:flex;gap:8px;overflow-x:auto;min-height:46px;align-items:center}
.bp-item{display:flex;align-items:center;gap:8px;background:#2b2228;border:2px solid #000;border-radius:8px;
  padding:5px 10px;min-height:46px;flex:none;cursor:pointer;color:#e4d8dd;font-family:inherit}
.bp-item:hover{background:#3d323a}
.bp-item:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.bp-name{font-size:12px;font-weight:700}
.bp-name i{font-style:normal;color:var(--gold);margin-left:6px}
.bp-empty{font-size:12.5px;color:#9a8f96}
.bp-warn{background:var(--coral2);color:#fff;border:2px solid #000;border-radius:6px;padding:5px 9px;font-size:12px;font-weight:700}
@media (max-width:700px){
  .panel.shop{width:98%;height:100%}
  .shop-card{flex-wrap:wrap;min-height:0}
  .shop-side{min-width:0;flex-direction:row;align-items:center;width:100%;justify-content:space-between}
  .how-grid{max-height:min(380px,calc(var(--stage-h,100vh) * 0.48))} .btn{min-height:48px}
}

/* ---- settings rows: one target, aligned labels, a state word beside the switch ---- */
.setting-row{display:flex;align-items:center;justify-content:space-between;gap:14px;width:100%;
  min-height:52px;padding:8px 12px;margin:6px 0;background:#2b2228;border:2px solid #000;border-radius:9px;
  font:inherit;color:var(--paper);text-align:left;cursor:pointer}
.setting-row:hover{background:#3a2f36}
.setting-row:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.set-label{font-size:14px;font-weight:700;line-height:1.25}
.set-right{display:flex;align-items:center;gap:10px;flex:none}
.set-state{font-size:12px;font-weight:800;color:#9a8f96;min-width:26px;text-align:right}
.setting-row[aria-pressed="true"] .set-state{color:var(--jade3)}

/* ---- bottom navigation: readable in every state, selected marked by more than colour ---- */
.nav-btn{background:#3f353c;color:#f2e9ec;border:3px solid #000;box-shadow:0 3px 0 #000}
.nav-btn kbd{background:#1d1519;color:#f2e9ec;border:2px solid #000}
.nav-btn:hover{background:#564a53;color:#fff}
.nav-btn:hover kbd{background:#2a2228;color:#fff}
.nav-btn:focus-visible{outline:3px solid var(--gold);outline-offset:3px}
.nav-btn[aria-pressed="true"]{background:var(--gold);color:#241a1e;
  box-shadow:0 3px 0 #000, inset 0 0 0 3px rgba(255,255,255,.55)}
.nav-btn[aria-pressed="true"] kbd{background:#241a1e;color:var(--gold)}
.nav-btn[aria-pressed="true"]::after{content:"";position:absolute;left:8px;right:8px;bottom:4px;height:3px;background:#241a1e;border-radius:2px}
.nav-btn{position:relative}
.nav-btn:disabled{opacity:.5;color:#cfc6c2;cursor:not-allowed}
.nav-btn.alert{box-shadow:0 3px 0 #000, 0 0 0 3px var(--coral)}
.st-chip{color:#ded2d7}
.st-chip b{color:#a99ca3}

/* ---- how to play: one readable column that scrolls ---- */
.how-grid{display:flex;flex-direction:column;gap:10px;max-height:min(420px,calc(var(--stage-h,100vh) * 0.56));overflow-y:auto;padding:2px 4px 2px 2px}
.how-card{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;gap:4px 12px;align-items:center}
.how-card .how-head{grid-column:1/3}
.how-art{grid-column:1;grid-row:2;margin:0}
.how-text{grid-column:2;grid-row:2}
@media (min-width:860px){ .how-grid{display:grid;grid-template-columns:1fr 1fr;align-content:start} .how-card:last-child{grid-column:1/3} }

/* ---- journey, regulars and mastery ---- */
.journey-card{background:#2b2228;border:3px solid #000;border-radius:10px;padding:11px 13px;margin:10px 0;text-align:left}
.j-head2{font-size:10px;font-weight:800;letter-spacing:.09em;color:#8a7f86}
.j-title2{font-size:17px;font-weight:800;color:var(--gold);margin-top:2px}
.j-blurb2{font-size:12.5px;color:#cbbfc4;margin:4px 0 8px;line-height:1.35}
.j-steps{display:flex;flex-direction:column;gap:5px}
.j-step{display:flex;align-items:center;gap:9px;font-size:12.5px;color:#cbbfc4}
.j-step.done{color:var(--jade3)}
.j-tick{width:16px;flex:none;text-align:center;font-weight:800}
.j-label{flex:1}
.j-count{flex:none;font-weight:700;color:#9a8f96}
.j-step.done .j-count{color:var(--jade3)}
.j-reward{margin-top:9px;font-size:13px;font-weight:700;color:var(--gold)}
.j-next{margin-top:9px;font-size:12px;color:#9a8f96}
.mastery-row{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0}
.mastery{display:flex;flex-direction:column;gap:1px;background:#3a2f36;border:2px solid #000;border-radius:7px;padding:5px 9px;min-width:92px}
.mastery.on{background:#3d3a2a;border-color:#6a5a1a}
.m-name{font-size:11px;font-weight:700;color:#e4d8dd}
.m-stars{font-size:12px;color:var(--gold)}
.m-next{font-size:10px;color:#9a8f96}
.regular-line{display:flex;align-items:center;gap:10px;background:#3a2f36;border:2px solid #000;border-radius:8px;
  padding:7px 10px;margin:8px 0;font-size:13px;color:#e4d8dd;text-align:left}
.regular-line b{color:var(--gold)}

/* what you own, said the same way everywhere */
.own-badge{font:700 10px/1.3 var(--ui);letter-spacing:.08em;text-transform:uppercase;
  display:inline-block;padding:2px 7px;border-radius:999px;margin:0 0 4px}
.own-badge.ok{background:#1f6b4a;color:#dff6e8}
.own-badge.warn{background:#8a5a12;color:#ffeccd}
.own-badge.muted{background:#4a4038;color:#cdc0b2}
.shop-own.warn{color:#d59b3a}
.shop-card.stored{box-shadow:inset 0 0 0 2px #c58a2a}
.goal-card.goal-done .goal-head{color:#6fd39a}

/* where the branch stands, after a service */
.standing{margin:10px 0;padding:10px 12px;border-radius:10px;background:rgba(0,0,0,.14)}
.standing-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:6px 0}
.standing-cell{text-align:center}
.standing .sc-val{font:800 17px/1.1 var(--ui);color:var(--ink)}
.standing .sc-key{font:600 9px/1.3 var(--ui);letter-spacing:.06em;text-transform:uppercase;opacity:.7}
@media (max-width:420px){ .standing-grid{grid-template-columns:repeat(2,1fr)} }

/* the map: a restaurant standing above each city */
.venue-btn{position:absolute;pointer-events:auto;transform:translate(-50%,-100%);background:none;border:0;padding:2px;
  cursor:pointer;line-height:0;filter:drop-shadow(0 2px 3px rgba(0,0,0,.45))}
.venue-btn.locked{opacity:.45;filter:grayscale(1)}
.venue-btn.sel{transform:translate(-50%,-100%) scale(1.18)}
.venue-btn.here .venue-ico{outline:2px solid var(--gold);outline-offset:3px;border-radius:4px}
.venue-btn .venue-lock,.venue-btn .venue-badge{position:absolute;right:-5px;top:-3px;font-size:11px;line-height:1}
.venue-btn .venue-badge{color:var(--gold);text-shadow:0 1px 2px #000}
button.city-dot{cursor:pointer;border:0;padding:0;pointer-events:auto}
.city-dot.sel{box-shadow:0 0 0 4px rgba(245,194,66,.9)}
.city-label.active{color:var(--gold);font-weight:800}
.city-label.sel{text-decoration:underline}
.branch-panel .bp-head{display:flex;gap:10px;align-items:center;margin:2px 0 6px}
.branch-panel .bp-venue{font:600 11px/1.3 var(--ui);opacity:.78}
.branch-panel .bp-stat{display:flex;justify-content:space-between;gap:8px;padding:3px 0;
  border-bottom:1px solid rgba(0,0,0,.10);font:600 11px/1.4 var(--ui)}
.branch-panel .bp-k{opacity:.7}
.branch-panel .bp-v{text-align:right;font-weight:800}
.branch-panel .bp-req{display:flex;gap:6px;font:600 11px/1.5 var(--ui);opacity:.85}
.branch-panel .bp-req.ok{opacity:1;color:#2f7d55}
.branch-panel .bp-tick{width:12px}
.branch-panel .bp-active{font:700 11px/1.4 var(--ui);color:var(--gold);margin:6px 0}
.branch-panel .btn.wide{width:100%;margin-top:8px}

/* a key cap on a HUD button */
.hud-btn{position:relative}
.hud-btn kbd{position:absolute;right:-3px;bottom:-4px;font:700 8px/1 var(--ui);
  background:var(--ink);color:var(--paper);border-radius:3px;padding:2px 3px;pointer-events:none}
.hud-btn kbd:empty{display:none}

/* ---------------------------------------------------------------------------
   Button hierarchy. Four weights, named for the job rather than the colour,
   so a screen can be read at a glance:
     primary    one per screen - the thing you came here to do (gold)
     secondary  an equal alternative, or a second useful action (jade/turquoise)
     quiet      take it or leave it: skip, dismiss, go back (cream, no fill)
     danger     destructive, and never the primary (coral)
   Sizes are separate: .big, (default), .small, .tiny, and .wide to fill a row.
   The older colour names still work; these are what new screens should use.
--------------------------------------------------------------------------- */
.btn.primary{background:var(--gold);color:var(--ink);text-shadow:none}
.btn.secondary{background:var(--turq)}
.btn.quiet{background:var(--cream2);color:var(--ink);text-shadow:none}
.btn.danger{background:var(--coral)}

/* the service results: the four figures that matter, then the rest on request */
.result-branch{font:800 13px/1.3 var(--ui);color:var(--coral2);text-align:center;margin:2px 0 4px}
.res-key{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:6px 0 8px}
.res-cell{text-align:center;background:rgba(0,0,0,.07);border-radius:9px;padding:7px 4px}
.res-cell b{display:block;font:900 19px/1.1 var(--ui);color:var(--ink)}
.res-cell.gold b{color:#d6961f}
.res-cell span{display:block;font:700 9.5px/1.3 var(--ui);letter-spacing:.05em;text-transform:uppercase;opacity:.72}
.res-xp-line{font:700 12px/1.4 var(--ui);text-align:center;color:var(--ink2);margin:2px 0 4px}
.res-next{margin:8px 0;padding:8px 10px;border-radius:9px;background:rgba(0,0,0,.07)}
.res-next-ttl{font:800 13.5px/1.35 var(--ui);color:var(--ink)}
.res-more.hidden{display:none}
@media (max-width:430px){ .res-key{grid-template-columns:repeat(2,1fr)} .res-cell b{font-size:17px} }

/* staff cards: the role, what it automates, and what stays the player's */
.role-tag{display:inline-block;font:800 9.5px/1.3 var(--ui);letter-spacing:.07em;text-transform:uppercase;
  background:var(--turq);color:#08343a;border-radius:999px;padding:2px 8px;margin:3px 0}
.role-does{margin:3px 0 4px;padding-left:16px;font:600 11.5px/1.45 var(--ui)}
.role-does li{margin:1px 0}
.role-yours{font:600 11px/1.4 var(--ui);opacity:.78}
.role-yours b{opacity:1}

/* the two action buttons that sit beside the screen nav: the bell and the staff sheet */
#screen-nav{display:flex;gap:8px;align-items:stretch}
.nav-btn.act-btn{min-width:84px}
.nav-btn.act-btn .nav-n{right:6px}
#nav-bell{background:#6b4a1c;color:#ffeccd}
#nav-bell:not(:disabled).ready{background:var(--gold);color:var(--ink);
  box-shadow:0 3px 0 #000,0 0 0 3px rgba(245,194,66,.55);animation:pulse .9s infinite alternate}
#nav-bell:disabled{opacity:.45}
#nav-staff{background:#2d5a63;color:#dff3f6}
#nav-staff.alert{box-shadow:0 3px 0 #000,0 0 0 3px var(--turq)}
/* the staff sheet: every member, what they are doing, and a switch each */
.staff-row{display:flex;align-items:center;gap:10px;padding:8px 2px;border-bottom:1px solid rgba(42,26,30,.12)}
.staff-row:last-child{border-bottom:0}
.staff-txt{flex:1 1 auto;min-width:0}
.staff-name{font:800 14px/1.2 var(--ui)}
.staff-note{font:600 12px/1.35 var(--ui);opacity:.78}
.staff-row .toggle{flex:none}
.staff-empty{font:600 12.5px/1.45 var(--ui);opacity:.75;padding:6px 0}

/* The six status badges stay on a phone - they are what tells you where the work is - but the
   rules that size them live in the (max-width:620px) block above, as one decision in one place.
   An earlier version of this file set them here too, larger, and quietly undid that block:
   the counters came back at 34px, wrapped onto a second row and cost the canvas 42px. */
/* a finger needs a bigger HUD button than a mouse does */
.touch .hud-btn{min-width:48px;min-height:48px;font-size:16px;padding:8px 12px}
.touch .hud-btn kbd{display:none}
.icon-btn.plain{background:none;border:0;padding:4px;min-width:48px;min-height:48px;
  display:flex;align-items:center;justify-content:center;cursor:pointer}

/* A finger needs 48px, and the HUD still has to fit a 360px phone: the earn bar gives up the
   room rather than the buttons, and the three groups never overflow the frame. */
.touch #hud{gap:4px;padding:4px 4px;flex-wrap:nowrap}
.touch .hud-left,.touch .hud-right{flex:0 0 auto;min-width:0;gap:4px}
.touch .hud-center{flex:1 1 auto;min-width:0;display:flex;justify-content:center;overflow:hidden}
.touch .hud-earn{min-width:0;max-width:100%;padding:2px 6px 4px}
@media (max-width:430px){
  .touch .hud-chip{padding:3px 6px;font-size:11px}
  .touch .hud-coins{padding:3px 6px}
}

/* the tutorial: a step counter, and a ring drawn around the real button to press */
#tut .txt{display:flex;flex-direction:column;gap:3px}
#tut .tut-step{font:800 9.5px/1.2 var(--ui);letter-spacing:.09em;text-transform:uppercase;color:var(--coral2)}
#tut .tut-text{font-size:14px;line-height:1.35}
.tut-spot{position:absolute;pointer-events:none;z-index:40;border-radius:14px;
  box-shadow:0 0 0 3px var(--gold),0 0 0 7px rgba(245,194,66,.35),0 0 24px rgba(245,194,66,.55);
  animation:spotpulse 1s ease-in-out infinite alternate}
.tut-spot i{position:absolute;left:50%;top:-26px;transform:translateX(-50%);
  width:0;height:0;border-left:11px solid transparent;border-right:11px solid transparent;
  border-top:16px solid var(--gold);filter:drop-shadow(0 2px 0 rgba(0,0,0,.6));
  animation:spotbob .7s ease-in-out infinite alternate}
@keyframes spotpulse{from{box-shadow:0 0 0 3px var(--gold),0 0 0 6px rgba(245,194,66,.22),0 0 16px rgba(245,194,66,.4)}
  to{box-shadow:0 0 0 4px var(--gold),0 0 0 10px rgba(245,194,66,.42),0 0 28px rgba(245,194,66,.7)}}
@keyframes spotbob{from{top:-26px}to{top:-19px}}

/* music volume: four steps, finger-sized */
.vol-row{display:flex;align-items:center;gap:8px}
.vol-bar{display:flex;gap:3px}
.vol-cell{width:22px;height:30px;min-height:30px;padding:0;border:2px solid var(--ink);border-radius:4px;
  background:var(--cream2);cursor:pointer}
.vol-cell.on{background:var(--turq)}
.touch .vol-cell{width:34px;height:44px;min-height:44px}
.setting-row.static{cursor:default}

/* the results page: four figures, the branch level, one next step */
.res-level{margin:8px 0 6px;padding:8px 10px;border-radius:9px;background:rgba(0,0,0,.07)}
.res-level-top{display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin-bottom:5px}
.res-level-top b{font:800 14px/1.2 var(--ui)}
.res-level-top span{font:600 11.5px/1.2 var(--ui);opacity:.75}

/* the opening story: a moving picture with a few lines under it */
.intro-panel{width:min(96%,660px)}
.intro-dots{display:flex;gap:6px;justify-content:center;margin:4px 0 2px}
.intro-dots i{width:22px;height:5px;border-radius:3px;background:rgba(42,26,30,.22)}
.intro-dots i.on{background:var(--coral)}
.intro-stage{position:relative;width:100%;aspect-ratio:16/9;border:3px solid var(--ink);border-radius:9px;
  overflow:hidden;background:#2a1f1a;box-shadow:0 3px 0 var(--ink)}
.intro-stage canvas{width:100%;height:100%;display:block;image-rendering:pixelated}
.intro-title{font:900 17px/1.25 var(--ui);color:var(--coral2);margin:10px 0 4px;text-align:center}
.intro-lines p{font:600 14px/1.45 var(--ui);margin:7px 0;opacity:0;animation:introLine .5s ease forwards}
.intro-lines b{color:var(--coral2)}
@keyframes introLine{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.intro-row{display:flex;gap:8px;align-items:center;justify-content:space-between}
.intro-row .btn.primary{margin-left:auto}
@media (max-width:480px){ .intro-title{font-size:15px} .intro-lines p{font-size:13px;margin:5px 0} }
.reduce-motion .intro-lines p{animation:none;opacity:1}
