/* Restocking Fee: a flat fluorescent big-box store, slightly too bright. Receipt paper, store red, linoleum. */
:root {
  --red: #cc0000; --red2: #a30000; --paper: #fafaf5; --fluor: #e8f1f2; --lino: #c9c3b5; --ink: #222222; --ink2: #6a6a64;
  --ok: #1f8a4c; --no: #cc0000; --cr: #c98a00;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --hud: 46px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--fluor); color: var(--ink); font-family: var(--sans); -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
body { touch-action: none; }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
kbd { font-family: var(--mono); font-size: .85em; border: 1px solid currentColor; border-bottom-width: 2px; border-radius: 4px; padding: 0 .3em; }

/* where the 3D view frames the customer and the item (the canvas itself is full screen) */
#stage { position: fixed; left: 0; right: 0; top: calc(var(--hud) + env(safe-area-inset-top)); bottom: calc(232px + env(safe-area-inset-bottom)); pointer-events: none; }

/* ---------- HUD: the store's red header ---------- */
#hud { position: fixed; top: 0; left: 0; right: 0; height: calc(var(--hud) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 4px 0 12px; display: flex; align-items: center; gap: 10px;
  background: var(--red); color: #fff; z-index: 5; box-shadow: 0 2px 0 var(--red2); }
#h-title { font-size: 16px; white-space: nowrap; letter-spacing: .02em; }
#today { font: 600 12px var(--mono); opacity: .85; white-space: nowrap; }
#clock { font: 700 17px var(--mono); margin-left: auto; }
#clock.late { color: #ffe36b; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }
#prog { font: 600 13px var(--mono); opacity: .9; }
.btns { display: flex; }
.btns button { min-width: 44px; height: 44px; border: 0; background: none; font-size: 15px; font-weight: 700; color: #fff; border-radius: 8px; padding: 0 8px; }
.btns button:hover { background: #fff2; }
#mute { font-size: 20px; }
#mute.off { opacity: .4; text-decoration: line-through; }
@media (max-width: 400px) { #today { display: none; } #hud { gap: 7px; } }

/* ---------- the rulebook: a sheet that drops down on phones, pinned at the left on wide screens ---------- */
#book { position: fixed; top: calc(var(--hud) + env(safe-area-inset-top) + 6px); left: 8px; right: 8px; z-index: 6; background: var(--paper); border-radius: 4px; padding: 10px 14px 8px;
  box-shadow: 0 10px 30px #0004, inset 0 0 0 1px #0001; transform: translateY(-140%); transition: transform .25s ease; font-size: 15px; line-height: 1.3; }
body.book #book { transform: none; }
#book h3 { margin: 0 0 4px; font: 700 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
#book ol { margin: 0; padding: 0; list-style: none; counter-reset: r; }
#book li { padding: 6px 0 6px 26px; border-top: 1px dashed #0002; position: relative; counter-increment: r; }
#book li::before { content: counter(r); position: absolute; left: 0; top: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: #fff; font: 700 11px/18px var(--sans); text-align: center; }
#book li.new { background: #ffd40055; margin: 0 -8px; padding-left: 34px; padding-right: 8px; border-radius: 4px; }
#book li.new::before { left: 8px; }
#book li.new::after { content: 'NEW TODAY'; display: block; font: 700 10px var(--mono); color: var(--red); letter-spacing: .1em; }
#book li.new.chg::after { content: 'CHANGED TODAY'; }
#book b.r { color: var(--no); } #book b.f { color: var(--ok); } #book b.c { color: var(--cr); }
body.newrule #rules-btn { animation: pulse .5s ease 4; }
@keyframes pulse { 50% { transform: scale(1.25); background: #fff4; } }

/* ---------- the customer's line ---------- */
#bubble { position: fixed; z-index: 3; max-width: min(300px, calc(100vw - 24px)); background: #fff; border-radius: 14px; padding: 8px 12px 9px; box-shadow: 0 4px 14px #0002; font-size: 15px; line-height: 1.3;
  left: 12px; top: calc(var(--hud) + 10px); transition: opacity .2s; pointer-events: none; }
#bubble::after { content: ''; position: absolute; left: var(--tail, 40px); bottom: -9px; border: 10px solid transparent; border-top-color: #fff; border-bottom: 0; }
#bubble b { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink2); }
#bubble.hide { opacity: 0; }
#bubble.mad { background: #ffe3e0; } #bubble.mad::after { border-top-color: #ffe3e0; }
#bubble.glad { background: #e3f6e9; } #bubble.glad::after { border-top-color: #e3f6e9; }
#hint { position: fixed; z-index: 3; left: 50%; transform: translateX(-50%); bottom: calc(266px + env(safe-area-inset-bottom)); margin: 0; background: var(--ink); color: #fff; padding: 7px 12px; border-radius: 999px; font-size: 14px; white-space: nowrap; max-width: calc(100vw - 16px); overflow: hidden; text-overflow: ellipsis; pointer-events: none; transition: opacity .2s; }
#hint:empty { opacity: 0; }
#hint.found { background: var(--ok); }
#tally { position: fixed; z-index: 3; left: 10px; bottom: calc(236px + env(safe-area-inset-bottom)); display: flex; gap: 3px; pointer-events: none; font: 700 12px var(--mono); }
#tally span { background: #fffd; padding: 2px 6px; border-radius: 4px; }
#tally .hit { animation: hit .6s ease; background: #ffd9d4; }
@keyframes hit { 30% { transform: scale(1.3); } }

/* ---------- the receipt and the stamps ---------- */
#desk { position: fixed; left: 0; right: 0; bottom: 0; padding: 0 10px calc(8px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 4; pointer-events: none; }
#slip { position: relative; width: min(360px, 100%); height: 156px; pointer-events: auto; }
.rc { position: absolute; inset: 0; background: var(--paper); border-radius: 2px; padding: 10px 14px 12px; font: 14px/1.38 var(--mono); color: var(--ink); touch-action: none; cursor: grab;
  box-shadow: 0 2px 0 #0001, 0 10px 26px #0003; transition: transform .22s cubic-bezier(.2,1.4,.4,1), opacity .2s; will-change: transform;
  -webkit-mask: radial-gradient(circle at 6px 0, transparent 5px, #000 5.5px) -6px 0 / 12px 100% repeat-x; mask: radial-gradient(circle at 6px 0, transparent 5px, #000 5.5px) -6px 0 / 12px 100% repeat-x; }
.rc.drag { transition: none; cursor: grabbing; }
.rc.enter { transform: translateY(60px); opacity: 0; }
.rc .hd { display: flex; justify-content: space-between; font-weight: 700; padding-top: 4px; }
.rc .hd .st { color: var(--red); letter-spacing: .04em; }
.rc .hd .st.other { color: #2b5fa8; }
.rc .ln { display: flex; justify-content: space-between; gap: 8px; }
.rc .ln span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc hr { border: 0; border-top: 1px dashed #0004; margin: 5px 0; }
.rc .by { font-weight: 700; }
.rc .by.late { color: var(--no); }
.rc.none { background: #f1efe6; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 4px; }
.rc.none .big { font: 700 22px var(--mono); color: var(--no); letter-spacing: .06em; }
.rc .stamp { position: absolute; left: 50%; top: 50%; font: 900 30px/1 var(--sans); letter-spacing: .04em; padding: 6px 10px; border: 4px solid currentColor; border-radius: 6px; transform: translate(-50%, -50%) rotate(-12deg) scale(1.6); opacity: 0; pointer-events: none; mix-blend-mode: multiply; white-space: nowrap; }
.rc .stamp.ok { color: var(--ok); } .rc .stamp.no { color: var(--no); } .rc .stamp.cr { color: var(--cr); }
.rc .stamp.show { opacity: .9; transform: translate(-50%, -50%) rotate(-12deg) scale(1); transition: transform .12s cubic-bezier(.3,1.8,.5,1), opacity .08s; }
.rc .stamp.peek { transition: none; }
.rc .clr { color: #8a6d00; background: #ffd40044; padding: 0 3px; }

#bar { display: flex; gap: 8px; width: min(360px, 100%); pointer-events: auto; }
.big { flex: 1; height: 54px; border: 0; border-radius: 10px; font-weight: 800; font-size: 15px; color: #fff; display: flex; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 3px 0 #0003; }
.big i { font-style: normal; font-size: 18px; opacity: .8; }
.big:active { transform: translateY(2px); box-shadow: 0 1px 0 #0003; }
.big.no { background: var(--no); } .big.ok { background: var(--ok); } .big.cr { background: var(--cr); flex: 1.15; }
.big:disabled { opacity: .5; }
body.touch .big i { display: none; }
#mark { position: fixed; z-index: 3; right: 10px; bottom: calc(238px + env(safe-area-inset-bottom)); opacity: .7; font-size: 11px; }
body.playing #mark { display: none; }

#toast { position: fixed; z-index: 8; left: 50%; bottom: calc(266px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 15px; max-width: calc(100vw - 24px); opacity: 0; transition: .25s; pointer-events: none; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--no); } #toast.good { background: var(--ok); } #toast.memo { background: #ffd400; color: var(--ink); font-weight: 600; }

/* ---------- sheets: help, the report ---------- */
#panel { position: fixed; inset: 0; z-index: 10; background: #0006; display: flex; align-items: center; justify-content: center; padding: 10px; }
#panel.hidden { display: none; }
.sheet { background: var(--paper); border-radius: 6px; width: min(440px, 100%); max-height: 100%; overflow-y: auto; padding: 16px 16px 12px; box-shadow: 0 20px 50px #0006; touch-action: pan-y; user-select: text; }
.sheet h2 { margin: 0 0 6px; font-size: 20px; }
.sheet h2 small { display: block; font: 600 12px var(--mono); color: var(--ink2); letter-spacing: .04em; margin-top: 2px; }
.sheet p { margin: 6px 0; line-height: 1.4; }
.sheet ul { margin: 6px 0; padding-left: 20px; line-height: 1.4; }
.sheet .row2 { display: flex; gap: 8px; margin: 10px 0; }
.sheet .row2 button, .sheet .go { flex: 1; min-height: 46px; border-radius: 8px; border: 2px solid var(--ink); background: #fff; font-weight: 700; font-size: 15px; }
.sheet .go, .sheet .primary, .sheet .row2 .go { background: var(--red); border-color: var(--red); color: #fff; }
.grid { display: flex; gap: 4px; margin: 8px 0; }
.grid i { flex: 1; height: 22px; border-radius: 3px; background: #ccc; }
.grid i.good { background: var(--ok); } .grid i.meh { background: #e6b400; } .grid i.bad { background: var(--no); } .grid i.late { background: #999; }
.score { display: flex; gap: 8px; margin: 6px 0; }
.score div { flex: 1; background: #fff; border-radius: 6px; padding: 6px 8px; text-align: center; font-size: 12px; color: var(--ink2); }
.score b { display: block; font-size: 20px; color: var(--ink); }
.incident { background: #fff; border: 2px solid var(--ink); border-radius: 2px; padding: 8px 10px; font: 13px/1.4 var(--mono); margin: 8px 0; position: relative; }
.incident h4 { margin: 0 0 4px; font: 700 13px var(--mono); letter-spacing: .1em; color: var(--red); display: flex; justify-content: space-between; }
.incident .k { color: var(--ink2); }
.incident.clean h4 { color: var(--ok); }
details { margin: 6px 0; } summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.calls { list-style: none; padding: 0 !important; font-size: 14px; }
.calls li { padding: 5px 0; border-top: 1px dashed #0002; display: flex; gap: 8px; }
.calls li i { flex: none; width: 12px; height: 12px; border-radius: 2px; margin-top: 4px; }
.calls em { display: block; color: var(--ink2); font-style: normal; font-size: 13px; }
.streak { font-size: 13px; color: var(--ink2); }
.vote { background: #fff; border-radius: 6px; padding: 6px 8px; margin: 8px 0; }
.vote p { margin: 0 0 6px; font-weight: 700; font-size: 14px; }
.vote .opts { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.vote .opts button { flex: none; min-height: 40px; border: 1px solid #0003; background: var(--fluor); border-radius: 999px; padding: 0 12px; font-size: 13px; white-space: nowrap; }
.door { width: 100%; text-align: left; background: #fff8d6; border: 1px dashed #c9a400; border-radius: 6px; padding: 8px 10px; font-size: 14px; margin: 4px 0 8px; }
.foot { font-size: 13px; text-align: center; }
.help-keys { font-size: 14px; }

/* ---------- wide screens: the rulebook pinned left, the receipt pinned right ---------- */
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  #stage { left: 300px; right: 400px; bottom: 0; }
  #book { transform: none; left: 16px; right: auto; width: 270px; top: calc(var(--hud) + 16px); }
  #rules-btn { display: none; }
  #desk { left: auto; right: 16px; top: calc(var(--hud) + 16px); bottom: auto; width: 370px; padding: 0; }
  #slip { height: 200px; }
  #hint { bottom: 24px; left: calc(50% - 50px); }
  #toast { bottom: 70px; left: calc(50% - 50px); }
  #tally { right: auto; left: 16px; top: auto; bottom: 16px; flex-direction: row; font-size: 14px; }
  #mark { bottom: 56px; left: 16px; }
  body.pad .big i { display: inline; }
}
.hidden { display: none !important; }

/* ---------- round 2: receipt flags, the magnifier ring, the share picture ---------- */
.rc .gift { color: #7a3fa0; font-weight: 700; letter-spacing: .04em; }
.rc .flag { color: var(--ink2); }
.rc .flag.hot { color: #fff; background: var(--no); margin: 0 -6px; padding: 0 6px; font-weight: 700; }
#ring { position: fixed; left: 0; top: 0; z-index: 2; width: 0; height: 0; pointer-events: none; opacity: 0; transition: opacity .15s; }
#ring i { position: absolute; left: -46px; top: -46px; width: 92px; height: 92px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 2px #0006, inset 0 0 0 2px #0004; transform: scale(1.5); transition: transform .25s cubic-bezier(.2,1.6,.4,1), border-color .15s; }
#ring i::after { content: ''; position: absolute; width: 34px; height: 8px; background: #fff; border-radius: 4px; box-shadow: 0 0 0 2px #0006; left: 74px; top: 86px; transform: rotate(45deg); transform-origin: 0 50%; }
#ring.on { opacity: 1; }
#ring.on i { transform: scale(1); }
#ring.hot i, #ring.hot i::after { border-color: var(--no); background-clip: padding-box; }
#ring.hot i::after { background: var(--no); }
#ring.hot i::before { content: '!'; position: absolute; right: -14px; top: -16px; width: 28px; height: 28px; border-radius: 50%; background: var(--no); color: #fff; font: 900 20px/28px var(--sans); text-align: center; animation: pop .3s cubic-bezier(.2,1.8,.4,1); }
@keyframes pop { from { transform: scale(0); } }
.pic { display: block; width: 100%; max-width: 420px; margin: 8px auto; border-radius: 4px; box-shadow: 0 4px 18px #0003; }
.savepic { display: block; text-align: center; font-size: 14px; margin: 0 0 8px; }

/* ---------- desk tools: a column on the right, earned by shifts worked ---------- */
#tools { position: fixed; z-index: 3; right: 8px; bottom: calc(270px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
#tools:empty { display: none; }
.tool { width: 58px; min-height: 54px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); font: 700 10px var(--sans); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; box-shadow: 0 3px 0 #0003; padding: 4px 2px; }
.tool span { font-size: 22px; line-height: 1; }
.tool:active { transform: translateY(2px); box-shadow: 0 1px 0 #0003; }
.tool.on { background: #6b3cff; border-color: #6b3cff; color: #fff; box-shadow: 0 0 16px #8a5cff; }
.tool.nudge { animation: nudge 1s ease 3; }
@keyframes nudge { 40% { transform: scale(1.14); box-shadow: 0 0 0 6px #ffd400aa; } }
.tool kbd { font: 600 9px var(--mono); opacity: .6; }
body.touch .tool kbd { display: none; }
#readout { position: fixed; z-index: 5; right: 74px; bottom: calc(400px + env(safe-area-inset-bottom)); max-width: calc(100vw - 92px); background: var(--ink); color: #9ff0b8; font: 700 13px/1.3 var(--mono); padding: 6px 9px; border-radius: 6px; pointer-events: none; opacity: 0; transform: translateX(8px); transition: .2s; box-shadow: 0 4px 14px #0004; }
#readout.show { opacity: 1; transform: none; }
#readout.hot { background: var(--no); color: #fff; }
#readout small { display: block; font-weight: 400; color: #ccc; }
#readout.hot small { color: #fff; }
body.uv #hud, body.uv #tally span { filter: brightness(.8); }
#rules li.tl { color: #4b2bb8; }
#rules li s { display: block; font-size: .85em; opacity: .55; margin-top: 2px; }
.unlock { background: #efe8ff; border: 2px solid #6b3cff; border-radius: 6px; padding: 8px 10px; margin: 8px 0; font-size: 14px; line-height: 1.35; }
.unlock b { color: #4b2bb8; }
.unlock.next { background: #fff; border-style: dashed; border-color: #0003; }
.desk-tools { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0; font-size: 13px; }
.desk-tools span { background: #fff; border: 1px solid #0002; border-radius: 999px; padding: 2px 8px; }
.desk-tools span.off { opacity: .45; }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  #tools { right: 402px; top: calc(var(--hud) + 16px); bottom: auto; }
  #readout { right: 16px; top: calc(var(--hud) + 292px); bottom: auto; width: 370px; max-width: none; z-index: 5; }
}
/* the memo cases: a manager's scrawl, a sun-faded receipt */
.rc .by { position: relative; }
.rc .mgr { position: absolute; right: 74px; top: -9px; font: italic 700 17px/1 "Comic Sans MS", "Marker Felt", cursive; color: #1d3f9e; transform: rotate(-8deg); opacity: .85; pointer-events: none; }
.rc.faded > :not(.stamp) { opacity: .38; filter: blur(.25px); }
.rc.faded { background: linear-gradient(100deg, #f6f1dc, #fbf8ec 40%, #efe7c8); }
/* two weeks in, the rulebook is long: it scrolls, and tightens up */
#book { max-height: calc(100dvh - var(--hud) - env(safe-area-inset-top) - 20px); overflow-y: auto; overscroll-behavior: contain; }
#book.long { font-size: 14px; line-height: 1.25; }
#book.long li { padding-top: 4px; padding-bottom: 4px; }
#book.long li::before { top: 4px; }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) { #book { max-height: calc(100vh - var(--hud) - 70px); } }

/* round 7: a handwritten receipt (the till was "down"), and Black Friday week */
.rc.hand { font-family: 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', 'Chalkboard SE', cursive; color: #1f3a8a; background: #fdfcf3; font-size: 13.5px; }
.rc.hand .hd .st { color: #1f3a8a; }
.rc.hand .ln span, .rc.hand .hd span { transform: rotate(-1deg); display: inline-block; }
body.rush #clock { color: #7a0000; background: #ffe36b; border-radius: 4px; padding: 0 4px; }
/* round 9: Season mode on the report, and the quiet day's clock */
.season { background: #fff; border: 2px solid var(--red); border-radius: 4px; padding: 8px 10px; margin: 8px 0; font: 13px/1.4 var(--mono); }
.season h4 { margin: 0 0 6px; font: 700 12px var(--mono); letter-spacing: .08em; color: var(--red); display: flex; justify-content: space-between; gap: 8px; }
.season .rank { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.season .rank span, .season h4 span { white-space: nowrap; }
.season .rank b { font: 900 20px var(--sans, Arial, sans-serif); color: var(--ink); }
.season .rank em { color: var(--ok); font-style: normal; font-weight: 700; }
.season .bar { height: 8px; background: #e6e2d8; border-radius: 4px; margin: 6px 0; overflow: hidden; }
.season .bar i { display: block; height: 100%; background: var(--red); border-radius: 4px; }
.season p { margin: 0; color: var(--ink2); }
.season.pre { border-style: dashed; color: var(--ink2); }
body.quiet #clock { color: #fff; background: var(--ok); border-radius: 4px; padding: 0 4px; }
/* round 10: a reprinted receipt says COPY across it; the season's end on the report */
.rc.copy { background-image: repeating-linear-gradient(-28deg, transparent 0 34px, #cc000014 34px 36px); }
.rc.copy::after { content: 'COPY'; position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%) rotate(-18deg); font: 900 44px Arial, sans-serif; letter-spacing: .12em; color: #cc00001f; pointer-events: none; }
.season.end { border-width: 3px; background: #fffdf3; }
.season.end .pic { margin-top: 8px; }
.season.end .go { width: 100%; margin-top: 6px; }

/* round 11: the manager's mid-season review and the welcome-back recap */
.review { background: #fffdf4; border: 2px solid var(--ink); border-radius: 4px; padding: 8px 10px; margin: 8px 0; font: 13px/1.4 var(--mono); position: relative; }
.review h4 { margin: 0 0 6px; font: 700 12px var(--mono); letter-spacing: .08em; color: var(--ink); display: flex; justify-content: space-between; gap: 8px; }
.review .stamp2 { display: inline-block; border: 3px solid; border-radius: 4px; padding: 2px 8px; font: 900 15px var(--mono); letter-spacing: .06em; transform: rotate(-3deg); margin: 2px 0 8px; }
.review .grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.review .grades span { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--ink2); background: #f1ede2; border-radius: 4px; padding: 4px 2px; }
.review .grades b { font: 900 22px var(--sans, Arial, sans-serif); }
.review .gA b, .review .gB b { color: var(--ok); }
.review .gC b { color: #d08a00; }
.review .gD b { color: var(--no); }
.review .note { margin: 0 0 6px; font: italic 14px/1.4 Georgia, serif; color: var(--ink); }
.review .note small { display: block; font: 12px var(--mono); color: var(--ink2); margin-top: 2px; }
.review .goal, .season.end .goal { margin: 4px 0 0; font-weight: 700; color: var(--ink); }
.review .sub { margin: 4px 0 0; color: var(--ink2); }
.review.mini { margin: 6px 0 0; border-width: 1px; }
.goalline { margin-top: 6px; color: var(--ink2); }
.goalline summary { cursor: pointer; }
.goalline em, .season.end .goal em { color: var(--ok); font-style: normal; font-weight: 700; }
.recap .rlist { margin: 6px 0 10px; padding-left: 20px; font: 14px/1.4 var(--mono); }
.recap .rlist li { margin: 0 0 6px; }
.recap .rlist li.chg::before { content: 'CHANGED '; color: var(--red); font-weight: 700; font-size: 11px; }
.recap .rlist s { display: block; color: var(--ink2); font-size: 12px; }
.recap .sub { color: var(--ink2); font-size: 14px; }

/* round 12: the restocking fee */
#fee { margin-left: 6px; font: 800 10px var(--mono); background: #fff3; border: 1px solid #fff8; border-radius: 999px; padding: 2px 6px; letter-spacing: .02em; }
#fee.on { background: #fff; color: var(--ok); }
#tally #t-fee { display: none; background: #e3f4ea; color: #1d6b40; }
#tally #t-fee.on { display: inline; }
#tally #t-fee.hit { background: #bfe8cf; }
.rc .stamp small { display: block; font: 800 12px/1.2 var(--mono); margin-top: 3px; text-align: center; }
.rc.feeing { box-shadow: 0 0 0 3px var(--ok), 0 8px 18px #0004; }
#feesign { margin: 8px 0 0; padding: 6px 8px; border: 2px dashed #cc000088; border-radius: 6px; font-size: 12px; line-height: 1.35; color: var(--ink); background: #fff8e0; }
.score .fees b { color: #1d6b40; }
.calls .aup { color: var(--no); } .calls .aok { color: var(--ok); }
/* round 12: the loss-prevention audit */
#audit { position: fixed; z-index: 6; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); width: min(420px, calc(100% - 20px)); background: var(--paper, #fafaf5); color: var(--ink); border-radius: 10px; padding: 10px 14px 12px; box-shadow: 0 10px 30px #0006; font: 14px/1.4 var(--sans); }
#audit.hidden { display: none; }
#audit h4 { display: flex; justify-content: space-between; margin: -10px -14px 8px; padding: 8px 14px; background: #2a2f38; color: #fff; border-radius: 10px 10px 0 0; font: 800 13px var(--mono); letter-spacing: .06em; }
#audit p { margin: 4px 0; }
#audit .k { color: var(--ink2); font: 700 12px var(--mono); }
#audit .finding { min-height: 2.8em; }
#audit .astamp { position: absolute; right: 14px; top: -64px; background: #fafaf5e6; font: 900 22px/1 var(--sans); letter-spacing: .04em; padding: 5px 9px; border: 4px solid currentColor; border-radius: 6px; transform: rotate(-12deg) scale(1.7); opacity: 0; pointer-events: none; mix-blend-mode: multiply; }
#audit .astamp.show { opacity: .9; transform: rotate(-12deg) scale(1); transition: transform .12s cubic-bezier(.3,1.8,.5,1), opacity .08s; }
#audit .astamp.up { color: var(--no); } #audit .astamp.ok { color: var(--ok); }
#audit button { width: 100%; margin-top: 8px; opacity: .55; }
#audit button.ready { opacity: 1; }
body.audit #desk, body.audit #tally, body.audit #hint, body.audit #tools { visibility: hidden; }
.auditr { border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-size: 13px; line-height: 1.4; background: #fff; border-left: 5px solid; }
.auditr.up { border-color: var(--no); } .auditr.ok { border-color: var(--ok); }
.auditr h4 { display: flex; justify-content: space-between; margin: 0 0 4px; font: 800 12px var(--mono); letter-spacing: .05em; }
.auditr.up h4 span:last-child { color: var(--no); } .auditr.ok h4 span:last-child { color: var(--ok); }
#audit button { height: 46px; border: 0; border-radius: 10px; background: var(--ink); color: #fff; font: 800 16px var(--sans); }
#audit button.ready { background: var(--red); }
#feemeter { position: fixed; z-index: 7; left: 50%; bottom: calc(250px + env(safe-area-inset-bottom)); transform: translateX(-50%) scale(.9); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; border-radius: 12px; padding: 8px 12px; text-align: center; transition: opacity .12s, transform .12s; white-space: nowrap; }
#feemeter.on { opacity: .95; transform: translateX(-50%) scale(1); }
#feemeter b { display: block; font: 800 14px var(--mono); margin-bottom: 6px; }
#feemeter span { display: flex; gap: 4px; }
#feemeter i { font: 700 12px var(--mono); font-style: normal; padding: 4px 8px; border-radius: 6px; background: #ffffff22; }
#feemeter i.lit { background: var(--ok); }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  #audit { left: auto; right: 24px; bottom: 24px; transform: none; width: 380px; }
  #feemeter { bottom: 230px; }
}
/* round 13: the receipt a rule-case write-up hinged on, with the line the auditor circles */
#audit .arc { margin: 6px 0 4px; }
#audit .arc .rc { position: relative; inset: auto; cursor: default; touch-action: auto; font-size: 12px; line-height: 1.3; padding: 6px 10px 8px; box-shadow: 0 1px 4px #0003; transform: rotate(-1deg); }
#audit .arc .rc.none { min-height: 64px; }
#audit .arc .rc .stamp { font-size: 20px; opacity: .35; transform: translate(-50%, -50%) rotate(-12deg); }
#audit .arc .rc .stamp small { display: none; }
#audit .arc .hinge { outline: 2.5px solid var(--no); outline-offset: 1px; border-radius: 3px; background: #cc000014; animation: hinge .35s cubic-bezier(.3,1.8,.5,1); }
#audit .arc .rc.none.hinge { outline-offset: -3px; }
@keyframes hinge { from { outline-offset: 8px; outline-color: transparent; } }

/* ---------- the How to play panel (games/studio#148): real HTML in index.html, styled like the sheets ---------- */
.how { position: fixed; inset: 0; z-index: 20; background: #0006; display: flex; align-items: center; justify-content: center; padding: 10px; touch-action: none; }
.how[hidden] { display: none; }
.how-card { background: var(--paper); border-radius: 6px; width: min(440px, 100%); max-height: 100%; overflow-y: auto; padding: 0 16px 12px; box-shadow: 0 20px 50px #0006; touch-action: pan-y; user-select: text; -webkit-user-select: text; overscroll-behavior: contain; outline: none; font-size: 15px; }
.how-top { position: sticky; top: 0; z-index: 1; background: var(--paper); display: flex; align-items: center; gap: 8px; padding: 12px 0 6px; border-bottom: 2px solid var(--red); }
.how-top h2 { flex: 1; margin: 0; font-size: 20px; }
.how-close { flex: none; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 8px; background: #fff; font-size: 24px; line-height: 1; font-weight: 700; }
.how h3 { margin: 12px 0 4px; font: 700 13px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.how p { margin: 6px 0; line-height: 1.4; }
.how ul { margin: 6px 0; padding-left: 20px; line-height: 1.4; }
.how dl { margin: 6px 0; line-height: 1.4; }
.how dt { font-weight: 700; margin-top: 6px; }
.how dd { margin: 0; }
.how-foot { font-size: 13px; color: var(--ink2); }
.how a { color: var(--red); }
.howlink { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--red); text-decoration: underline; white-space: nowrap; }
