/* Repair Shop Tycoon: a walk-around repair shop. System fonts only, no inline styles. */
[hidden]{display:none!important}
*{box-sizing:border-box}
html,body{margin:0;padding:0;height:100%;width:100%;overflow:hidden;overscroll-behavior:none;touch-action:none;
  -webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%}
body{position:fixed;inset:0;height:100dvh;background:#2b3a4f;color:#1d2b3a;
  font-family:ui-rounded,"SF Pro Rounded","Nunito","Segoe UI Rounded","Trebuchet MS",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
#rs{position:fixed;inset:0;height:100dvh;width:100vw;overflow:hidden;overscroll-behavior:none;touch-action:none}
#world{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;outline:none;cursor:pointer}
#world:focus-visible{box-shadow:inset 0 0 0 4px #ffd166aa}
button,a{touch-action:manipulation;font:inherit;color:inherit}
button{cursor:pointer}
.nojs{position:absolute;inset:40% 10% auto;text-align:center;font-weight:800;background:#fff;padding:16px;border-radius:16px}
svg{display:block}

/* ---------- HUD ---------- */
.hud{position:absolute;left:0;right:0;top:0;display:flex;align-items:center;gap:6px;flex-wrap:nowrap;z-index:5;
  padding:calc(env(safe-area-inset-top,0px) + 6px) calc(env(safe-area-inset-right,0px) + 8px) 6px calc(env(safe-area-inset-left,0px) + 8px);
  background:linear-gradient(#1d3557f2,#1d3557d9);box-shadow:0 3px 12px #0005}
.hbtn{flex:0 0 auto;width:46px;height:46px;border-radius:15px;border:0;display:grid;place-items:center;padding:0;
  background:linear-gradient(#fffdf6,#ffe7a8);box-shadow:0 3px 0 #c98f1d,0 5px 12px #0006,inset 0 1px 0 #fff;text-decoration:none}
.hbtn svg{width:30px;height:30px}
.hbtn:active{transform:translateY(2px);box-shadow:0 1px 0 #c98f1d}
.hbtn[aria-pressed="true"],.hbtn[aria-expanded="true"]{background:linear-gradient(#e9fff1,#9be7b5);box-shadow:0 3px 0 #3c9a5f,0 5px 12px #0006}
.hbtn:focus-visible,.sheet button:focus-visible,.menu a:focus-visible,.menu button:focus-visible{outline:4px solid #ffd166;outline-offset:2px}
.pill{flex:0 0 auto;height:40px;border-radius:20px;display:flex;align-items:center;gap:6px;padding:0 12px 0 6px;
  background:linear-gradient(#ffffff,#e8f1ff);box-shadow:inset 0 -2px 0 #b8c9e6,0 2px 6px #0004;font-weight:900;white-space:nowrap}
.pill b{font-size:19px;color:#163a5f}
.pic svg{width:28px;height:28px}
.cash b{color:#1e7a3c}
.cash.bump{animation:bump .5s}
@keyframes bump{40%{transform:scale(1.18)}}
.stars{padding:0 10px;gap:1px}
#stars{display:flex;gap:1px}
.stars svg{width:18px;height:18px}
.lvl{padding:0 12px}
.lvl b{font-size:16px}
.xbar{width:56px;height:10px;border-radius:5px;background:#cfdbee;overflow:hidden;display:block}
.xbar i{display:block;height:100%;width:0;background:linear-gradient(90deg,#4cc9f0,#4361ee);border-radius:5px;transition:width .4s}
.ticker{flex:1 1 0;min-width:0;margin:0;height:40px;display:flex;align-items:center;justify-content:center;text-align:center;
  padding:0 12px;border-radius:14px;background:#0d1b2acc;color:#fff;font-weight:800;font-size:17px;line-height:1.15;overflow:hidden}
.ticker.flash{animation:flash .6s}
@keyframes flash{0%{background:#ffd166;color:#3a2a00}100%{background:#0d1b2acc}}
/* portrait / narrow: the ticker gets its own row under the buttons so it never covers the shop */
@media (max-aspect-ratio:1/1),(max-width:620px){
  .hud{flex-wrap:wrap;row-gap:5px}
  .ticker{order:10;flex:1 1 100%;height:auto;min-height:36px;font-size:16px;padding:4px 10px}
}
@media (max-width:430px){.hbtn{width:42px;height:42px}.hbtn svg{width:27px;height:27px}.pill{height:38px;padding:0 9px 0 5px}.pill b{font-size:17px}
  .xbar{width:34px}.stars svg{width:14px;height:14px}.stars{padding:0 7px}.lvl{padding:0 8px}.hud{gap:4px}}
@media (max-width:360px){.stars{display:none}}
@media (max-height:430px) and (min-aspect-ratio:1/1){.hud{padding-top:calc(env(safe-area-inset-top,0px) + 4px);padding-bottom:4px}
  .hbtn{width:40px;height:40px}.pill{height:36px}.ticker{height:36px;font-size:15px}}

/* ---------- menu ---------- */
.menu{position:absolute;z-index:20;top:calc(env(safe-area-inset-top,0px) + 58px);left:calc(env(safe-area-inset-left,0px) + 8px);
  display:flex;flex-direction:column;gap:8px;padding:12px;border-radius:20px;background:#fffdf6;box-shadow:0 10px 30px #0007;min-width:230px;
  max-height:calc(100dvh - 70px);overflow-y:auto}
.menu a,.menu button{display:block;text-align:left;border:0;border-radius:14px;padding:13px 16px;font-size:18px;font-weight:800;color:#163a5f;
  background:#eef4ff;text-decoration:none}
.menu a:first-child{background:#ffe7a8}

/* ---------- sheet (cards, build, checkout) ---------- */
.sheet{position:absolute;z-index:10;display:flex;flex-direction:column;background:linear-gradient(#fffdf8,#f4f7fb);color:#1d2b3a;
  box-shadow:0 -6px 30px #0006;overflow:hidden}
.sheet.side{top:var(--hud-h,58px);right:0;bottom:0;width:clamp(300px,40vw,420px);border-radius:22px 0 0 0;
  padding-right:env(safe-area-inset-right,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
.sheet.bottom{left:0;right:0;bottom:0;max-height:56%;border-radius:24px 24px 0 0;
  padding-bottom:env(safe-area-inset-bottom,0px);padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px)}
.sheet-head{display:flex;align-items:center;gap:8px;padding:10px 10px 6px 12px;flex:0 0 auto}
.sheet-head h2{flex:1 1 auto;min-width:0;margin:0;font-size:21px;line-height:1.1;color:#163a5f}
.sheet-ic svg,.sheet-ic img,.sheet-ic canvas{width:44px;height:44px;display:block}
.x,.say-btn{flex:0 0 auto;width:44px;height:44px;border:0;border-radius:14px;background:#e6edf8;display:grid;place-items:center;padding:0}
.x svg,.say-btn svg{width:24px;height:24px}
.tabs{display:flex;gap:6px;padding:0 10px 6px;flex:0 0 auto}
.tabs button{flex:1 1 0;min-width:0;border:0;border-radius:14px;padding:6px 2px;background:#e6edf8;font-weight:800;font-size:14px;color:#163a5f;
  display:flex;flex-direction:column;align-items:center;gap:2px}
.tabs button svg{width:28px;height:28px}
.tabs button[aria-selected="true"]{background:#ffd166;box-shadow:inset 0 -3px 0 #d99a00}
.sheet-body{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;padding:4px 12px 14px;overscroll-behavior:contain;touch-action:pan-y;font-size:18px}
.sheet-body p{margin:6px 0;line-height:1.3}
.quote{font-size:21px;font-weight:800;background:#fff;border-radius:18px;padding:12px 14px;box-shadow:0 2px 8px #0002;margin:8px 0;position:relative}
.who{display:flex;align-items:center;gap:10px}
.who canvas{width:72px;height:72px;flex:0 0 auto;border-radius:18px;background:#dfeaf7}
.ro{display:grid;grid-template-columns:auto 1fr;gap:4px 10px;background:#fff8e6;border:2px dashed #e5b84a;border-radius:14px;padding:8px 12px;margin:8px 0;font-size:17px}
.ro b{color:#8a5a00}
.btn{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:56px;margin:8px 0 0;border:0;border-radius:18px;padding:8px 14px;
  font-size:20px;font-weight:900;color:#fff;background:linear-gradient(#3fbf6f,#23934e);box-shadow:0 4px 0 #17703a,0 6px 14px #0003;text-align:left}
.btn svg{width:34px;height:34px;flex:0 0 auto}
.btn:active{transform:translateY(2px);box-shadow:0 2px 0 #17703a}
.btn.alt{background:linear-gradient(#5aa9ff,#2f78d6);box-shadow:0 4px 0 #1d58a3,0 6px 14px #0003}
.btn.gold{background:linear-gradient(#ffd166,#f0a500);color:#3a2a00;box-shadow:0 4px 0 #b77d00,0 6px 14px #0003}
.btn.soft{background:#e6edf8;color:#163a5f;box-shadow:0 3px 0 #b8c9e6}
.btn:disabled{opacity:.5;filter:grayscale(.6)}
.btn small{display:block;font-size:14px;font-weight:700;opacity:.9}
.btn .bt{flex:1 1 auto;min-width:0}
.steps{display:flex;gap:3px;margin:2px 0 8px}
.steps i{flex:1 1 0;height:8px;border-radius:4px;background:#d6e0ee}
.steps i.on{background:#3fbf6f}
.steps i.now{background:#ffd166}
.checks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:6px 0}
.chk{display:flex;align-items:center;gap:8px;min-height:62px;border:0;border-radius:16px;padding:6px 8px;background:#fff;box-shadow:0 2px 6px #0002, inset 0 0 0 3px #d6e0ee;text-align:left;font-weight:800;font-size:16px;color:#1d2b3a}
.chk svg{width:38px;height:38px;flex:0 0 auto}
.chk .ct{min-width:0;line-height:1.1}
.chk small{display:block;font-weight:700;font-size:13px;color:#4a5a6a}
.chk.g{box-shadow:0 2px 6px #0002, inset 0 0 0 4px #3fbf6f;background:#effcf3}
.chk.y{box-shadow:0 2px 6px #0002, inset 0 0 0 4px #f0b400;background:#fff9e3}
.chk.r{box-shadow:0 2px 6px #0002, inset 0 0 0 4px #e5484d;background:#fff0f0}
.chk.busy{animation:pulse .5s infinite alternate}
@keyframes pulse{to{background:#e6f0ff}}
.dot{display:inline-block;width:16px;height:16px;border-radius:50%;vertical-align:-2px;margin-right:4px}
.dot.g{background:#3fbf6f}.dot.y{background:#f0b400}.dot.r{background:#e5484d}
.legend{font-size:15px;font-weight:700;color:#3a4a5a}
.rec{display:flex;align-items:center;gap:10px;width:100%;min-height:62px;margin:6px 0;border:0;border-radius:16px;padding:6px 10px;background:#fff;
  box-shadow:0 2px 6px #0002, inset 0 0 0 3px #d6e0ee;text-align:left;font-size:17px;font-weight:800;color:#1d2b3a}
.rec svg{width:36px;height:36px;flex:0 0 auto}
.rec .rt{flex:1 1 auto;min-width:0;line-height:1.15}
.rec small{display:block;font-weight:700;font-size:14px;color:#4a5a6a}
.rec .box{width:34px;height:34px;flex:0 0 auto;border-radius:10px;background:#e6edf8;display:grid;place-items:center}
.rec[aria-pressed="true"]{box-shadow:0 2px 6px #0002, inset 0 0 0 4px #2f78d6;background:#eef5ff}
.rec[aria-pressed="true"] .box{background:#2f78d6}
.rec .price{font-weight:900;color:#1e7a3c;white-space:nowrap}
.inv{width:100%;border-collapse:collapse;font-size:17px;margin:6px 0;background:#fff;border-radius:14px;overflow:hidden}
.inv td,.inv th{padding:7px 6px;border-bottom:1px solid #e3e9f2;text-align:left}
.inv th{font-size:14px;color:#5a6a7a}
.inv td.n,.inv th.n{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.inv tr.tot td{font-weight:900;font-size:19px;background:#fff8e6}
.choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:8px 0}
.choices button{min-height:64px;border:0;border-radius:18px;font-size:26px;font-weight:900;background:#fff;color:#163a5f;box-shadow:0 4px 0 #b8c9e6,0 4px 10px #0002}
.choices button.no{background:#ffe3e3;color:#9b2c2c}
.choices button.yes{background:#d9f7e3;color:#17703a}
.adder{background:#eef5ff;border-radius:14px;padding:8px 12px;font-size:19px;font-weight:800;font-variant-numeric:tabular-nums;margin:6px 0}
.adder div{padding:2px 0}
.money{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:8px 0}
.money button{border:0;background:none;padding:0;min-height:56px;display:grid;place-items:center}
.money button svg{width:100%;max-width:100px;height:auto}
.tray{display:flex;flex-wrap:wrap;gap:4px;min-height:44px;align-items:center;background:#e9f6ee;border-radius:14px;padding:6px 8px;margin:6px 0}
.tray svg{width:54px;height:auto}
.tray .lbl{font-weight:900;font-size:19px;margin-right:auto;color:#17703a}
.row2{display:flex;gap:8px}
.row2 .btn{flex:1 1 0}
.card-list{display:flex;flex-direction:column;gap:8px;margin:6px 0}
.item{display:flex;align-items:center;gap:10px;background:#fff;border-radius:16px;padding:8px 10px;box-shadow:0 2px 6px #0002}
.item img,.item svg,.item canvas{width:58px;height:58px;flex:0 0 auto;object-fit:contain}
.item .it{flex:1 1 auto;min-width:0;line-height:1.2}
.item .it b{display:block;font-size:18px}
.item .it small{display:block;font-size:14px;font-weight:700;color:#4a5a6a}
.item .btn{width:auto;min-height:48px;margin:0;font-size:17px;padding:6px 12px;flex:0 0 auto}
.item.done{background:#effcf3}
.item.lock{opacity:.6}
.tag{display:inline-block;border-radius:10px;padding:2px 8px;font-size:14px;font-weight:900;background:#d9f7e3;color:#17703a}
.big-num{font-size:34px;font-weight:900;color:#1e7a3c;text-align:center;margin:6px 0}
.bars{display:flex;flex-direction:column;gap:6px;margin:6px 0}
.bar{height:16px;border-radius:8px;background:#e3e9f2;overflow:hidden}
.bar i{display:block;height:100%;width:0;background:linear-gradient(90deg,#3fbf6f,#23934e)}
.trophies{display:flex;flex-wrap:wrap;gap:8px}
.trophy{display:flex;flex-direction:column;align-items:center;background:#fff8e6;border-radius:14px;padding:6px 10px;font-size:14px;font-weight:800}
.trophy svg{width:44px;height:44px}
.fact{background:#eef9ff;border-left:6px solid #4cc9f0;border-radius:10px;padding:8px 10px;font-size:16px;font-weight:700}
@media (max-height:430px) and (min-aspect-ratio:1/1){
  .sheet-body{font-size:16px}.quote{font-size:18px;padding:8px 10px}.btn{min-height:48px;font-size:17px}.btn svg{width:28px;height:28px}
  .chk{min-height:50px;font-size:14px}.chk svg{width:30px;height:30px}.sheet-head h2{font-size:18px}.sheet-ic svg,.sheet-ic img,.sheet-ic canvas{width:36px;height:36px}
  .x,.say-btn{width:40px;height:40px}.choices button{min-height:50px;font-size:22px}.rec{min-height:50px;font-size:15px}
}
@media (max-width:360px){.checks{grid-template-columns:1fr 1fr}.chk{font-size:14px}.chk svg{width:30px;height:30px}.money{grid-template-columns:repeat(2,minmax(0,1fr))}}
.snum{display:none;font-size:17px;color:#8a5a00;margin-left:3px}
.paybill{display:flex;justify-content:center;margin:4px 0}
.paybill svg{width:150px;max-width:60%;height:auto}
@media (max-width:430px){#stars svg:nth-child(n+2){display:none}.snum{display:inline}.xbar{display:none}}
/* shared voice toggle (assets/js/voice.js) */
.hbtn.kav-btn .kav-ic{width:30px;height:30px;display:block}
.hbtn.kav-btn{color:#163a5f}
.hbtn.kav-btn.kav-off{color:#8a95a3;background:#e3e7ec}
.menu .kav-btn{display:flex;align-items:center;gap:10px}
.menu .kav-btn .kav-ic{width:26px;height:26px}
@media (max-width:430px){.hbtn.kav-btn .kav-ic{width:27px;height:27px}}
/* phones: make room for the voice button so the HUD stays one row of buttons */
@media (max-width:430px){.hud{gap:3px}.hbtn{width:40px;height:40px}.hbtn svg,.hbtn.kav-btn .kav-ic{width:26px;height:26px}.pill{padding:0 7px 0 4px}.stars{padding:0 5px}.lvl{padding:0 6px}}
