/* Counter kit. The counter is a fixed 1024×1536 stage (plus a 256px awning band) scaled as one
   piece, so every tap target stays glued to the painted object at any screen size. */
:root {
  --ink: #3b2418; --ink2: #6b4a36; --wood: #8a5a32; --wood2: #b07a45; --wood3: #e0b27a;
  --cream: #fff8ec; --paper: #fdf0d8; --paper2: #f4e2c2; --line: #d9b98f;
  --green1: #a6e05a; --green2: #6bb22a; --green3: #3f7a12;
  --red1: #ff8a7a; --red2: #d9534f; --red3: #8f2a24;
  --gold: #f5c542; --mint: #8fcfb0; --mint2: #4f9e7c; --peach: #f28d62;
  --good: #3f8f2a; --bad: #c23b32;
  --font: 'Be Vietnam Pro', system-ui, sans-serif; --title: 'Baloo 2', 'Be Vietnam Pro', sans-serif;
  --hud: 52px; --dock: 0px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #2a1a12; color: var(--ink); font-family: var(--font); overscroll-behavior: none; }
body { display: flex; justify-content: center; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
img { -webkit-user-drag: none; user-select: none; }
#app { position: relative; width: 100%; max-width: 520px; height: 100dvh; overflow: hidden; background: #3a2618; user-select: none; -webkit-user-select: none; }
.screen { position: absolute; inset: 0; display: none; flex-direction: column; }
.screen.on { display: flex; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn { --b1: var(--green1); --b2: var(--green2); --b3: var(--green3); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 14px; font-weight: 800; font-size: 16px; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.25);
  background: linear-gradient(var(--b1), var(--b2)); box-shadow: inset 0 -4px 0 var(--b3), 0 3px 0 rgba(0,0,0,.18); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 var(--b3), 0 1px 0 rgba(0,0,0,.18); }
.btn.cream { --b1: #fffaf0; --b2: #f3e1c1; --b3: #c9a575; color: var(--ink); text-shadow: none; }
.btn.red { --b1: var(--red1); --b2: var(--red2); --b3: var(--red3); }
.btn.gold { --b1: #ffe28a; --b2: #f2b62e; --b3: #a8730c; color: #4a2d00; text-shadow: none; }
.btn.big { min-height: 64px; font-size: 22px; border-radius: 18px; font-family: var(--title); letter-spacing: .5px; }
.btn.wide { width: 100%; }
.btn[disabled] { filter: grayscale(.85) opacity(.7); pointer-events: none; }
.btn.sm { min-height: 40px; font-size: 14px; padding: 0 12px; border-radius: 12px; }

/* ---------- HUD ---------- */
.hud { position: relative; z-index: 5; flex: 0 0 var(--hud); display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: linear-gradient(#4b2f1f, #3a2618); color: var(--cream); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border-radius: 12px; background: rgba(255,248,236,.12); font-weight: 800; font-size: 15px; white-space: nowrap; }
.chip img { width: 22px; height: 22px; object-fit: contain; }
.chip small { font-weight: 600; opacity: .8; font-size: 12px; }
.hud .grow { flex: 1; min-width: 0; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,248,236,.14); display: grid; place-items: center; color: var(--cream); font-weight: 900; font-size: 18px; flex: none; }
.iconbtn svg { width: 22px; height: 22px; }
.stars { color: var(--gold); letter-spacing: -1px; }

/* ---------- title ---------- */
#title { background: #f6e4c4; }
#title .art { flex: 1; min-height: 0; background: center/cover no-repeat; position: relative; }
#title .art::after { content: ''; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(transparent, #f6e4c4); }
#title .logo { position: absolute; left: 0; right: 0; top: 7%; text-align: center; font-family: var(--title); font-weight: 800; line-height: .92; color: var(--logo, #fff8ec); text-shadow: 0 4px 0 var(--logo-edge, #a2512b), 0 7px 0 rgba(0,0,0,.18); font-size: 54px; z-index: 1; }
#title .logo small { display: block; font-size: 26px; color: var(--logo-sub, #ffe7a8); text-shadow: 0 3px 0 var(--logo-edge, #a2512b); margin-top: 6px; }
#title .actions { padding: 0 20px calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 10px; }
#title .note { text-align: center; font-size: 12px; color: var(--ink2); }

/* ---------- hub ---------- */
#hub { background: #f4e2c2; }
.hub-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.hero { position: relative; aspect-ratio: 2 / 1.12; background: center 30%/cover no-repeat; border-bottom: 4px solid var(--wood); }
.hero .cta { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(78%, 330px); }
.hero .cta .btn { width: 100%; }
.hero .cta .btn:active { transform: translateY(2px); }
.hero .daytag { position: absolute; left: 10px; top: 10px; background: rgba(59,36,24,.82); color: var(--cream); border-radius: 10px; padding: 6px 10px; font-weight: 800; font-size: 13px; }
.cards { padding: 12px 12px 8px; display: grid; gap: 10px; }
.card { background: var(--cream); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: 0 2px 0 rgba(138,90,50,.18); }
.card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.card h3 .tag { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--ink2); background: var(--paper2); border-radius: 8px; padding: 2px 8px; }
.card p { margin: 4px 0; font-size: 14px; line-height: 1.45; }
.card.story { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; cursor: pointer; }
.card.story img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; border: 2px solid var(--line); }
.card.warn { border-color: #e7a46a; background: #fff1df; }
.rows { display: grid; gap: 4px; font-size: 14px; }
.row { display: flex; justify-content: space-between; gap: 10px; }
.row b { font-variant-numeric: tabular-nums; }
.goal { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 3px 0; }
.goal i { flex: none; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--wood2); display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 900; color: #fff; }
.goal i.ok { background: var(--good); border-color: var(--good); }
.goal span { flex: 1; }
.goal em { font-style: normal; font-weight: 800; color: var(--good); font-size: 13px; }
.dock { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(#5a3a26, #3a2618); }
.dock button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; border-radius: 14px; background: linear-gradient(#fffaf0, #f0dcb8); box-shadow: inset 0 -3px 0 #c9a575; font-size: 12px; font-weight: 800; color: var(--ink); }
.dock button img { width: 34px; height: 34px; object-fit: contain; }
.dock button.locked { filter: grayscale(1); opacity: .55; }
.dock button .lock { position: absolute; top: 4px; right: 6px; font-size: 10px; background: var(--ink); color: var(--cream); border-radius: 6px; padding: 1px 5px; }
.dock button .dot { position: absolute; top: 4px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--red2); box-shadow: 0 0 0 2px #fff; }

/* ---------- shift ---------- */
#shift { background: #2f1e14; }
.stagewrap { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #c98d52 var(--counter) center bottom/cover no-repeat; }
.stagewrap::before { content: ''; position: absolute; inset: 0; backdrop-filter: blur(10px); background: rgba(255,240,215,.18); }
#stage { position: absolute; left: 50%; top: 0; width: 1024px; height: 1792px; transform-origin: 0 0; background: var(--counter) 0 0/1024px 1792px no-repeat; }
#scene { position: absolute; left: 0; top: 256px; width: 1024px; height: 1536px; }
.awning { position: absolute; left: 0; top: -256px; width: 1024px; height: 333px; z-index: 2; pointer-events: none; }
.sign { position: absolute; z-index: 2; left: 262px; width: 500px; top: -106px; height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--sign-ink, #4a2a14); pointer-events: none; }
.sign b { font-family: var(--title); font-size: 46px; line-height: 1; font-weight: 800; }
.sign span { font-size: 30px; font-weight: 800; margin-top: 4px; color: var(--sign-ink2, #7a4a22); }
.alley { position: absolute; left: 0; top: 0; width: 1024px; height: 530px; overflow: hidden; }
.guest { position: absolute; bottom: -14px; width: 400px; height: 416px; transition: transform .45s cubic-bezier(.2,.9,.3,1.2), opacity .4s; }
.guest img.body { position: absolute; left: 0; bottom: 0; width: 400px; height: 416px; object-fit: contain; object-position: bottom; }
.guest.enter { transform: translateY(120px); opacity: 0; }
.guest.leave { transform: translateY(140px); opacity: 0; }
.ticket { position: absolute; z-index: 4; width: 310px; padding: 10px 12px 12px; border-radius: var(--tk-radius, 22px); background: var(--tk-bg, #fff); border: 4px solid var(--tk-line, #3b2418); box-shadow: 0 6px 0 rgba(0,0,0,.18); cursor: pointer; transition: transform .15s; }
.ticket::after { content: ''; position: absolute; left: 50%; bottom: -20px; margin-left: -14px; border: 14px solid transparent; border-top: 16px solid var(--tk-line, #3b2418); border-bottom: 0; }
.ticket.target { border-color: #e48a1c; box-shadow: 0 0 0 6px rgba(245,197,66,.65), 0 6px 0 rgba(0,0,0,.18); }
.ticket.target::after { border-top-color: #e48a1c; }
.ticket.hint { animation: glow 1s ease-in-out infinite; }
.ticket .cup { display: flex; align-items: center; gap: 8px; min-height: 104px; position: relative; }
.ticket .cup + .cup { border-top: 3px dashed #e6d3b6; margin-top: 6px; padding-top: 6px; }
.ticket .cup.done { opacity: .35; }
.ticket .cup.done::after { content: '✓'; position: absolute; left: 22px; top: 6px; font-size: 64px; font-weight: 900; color: var(--good); }
.ticket .drink { width: 100px; height: 100px; object-fit: contain; flex: none; }
.ticket .size { position: absolute; left: 62px; top: 52px; width: 50px; height: 50px; border-radius: 50%; background: var(--tk-badge, #3b2418); color: #fff; font-weight: 900; font-size: 34px; display: grid; place-items: center; border: 3px solid #fff; }
.ticket .info { flex: 1; min-width: 0; }
.ticket .name { font-weight: 900; font-size: 40px; line-height: 1.02; }
.ticket .tops { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.ticket .tops img { width: 58px; height: 58px; object-fit: contain; background: var(--tk-chip, #f6ecd9); border-radius: 10px; padding: 2px; }
.ticket .opt { display: inline-block; margin-top: 4px; margin-right: 4px; font-size: 28px; font-weight: 800; padding: 1px 8px; border-radius: 8px; background: #ffe3cf; color: #9a3c12; }
.ticket .bar { height: 16px; border-radius: 6px; background: #eadbc2; margin-top: 8px; overflow: hidden; }
.ticket .bar i { display: block; height: 100%; width: 100%; background: var(--good); border-radius: 6px; transform-origin: left; }
.ticket.hurry .bar i { background: #e48a1c; }
.ticket.angry { animation: shake .4s infinite; }
.ticket.angry .bar i { background: var(--red2); }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.queue { position: absolute; left: 50%; transform: translateX(-50%); top: 470px; z-index: 5; background: rgba(59,36,24,.85); color: #fff; font-weight: 800; font-size: 30px; padding: 6px 16px; border-radius: 16px; }
.mood { position: absolute; right: 30px; top: 40px; font-size: 70px; z-index: 4; animation: pop .5s cubic-bezier(.2,1.6,.4,1); }
.pay { position: absolute; left: 50%; top: 80px; transform: translateX(-50%); z-index: 5; background: #fff; border: 4px solid var(--good); color: var(--good); border-radius: 18px; padding: 4px 16px; font-size: 36px; font-weight: 900; white-space: nowrap; animation: rise 1.2s ease-out forwards; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 20px); } 20% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -60px); } }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* stations: invisible tap areas with a wooden name plate under each */
.st { position: absolute; border-radius: 22px; outline: none; }
.st:active { background: rgba(255,255,255,.18); }
.st.hint { animation: glow 1s ease-in-out infinite; }
@keyframes glow { 0%,100% { box-shadow: 0 0 0 5px rgba(255,214,90,.95), 0 0 30px 10px rgba(255,214,90,.55); } 50% { box-shadow: 0 0 0 9px rgba(255,214,90,.6), 0 0 44px 16px rgba(255,214,90,.35); } }
.st.off { background: rgba(40,25,15,.55); }
.st.locked { background: rgba(40,25,15,.62); }
.st .lockt { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #fff; font-weight: 900; font-size: 28px; line-height: 1.1; padding: 8px; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.plate { position: absolute; left: 50%; transform: translateX(-50%); bottom: -40px; white-space: nowrap; background: linear-gradient(#fff6e2, #f0d9b0); border: 3px solid #8a5a32; border-radius: 12px; padding: 2px 12px; font-weight: 900; font-size: 30px; color: #3b2418; box-shadow: 0 3px 0 rgba(0,0,0,.2); pointer-events: none; z-index: 2; }
.count { position: absolute; right: -10px; top: -14px; min-width: 52px; height: 52px; padding: 0 10px; border-radius: 26px; background: #3b2418; color: #fff; font-weight: 900; font-size: 30px; display: grid; place-items: center; border: 4px solid #fff8ec; z-index: 3; box-shadow: 0 3px 0 rgba(0,0,0,.25); pointer-events: none; }
.count.low { background: var(--red2); }
.count.bottom { top: auto; bottom: -6px; }
.prop { position: absolute; pointer-events: none; filter: drop-shadow(0 6px 4px rgba(0,0,0,.25)); }
#propsBack { position: absolute; inset: 0; } #propsFront { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
#title .row2 { display: flex; gap: 8px; } #title .row2 > * { flex: 1; text-decoration: none; }
.meter { position: absolute; left: 14%; right: 14%; bottom: 12px; height: 16px; border-radius: 8px; background: rgba(0,0,0,.35); overflow: hidden; border: 2px solid rgba(255,255,255,.7); }
.meter i { display: block; height: 100%; background: linear-gradient(#ffe08a, #f2a72e); transform-origin: left; }
.state { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); white-space: nowrap; border-radius: 16px; padding: 4px 16px; font-weight: 900; font-size: 32px; color: #fff; background: rgba(59,36,24,.86); z-index: 2; }
.state.go { background: var(--green2); animation: bob .7s ease-in-out infinite; }
.state.bad { background: var(--red2); }
@keyframes bob { 0%,100% { transform: translate(-50%, -50%); } 50% { transform: translate(-50%, calc(-50% - 8px)); } }
.steam { position: absolute; left: 30%; top: -30px; width: 40%; height: 60px; border-radius: 50%; background: radial-gradient(rgba(255,255,255,.75), transparent 65%); animation: steam 1.4s ease-out infinite; }
@keyframes steam { from { transform: translateY(20px) scale(.7); opacity: .9; } to { transform: translateY(-30px) scale(1.3); opacity: 0; } }

/* the cup being made, centred on the work board */
.workitem { position: absolute; pointer-events: none; transition: transform .2s; }
.workitem .cupbox { position: absolute; inset: 0; }
.cupin { position: absolute; inset: 0; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.cl { position: absolute; display: block; max-width: none; pointer-events: none; }
.cl.cup { left: 0; top: 0; width: 100%; height: 100%; }
.cl.cup.back { opacity: .55; } .cl.cup.front { opacity: .42; }
.cl.surf { height: 1.2%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); }
.workitem.pop { animation: pop .3s cubic-bezier(.2,1.6,.4,1); }
.boardhint { position: absolute; text-align: center; font-weight: 800; font-size: 30px; color: rgba(59,36,24,.7); pointer-events: none; }
.shelfcup { position: absolute; top: 520px; width: 110px; height: 120px; z-index: 2; }
.shelfcup img { width: 100%; height: 100%; object-fit: contain; }
.shelfcup span { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); white-space: nowrap; font-size: 20px; font-weight: 800; background: #fff; border: 2px solid #8a5a32; border-radius: 8px; padding: 0 6px; }
.flycup { position: absolute; width: 130px; height: 130px; z-index: 6; pointer-events: none; transition: transform .55s cubic-bezier(.4,0,.2,1), opacity .55s; }
.flycup img { width: 100%; height: 100%; object-fit: contain; }

/* bottom bar during a shift */
.shiftbar { flex: none; background: linear-gradient(#5a3a26, #3a2618); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); display: grid; gap: 8px; }
.say { min-height: 40px; display: flex; align-items: center; gap: 8px; background: var(--cream); border-radius: 12px; padding: 4px 10px; font-size: 14px; line-height: 1.3; }
.say img { width: 32px; height: 32px; object-fit: cover; object-position: top; border-radius: 50%; background: #f1dfc0; flex: none; }
.say b { white-space: nowrap; }
.say .hand { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.say .chips { display: contents; }
.say .chips span { font-size: 12px; font-weight: 800; background: #fff; border: 1.5px solid #c9a575; border-radius: 7px; padding: 0 5px; line-height: 18px; }
.say .chips span.ok { border-color: var(--good); color: var(--good); }
.say .chips span.miss { border-style: dashed; color: #9a7a5a; }
.say .chips span.bad { border-color: var(--red2); color: var(--red2); }
.say em { font-style: normal; font-weight: 800; color: #b5560f; }
.say.bad { background: #ffe1dc; color: var(--red3); }
.say.good { background: #e3f6d5; color: #2b5d16; }
.tools { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.tools .btn { min-height: 44px; font-size: 14px; }

/* ---------- sheets / dialogs ---------- */
.veil { position: absolute; inset: 0; z-index: 40; background: rgba(30,18,10,.6); display: none; align-items: flex-end; justify-content: center; }
.veil.on { display: flex; }
.veil.center { align-items: center; }
.sheet { position: relative; width: 100%; max-height: 88%; display: flex; flex-direction: column; background: var(--paper); border-radius: 22px 22px 0 0; border-top: 5px solid var(--wood); box-shadow: 0 -6px 30px rgba(0,0,0,.35); animation: up .25s ease-out; }
.veil.center .sheet { width: calc(100% - 24px); border-radius: 22px; border: 5px solid var(--wood); max-height: 86%; animation: pop .25s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet header { display: flex; align-items: center; gap: 8px; padding: 14px 14px 8px; }
.sheet header h2 { margin: 0; font-size: 19px; font-weight: 900; flex: 1; }
.sheet header .sub { font-size: 12px; color: var(--ink2); font-weight: 600; }
.sheet .x { width: 40px; height: 40px; border-radius: 12px; background: var(--red2); color: #fff; font-weight: 900; font-size: 22px; box-shadow: inset 0 -3px 0 var(--red3); flex: none; }
.sheet .body { overflow-y: auto; padding: 0 14px 14px; -webkit-overflow-scrolling: touch; }
.sheet footer { padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 2px solid var(--paper2); display: flex; gap: 8px; }
.sheet footer .btn { flex: 1; }
.item { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 10px; background: var(--cream); border: 2px solid var(--line); border-radius: 14px; margin-bottom: 8px; }
.item img { width: 56px; height: 56px; object-fit: contain; }
.item h4 { margin: 0; font-size: 15px; font-weight: 900; }
.item p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink2); line-height: 1.35; }
.item .have { font-weight: 800; color: var(--ink); }
.item .low { color: var(--red2); font-weight: 800; }
.item.locked { opacity: .55; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(#fffaf0, #f0dcb8); box-shadow: inset 0 -3px 0 #c9a575; font-weight: 900; font-size: 20px; }
.stepper b { min-width: 26px; text-align: center; font-size: 16px; }
.total { display: flex; justify-content: space-between; align-items: center; font-weight: 900; font-size: 16px; padding: 4px 2px 10px; }
.picker h4 { margin: 12px 0 8px; font-size: 15px; }
.opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.opts.three { grid-template-columns: repeat(3, 1fr); }
.opts button { position: relative; min-height: 54px; border-radius: 14px; background: var(--cream); border: 3px solid var(--line); font-weight: 900; font-size: 16px; }
.opts button.sel { border-color: var(--green2); background: #e9f8dc; box-shadow: 0 0 0 3px rgba(107,178,42,.3); }
.opts button .need { position: absolute; top: -8px; right: -6px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--red2); color: #fff; font-size: 12px; display: grid; place-items: center; padding: 0 5px; border: 2px solid #fff; }
.recipe { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; padding: 10px; background: var(--cream); border: 2px solid var(--line); border-radius: 14px; margin-bottom: 8px; }
.recipe img { width: 76px; height: 76px; object-fit: contain; }
.recipe h4 { margin: 0 0 2px; font-size: 16px; font-weight: 900; }
.recipe ol { margin: 2px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.45; }
.recipe .price { font-size: 12.5px; color: var(--ink2); font-weight: 700; }
.ledger { background: var(--cream); border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; }
.ledger .row { padding: 3px 0; font-size: 14px; }
.ledger .row.sum { border-top: 2px dashed var(--line); margin-top: 4px; padding-top: 6px; font-weight: 900; font-size: 16px; }
.ledger .pos { color: var(--good); } .ledger .neg { color: var(--bad); }
.ledger h4 { margin: 0 0 6px; font-size: 14px; color: var(--ink2); text-transform: uppercase; letter-spacing: .4px; }
.big-result { text-align: center; padding: 6px 0 12px; }
.big-result .v { font-family: var(--title); font-size: 40px; font-weight: 800; line-height: 1; }
.big-result .l { font-size: 13px; font-weight: 700; color: var(--ink2); }
.review { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: start; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.review img { width: 44px; height: 44px; object-fit: cover; object-position: top; border-radius: 50%; background: #f1dfc0; }
.storyart { width: 100%; aspect-ratio: 2/1.05; object-fit: cover; border-radius: 14px; border: 3px solid var(--line); }
.story p { font-size: 15px; line-height: 1.55; margin: 10px 0; }

/* toast: below the HUD, never takes taps */
#toast { position: absolute; left: 50%; top: calc(var(--hud) + 8px); transform: translateX(-50%); z-index: 60; width: max-content; max-width: calc(100% - 24px); pointer-events: none; display: grid; gap: 6px; justify-items: center; }
#toast div { background: var(--cream); color: var(--ink); border: 3px solid var(--good); border-radius: 14px; padding: 8px 14px; font-weight: 800; font-size: 14px; text-align: center; text-wrap: balance; box-shadow: 0 4px 14px rgba(0,0,0,.25); animation: toastin .3s cubic-bezier(.2,1.6,.4,1); }
#toast div.bad { border-color: var(--red2); background: #fff1ef; animation: toastin .3s cubic-bezier(.2,1.6,.4,1), shake .3s .3s 2; }
#toast div.event { border-color: #e48a1c; background: #fff4e0; }
#app[data-screen=shift] #toast { top: calc(var(--hud) + 30%); }
@keyframes toastin { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* tutorial spotlight */
#coach { position: absolute; inset: 0; z-index: 50; pointer-events: none; display: none; }
#coach.on { display: block; }
#coach .dim { position: absolute; background: rgba(20,12,6,.62); pointer-events: auto; }
#coach .ring { position: absolute; border-radius: 16px; box-shadow: 0 0 0 4px #ffd65a, 0 0 24px 6px rgba(255,214,90,.8); animation: ringpulse 1.1s ease-in-out infinite; }
@keyframes ringpulse { 50% { box-shadow: 0 0 0 7px #ffd65a, 0 0 34px 10px rgba(255,214,90,.6); } }
#coach .hand { position: absolute; font-size: 40px; animation: tap 1s ease-in-out infinite; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
@keyframes tap { 50% { transform: translateY(10px); } }
#coach .bubble { position: absolute; left: 12px; right: 12px; pointer-events: auto; display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: start; background: var(--cream); border: 3px solid var(--wood); border-radius: 18px; padding: 10px 12px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
#coach .bubble img { width: 52px; height: 52px; object-fit: cover; object-position: top; border-radius: 50%; background: #f1dfc0; border: 2px solid var(--line); }
#coach .bubble p { margin: 0; font-size: 15px; line-height: 1.45; font-weight: 600; }
#coach .bubble .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12px; color: var(--ink2); font-weight: 700; }
#coach .bubble .meta button { color: var(--ink2); text-decoration: underline; font-weight: 700; font-size: 12px; padding: 6px 0; }
#coach .bubble .next { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; } }

/* ===================== Clean theme (13/10/2026) =====================
   Light cream background, white rounded cards with soft shadows, a light HUD, coral pill CTAs and
   segmented tabs: the menus read like a modern app while the counter stays a painted scene. */
:root {
  --bg: #fbf6ee; --card: #ffffff; --edge: #efe5d6; --soft: #f6efe4; --ink: #2f2219; --ink2: #8a7563;
  --coral1: #ff9a7c; --coral2: #f2705a; --coral3: #c8503d; --green-t: #2f9d55; --shadow: 0 4px 16px rgba(110, 72, 36, .08);
  --bar: #fffaf3; --tk-bg: #fff; --tk-line: #3b2418; --tk-badge: #3b2418; --tk-chip: #f6ecd9; --tk-radius: 22px;
  --logo: #fff8ec; --logo-sub: #ffe7a8; --logo-edge: #a2512b; --sign-ink: #4a2a14; --sign-ink2: #7a4a22;
}
html, body { background: #efe6d8; }
#app { background: var(--bg); }
.btn { --b1: var(--coral1); --b2: var(--coral2); --b3: var(--coral3); border-radius: 999px; box-shadow: inset 0 -3px 0 var(--b3), 0 6px 14px rgba(242, 112, 90, .28); text-shadow: none; }
.btn.cream { --b1: #fff; --b2: #fbf4ea; --b3: #e7dccb; color: var(--ink); box-shadow: inset 0 -2px 0 var(--b3), 0 2px 8px rgba(110, 72, 36, .08); }
.btn.gold { --b1: #ffc163; --b2: #f8a531; --b3: #c97a12; color: #fff; box-shadow: inset 0 -3px 0 var(--b3), 0 6px 14px rgba(248, 165, 49, .3); }
.btn.big { border-radius: 999px; }
.btn.sm { border-radius: 999px; }

/* HUD: light bar, bold numbers */
.hud { background: var(--bar); color: var(--ink); border-bottom: 1px solid var(--edge); box-shadow: 0 2px 10px rgba(110, 72, 36, .06); }
.chip { background: var(--soft); color: var(--ink); border: 1px solid var(--edge); border-radius: 999px; }
.chip small { color: var(--ink2); opacity: 1; }
.iconbtn { background: var(--soft); color: var(--ink2); border: 1px solid var(--edge); border-radius: 999px; }
.stars { color: #f6b21b; }

/* hub */
#hub { background: var(--bg); }
.hero { border-bottom: 0; border-radius: 0 0 26px 26px; overflow: hidden; box-shadow: var(--shadow); }
.hero .daytag { background: rgba(255, 250, 243, .92); color: var(--ink); border-radius: 999px; box-shadow: var(--shadow); }
.cards { padding: 14px 14px 10px; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--edge); border-radius: 20px; box-shadow: var(--shadow); padding: 14px 16px; }
.card h3 { font-size: 16px; }
.card h3 .tag { background: var(--soft); color: var(--ink2); border-radius: 999px; padding: 3px 10px; }
.card.warn { background: #fff7ea; border-color: #f6dcb3; }
.card.story img { border: 0; border-radius: 14px; }
.goal i { border: 2px solid #d9cbb8; border-radius: 7px; }
.goal i.ok { background: var(--green-t); border-color: var(--green-t); }
.goal em { color: var(--green-t); }
.row b { color: var(--ink); }
.dock { background: var(--bar); border-top: 1px solid var(--edge); box-shadow: 0 -4px 14px rgba(110, 72, 36, .06); gap: 4px; }
.dock button { background: transparent; box-shadow: none; border-radius: 16px; color: var(--ink2); font-weight: 800; }
.dock button:active { background: var(--soft); }
.dock button img { width: 38px; height: 38px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.12)); }
.dock button .lock { background: var(--ink2); }

/* title */
#title { background: var(--bg); }
#title .art::after { background: linear-gradient(transparent, var(--bg)); }

/* sheets */
.veil { background: rgba(47, 34, 25, .45); backdrop-filter: blur(2px); }
.sheet { background: var(--bg); border-top: 0; border-radius: 26px 26px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.18); }
.veil.center .sheet { border: 0; border-radius: 26px; }
.sheet header h2 { font-size: 20px; }
.sheet header .sub { color: var(--ink2); font-size: 12.5px; }
.sheet .x { background: var(--soft); color: var(--ink2); border: 1px solid var(--edge); border-radius: 999px; box-shadow: none; font-size: 18px; }
.sheet footer { border-top: 1px solid var(--edge); background: var(--bar); }
.item, .recipe, .ledger { background: var(--card); border: 1px solid var(--edge); border-radius: 18px; box-shadow: var(--shadow); }
.ledger h4 { color: var(--ink2); font-size: 12.5px; }
.ledger .row.sum { border-top: 1px dashed var(--edge); }
.ledger .pos { color: var(--green-t); }
.stepper button { background: var(--soft); box-shadow: none; border: 1px solid var(--edge); border-radius: 999px; }
.opts button { background: var(--card); border: 2px solid var(--edge); border-radius: 16px; }
.opts button.sel { border-color: var(--coral2); background: #fff2ee; box-shadow: 0 0 0 3px rgba(242, 112, 90, .18); }
.big-result .l { color: var(--ink2); }
.empty { text-align: center; color: var(--ink2); padding: 22px 8px; font-size: 14px; }
.chapter { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 8px 0; border-top: 1px solid var(--edge); }
.chapter:first-of-type { border-top: 0; }
.chapter img { width: 64px; height: 44px; object-fit: cover; border-radius: 10px; }
.chapter span { display: flex; flex-direction: column; } .chapter small { color: var(--ink2); font-size: 12px; }

/* shift bar */
.shiftbar { background: var(--bar); border-top: 1px solid var(--edge); }
.say { background: var(--card); border: 1px solid var(--edge); border-radius: 16px; box-shadow: var(--shadow); }
#toast div { border-width: 2px; border-radius: 999px; padding: 9px 16px; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
#coach .bubble { border: 0; border-radius: 22px; background: var(--card); box-shadow: 0 12px 34px rgba(0,0,0,.28); }

/* leaderboard */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 5px; background: var(--soft); border-radius: 18px; margin-bottom: 12px; }
.seg button { min-height: 38px; border-radius: 14px; font-size: 13px; font-weight: 800; color: var(--ink2); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px rgba(110, 72, 36, .12); }
.mecard { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 14px; border-radius: 20px; background: linear-gradient(#fff8d9, #fff0c2); border: 2px solid #f6cf62; }
.mecard b { display: block; font-size: 17px; color: #b2531a; }
.mecard small { display: block; font-size: 13px; color: #6d5a2c; margin-top: 3px; line-height: 1.35; }
.mecard input { margin-top: 8px; width: 100%; height: 40px; border-radius: 12px; border: 1px solid #e9d7a4; padding: 0 12px; font: inherit; font-weight: 700; background: #fff; color: var(--ink); }
.podium { display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: 8px; align-items: end; padding: 10px; border-radius: 22px; background: #fff3e2; border: 1px solid #f6dfbf; margin-bottom: 12px; }
.pod { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 10px 6px 12px; border-radius: 18px; background: #fff; border: 2px solid #dfe4ec; min-width: 0; }
.pod.p1 { border-color: #f6b21b; box-shadow: 0 6px 18px rgba(246, 178, 27, .25); padding-top: 14px; }
.pod.p3 { border-color: #e9a07a; }
.pod.empty { background: transparent; border: 1px dashed #ead8bf; min-height: 120px; }
.pod b { font-size: 13.5px; line-height: 1.2; overflow-wrap: anywhere; }
.pod small { color: var(--ink2); font-size: 11.5px; }
.pod em { font-style: normal; font-weight: 900; color: var(--green-t); font-size: 13px; }
.pod.mine { background: #fffaf0; }
.lrow { display: grid; grid-template-columns: 34px 52px 1fr auto; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 18px; background: #fff; border: 1px solid var(--edge); box-shadow: var(--shadow); margin-bottom: 8px; }
.lrow.mine { border: 2px solid #f6b21b; background: #fffaf0; }
.lrow .no { font-weight: 900; color: var(--ink2); }
.lrow b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow small { color: var(--ink2); font-size: 12px; }
.lrow em { font-style: normal; font-weight: 900; color: var(--green-t); font-size: 13.5px; white-space: nowrap; }
.emblem { position: relative; display: inline-block; width: 52px; height: 52px; flex: none; }
.emblem.big { width: 76px; height: 76px; }
.emblem img { position: absolute; }
.emblem .frame { inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; }
.emblem .core { left: 28%; top: 26%; width: 44%; height: 44%; object-fit: contain; }
.emblem.e1 .core, .emblem.e2 .core, .emblem.e3 .core { top: 18%; }
.btn.sm { white-space: nowrap; }
.lrow small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }
/* Layered items drawn by a game's renderItem (bread fillings, ramen toppings, flowers). */
.workitem .lay { position: absolute; height: auto; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(78, 48, 27, .4)); }
/* Size badges that are words (Nhỏ, Lớn) become pills under the drink icon. */
.ticket .size.word { left: 14px; top: 78px; width: auto; height: 40px; padding: 0 12px; border-radius: 20px; font-size: 24px; }
.classic-note { display: grid; gap: 2px; padding: 10px 14px; border-radius: 16px; background: #fff7ea; border: 1px solid #f6dcb3; color: var(--ink); text-decoration: none; font-size: 13px; }
.classic-note b { font-size: 14px; } .classic-note span { color: var(--ink2); }
.name-input { margin-top: 6px; width: 100%; height: 38px; border-radius: 12px; border: 1px solid var(--edge); padding: 0 10px; font: inherit; font-weight: 700; color: var(--ink); background: #fff; }
.board-card { cursor: pointer; }
.board-card .mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 6px; }
.board-card .mini > div { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; min-width: 0; }
.board-card .mini b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.board-card .mini small { font-size: 11.5px; color: var(--green-t); font-weight: 800; }

/* event toast with its picture */
#toast div.event.art { display: flex; align-items: center; gap: 10px; text-align: left; border-radius: 16px; padding: 8px 12px 8px 8px; max-width: 340px; }
#toast div.event.art img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; }

/* hub: the open button sits under the picture so it never covers faces */
.hub-cta { position: relative; z-index: 2; display: flex; justify-content: center; margin: -32px auto 0; width: min(80%, 340px); }
.hub-cta .btn { width: 100%; }
.hero { aspect-ratio: 2 / 1.05; background-position: center 35%; }
/* order tickets: names never break into three lines */
.ticket .name { font-size: 34px; line-height: 1.05; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ticket .opt { font-size: 24px; }
/* the hand line keeps one height so the counter does not jump */
.shiftbar .say { min-height: 58px; }
/* logo subtitle always on its own line */
#title .logo small { display: table; margin-left: auto; margin-right: auto; }

/* dreams: the big purchases that keep money meaningful after the first weeks */
.dreams-h { margin: 6px 0 4px; font-size: 15px; }
.dreams-p { margin: 0 0 10px; font-size: 13px; color: var(--ink2); }
.dream { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center; padding: 10px; margin-bottom: 10px; border-radius: 18px; background: var(--card); border: 1px solid var(--edge); box-shadow: var(--shadow); }
.dream img { width: 112px; height: 76px; object-fit: cover; border-radius: 12px; }
.dream h4 { margin: 0 0 2px; font-size: 15px; } .dream p { margin: 0 0 6px; font-size: 12.5px; color: var(--ink2); line-height: 1.35; }
.dream .dbody { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.dream.locked { opacity: .6; } .dream.locked img { filter: grayscale(.7); }
.dream .done { color: var(--good); }
.dprog { width: 100%; height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.dprog i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--coral1), var(--coral2)); }
.dream-card { display: grid; grid-template-columns: 88px 1fr; gap: 12px; align-items: center; cursor: pointer; }
.dream-card img { width: 88px; height: 64px; object-fit: cover; border-radius: 12px; }
.dream-card h3 { margin: 0 0 2px; } .dream-card p { margin: 0 0 6px; font-size: 13px; }

/* awning skins (Trang trí) */
.decor { display: grid; grid-template-columns: 132px 1fr; gap: 12px; align-items: center; padding: 10px; margin-bottom: 10px; border-radius: 18px; background: var(--card); border: 1px solid var(--edge); box-shadow: var(--shadow); }
.decor.on { border: 2px solid var(--coral2); }
.decor .dprev { height: 64px; border-radius: 12px; background: linear-gradient(#cfe6f5, #f3e7d3); overflow: hidden; display: flex; align-items: flex-start; }
.decor .dprev img { width: 100%; height: auto; }
.decor h4 { margin: 0 0 2px; font-size: 15px; } .decor p { margin: 0 0 6px; font-size: 12.5px; color: var(--ink2); line-height: 1.35; }
.decor .dbody { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.decor.locked { opacity: .6; }
.decor .done { color: var(--good); }

/* the long game: calendar card, handover buttons, year rows */
.calcard p { margin: 4px 0 0; font-size: 13.5px; }
.calcard .soon { color: var(--ink2); font-size: 12.5px; }
.ho { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 6px; margin-top: 8px; }
.ho .btn { width: 100%; }
.yearcard { cursor: pointer; }
.yearcard .goal em { color: var(--ink2); font-weight: 700; }
.yrow { width: 100%; text-align: left; }
#chainCard { cursor: pointer; }

/* incidents and growth */
.inccard { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; cursor: pointer; border: 2px solid var(--coral2); }
.inccard img { width: 96px; height: 72px; object-fit: cover; border-radius: 12px; }
.inccard h3 { margin: 4px 0 2px; } .inccard p { margin: 0 0 4px; font-size: 13px; }
.inccard .tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--ink2); text-transform: uppercase; }
.choices { display: grid; gap: 8px; margin-top: 4px; }
.choice { text-align: left; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 2px solid var(--edge); box-shadow: var(--shadow); display: grid; gap: 3px; }
.choice:active { border-color: var(--coral2); }
.choice b { font-size: 15px; } .choice small { color: var(--ink2); font-size: 12.5px; }
.logrow { display: grid; gap: 2px; padding: 7px 0; border-top: 1px solid var(--edge); font-size: 13px; }
.logrow:first-of-type { border-top: 0; }
.logrow span { color: var(--ink2); } .logrow em { font-style: normal; font-size: 12px; color: var(--coral3); font-weight: 700; }
.dprog.moodbar i { background: linear-gradient(90deg, #e9a23b, var(--green-t)); }
small.co { display: block; font-size: 11.5px; color: var(--coral3); font-weight: 800; margin-bottom: 4px; }

.fxrow { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 5px 0; border-top: 1px dashed var(--edge); font-size: 13.5px; }
.fxrow:first-of-type { border-top: 0; }
.fxrow b { text-align: right; white-space: nowrap; } .fxrow b.neg { color: var(--bad); } .fxrow b.pos { color: var(--green-t); }
.fxrow small { grid-column: 1 / -1; color: var(--ink2); font-size: 11.5px; }
