/* Layout: full-bleed canvas store; overlays read like the chain's world:
   a flyer cover (menu), a handwritten list (brief), a till receipt (end). */
:root {
  --red: #E30613;
  --red-deep: #9C1006;
  --red-night: #5b0a05;
  --yellow: #FFED00;
  --orange: #F39200;
  --ink: #1d1a17;
  --paper: #fffdf5;
  --ruled: #cfe0f2;
  --muted: #6d625a;
  --green: #2e9e44;
  --white: #ffffff;
  --f-display: "Baloo 2", "Arial Rounded MT Bold", system-ui, sans-serif;
  --f-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-hand: "Caveat", "Segoe Print", "Comic Sans MS", cursive;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --hud-h: 96px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
html { overflow: hidden; }
body {
  margin: 0;
  background: var(--red-night);
  color: var(--ink);
  font-family: var(--f-body);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
/* Quick taps (scanning at the till, skills, the pad) must never zoom the page: Safari on iPhone ignores
   user-scalable=no but honours this, and it also drops the delay before a tap counts. */
html, body, button, a, .sheet, .hud { touch-action: manipulation; }
button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#ov { position: fixed; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }

/* ---------- HUD ---------- */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  padding: calc(env(safe-area-inset-top, 0px) + 6px) max(12px, env(safe-area-inset-right, 0px)) 6px max(12px, env(safe-area-inset-left, 0px));
  background: var(--red);
  border-bottom: 4px solid var(--yellow);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .18);
}
.hud-row { display: flex; align-items: center; gap: 8px; }
.hbtn {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .14); border: 2px solid rgba(255, 255, 255, .4); color: var(--white);
}
.hbtn svg { width: 22px; height: 22px; fill: currentColor; }
#btnMap svg { fill: none; }
#btnMute .cross { display: none; }
#btnMute.off .cross { display: inline; }
#btnMute.off .wave { display: none; }
#btnMute.off { opacity: .75; }
.hud-day { flex: 1; min-width: 0; color: var(--white); font: 700 15px/1.1 var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-timer {
  flex: none; min-width: 84px; text-align: center;
  font: 800 28px/1.2 var(--f-display); font-variant-numeric: tabular-nums;
  color: var(--yellow); background: var(--red-deep); border-radius: 10px; padding: 0 10px;
}
.hud-timer.warn { background: var(--yellow); color: var(--red); animation: pulse .6s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }
.hud-count {
  flex: none; display: flex; align-items: center; gap: 4px;
  font: 800 17px/1 var(--f-display); font-variant-numeric: tabular-nums;
  color: var(--ink); background: var(--yellow); border-radius: 10px; padding: 8px 9px 7px;
}
.hud-count svg { width: 18px; height: 18px; color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.chip {
  position: relative; width: 34px; height: 34px; padding: 0; border-radius: 9px;
  border: 2px solid var(--yellow); background: var(--paper);
  font-size: 19px; line-height: 1; display: grid; place-items: center;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.chip.got { background: #c9ecd1; border-color: var(--green); }
.chip.got::after, .chip.missing::after, .chip.hinted::after {
  position: absolute; right: -5px; top: -6px; width: 16px; height: 16px; border-radius: 50%;
  font: 800 11px/16px var(--f-display); text-align: center; color: var(--white);
}
.chip.got::after { content: "✓"; background: var(--green); }
.chip.missing { border-style: dashed; border-color: var(--orange); }
.chip.missing::after { content: "?"; background: var(--orange); }
.chip.hinted::after { content: "!"; background: var(--red); }

/* ---------- Announcements & toasts ---------- */
.banner {
  position: fixed; z-index: 6; left: 50%; top: calc(var(--hud-h) + 10px);
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  width: max-content; max-width: calc(100% - 32px);
  padding: 5px 12px 6px; border-radius: 10px;
  background: var(--yellow); color: var(--red); border: 3px solid var(--red);
  font: 800 15px/1.2 var(--f-display); text-align: center;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
  transition: opacity .25s, transform .25s;
}

.banner::before { content: "Komunikat"; display: block; font: 700 10px/1.3 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--red-deep); }
.banner.show { opacity: 1; transform: translate(-50%, 0); }
.toast {
  position: fixed; z-index: 7; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  transform: translate(-50%, 10px); opacity: 0; pointer-events: none;
  width: max-content; max-width: calc(100% - 32px);
  padding: 9px 14px; border-radius: 12px;
  background: rgba(29, 26, 23, .9); color: var(--white);
  font: 700 14px/1.3 var(--f-body); text-align: center;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body:has(.sheet:not([hidden])) .toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 190px); }
body:has(.pad:not([hidden])) .toast { top: calc(var(--hud-h, 0px) + 92px); bottom: auto; } /* keep the bottom corners free for the joystick */

/* ---------- On-screen controls: joystick in a bottom corner, skill buttons around it ---------- */
.pad {
  position: fixed; z-index: 5; width: 132px; height: 132px;
  right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  pointer-events: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.pad.left { right: auto; left: max(18px, env(safe-area-inset-left, 0px)); }
.stick {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 0, 0, .3) 0 46%, rgba(0, 0, 0, .16) 47% 100%);
  border: 3px solid rgba(255, 237, 0, .85);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .25), inset 0 2px 8px rgba(0, 0, 0, .3);
  pointer-events: auto; touch-action: none; cursor: grab;
}
.stick::before { content: ""; position: absolute; inset: -20px; border-radius: 50%; } /* bigger touch target */
.ch { position: absolute; width: 0; height: 0; border: 7px solid transparent; opacity: .85; }
.ch-u { top: 7px; left: 50%; margin-left: -7px; border-top: 0; border-bottom-color: var(--yellow); }
.ch-d { bottom: 7px; left: 50%; margin-left: -7px; border-bottom: 0; border-top-color: var(--yellow); }
.ch-l { left: 7px; top: 50%; margin-top: -7px; border-left: 0; border-right-color: var(--yellow); }
.ch-r { right: 7px; top: 50%; margin-top: -7px; border-right: 0; border-left-color: var(--yellow); }
.knob {
  position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%;
  border: 3px solid var(--yellow);
  background:
    radial-gradient(circle at 33% 40%, var(--ink) 0 5px, transparent 6px),
    radial-gradient(circle at 67% 40%, var(--ink) 0 5px, transparent 6px),
    radial-gradient(circle at 50% 72%, var(--ink) 0 5px, transparent 6px),
    radial-gradient(circle at 38% 30%, #ff4a3d, var(--red) 60%);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .35);
  pointer-events: none;
  transition: transform .14s ease-out;
}
.pad.held .knob { transition: none; }
.pad.held .stick { cursor: grabbing; background: radial-gradient(circle, rgba(0, 0, 0, .3) 0 46%, rgba(255, 237, 0, .18) 47% 100%); }
.skillbar { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.skill {
  position: absolute; left: calc(var(--x, 0px) - 26px); top: calc(var(--y, 0px) - 26px); pointer-events: auto;
  width: 52px; height: 52px; padding: 0; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; border: 3px solid var(--yellow); background: rgba(156, 16, 6, .92);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .35); color: var(--white);
}
.skill .cd { position: absolute; inset: 0; background: conic-gradient(rgba(0, 0, 0, .58) var(--p, 0%), transparent 0); }
.skill .ic { position: relative; font-size: 24px; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.skill .n { position: absolute; right: 4px; bottom: 2px; min-width: 18px; padding: 0 4px; border-radius: 9px; background: var(--yellow); color: var(--red); font: 800 12px/18px var(--f-display); }
.skill .n:empty { display: none; }
.skill .key { display: none; }
.skill.on { border-color: var(--white); animation: skillPulse .45s ease-in-out infinite alternate; }
.skill.on .cd { background: conic-gradient(rgba(255, 237, 0, .5) var(--p, 0%), transparent 0); }
.skill:disabled { opacity: .45; }
@keyframes skillPulse { to { box-shadow: 0 0 0 7px rgba(255, 237, 0, .4); } }
@media (hover: hover) and (pointer: fine) {
  .skill .key { display: block; position: absolute; left: 7px; top: 4px; font: 700 11px/1 var(--f-body); color: rgba(255, 255, 255, .75); }
}

/* ---------- Skill shop ---------- */
.shop { max-width: 480px; display: flex; flex-direction: column; gap: 12px; }
.shop-bal { margin: 0; font: 600 15px/1.4 var(--f-body); color: #ffe9e6; }
.shop-bal b { font: 800 24px/1 var(--f-display); color: var(--yellow); }
.shop-list { display: flex; flex-direction: column; gap: 10px; }
.sk-card { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px 12px; align-items: start; padding: 12px; border-radius: 14px; background: var(--paper); color: var(--ink); box-shadow: 0 4px 0 var(--red-night); }
.sk-ic { width: 52px; height: 52px; border-radius: 12px; background: var(--yellow); display: grid; place-items: center; font-size: 28px; }
.sk-body { min-width: 0; }
.sk-body b { font: 800 18px/1.2 var(--f-display); }
.sk-dots { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.sk-dots i { width: 10px; height: 10px; border-radius: 50%; background: #e3d8cc; }
.sk-dots i.on { background: var(--red); }
.sk-body p { margin: 4px 0 0; font: 600 14px/1.35 var(--f-body); }
.sk-body .sk-next { color: var(--muted); font-size: 13px; }
.sk-buy { grid-column: 1 / -1; min-height: 44px; }
.sk-buy:disabled { opacity: .5; cursor: not-allowed; }
.brief-skills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 600 14px/1.35 var(--f-body); color: var(--white); }
.brief-skills .chipsk { padding: 4px 10px; border-radius: 999px; background: var(--paper); color: var(--ink); font: 800 14px/1.3 var(--f-display); }

/* ---------- Checkout sheet ---------- */
.sheet {
  position: fixed; z-index: 6; left: 0; right: 0; bottom: 0;
  margin: 0 auto; max-width: 560px;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 14px) max(16px, env(safe-area-inset-left, 0px));
  background: var(--paper); color: var(--ink);
  border-top: 5px solid var(--yellow); border-radius: 18px 18px 0 0;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .3);
}
.sheet-head { display: flex; flex-direction: column; gap: 2px; }
.sheet-head b { font: 800 19px/1.1 var(--f-display); color: var(--red); }
.sheet-head span { font: 700 15px/1.3 var(--f-body); min-height: 2.6em; }
.co-bar { height: 8px; border-radius: 4px; background: #eadfd2; overflow: hidden; margin: 6px 0 8px; }
.co-bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width .2s; }
.co-items { display: flex; flex-wrap: wrap; gap: 4px; font-size: 20px; margin-bottom: 10px; }
.co-item { opacity: .35; filter: grayscale(1); }
.co-item.done { opacity: 1; filter: none; }
.co-btns { display: flex; flex-wrap: wrap; gap: 8px; min-height: 48px; }
.co-btns .btn { flex: 1 1 auto; }
.sheet .btn-ghost { color: var(--ink); border-color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  border: 0; border-radius: 999px; padding: 11px 20px; min-height: 48px;
  font: 800 17px/1.1 var(--f-display);
  transition: transform .08s;
}
.btn:active { transform: translateY(2px); }
.btn-yellow { background: var(--yellow); color: var(--red); box-shadow: 0 3px 0 var(--red-deep); }
.btn-white { background: var(--white); color: var(--ink); box-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.btn-ghost { background: transparent; color: var(--white); border: 2px solid rgba(255, 255, 255, .65); }
.btn-big { font-size: 19px; padding: 13px 22px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.row .btn { flex: 1 1 auto; }
.col { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Screens ---------- */
.screen {
  position: fixed; inset: 0; z-index: 10;
  display: flex; justify-content: center; align-items: flex-start;
  overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: rgba(91, 10, 5, .78);
  color: var(--white);
}
.screen > * { margin: auto 0; width: 100%; }
h1, h2, h3 { text-wrap: balance; }

/* menu = flyer cover */
.screen-menu { background: radial-gradient(120% 80% at 50% 0%, var(--red) 0%, var(--red-deep) 70%, var(--red-night) 100%); }
.menu { max-width: 460px; display: flex; flex-direction: column; gap: 14px; }
.brand { display: flex; align-items: center; gap: 14px; }
.bug { width: 88px; height: 88px; flex: none; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .25)); animation: wiggle 3.5s ease-in-out infinite; }
@keyframes wiggle { 0%, 88%, 100% { transform: rotate(0); } 92% { transform: rotate(-8deg); } 96% { transform: rotate(6deg); } }
.title { margin: 0; font: 800 clamp(46px, 14vw, 66px)/.86 var(--f-display); color: var(--yellow); text-shadow: 3px 4px 0 var(--red-night); letter-spacing: -.01em; }
.title span { color: var(--white); }
.subtitle { margin: 6px 0 0; display: inline-block; background: var(--yellow); color: var(--red); font: 800 15px/1 var(--f-display); letter-spacing: .1em; text-transform: uppercase; padding: 6px 10px 5px; border-radius: 6px; transform: rotate(-2deg); }
.lead { margin: 0; font: 600 16px/1.45 var(--f-body); color: #ffe9e6; max-width: 40ch; }
.sec { margin: 4px 0 -4px; font: 700 13px/1 var(--f-body); letter-spacing: .12em; text-transform: uppercase; color: var(--yellow); }
.levels { display: flex; flex-direction: column; gap: 9px; }
.lvl {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  width: 100%; text-align: left; padding: 9px 12px 9px 9px; border: 0; border-radius: 14px;
  background: var(--paper); color: var(--ink); box-shadow: 0 4px 0 var(--red-night);
}
.lvl:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--red-night); }
.lvl-n { height: 46px; display: grid; place-items: center; border-radius: 10px; background: var(--yellow); color: var(--red); font: 800 28px/1 var(--f-display); }
.lvl-t { min-width: 0; }
.lvl-t b { display: block; font: 800 17px/1.15 var(--f-display); }
.lvl-t small { display: block; font: 600 13px/1.3 var(--f-body); color: var(--muted); }
.lvl-s { font-size: 17px; letter-spacing: 1px; color: var(--orange); white-space: nowrap; }
.lvl.locked { background: #e9dfd6; cursor: not-allowed; }
.lvl.sunday .lvl-n { background: var(--red); color: var(--yellow); }
.weeks { position: relative; display: flex; gap: 8px; overflow-x: auto; margin: -4px -16px 0; padding: 8px 16px 6px; scrollbar-width: none; }
.weeks::-webkit-scrollbar { display: none; }
.wk {
  position: relative; flex: none; display: grid; justify-items: center; gap: 2px; min-width: 76px; padding: 7px 8px 6px;
  border-radius: 12px; border: 2px solid rgba(255, 255, 255, .35); background: rgba(0, 0, 0, .18); color: var(--white);
  font: 800 13px/1.1 var(--f-display);
}
.wk .ic { font-size: 20px; line-height: 1.1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.wk small { max-width: 92px; font: 600 11px/1.15 var(--f-body); opacity: .85; text-align: center; }
.wk.on { background: var(--yellow); color: var(--red); border-color: var(--yellow); }
.wk.locked { opacity: .55; }
.wk-nd { position: absolute; top: -5px; right: -4px; padding: 1px 5px; border-radius: 7px; background: var(--white); color: var(--red); font: 800 10px/1.4 var(--f-body); font-style: normal; }
.week-info { margin: 0; font: 600 14px/1.35 var(--f-body); color: #ffe3de; }
.week-info b { color: var(--yellow); }
.lvl.locked .lvl-n { background: #cbbfb4; color: var(--white); }
.lvl.locked .lvl-s { font: 700 12px/1 var(--f-body); color: var(--muted); letter-spacing: 0; }
.nogl { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--paper); color: var(--ink); font: 600 15px/1.4 var(--f-body); }
.nogl p { margin: 0; }
.nogl p + p { margin-top: 8px; }
/* the statistics question: a panel along the bottom, like a cookie notice, gone once answered */
.consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 12;
  width: auto; max-width: 560px; margin: 0 auto;
  padding: 14px max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 14px) max(16px, env(safe-area-inset-left, 0px));
  border-radius: 18px 18px 0 0; border-top: 4px solid var(--yellow);
  background: var(--paper); color: var(--ink); box-shadow: 0 -6px 24px rgba(0, 0, 0, .35);
  animation: consent-in .35s ease-out;
}
.consent p { margin: 0 0 12px; font: 600 14px/1.4 var(--f-body); }
.consent p b { font: 800 16px/1.2 var(--f-display); color: var(--red); }
.consent a { color: var(--red); text-decoration: underline; }
.consent-btns { display: flex; gap: 10px; }
.consent-btns .btn { flex: 1 1 0; }
.btn-line { background: transparent; color: var(--ink); border: 2px solid rgba(29, 26, 23, .3); }
.consent.out { animation: consent-out .22s ease-in forwards; }
@keyframes consent-in { from { transform: translateY(110%); } }
@keyframes consent-out { to { transform: translateY(110%); } }
@media (min-width: 600px) { .consent { bottom: 16px; border-radius: 18px; border: 0; border-top: 4px solid var(--yellow); } }
.screen-menu.asking { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 190px); }
.disclaimer a { color: inherit; text-decoration: underline; }
.disclaimer { margin: 2px 0 0; font: 600 12px/1.4 var(--f-body); color: #f3b8b1; }
.ver { align-self: center; margin: 4px 0 0; padding: 6px 10px; border: 0; background: none; font: 600 11px/1.2 var(--f-mono); color: #f3b8b1; }
.diag { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .25); }
.diag p { margin: 0; font: 600 12px/1.5 var(--f-mono); color: #f3d9d4; }

/* brief = handwritten list */
.brief { max-width: 460px; display: flex; flex-direction: column; gap: 14px; }
.eyebrow { margin: 0; font: 700 13px/1 var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--yellow); }
.brief-title { margin: -6px 0 0; font: 800 34px/1 var(--f-display); color: var(--white); }
.note {
  position: relative; color: var(--ink); padding: 18px 18px 14px 46px; border-radius: 4px;
  background:
    linear-gradient(90deg, transparent 34px, #f2a7a0 34px, #f2a7a0 36px, transparent 36px),
    repeating-linear-gradient(var(--paper) 0 31px, var(--ruled) 31px 32px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
  transform: rotate(-1.2deg);
}
.note::before { content: ""; position: absolute; top: -10px; left: 50%; width: 90px; height: 22px; transform: translateX(-50%) rotate(2deg); background: rgba(255, 237, 0, .75); }
.note-greet { margin: 0 0 6px; font: 700 26px/32px var(--f-hand); color: #23439a; }
.note-list { list-style: none; margin: 0; padding: 0; }
.note-list li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; column-gap: 6px; min-height: 32px; }
.note-list .em { font-size: 20px; line-height: 1; }
.note-list .nm { font: 700 25px/32px var(--f-hand); color: #23439a; }
.note-list .ct { font: 700 11px/1 var(--f-body); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; text-align: right; }
.note-who { margin: 6px 0 0; text-align: right; font: 600 24px/32px var(--f-hand); color: #23439a; }
.brief-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.tag { background: var(--yellow); color: var(--red); font: 800 18px/1 var(--f-display); padding: 8px 12px 7px; border-radius: 8px; }
.tag b { font-variant-numeric: tabular-nums; }
.meta-hint { font: 600 13px/1.3 var(--f-body); color: #ffd9d4; }
.haz h3 { margin: 0 0 6px; font: 700 13px/1 var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--yellow); }
.haz ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font: 600 15px/1.35 var(--f-body); color: var(--white); }

/* end = receipt */
.end { max-width: 400px; display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.end-title { margin: 0; text-align: center; font: 800 34px/1 var(--f-display); color: var(--yellow); text-shadow: 2px 3px 0 var(--red-night); }
.receipt {
  position: relative; margin: 0 auto; width: 100%; max-width: 330px;
  background: var(--white); color: var(--ink); padding: 16px 16px 26px;
  font: 500 13px/1.45 var(--f-mono);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 9px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 9px repeat-x;
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - 9px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 9px repeat-x;
}
.r-head { text-align: center; margin-bottom: 8px; }
.r-head b { font: 600 17px/1.3 var(--f-mono); letter-spacing: .08em; }
.r-title { text-align: center; padding: 4px 0; margin-bottom: 6px; border-top: 1px dashed var(--ink); border-bottom: 1px dashed var(--ink); font-weight: 600; }
.r-row { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.r-row span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-miss { color: #9a8f86; text-decoration: line-through; }
.r-sum { font-weight: 600; font-size: 17px; margin-top: 2px; }
.r-sep { border-top: 1px dashed var(--ink); margin: 7px 0; }
.r-stars { text-align: center; font-size: 34px; line-height: 1.2; color: var(--orange); margin: 6px 0 2px; letter-spacing: 4px; }
.r-stars i { font-style: normal; color: #e3dbd3; }
.r-unlock { margin: 10px 0 0; padding: 6px 4px; border: 2px dashed currentColor; text-align: center; font-weight: 800; }
.r-foot { text-align: center; margin-top: 4px; }
.r-code { height: 38px; margin: 10px 18px 0; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px, var(--ink) 8px 11px, transparent 11px 12px); }
/* ---------- Game over ---------- */
.screen-over { align-items: center; background: radial-gradient(120% 90% at 50% 28%, rgba(150, 8, 0, .8), rgba(25, 3, 0, .95)); }
.over { max-width: 420px; text-align: center; }
.over-ic { width: 150px; margin: 0 auto -2px; animation: overShake .45s ease-in-out .5s 2; }
.over-ic svg { display: block; width: 100%; height: auto; max-height: 112px; }
.over-ic .beacon { animation: overBlink .5s steps(2) infinite; }
.over-ic .spot { animation: overBlink .7s steps(2) infinite; }
.over-title { display: flex; justify-content: center; flex-wrap: wrap; column-gap: 16px; margin: 4px 0 6px; font: 800 54px/1 var(--f-display); color: var(--yellow); text-shadow: 0 4px 0 var(--red-night), 0 0 22px rgba(255, 214, 10, .35); }
.over-title .w { display: inline-flex; }
.over-title .w span { display: inline-block; animation: overDrop .6s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(var(--i) * 70ms); }
.over-reason { margin: 4px 0 2px; font: 800 22px/1.2 var(--f-display); color: var(--white); }
.over-sub { margin: 0 0 14px; font: 600 15px/1.35 var(--f-body); color: #ffd9d3; }
.over-stats { margin: 0 0 12px; padding: 8px 14px; border-radius: 14px; background: var(--paper); color: var(--ink); text-align: left; box-shadow: 0 6px 0 var(--red-night); }
.over-stats div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font: 600 15px/1.3 var(--f-body); border-bottom: 1px dashed #d9cfc4; }
.over-stats div:last-child { border-bottom: 0; }
.over-stats b { font-weight: 800; text-align: right; }
.over-tip { margin: 0 0 16px; font: 600 14px/1.4 var(--f-body); color: #ffe3de; }
@keyframes overDrop { from { opacity: 0; transform: translateY(-70px) rotate(-14deg); } to { opacity: 1; transform: none; } }
@keyframes overShake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px) rotate(-3deg); } 75% { transform: translateX(6px) rotate(3deg); } }
@keyframes overBlink { 50% { opacity: .15; } }

/* pause / help */
.panel { max-width: 420px; background: var(--red); border: 4px solid var(--yellow); border-radius: 20px; padding: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.panel h2 { margin: 0 0 6px; font: 800 30px/1 var(--f-display); color: var(--yellow); }
.panel p { margin: 0 0 16px; font: 600 15px/1.4 var(--f-body); }
/* save code */
.save-panel .eyebrow { margin: 4px 0 8px; }
.code-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--paper); color: var(--ink); }
.code { flex: 1 1 auto; white-space: nowrap; font: 600 clamp(17px, 5.4vw, 24px)/1.2 var(--f-mono); letter-spacing: .02em; -webkit-user-select: all; user-select: all; }
.code.none { color: var(--muted); font-size: 18px; -webkit-user-select: none; user-select: none; }
.code-box .btn { flex: none; margin-left: auto; min-height: 42px; padding: 8px 16px; font-size: 16px; }  /* drops below the code on narrow phones */
.save-panel .save-state { margin: 8px 0 16px; font: 700 14px/1.4 var(--f-body); color: #ffe3de; }
.code-in { display: flex; gap: 8px; }
.code-in input {
  flex: 1; min-width: 0; padding: 10px 12px; border: 2px solid rgba(255, 255, 255, .65); border-radius: 12px;
  background: rgba(0, 0, 0, .18); color: var(--white); font: 600 18px/1.2 var(--f-mono); letter-spacing: .04em; text-transform: uppercase;
  -webkit-user-select: text; user-select: text;
}
.code-in input::placeholder { color: rgba(255, 255, 255, .5); }
.code-in input:focus { outline: 3px solid var(--yellow); outline-offset: 1px; }
.code-in .btn { flex: none; }
.save-panel .code-msg { min-height: 1.4em; margin: 8px 0 10px; font: 700 14px/1.4 var(--f-body); color: var(--yellow); }
.save-panel .code-msg.err { color: #fff; background: rgba(0, 0, 0, .22); padding: 6px 10px; border-radius: 10px; }
.save-panel .code-msg:empty { min-height: 0; margin: 4px 0; padding: 0; }
.save-panel .save-note { margin: 0 0 14px; font: 600 13px/1.4 var(--f-body); color: #f3c4bd; }
.save-panel .save-note a { color: inherit; }
.help dl { margin: 10px 0 18px; display: grid; gap: 4px; }
.help dt { font: 800 16px/1.2 var(--f-display); color: var(--yellow); margin-top: 8px; }
.help dd { margin: 0; font: 600 15px/1.45 var(--f-body); color: var(--white); }

/* map */
.screen-map { align-items: center; background: rgba(29, 26, 23, .7); }
.map-wrap { margin: auto; width: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; }
#mapCv {
  display: block; aspect-ratio: 26 / 31;
  width: min(100%, calc((100vh - 150px) * 26 / 31));
  max-width: 520px; background: #f4f1ea; border-radius: 12px; border: 4px solid var(--yellow);
}
.map-hint { margin: 0; text-align: center; font: 700 14px/1.35 var(--f-body); color: var(--white); max-width: 34ch; }

@media (max-width: 420px) {
  .hud-day { visibility: hidden; }
}
@media (max-width: 350px) {
  .hud-row { gap: 5px; }
  .hbtn { width: 36px; height: 36px; }
  .hud-timer { min-width: 70px; font-size: 24px; padding: 0 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .bug, .hud-timer.warn { animation: none; }
  .banner, .toast, .btn { transition: none; }
  .over-ic, .over-title .w span, .over-ic .beacon, .over-ic .spot { animation: none; }
}

/* ---------- Świeżaki: the collection board and the full-screen reveal ---------- */
.fresh-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fr-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 10px; border: 0; border-radius: 14px; background: rgba(0, 0, 0, .22); color: #ffe9e6; font: 700 12px/1.2 var(--f-body); text-align: center; }
.fr-art { display: block; width: 100%; aspect-ratio: 6 / 7; }
.fr-art svg { width: 100%; height: 100%; filter: brightness(0) opacity(.42); }
.fr-card.own { background: var(--paper); color: var(--ink); box-shadow: 0 3px 0 var(--red-night); }
.fr-card.own .fr-art svg { filter: none; }
.fr-card.can { background: rgba(255, 237, 0, .16); outline: 2px solid var(--yellow); color: var(--yellow); }
.fr-card.can .fr-art svg { filter: brightness(0) opacity(.55) drop-shadow(0 0 6px rgba(255, 237, 0, .9)); }
.fr-name { min-height: 2.4em; display: flex; align-items: center; }
.btn-fresh { width: 100%; }
.btn-fresh.glow { box-shadow: 0 0 0 3px var(--yellow), 0 0 18px rgba(255, 237, 0, .8); }
.fresh-show { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #ff3b3b 0%, var(--red-deep) 55%, var(--red-night) 100%); }
.fs-rays { position: absolute; left: 50%; top: 45%; width: 160vmax; height: 160vmax; margin: -80vmax 0 0 -80vmax; opacity: .35;
  background: repeating-conic-gradient(rgba(255, 237, 0, .55) 0 7deg, transparent 7deg 22deg); animation: fs-spin 18s linear infinite; }
.fresh-show:not(.new) .fs-rays { opacity: .18; }
#fsConfetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fs-stars { position: absolute; inset: 0; pointer-events: none; }
.fs-stars i { position: absolute; font-style: normal; font-size: 30px; color: var(--yellow); text-shadow: 0 0 12px rgba(255, 255, 255, .9); transform: translate(-50%, -50%) scale(0); animation: fs-star 2.6s ease-out forwards; }
.fs-stars i:nth-child(2n) { font-size: 20px; color: #fff; }
.fs-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; text-align: center; }
.fs-art { width: min(72vw, 330px); aspect-ratio: 6 / 7; animation: fs-pop .8s cubic-bezier(.2, 1.6, .4, 1) both; }
.fs-art svg { width: 100%; height: 100%; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .35)); }
.fs-name { margin: 0; font: 800 32px/1.05 var(--f-display); color: var(--white); text-shadow: 0 3px 0 var(--red-night); }
@keyframes fs-spin { to { transform: rotate(360deg); } }
@keyframes fs-pop { 0% { transform: scale(0) rotate(-12deg); } 70% { transform: scale(1.12) rotate(3deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes fs-star { 0% { transform: translate(-50%, -50%) scale(0) rotate(0); opacity: 0; } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.3) rotate(40deg); } 100% { transform: translate(-50%, -50%) scale(.2) rotate(160deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fs-rays, .fs-art, .fs-stars i { animation-duration: .01s; } }
