/* In-game HUD over the third-person 3D view, the till (checkout) panel and the interaction prompt.
   Glass chips (dark, blurred, hairline edge) hugging the edges and the safe areas; numbers in tabular Inter; colour only where it means
   something (gold = money / XP / rating, green = good / open, red = danger). On touch devices the bottom-left and bottom-right
   34 % x 40 % zones belong to the joystick and the action buttons (css/touch.css), so nothing of ours sits there. */

#hud { position: absolute; inset: 0; pointer-events: none; font-family: var(--font-ui); color: var(--text-1); --edge: 12px; }
#hud > * { pointer-events: none; }
#hud .interactive, #hud button, #hud .acc-chip { pointer-events: auto; }
.hud-tl, .hud-tc, .hud-tr, .hud-bl, .hud-bc, .hud-ml { position: absolute; z-index: 5; }
.hud-tl { top: calc(var(--sa-t) + var(--edge)); left: calc(var(--sa-l) + var(--edge)); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; max-width: 300px; }
.hud-tc { top: calc(var(--sa-t) + var(--edge)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: min(620px, calc(100vw - 640px)); min-width: 280px; }
.hud-tr { top: calc(var(--sa-t) + var(--edge)); right: calc(var(--sa-r) + var(--edge)); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: 300px; }
.hud-bl { bottom: calc(var(--sa-b) + 16px); left: calc(var(--sa-l) + 16px); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.hud-bc { bottom: calc(var(--sa-b) + 20px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: calc(100vw - 32px); }
.hud-ml { left: calc(var(--sa-l) + var(--edge)); top: calc(var(--sa-t) + 150px); display: flex; flex-direction: column; gap: 8px; width: 256px; }

.glass { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: var(--text-1); border-radius: var(--r-3); box-shadow: inset 0 0 0 1px var(--glass-line), var(--hl), var(--sh-glass); }
.glass.light { background: rgba(244, 247, 245, .95); color: var(--text-inv); }

/* ---- top-left: money, level, xp */
.money-box { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px 10px 10px; min-width: 200px; }
.money-row { display: flex; align-items: center; gap: 10px; }
.money-box .coin { flex: none; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-ui); font-size: 15px; font-weight: 750; color: #3b2500; background: radial-gradient(circle at 35% 30%, #ffe7ad, var(--gold-400) 55%, var(--gold-600)); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18), 0 0 0 3px rgba(245, 189, 80, .12); }
.money-box .amt { font-family: var(--font-ui); font-weight: 700; font-size: 1.375rem; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.money-box .amt.up { animation: amtUp 1.4s ease-out; } .money-box .amt.dn { animation: amtDn 1.4s ease-out; }
@keyframes amtUp { 0%, 35% { color: var(--accent-300); } 100% { color: var(--text-1); } }
@keyframes amtDn { 0%, 35% { color: var(--red-300); } 100% { color: var(--text-1); } }
.money-box .delta { font-size: var(--fs-12); font-weight: 600; min-height: 1em; line-height: 1; margin-top: 3px; font-variant-numeric: tabular-nums; }
.money-box .delta.up { color: var(--accent-300); } .money-box .delta.dn { color: var(--red-300); }
.lvl-box { display: flex; align-items: center; gap: 8px; min-width: 0; padding-left: 2px; }
.lvl-badge { flex: none; display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--gold-soft); box-shadow: inset 0 0 0 1px rgba(245, 189, 80, .3); color: var(--gold-300); font-family: var(--font-ui); font-size: var(--fs-11); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.xp { position: relative; flex: 0 0 64px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.xp > i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--gold-500), var(--gold-300)); border-radius: 4px; transition: width var(--dur-3) var(--ease-out); }
.lvl-box .store { min-width: 0; flex: 1 1 auto; font-size: var(--fs-12); font-weight: 500; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.mini-rating { display: none; flex: none; font-size: var(--fs-12); font-weight: 600; color: var(--gold-300); font-variant-numeric: tabular-nums; }

/* ---- top-centre: clock, phase, speed, open/close, coach */
.clock-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.clock-box { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 6px 0 14px; border-radius: var(--r-pill); }
.clock-box .wx { display: inline-flex; color: var(--gold-300); }
.clock-box .wx .ico-svg { width: 20px; height: 20px; }
.clock-box .time { font-family: var(--font-ui); font-weight: 650; font-size: 1.125rem; letter-spacing: -.01em; line-height: 1; font-variant-numeric: tabular-nums; min-width: 4.9em; text-align: left; }
.clock-box .day { position: relative; padding-left: 12px; font-size: var(--fs-11); line-height: 1.2; color: var(--text-3); white-space: nowrap; font-weight: 500; }
.clock-box .day::before { content: ''; position: absolute; left: 0; top: 2px; bottom: 2px; width: 1px; background: var(--line-3); }
.clock-box .day b { display: block; font-weight: 600; color: var(--text-1); font-size: var(--fs-12); }
.phase-badge { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px 0 9px; border-radius: var(--r-pill); font-weight: 600; font-size: var(--fs-12); white-space: nowrap; background: rgba(255, 255, 255, .07); color: var(--text-1); }
.phase-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.phase-badge.prep::before { background: var(--blue-300); }
.phase-badge.open { background: var(--accent-soft-2); color: var(--accent-200); }
.phase-badge.open::before { background: var(--accent-300); box-shadow: 0 0 0 3px rgba(114, 226, 173, .2), 0 0 8px var(--accent-300); }
.phase-badge.closing { background: var(--amber-soft); color: var(--amber-300); } .phase-badge.closing::before { background: var(--amber-400); }
.phase-badge.summary::before { background: var(--text-3); }
.speed-btns { display: inline-flex; gap: 2px; height: 44px; padding: 4px; border-radius: var(--r-pill); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: inset 0 0 0 1px var(--glass-line), var(--sh-glass); }
.speed-btns button { border: 0; background: transparent; color: var(--text-3); border-radius: var(--r-pill); padding: 0 10px; min-width: 36px; height: 100%; font-weight: 600; font-size: var(--fs-13); font-variant-numeric: tabular-nums; transition: background-color var(--dur-2), color var(--dur-2); }
.speed-btns button:hover:not(.on) { color: var(--text-1); }
.speed-btns button.on { background: var(--n-50); color: var(--text-inv); }
html.is-touch .speed-btns button { height: var(--tap); min-width: var(--tap); }
html.is-touch .speed-btns { height: auto; padding: 0; }
.hud-tc .open-btn { min-height: 44px; border-radius: var(--r-pill); padding: 0 18px; }
.hud-tc .open-btn.red { --bc: rgba(48, 12, 12, .72); --bh: var(--red-500); --bfg: var(--red-300); --bbd: var(--red-line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.open-btn .ob-short { display: none; }
html.is-touch .hud-tc .open-btn { min-height: var(--tap); }
.btn.pulse:not(:disabled) { animation: goPulse 1.6s ease-out infinite; }
@keyframes goPulse { 0% { box-shadow: 0 0 0 0 rgba(114, 226, 173, .7); } 100% { box-shadow: 0 0 0 14px rgba(114, 226, 173, 0); } }

.coach { display: flex; align-items: center; gap: 10px; max-width: 100%; min-height: 44px; padding: 6px 6px 6px 14px; font-size: var(--fs-14); border-radius: var(--r-3); animation: coachIn var(--dur-3) var(--ease-out); }
.coach .coach-ico { flex: none; display: inline-flex; color: var(--gold-300); }
.coach-text { flex: 1 1 auto; min-width: 0; font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.coach .fold { flex: none; width: 30px; height: 30px; border: 0; border-radius: 9px; background: transparent; color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; transition: background-color var(--dur-2), color var(--dur-2); }
.coach .fold:hover { background: rgba(255, 255, 255, .08); color: var(--text-1); }
html.is-touch .coach .fold { width: var(--tap); height: var(--tap); }
.coach.tut { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 12px 14px 16px; min-width: min(480px, calc(100vw - 24px)); background: var(--glass-strong); box-shadow: inset 0 0 0 1px var(--accent-line), var(--hl), 0 12px 32px -8px rgba(0, 0, 0, .6); }
.coach.tut .coach-text { font-size: var(--fs-15); font-weight: 550; -webkit-line-clamp: 3; }
.coach-head { display: flex; align-items: center; gap: 12px; }
.tut-step { color: var(--accent-300); font-weight: 650; font-size: var(--fs-12); letter-spacing: .01em; white-space: nowrap; }
.coach .dots { display: flex; gap: 4px; }
.coach .dots::after { content: none; animation: none; }   /* not the animated '...' of .dots used at the till */
.coach .dots i { width: 14px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .16); display: block; transition: background-color var(--dur-2); }
.coach .dots i.done { background: var(--accent-500); }
.coach .dots i.now { background: var(--accent-300); width: 22px; }
.coach .skip { flex: none; white-space: nowrap; margin-left: auto; min-height: 28px; padding: 0 10px; border-radius: var(--r-1); border: 0; background: rgba(255, 255, 255, .07); color: var(--text-2); font-size: var(--fs-12); font-weight: 600; transition: background-color var(--dur-2), color var(--dur-2); }
.coach .skip:hover { background: rgba(255, 255, 255, .12); color: var(--text-1); }
html.is-touch .coach .skip { min-height: var(--tap); padding: 0 14px; }
.coach-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: var(--text-1); font-size: var(--fs-13); font-weight: 600; box-shadow: inset 0 0 0 1px var(--glass-line), var(--sh-glass); }
.coach-pill .ico-svg { color: var(--gold-300); }
html.is-touch .coach-pill { height: var(--tap); }
@keyframes coachIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---- top-right: buttons, rating, events, power */
.hud-btns { display: flex; gap: 8px; align-items: center; }
.hud-btns .btn { min-height: 44px; border-radius: var(--r-2); }
.hud-btns .btn.ghost { --bc: var(--glass); --bh: var(--glass-strong); --bbd: var(--glass-line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--hl), var(--sh-glass); }
.hud-btns .btn.icon { width: 44px; }
.hud-btns .manage-btn { padding: 0 8px 0 14px; gap: 8px; }
.hud-btns .manage-btn .kbd { background: rgba(0, 0, 0, .22); border-color: rgba(255, 255, 255, .22); border-bottom-color: rgba(0, 0, 0, .35); box-shadow: none; font-size: .7em; }
.hud-btns .acc-chip { flex: none; }
.rating-box { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: var(--r-pill); }
.rating-box .stars { font-size: 13px; }
.rating-box .sub { font-size: var(--fs-12); font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.hud-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 11px 0 9px; border-radius: var(--r-pill); font-weight: 550; font-size: var(--fs-12); color: var(--text-1); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: inset 0 0 0 1px var(--glass-line); }
.hud-chip .ico-svg { width: 14px; height: 14px; }
.hud-chip.good .ico-svg { color: var(--accent-300); } .hud-chip.warn .ico-svg { color: var(--amber-300); } .hud-chip.bad .ico-svg { color: var(--red-300); }
.hud-chip.bad { box-shadow: inset 0 0 0 1px var(--red-line); }
.ev-pill { display: none; }
.ev-list { display: none; flex-direction: column; align-items: flex-end; gap: 6px; }
.ico-pause { display: inline-flex; gap: 4px; height: 14px; }
.ico-pause i { width: 4px; height: 100%; border-radius: 2px; background: currentColor; }
.power-ind { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: var(--r-pill); font-weight: 550; font-size: var(--fs-12); }
.power-ind .ico-svg { color: var(--text-2); }
.power-ind .off { color: var(--red-300); }
.gauge { width: 48px; height: 4px; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, .14); }
.gauge i { display: block; height: 100%; background: var(--gold-400); border-radius: 4px; }
.gauge i.inv { background: var(--accent-400); }

/* ---- goals (mid-left, folds to its title) */
.goal-card { padding: 6px 12px 12px; font-size: var(--fs-13); }
.goal-card.folded { padding-bottom: 6px; }
.goal-card .goal-head { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; color: inherit; padding: 0; font-weight: 600; font-size: var(--fs-13); text-align: left; min-height: 32px; }
.goal-card .goal-head > .ico-svg { color: var(--text-3); }
.goal-card .goal-head .cnt { margin-left: auto; color: var(--text-3); font-weight: 500; font-size: var(--fs-12); font-variant-numeric: tabular-nums; }
.goal-card .goal-head .chev { display: inline-flex; transition: transform var(--dur-2) var(--ease-out); color: var(--text-3); }
.goal-card .goal-head .chev .ico-svg { display: block; }
.goal-card.folded .goal-head .chev { transform: rotate(-90deg); }
.goal-card.folded .goal-body { display: none; }
.goal-card .goal-body { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.goal-card .ch { display: flex; flex-direction: column; gap: 5px; }
.goal-card .ch .t { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-12); line-height: 1.25; color: var(--text-2); }
.goal-card .ch .t > span:last-child { font-variant-numeric: tabular-nums; color: var(--text-3); white-space: nowrap; }
.goal-card .ch .t .ico-svg { color: var(--accent-300); }
.goal-card .ch.done .t { color: var(--text-3); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .25); }
.goal-card .bar { height: 3px; background: rgba(255, 255, 255, .1); }
.goal-card .tiny { color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
html.is-touch .goal-card .goal-head { min-height: var(--tap); }

/* ---- bottom: carrying, combo, interaction prompt */
.carry-box { display: flex; gap: 6px; align-items: center; padding: 8px; min-height: 56px; border-radius: var(--r-3); }
.carry-box .slot-c { width: 40px; height: 44px; border-radius: 10px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); display: flex; align-items: center; justify-content: center; position: relative; }
.carry-box .slot-c:not(.full) { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .03) 0 4px, transparent 4px 8px); }
.carry-box .slot-c.full { background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.carry-box .slot-c.spoiled { background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red-line); }
.carry-box .slot-c canvas { width: 30px; height: 32px; }
.carry-box .slot-c i { position: absolute; bottom: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; display: flex; align-items: center; justify-content: center; background: var(--gold-400); color: #2a1a00; font-style: normal; font-size: var(--fs-11); font-weight: 700; border-radius: 9px; line-height: 1; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px rgba(10, 13, 12, .9); }
.carry-box .tool { display: flex; flex-direction: column; gap: 6px; padding: 0 6px; font-size: var(--fs-12); font-weight: 600; color: var(--text-2); }
.carry-box .tool .ico-svg { color: var(--text-1); }
.carry-box .tool .bar { width: 72px; height: 4px; background: rgba(255, 255, 255, .14); }
.combo { font-family: var(--font-display); font-stretch: 115%; font-weight: 800; font-size: 1.5rem; letter-spacing: -.01em; color: var(--gold-300); text-shadow: 0 2px 12px rgba(0, 0, 0, .55); animation: comboPop .25s var(--ease-out); line-height: 1; font-variant-numeric: tabular-nums; }
@keyframes comboPop { from { transform: scale(1.3); } to { transform: none; } }
.combo-bar { width: 128px; height: 4px; border-radius: 4px; background: rgba(0, 0, 0, .45); overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.combo-bar i { display: block; height: 100%; background: var(--gold-300); transition: width .1s linear; }
.prompt { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 18px 6px 7px; border-radius: var(--r-pill); font-size: var(--fs-15); font-weight: 550; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; background: var(--glass-strong); }
.prompt .kbd { font-size: 1rem; height: 30px; min-width: 30px; border-radius: 8px; }
.prompt .kbd.pad { width: 30px; border-radius: 50%; }
.prompt.dim { padding-left: 18px; color: var(--text-2); font-weight: 500; }
.prompt.sub { min-height: 30px; font-size: var(--fs-13); padding: 4px 14px; color: var(--text-2); font-weight: 500; background: var(--glass); }
.hud-hint { font-size: var(--fs-12); color: rgba(255, 255, 255, .8); text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }

/* ---- the till panel */
#checkout { position: absolute; right: calc(var(--sa-r) + 12px); top: calc(var(--sa-t) + 112px); bottom: calc(var(--sa-b) + 16px); width: min(392px, calc(100vw - 24px)); z-index: 6; display: flex; flex-direction: column; pointer-events: none; }
#checkout > .co-card { pointer-events: auto; max-height: 100%; min-height: 0; }
html.co-open .hud-tr .chip-row, html.co-open .hud-tr .power-ind { display: none !important; }   /* the docked till takes that side */
.co-card { display: flex; flex-direction: column; max-height: inherit; overflow: hidden; border-radius: 20px; background: var(--glass-strong); }
.co-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-bottom: 1px solid var(--line-2); }
.co-head > canvas { flex: none; width: 30px !important; height: 40px !important; border-radius: 9px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--line-2); object-fit: contain; }
.co-head .who { font-weight: 600; font-size: var(--fs-15); line-height: 1.2; letter-spacing: -.005em; }
.co-head .sub { font-size: var(--fs-12); color: var(--text-3); }
.co-head .pill { background: rgba(255, 255, 255, .08); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--line-2); }
.co-head .pill.warn { background: var(--gold-soft); color: var(--gold-300); }
.co-meters { flex: none; display: flex; flex-direction: column; gap: 5px; width: 78px; font-size: .7rem; }
.co-meters .row { gap: 6px; color: var(--text-3); }
.co-meters .bar { height: 4px; background: rgba(255, 255, 255, .1); }
.co-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.co-items { display: flex; gap: 4px; flex-wrap: wrap; max-height: 60px; overflow: hidden; }
.co-items span { background: rgba(255, 255, 255, .08); border-radius: 8px; padding: 1px 6px 1px 3px; display: inline-flex; align-items: center; gap: 2px; color: var(--text-1); font-size: .74rem; font-weight: 650; }
.co-items span.scanned { background: var(--accent-soft-2); }
.co-items canvas { width: 18px; height: 22px; }
.co-sums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.co-sum { padding: 8px 10px; border-radius: var(--r-2); background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--line-1); min-width: 0; }
.co-sum .l { font-size: var(--fs-11); font-weight: 600; color: var(--text-3); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 3px; }
.co-big { font-family: var(--font-ui); font-weight: 700; font-size: 1.25rem; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.co-sum.due { background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold-line); }
.co-sum.due .l { color: var(--gold-300); }
.co-sum.due .co-big { color: var(--gold-200); }
.notes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.note {
  --note: #9aa59f; position: relative; min-height: 52px; border: 0; border-radius: var(--r-2); padding: 6px 4px 4px; font-family: var(--font-ui); font-weight: 700; font-size: var(--fs-15); letter-spacing: -.01em; color: var(--text-1); font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .04));
  background: linear-gradient(180deg, color-mix(in srgb, var(--note) 24%, #1b2220), color-mix(in srgb, var(--note) 10%, #151a18));
  box-shadow: inset 0 3px 0 var(--note), inset 0 0 0 1px rgba(255, 255, 255, .1), 0 2px 6px rgba(0, 0, 0, .3);
  touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: transform var(--dur-1) var(--ease-out), filter var(--dur-2);
}
.note:hover { filter: brightness(1.18); }
.note.coin { border-radius: 999px; box-shadow: inset 0 0 0 2px var(--note), 0 2px 6px rgba(0, 0, 0, .3); }
.note:active { transform: scale(.95); }
.note small { display: block; margin-top: 2px; font-size: .62rem; font-weight: 600; color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; line-height: 1; }
.note i { position: absolute; top: -7px; right: -5px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--gold-400); color: #2a1a00; font-style: normal; font-size: var(--fs-12); font-weight: 750; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #0f1311; font-variant-numeric: tabular-nums; }
.co-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.co-hand { display: flex; align-items: baseline; gap: 8px; }
.co-hand .l { font-size: var(--fs-12); color: var(--text-3); font-weight: 500; }
.co-hand .co-big.ok { color: var(--accent-300); } .co-hand .co-big.over { color: var(--red-300); }
.co-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.co-choices { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.co-choices .btn { flex: 1 1 110px; flex-direction: column; gap: 3px; min-height: 58px; padding: 6px 10px; }
.co-choices .btn small { white-space: normal; text-align: center; line-height: 1.2; }
.co-note { font-size: var(--fs-12); text-align: center; color: var(--text-3); line-height: 1.45; }
.co-wait { text-align: center; padding: 6px 0; }
.co-leave { display: none; }
html.is-touch .co-leave { display: inline-flex; }
.phone { background: var(--surface-0); border-radius: var(--r-3); padding: 10px 14px; text-align: center; min-width: 210px; box-shadow: inset 0 0 0 1px var(--line-3); }
.phone .ring { color: var(--gold-300); font-weight: 600; animation: breathe .8s infinite; }
.dots::after { content: ''; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* ================================================================ responsive HUD */
/* medium windows: the centre column gets narrower, the store name hides */
@media (max-width: 1100px) {
  .hud-tc { max-width: calc(100vw - 520px); min-width: 240px; }
  .lvl-box .store { max-width: 110px; }
}
/* tablets in portrait and medium windows: the clock row moves under the top corners */
@media (max-width: 999px) {
  .hud-tc { top: calc(var(--sa-t) + 92px); max-width: calc(100vw - 16px); min-width: 0; width: max-content; }
  .money-box .delta { display: none; }
  .rating-box { display: none !important; }
  .mini-rating { display: inline-flex; }
  .hud-ml { top: calc(var(--sa-t) + 200px); }
}
/* phones and narrow windows: two rows (money | buttons) then the clock + coach centred below; fewer elements */
@media (max-width: 760px) {
  #hud { --edge: 8px; }
  .hud-tc { top: calc(var(--sa-t) + 66px); max-width: calc(100vw - 16px); min-width: 0; width: calc(100vw - 16px); }
  .money-box { min-width: 0; padding: 7px 12px 8px 8px; gap: 5px; }
  .money-box .amt { font-size: 1.15rem; }
  .money-box .coin { width: 26px; height: 26px; font-size: 13px; }
  .lvl-box .store { display: none; }
  .mini-rating { display: inline-flex; }
  .rating-box, .chip-row, .hud-ml { display: none !important; }
  .ev-pill { display: inline-flex; }
  .ev-list.open { display: flex; }
  .clock-box { height: 40px; padding: 0 5px 0 12px; gap: 10px; }
  .clock-box .time { font-size: 1rem; }
  .clock-box .day { font-size: var(--fs-11); }
  .speed-btns { height: 40px; }
  .coach { font-size: var(--fs-13); }
  .coach.tut { min-width: 0; width: 100%; }
  .hud-btns { gap: 6px; }
  .hud-btns .manage-btn .lbl, .hud-btns .manage-btn .kbd { display: none; }
  .hud-btns .manage-btn { width: 44px; padding: 0; }
  .money-box .delta { display: none; }
  .power-ind { display: none !important; }
  #checkout { bottom: auto; top: calc(var(--sa-t) + 150px); left: 50%; right: auto; transform: translateX(-50%); width: min(560px, calc(100vw - 16px)); max-height: calc(100% - var(--sa-t) - 160px); }
}
/* short landscape screens (phones on their side): one top row, everything compact */
@media (max-height: 520px) {
  #hud { --edge: 8px; }
  .hud-tc { top: calc(var(--sa-t) + 8px); max-width: calc(100vw - 420px); min-width: 0; width: max-content; }
  .money-box { min-width: 0; padding: 6px 10px 7px 7px; gap: 4px; }
  .money-box .amt { font-size: 1.05rem; }
  .money-box .coin { width: 24px; height: 24px; font-size: 12px; }
  .lvl-box .store { display: none; }
  .mini-rating { display: inline-flex; }
  .rating-box, .chip-row, .hud-ml, .power-ind { display: none !important; }
  .ev-pill { display: inline-flex; }
  .ev-list.open { display: flex; }
  .clock-row { flex-wrap: nowrap; }
  .clock-box { height: 40px; }
  .clock-box .day { display: none; }
  .clock-box .time { font-size: 1rem; min-width: 4.6em; }
  .speed-btns { height: 40px; }
  .coach { padding: 4px 5px 4px 10px; font-size: var(--fs-13); min-height: 0; }
  .coach-text { -webkit-line-clamp: 1; }
  .coach.tut { min-width: 0; padding: 6px 8px 8px 10px; gap: 4px; }
  .coach.tut .coach-text { font-size: var(--fs-13); -webkit-line-clamp: 2; }
  .hud-btns .manage-btn .lbl, .hud-btns .manage-btn .kbd { display: none; }
  .hud-btns .manage-btn { width: 44px; padding: 0; }
  .money-box .delta { display: none; }
  .speed-btns button:not(.on) { display: none; }
  .open-btn .ob-long { display: none; } .open-btn .ob-short { display: inline; }
  .phase-badge.prep { display: none; }
  #checkout { bottom: calc(var(--sa-b) + 8px); top: calc(var(--sa-t) + 56px); left: 50%; right: auto; transform: translateX(-50%); width: min(420px, 50vw); }
}

/* touch devices: keep the joystick (bottom-left) and button (bottom-right) zones free */
html.is-touch .hud-bl { bottom: auto; top: calc(var(--sa-t) + 96px); left: calc(var(--sa-l) + 8px); }
html.is-touch .hud-ml { top: calc(var(--sa-t) + 200px); max-height: calc(60% - 210px); overflow: hidden; }
html.is-touch .hud-bc { bottom: calc(var(--sa-b) + 10px); max-width: 30vw; }
html.is-touch .prompt { font-size: var(--fs-13); padding: 6px 12px; min-height: 0; white-space: normal; text-align: center; line-height: 1.25; }
html.is-touch .prompt .kbd { display: none; }
html.has-touch-label .hud-bc .prompt:not(.dim):not(.sub) { display: none; }
html.is-touch .carry-box { min-height: 0; padding: 6px; }
html.is-touch .carry-box .slot-c { width: 34px; height: 38px; }
html.is-touch .carry-box .slot-c canvas { width: 26px; height: 28px; }
@media (max-width: 760px) { html.is-touch .hud-bl { top: calc(var(--sa-t) + 186px); } }
@media (max-height: 520px) { html.is-touch .hud-bl { top: calc(var(--sa-t) + 84px); } }
/* the till on touch: below the HUD, above the control zones (portrait: full width; landscape phone: the free centre column) */
html.is-touch #checkout { bottom: auto; top: calc(var(--sa-t) + 120px); max-height: calc(60% - 128px); }
html.is-touch #checkout > .co-card { width: 100%; }
html.co-open.is-touch .coach, html.co-open.is-touch .coach-pill { display: none !important; }
@media (max-width: 760px) {
  html.is-touch #checkout { top: calc(var(--sa-t) + 160px); max-height: calc(60% - 164px); min-height: 0; }
  .co-meters { display: none; }
  .co-head { flex-wrap: wrap; row-gap: 4px; }
  .co-sum { padding: 6px 8px; } .co-big { font-size: 1.1rem; }
}
@media (max-height: 520px) {
  html.is-touch #checkout { top: calc(var(--sa-t) + 54px); bottom: calc(var(--sa-b) + 6px); max-height: none; width: 32vw; min-width: 250px; }
  html.is-touch .notes { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  html.is-touch .note { min-height: 44px; font-size: var(--fs-13); }
  html.is-touch .co-sums { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  html.is-touch .co-big { font-size: 1rem; }
  html.is-touch .co-head { padding: 6px 10px; }
  html.is-touch .co-meters { display: none; }
  html.is-touch .co-body { padding: 8px 10px 10px; gap: 8px; }
}
/* dual-screen: the centre column sits in the middle of the first screen, not on the hinge */
html.is-dual .hud-tc, html.is-dual .hud-bc, html.is-dual #checkout { left: calc(var(--seg-x) + var(--seg-w) / 2); max-width: calc(var(--seg-w) - 24px); }
html.is-dual .hud-tr { right: auto; left: calc(var(--seg-x) + var(--seg-w) - var(--edge)); transform: translateX(-100%); }
html.is-touch .ev-pill { min-height: var(--tap); border: 0; color: var(--text-1); }
@media (min-width: 761px) and (max-width: 999px) and (min-height: 521px) { html.is-touch #checkout { top: calc(var(--sa-t) + 146px); max-height: calc(60% - 150px); } }
html.co-open.is-touch .hud-ml { display: none !important; }
html.is-dual #checkout { right: auto; transform: translateX(-50%); }

/* ---- the POS screen (checkout.js): receipt, scan row, payment step */
.pos-badge, .pay-ico { flex: none; width: 40px; height: 40px; border-radius: var(--r-2); background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--line-2); display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.pay-ico { width: 56px; height: 56px; border-radius: var(--r-3); color: var(--gold-300); }
.pay-ico.ok { background: var(--accent-soft-2); color: var(--accent-300); box-shadow: inset 0 0 0 1px var(--accent-line); }
.co-head .pay-chip { gap: 6px; min-height: 30px; padding: 0 11px 0 9px; background: rgba(255, 255, 255, .08); color: var(--text-1); font-size: var(--fs-12); font-weight: 600; }
.co-head .pay-chip .ico-svg { color: var(--text-2); width: 15px; height: 15px; }
.receipt { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; border-radius: 14px; background: rgba(0, 0, 0, .28); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--line-2); }
.rc-head { display: flex; align-items: center; gap: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line-1); font-weight: 650; font-size: var(--fs-11); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.rc-head .ico-svg { width: 14px; height: 14px; }
.rc-left { font-weight: 500; color: var(--text-3); font-size: var(--fs-12); letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.rc-lines { display: flex; flex-direction: column; gap: 0; max-height: 168px; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.rc-lines:empty::before { content: 'Nothing scanned yet'; color: var(--text-3); font-size: var(--fs-13); padding: 8px 0; }
.rc-line { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 2px; border-bottom: 1px solid var(--line-1); }
.rc-line:last-child { border-bottom: 0; }
.rc-line.new { animation: rcIn .3s var(--ease-out); }
@keyframes rcIn { from { transform: translateY(-4px); background: var(--accent-soft-2); } to { transform: none; background: transparent; } }
.rc-name { min-width: 0; line-height: 1.2; }
.rc-name b { display: block; font-size: var(--fs-13); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-name small { font-size: var(--fs-12); color: var(--text-3); font-variant-numeric: tabular-nums; }
.rc-sum { font-weight: 600; font-size: var(--fs-13); font-variant-numeric: tabular-nums; }
.rc-pending { display: flex; flex-wrap: wrap; gap: 4px; }
.rc-chip { display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px 1px 3px; border-radius: 7px; background: rgba(255, 255, 255, .07); font-size: var(--fs-11); font-weight: 650; color: var(--text-2); font-variant-numeric: tabular-nums; }
.rc-chip canvas { width: 16px; height: 20px; }
.rc-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 8px; border-top: 1px solid var(--line-3); font-weight: 500; font-size: var(--fs-13); color: var(--text-2); }
.rc-total-v { font-family: var(--font-ui); font-weight: 700; font-size: 1.375rem; letter-spacing: -.02em; color: var(--text-1); font-variant-numeric: tabular-nums; }
.pos-step { display: flex; flex-direction: column; gap: 10px; animation: posStep var(--dur-3) var(--ease-out); }
@keyframes posStep { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.scan-row { display: flex; align-items: center; gap: 12px; }
.scan-bar { height: 4px; background: rgba(255, 255, 255, .1); margin-bottom: 8px; }
.scan-bar > i, .scan-bar.mango > i { background: var(--accent-400); }
.co-scan { flex: none; min-width: 124px; min-height: 64px; font-size: var(--fs-16); flex-direction: column; gap: 3px; border-radius: var(--r-3); touch-action: none; user-select: none; -webkit-user-select: none; }
.co-note.left { text-align: left; }
.haggle-q { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 4px 0; font-family: var(--font-display); font-stretch: 108%; font-weight: 700; font-size: var(--fs-20); letter-spacing: -.01em; }
.haggle-q .ico-svg { color: var(--gold-300); }
.pay-wait { display: flex; align-items: center; gap: 14px; padding: 4px 0; }
.ring { color: var(--gold-300); font-weight: 600; }
@media (max-width: 760px), (max-height: 520px) { .rc-lines { max-height: 92px; } .co-scan { min-width: 104px; min-height: 56px; } .receipt { padding: 8px 10px; } }
@media (max-height: 520px) { .rc-pending { display: none; } }
/* compact screens: once everything is scanned the receipt shrinks to its total, so the payment step (notes, choices) gets the room */
@media (max-width: 760px), (max-height: 520px) {
  .co-body:has(.pos-step:not([data-phase="scan"])) .rc-lines, .co-body:has(.pos-step:not([data-phase="scan"])) .rc-head { display: none; }
  .co-body:has(.pos-step:not([data-phase="scan"])) .rc-total { border-top: 0; padding-top: 0; }
}
/* the day is over: Start day N + Day report stay on screen while the player tidies up */
.day-end { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.day-end .start-day { min-height: 48px; padding: 0 22px; font-size: var(--fs-16); border-radius: 999px; animation: goPulse 1.8s ease-out infinite; }
.day-end .day-report { min-height: 48px; border-radius: 999px; --bc: var(--glass); --bh: var(--glass-strong); --bbd: var(--glass-line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.coach-ico { display: inline-flex; color: var(--gold-300); }
