:root {
  color-scheme: light;
  --paper: #f4efe3;
  --ink: #272d32;
  --accent: #ffcf69;
  --muted: #7a6650; /* small words on the paper */
  --gold: #e3b23c; /* gold edges and outlines */
  --quip: #ffd84a; /* the achievement band's quips */
  --secret-glow: #a77bff; /* the glow of a hidden achievement's badge */
  /* result-card.js and badges.js read these for the share image and the badge pictures. */
  --dark: #292e35;
  /* The two typefaces (fonts.js has the same pair for canvas text): words in 源泉圓體 Heavy,
     numbers in Bungee. Each has one weight, declared for every weight so it is always picked;
     everything asks for 900 so that if a font hasn't arrived (or fails), the stand-in system font
     is its heaviest, which sits well with the rest. Bold is never faked. */
  --font-text: 'GenSen Rounded', system-ui, sans-serif;
  --font-number: 'Bungee Numbers', var(--font-text);
  font-family: var(--font-text);
  font-weight: 900;
  font-synthesis: none;
}
/* Both cut to the characters the game uses (npm run fonts, tools/fonts.mjs; SIL OFL, licences in
   assets/fonts). Text swaps in when it arrives; the tiny number font is waited for. */
@font-face {
  font-family: 'GenSen Rounded';
  src: url(assets/fonts/gensen-rounded-heavy.woff2?v=54b0cad6) format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Bungee Numbers';
  src: url(assets/fonts/bungee-numbers.woff2?v=6f303f66) format('woff2');
  font-weight: 100 900;
  font-display: block;
}
* { box-sizing: border-box; }
h1, h2 { font-weight: inherit; } /* 900 like everything else (see :root) */
/* iPhone Safari may enlarge small text on its own; keep the sizes as written. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--paper); }
main {
  width: min(100% - 24px, 480px);
  margin: 8px auto 12px;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  /* No browser flash on tap (blue on Android, grey on iPhone): the buttons show their own press. */
  -webkit-tap-highlight-color: transparent;
}
header span { font: 900 .72rem/1.2 var(--font-text); letter-spacing: .14em; }
h1 { margin: 0 0 6px; font-size: clamp(1.4rem, 5.4vw, 1.85rem); line-height: 1.15; }
.frame { container-type: inline-size; position: relative; background: var(--dark); color: white; border-radius: 14px; overflow: hidden; box-shadow: 0 9px 24px #21242b26; }
/* Reserve the full timer and hours formats; only the prize track flexes. */
.hud {
  display: grid;
  grid-template-columns: 4.5rem 7rem minmax(0, 1fr);
  padding: 8px clamp(8px, 3vw, 16px);
}
.hud > div { min-width: 0; }
.hud > div + div {
  border-left: 1px solid #ffffff30;
  padding-left: clamp(6px, 2.5vw, 12px);
}
.hud > div:last-child { container-type: inline-size; }
.hud small, .hud strong { display: block; white-space: nowrap; }
.hud small { color: #d5d2cc; font: 900 .68rem/1rem var(--font-text); }
.hud strong {
  font: 900 1.1rem/1.4rem var(--font-number);
  font-variant-numeric: tabular-nums;
}
#bonus { font-size: min(1.1rem, 16cqi); }
@media (max-width: 360px) {
  .hud { grid-template-columns: 3.75rem 6.25rem minmax(0, 1fr); }
  .hud strong { font-size: 1rem; }
  #bonus { font-size: min(1rem, 16cqi); }
}
#clock { color: var(--accent); }
.supplies {
  /* z 1: above the scene, so the combo counter may hang a little over it, but under the opening
     comic (also z 1, later in the page), which covers this row. */
  position: relative; z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 14px;
  padding: 4px clamp(8px, 3vw, 16px) 6px;
  border-top: 1px solid #ffffff30;
  color: #e9e3d9;
  font-size: .74rem;
  font-variant-numeric: tabular-nums;
}
.supplies strong { color: #fff; font: 900 .8rem/1 var(--font-number); }
/* Stamina battery: full while playing, drains during the overtime fast-forward. */
.stamina { display: flex; align-items: center; gap: 6px; }
.battery {
  position: relative; display: inline-block; width: 26px; height: 12px;
  border: 2px solid #e9e3d9; border-radius: 3px; padding: 1px;
}
.battery::after {
  content: ''; position: absolute; right: -5px; top: 2px; width: 3px; height: 4px;
  border-radius: 0 2px 2px 0; background: #e9e3d9;
}
.battery i {
  display: block; height: 100%; width: calc(var(--charge, 1) * 100%);
  border-radius: 1px; background: #7fd18b; transition: width .12s linear;
}
.battery.low i { background: #ec6641; }
/* A caught supply flying into its number, the bump when it lands, and the small text it pops. */
.hud-fly {
  position: fixed; z-index: 20; pointer-events: none;
  font-size: 22px; line-height: 1; transform: translate(-50%, -50%);
}
.hud-bump { animation: hud-bump .32s ease-out; }
@keyframes hud-bump { 35% { transform: scale(1.3); color: #ffd794; } }
.hud-pop {
  position: fixed; z-index: 21; pointer-events: none;
  transform: translate(-50%, -100%);
  color: #ffd794; font: 900 .8rem/1 var(--font-number); text-shadow: 0 1px 2px #0008;
  animation: hud-pop .8s ease-out forwards;
}
@keyframes hud-pop { to { transform: translate(-50%, -190%); opacity: 0; } }
/* The office rules, before the comic: a notice taped over the whole frame; tap to sign. */
.office-rules {
  position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 14px;
  background: var(--dark); animation: rules-in .35s ease-out both;
}
.office-rules[hidden] { display: none; }
.office-rules.leaving { animation: rules-out .3s ease-in both; }
/* Until game.js has filled in the lines for this phone, only the dark page shows. */
.office-rules.pending .rules-note { visibility: hidden; }
@keyframes rules-in { from { opacity: 0; } }
@keyframes rules-out { to { opacity: 0; } }
.rules-note {
  position: relative; display: grid; gap: 0; width: min(100%, 350px); min-height: 0;
  padding: 20px 16px 14px; animation: rules-in .35s ease-out both; border-radius: 12px; background: var(--paper); color: var(--ink);
  box-shadow: 0 10px 30px #0008, inset 0 0 0 1px #0002; text-align: left; font-weight: 900;
}
.rules-note::before { /* the tape */
  content: ''; position: absolute; top: -9px; left: 50%; width: 64px; height: 18px;
  transform: translateX(-50%) rotate(-2deg); background: #e9dcb0cc; box-shadow: 0 1px 2px #0003;
}
.rules-title { text-align: center; font-size: 1.2rem; letter-spacing: .08em; }
.rules-stamp { margin: 2px 0 10px; text-align: center; color: #a33132; font-size: .66rem; letter-spacing: .2em; }
/* The numbers written out (not cjk-ideographic), so tools/fonts.mjs sees them and cuts them into the font. */
@counter-style rule-number { system: fixed; symbols: '一' '二' '三' '四' '五' '六'; }
.rules-note ol { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; counter-reset: rule; }
.rules-note li { position: relative; padding-left: 2.1em; font-size: .84rem; line-height: 1.35; text-wrap: pretty; }
.rules-note li::before { position: absolute; left: 0; counter-increment: rule; content: counter(rule, rule-number) '、'; color: var(--muted); }
.rules-note li[hidden] { display: none; }
.rules-note small { display: block; margin-top: 1px; color: var(--muted); font-size: .74rem; }
/* The line to sign: a form field with a box that pulses; if nobody taps, rings ripple out of it. */
.rules-sign {
  position: relative; display: flex; align-items: center; gap: 7px; margin-top: 14px;
  padding: 8px 10px; border-radius: 8px; background: #e9e1cf; font-size: .8rem;
}
.rules-hint { color: var(--muted); font-size: .72rem; }
.rules-box {
  position: relative; flex: none; width: 16px; height: 16px; border: 2px solid #c99a1e; border-radius: 3px; background: #fff;
  animation: rules-pulse 1.1s ease-in-out infinite alternate;
}
.rules-box::before {
  content: ''; position: absolute; inset: -4px; border: 2px solid var(--gold); border-radius: 6px; opacity: 0;
  animation: rules-ripple 1.4s ease-out 3s infinite;
}
@keyframes rules-ripple { 0% { opacity: .9; transform: scale(.7); } 100% { opacity: 0; transform: scale(2.2); } }
.rules-note.signed .rules-box::before { display: none; }
@keyframes rules-pulse { to { box-shadow: 0 0 0 4px #e3b23c55; border-color: var(--gold); } }
.rules-note.signed .rules-box { animation: none; border-color: var(--ink); background: var(--ink); }
.rules-note.signed .rules-box::after { content: '✓'; display: block; color: #fff; font-size: 13px; line-height: 12px; text-align: center; }

.opening-comic {
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  aspect-ratio: 3;
  overflow: hidden;
  background: #303d47;
  pointer-events: none;
}
.opening-comic[hidden] { display: none; }
.opening-comic.leaving { animation: comic-exit .22s ease-out both; }
.comic-panel {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.comic-panel img { display: block; width: 100%; height: auto; }
.opening-comic.loaded .comic-panel {
  animation: comic-fly-in .38s cubic-bezier(.2, .8, .3, 1) both;
}
/* Follow the illustrated gutter while moving each half independently. */
.comic-left {
  -webkit-clip-path: polygon(0 0, 32.55% 0, 41.3% 100%, 0 100%);
  clip-path: polygon(0 0, 32.55% 0, 41.3% 100%, 0 100%);
  --comic-entry: -45%;
}
.comic-right {
  -webkit-clip-path: polygon(32.55% 0, 100% 0, 100% 100%, 41.3% 100%);
  clip-path: polygon(32.55% 0, 100% 0, 100% 100%, 41.3% 100%);
  --comic-entry: 72%;
}
.opening-comic.loaded .comic-right { animation-delay: .65s; }
@keyframes comic-fly-in {
  from { opacity: 0; transform: translateX(var(--comic-entry)); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes comic-exit { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .comic-panel { --comic-entry: 0px; }
}
.scene {
  position: relative; background: #404557;
  /* The scene (4:5) always fills the frame's width. On a screen too short for all of it, a strip
     of floor at the bottom is cut off instead (the frame clips it): just enough for the page to
     fit (everything above the scene plus the margins is about 150px), at most 15% of the width.
     The canvas keeps its full size, so taps map the same; only what shows is shorter. */
  --crop: clamp(0px, calc(125cqi - 100svh + 150px), 15cqi);
  margin-bottom: calc(-1 * var(--crop));
}
canvas { display: block; width: 100%; height: auto; touch-action: none; }
/* Read by screen readers, not shown (the banner's text: the banner itself is drawn in the scene). */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  padding: 10px;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  background: #202532ae;
}
.overlay[hidden] { display: none; }
.result {
  flex: none;
  width: min(100%, 338px);
  margin: auto;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 4px 5px 0 #151b22a6;
  border-radius: 10px;
  display: flex; flex-direction: column; /* the back fills the front's height (game.js) */
  position: relative; /* for the floating share note */
}
.result-picture { position: relative; }
.result-picture #achievements { position: absolute; inset: auto 0 0; }
.result-art { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: #536d70; }
.result-body { padding: 10px 12px 12px; }
.result h2 { margin: 0; font-size: clamp(1.06rem, 4.4vw, 1.3rem); line-height: 1.22; text-wrap: balance; }
.result p { margin: 6px 0 0; font-size: .76rem; line-height: 1.4; }
.result .achievement-band {
  position: relative; display: flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 4px 10px 4px 72px; background: var(--ink); color: #fff;
  box-shadow: inset 0 2px 0 var(--gold); /* a gold edge against the picture */
}
/* The headline badge sticks up over the picture, with a shadow under it. */
.achievement-hero { position: absolute; left: 8px; bottom: 2px; width: auto; height: 66px; filter: drop-shadow(0 4px 3px #0007); }
.achievement-hero.badge-glow { filter: drop-shadow(0 0 7px var(--secret-glow)) drop-shadow(0 4px 3px #0007); }
.achievement-band p { min-width: 0; margin: 0; }
.achievement-band strong { display: block; overflow: hidden; font-size: 1rem; line-height: 1.15; white-space: nowrap; text-overflow: ellipsis; }
.achievement-band small { display: block; overflow: hidden; color: var(--quip); font-size: .72rem; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }
/* The rest: a stack, each one half over the one to its right (the leftmost on top). The list is
   in reverse order (achievements.js), laid out right to left so later ones are drawn on top. */
.achievement-stack { display: flex; flex-direction: row-reverse; flex-shrink: 0; margin-left: auto; }
.achievement-stack img { width: auto; height: 34px; filter: drop-shadow(3px 2px 2px #000a); }
.achievement-stack img.badge-glow { filter: drop-shadow(0 0 4px var(--secret-glow)) drop-shadow(3px 2px 2px #000a); }
.achievement-stack img + img { margin-right: -14px; }
.ending-line { color: var(--muted); white-space: pre-line; }
.result-stats { display: flex; gap: 18px; margin: 7px 0; padding-top: 5px; border-top: 1px solid #b9b8a9; }
.result-stats dt { font-size: .67rem; color: var(--muted); }
.result-stats dd { margin: 0; font: 900 .92rem var(--font-number); font-variant-numeric: tabular-nums; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.result-actions button { padding-inline: 4px; }
.result-actions button:disabled { opacity: .48; cursor: default; }
/* Share: dark with gold, like the achievement band on the card. */
#shareResult { background: var(--ink); color: #f0c24e; box-shadow: inset 0 0 0 2px var(--gold); }
#copyGameLink { background: #e3dbca; color: var(--ink); }
.result-navigation { margin-top: 6px; }
.result-flip { background: #e3dbca; color: var(--ink); }
/* The back: this round's picture across the top (game.js sets it), darkened under the title;
   the badges and what the tapped one asks for share one dark sunken tray. */
.result-back { display: flex; flex: 1; flex-direction: column; }
.result-back[hidden] { display: none; }
.result-back-heading {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  min-height: 74px; margin: -10px -12px 0; padding: 10px 12px;
  background: var(--ink) center 25% / cover; color: #fff; border-bottom: 2px solid var(--gold);
}
.result-back-heading h2 { text-shadow: 0 2px 4px #000a; }
.result-back-heading button { flex-shrink: 0; }
.share-status {
  position: absolute; right: 14px; bottom: 112px; z-index: 2; /* the empty end of the stats row */
  margin: 0; padding: 6px 14px; border-radius: 99px; background: var(--ink); color: #fff;
  font-size: .74rem; white-space: nowrap; box-shadow: 0 3px 8px #0006; pointer-events: none;
}
.share-link { width: 100%; margin-top: 5px; font: inherit; }
/* One dark sunken tray: the badges, and under a thin line what the tapped one asks for. */
.achievement-tray {
  display: flex; flex: 1; flex-direction: column; margin: 10px 0 0;
  border-radius: 10px; background: #2b3238;
  box-shadow: inset 0 3px 8px #000c, inset 0 0 0 1px #0008, 0 1px 0 #fff8;
}
.achievement-checklist {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px;
  margin: 0; padding: 8px 4px 4px; list-style: none;
}
/* One badge: a shield (badges.js), the name, and one short status. */
.badge {
  display: grid; justify-items: center; align-content: start; gap: 2px; width: 100%;
  min-height: 0; padding: 4px 0 2px; border: 0; border-radius: 8px; background: none;
  color: #ece6d8; font: inherit; text-align: center;
}
.badge-shield { width: auto; height: 58px; }
.badge strong { margin-top: 2px; font-size: .72rem; line-height: 1.1; white-space: nowrap; }
.badge small { color: #95a3a6; font: 900 .6rem var(--font-number); line-height: 1.1; font-variant-numeric: tabular-nums; }
.badge-earned small { color: #f0c24e; }
.badge-secret small { color: #c9a8ff; }
.badge-bronze small { color: #e0a77a; }
.badge-silver small { color: #cfd7dc; }
/* Earned this round: a glow in its tier's colour (secret: badges.js glow). */
.badge-glow-bronze { filter: drop-shadow(0 0 5px #e9a66e) drop-shadow(0 0 2px #f6d2ae); }
.badge-glow-silver { filter: drop-shadow(0 0 5px #dfe7ec) drop-shadow(0 0 2px #fff); }
.badge-glow-gold { filter: drop-shadow(0 0 5px #f0c24e) drop-shadow(0 0 2px #fff1b8); }
.badge-glow-secret { filter: drop-shadow(0 0 5px var(--secret-glow)) drop-shadow(0 0 2px #c9a8ff); }
.badge strong.badge-name-long { font-size: .62rem; letter-spacing: -.02em; }
.badge-locked strong { color: #7d898c; }
.badge-selected { background: #ffffff17; }
/* What the tapped badge asks for. */
.achievement-detail {
  display: grid; align-content: start; gap: 2px; flex: 1; margin: 0 12px;
  padding: 8px 8px 10px; border-top: 1px solid #ffffff1f;
  color: #b9c6c4; font-size: .74rem; line-height: 1.3;
}
.achievement-detail > span:last-child { white-space: pre-line; } /* conditions break at \n */
.detail-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.detail-head strong { color: #fff; font-size: .84rem; white-space: nowrap; }
.detail-head small { color: #e9d9a8; font-size: .7rem; text-align: right; }
button {
  cursor: pointer; border: 0; font: 900 .87rem var(--font-text); border-radius: 7px; padding: 9px 13px; min-height: 40px; touch-action: manipulation;
  transition: transform .08s ease-out;
}
button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; } /* the card's own dark, not a stray blue */
/* Pressed: every button shrinks a little (the browser's own tap flash is off, see main). */
button:active:not(:disabled):not(.rules-note) { transform: scale(.95); }
#start { background: var(--accent); color: var(--ink); width: 100%; }
.control-help {
  /* Written on the floor near the bottom of what shows of the scene (above the 跳過教學 button). */
  position: absolute; left: 10px; right: 10px; bottom: calc(var(--crop) + 56px); z-index: 1; margin: 0;
  text-align: center; color: #f3eee2; font-size: .72rem; line-height: 1.35; text-wrap: balance;
  text-shadow: 0 1px 3px #000c; pointer-events: none;
}
.control-help:empty { display: none; }


.intro-caption {
  position: absolute;
  inset: 52% 0 auto;
  width: fit-content;
  max-width: calc(100% - 24px);
  text-align: center;
  margin: auto;
  padding: 5px 10px;
  border-radius: 4px;
  background: #303d47;
  color: #fff6e4;
  font-size: .8rem;
  pointer-events: none;
}
canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }


.dodge-demo {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: #fffaf09e;
  color: #303d47;
  text-align: center;
  pointer-events: none;
}
.dodge-demo[hidden] { display: none; }
.dodge-demo p { margin: 0 12px; padding: 8px 12px; border-radius: 6px; background: #fffaf0; color: #29343a; }
.dodge-demo small { font-size: .78rem; }
/* The dodge gesture picture: a phone rolling under a two-way arc, or a finger sliding. */
.gesture-demo { display: flex; flex-direction: column; align-items: center; gap: 2px; color: #303d47; }
.gesture-tilt, .gesture-swipe { position: relative; display: grid; justify-items: center; }
.gesture-arc { width: 74px; height: 26px; fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.gesture-phone {
  width: 40px; height: 70px; margin-top: 2px;
  border: 3px solid currentColor; border-radius: 9px; background: #e1eae8a6;
  animation: show-phone-roll .9s ease-in-out infinite;
}
.gesture-swipe { width: 84px; height: 80px; }
.gesture-track { position: absolute; left: 6px; right: 6px; bottom: 10px; border-top: 2px dashed #657e82; }
.gesture-finger {
  position: absolute; bottom: 12px; width: 30px; height: 42px;
  fill: #f3d6bf; stroke: currentColor; stroke-width: 3; stroke-linejoin: round;
  animation: show-finger-swipe 1.1s ease-in-out infinite;
}
@keyframes show-finger-swipe {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-24px); }
  70% { transform: translateX(24px); }
}
/* The same picture in white lines, stacked, right on the chair back (no card): shown again
   when the player keeps tapping during the dodge or catch step instead of moving. */
.dodge-nudge {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  transform: translateX(-50%) scale(.68); transform-origin: top center;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px #000a);
  animation: nudge-in .25s ease-out;
}
.dodge-nudge[hidden] { display: none; }
.dodge-nudge .gesture-demo { color: #fff; }
.dodge-nudge .gesture-phone { background: transparent; }
.dodge-nudge .gesture-or { font-size: .9rem; line-height: 1; }
.dodge-nudge .gesture-finger { fill: #fff3; }
.dodge-nudge .gesture-track { border-top-color: #fffc; }
/* Finger right under the 或, close to the phone above. */
.dodge-nudge .gesture-swipe { height: 52px; }
@keyframes nudge-in { from { opacity: 0; transform: translateX(-50%) scale(.55); } }
@keyframes show-phone-roll {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-24deg); }
  75% { transform: rotate(24deg); }
}
@media (prefers-reduced-motion: reduce) {
  .gesture-phone { animation: none; transform: rotate(18deg); }
  .gesture-finger { animation: none; }
}
/* Bottom right, on the floor, during the comic and the tutorial (clear of the banner at the
   top); it starts the round straight away. */
.skip-tutorial {
  position: absolute; bottom: 10px; right: 10px; z-index: 3;
  padding: 3px 10px; border: 1px solid #ffffff55; border-radius: 999px;
  background: #303d47cc; color: #fff6e4; font: 900 .72rem/1.3 var(--font-text);
  white-space: nowrap;
}
.skip-tutorial[hidden] { display: none; }

/* Achievement toast: slides in from the right over the bonus (achievements.js sizes it to that
   corner of the top bar), holds, and slides back out. */
.achievement-toast {
  position: absolute; top: 0; right: 0; z-index: 4;
  display: grid; grid-template-columns: auto 1fr; align-content: center; gap: 2px 8px; padding: 0 12px 0 10px;
  border-left: 3px solid var(--quip); border-radius: 0 0 0 6px;
  background: #1f262b; box-shadow: -2px 2px 10px #0006; pointer-events: none;
  animation: achievement-toast 3.2s ease-in-out both;
}
.achievement-toast[hidden] { display: none; }
.achievement-toast-shield { grid-row: span 2; align-self: center; width: auto; height: 38px; }
.achievement-toast small { color: var(--quip); font: 900 .62rem/1 var(--font-text); letter-spacing: .04em; white-space: nowrap; }
.achievement-toast strong { color: #fff; font: 900 .98rem/1.1 var(--font-text); white-space: nowrap; }
/* A hidden one: violet, like its badge. */
.achievement-toast-secret { border-left-color: var(--secret-glow); box-shadow: -2px 2px 10px #0006, inset 0 0 18px #7b4fd855; }
.achievement-toast-secret small { color: #c9a8ff; }
@keyframes achievement-toast {
  0% { transform: translateX(105%); }
  10%, 88% { transform: translateX(0); }
  100% { transform: translateX(105%); }
}

/* Combo counter (hud.js createCombo): the free right end of the supplies row, hanging a little
   below it (clear of the achievement toast over the top bar), fighting-game style: an outlined
   Bungee number and a slanted COMBO tag. */
.combo {
  position: absolute; top: -7px; right: 10px; pointer-events: none;
  display: flex; align-items: center; gap: 5px;
  transform: rotate(-6deg); transform-origin: right center;
}
.combo[hidden] { display: none; }
.combo strong {
  display: inline-block; font: 900 1.8rem/1 var(--font-number); font-variant-numeric: tabular-nums;
  color: #fff; background: linear-gradient(#ffffff 35%, #ffe27a); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; -webkit-text-stroke: 1.5px #26333b;
  filter: drop-shadow(0 2px 0 #26333b) drop-shadow(0 0 5px #0007);
}
.combo small {
  padding: 3px 7px 2px; transform: skewX(-12deg); border-radius: 3px;
  background: #fff2d6; color: #26333b; font: 900 .7rem/1 var(--font-number); letter-spacing: .08em; /* the neighbours' bubble colour */
  box-shadow: 0 2px 0 #0005;
}
.combo-hot strong { background-image: linear-gradient(#fff3d6 20%, #ff9a3c); }
.combo-hot small { background: #c4561c; color: #fff; }
.combo-gold strong { background-image: linear-gradient(#fffbe8 15%, #ffd84a 55%, #d99a12); filter: drop-shadow(0 2px 0 #6b4a0c) drop-shadow(0 0 8px #ffcf4a); }
.combo-gold small { background: #b8860b; color: #fff; }
.combo-bump strong { animation: combo-bump .24s ease-out; }
.combo-milestone strong { animation: combo-milestone .5s ease-out; }
.combo-break { animation: combo-break .45s ease-in forwards; }
@keyframes combo-bump { from { transform: scale(1.5) rotate(-8deg); } 60% { transform: scale(.94) rotate(2deg); } }
@keyframes combo-milestone {
  from { transform: scale(2.1) rotate(-10deg); filter: drop-shadow(0 0 14px #fff) brightness(1.6); }
  50% { transform: scale(.9) rotate(3deg); }
}
@keyframes combo-break { to { transform: rotate(-6deg) translateY(22px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .combo-bump strong, .combo-milestone strong, .combo-break { animation: none; } }
