/* Fredoka (SIL Open Font License, fonts/OFL.txt), served with the game: no outside requests */
@font-face {
  font-family: "Fredoka";
  src: url("fonts/fredoka-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
/* the art's colours (art/vex/factory.vx.js) */
:root {
  --ink: #3a2230;
  --bg: #2a1d26;
  --cream: #fff6f0;
  --pink: #ea6aa2;
  --red: #e2404c;
  --red-dark: #8c1f2b;
  --mint: #2f8a62;
  --guide: #ffcf40; /* the guided start's ring and arrow */
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Fredoka", "Segoe UI", system-ui, sans-serif;
  /* the page is a game: nothing selects or drags, no pull-to-refresh or bounce (CrazyGames asks for it) */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  overscroll-behavior: none;
  /* (an iPhone turned sideways would enlarge the text; and Safari flashes grey on every tapped button) */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
#game { position: fixed; inset: 0; }
#game canvas { display: block; width: 100%; height: 100%; }

#loading {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--bg);
  color: var(--cream);
  font-weight: 700;
  font-size: clamp(1.4rem, 5vmin, 2.4rem);
}
#loading p { margin: 0; }
.bar { width: min(60vw, 22rem); height: 0.8rem; border-radius: 0.4rem; background: #4a3340; overflow: hidden; }
#loadingFill { height: 100%; width: 0; background: var(--pink); transition: width 0.15s; }
/* (a picture the factory needs couldn't be downloaded: main.js cantLoad) */
#loading .small { font-size: 0.55em; font-weight: 600; opacity: 0.85; }
#loading button {
  font: inherit;
  font-size: 0.65em;
  padding: 0.35em 1.2em;
  color: var(--cream);
  background: var(--pink);
  border: 0.12em solid var(--ink);
  border-radius: 0.6em;
  cursor: pointer;
}

/* ---- the HUD: sized from the window's height, like the scene */
#hud { position: fixed; inset: 0; pointer-events: none; font-size: clamp(14px, 2.9vh, 30px); font-size: clamp(14px, 2.9dvh, 30px); }
#hud button { pointer-events: auto; font: inherit; cursor: pointer; }
/* top left: the money, then the Golden Sprinkles badge */
#topLeft {
  position: absolute;
  top: max(2.2vh, env(safe-area-inset-top));
  left: max(1.6vw, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 0.4em;
}
#money {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.25em 1.1em 0.25em 0.35em;
  background: #fff;
  border: 0.18em solid var(--ink);
  border-radius: 99px;
  font-size: 1.15em;
  font-weight: 700;
  box-shadow: 0 0.25em 0 rgba(58, 34, 48, 0.25);
}
#money i {
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #ffe27a, #f0b02c 70%);
  border: 0.14em solid #b8700f;
}
#money small { font-size: 0.62em; color: var(--mint); margin-left: 0.3em; }
#btnGold {
  display: flex;
  align-items: center;
  gap: 0.25em;
  padding: 0.2em 0.6em 0.2em 0.3em;
  color: var(--ink);
  background: #fff;
  border: 0.16em solid var(--ink);
  border-radius: 99px;
  box-shadow: 0 0.2em 0 rgba(58, 34, 48, 0.25);
  font-size: 0.9em;
  font-weight: 700;
}
#btnGold svg { width: 1.5em; height: 1.5em; }
#btnGold .sp { fill: #f7c43c; stroke: var(--ink); stroke-width: 1.4; }
#btnGold .shine { fill: none; stroke: #fff6c9; stroke-width: 1.3; stroke-linecap: round; }
#btnGold .star { fill: #ffe27a; stroke: #b8700f; stroke-width: 0.6; stroke-linejoin: round; }
#btnGold small { font-size: 0.72em; color: #a0610c; }
#btnGold:active { transform: translateY(0.12em); box-shadow: 0 0.06em 0 rgba(58, 34, 48, 0.25); }

#btnSound {
  position: absolute;
  top: max(2.2vh, env(safe-area-inset-top));
  right: max(1.6vw, env(safe-area-inset-right));
  width: 2.3em;
  height: 2.3em;
  padding: 0.35em;
  border-radius: 50%;
  background: #fff;
  border: 0.16em solid var(--ink);
  box-shadow: 0 0.2em 0 rgba(58, 34, 48, 0.25);
}
#btnSound svg { width: 100%; height: 100%; display: block; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#btnSound .spk { fill: var(--ink); }
#btnSound .off, #btnSound[data-muted] .on { display: none; }
#btnSound[data-muted] .off { display: inline; }

/* the shop: a column down the right, over the far wall (the line and the box stay clear) */
#shop {
  position: absolute;
  top: calc(max(2.2vh, env(safe-area-inset-top)) + 3em);
  right: max(1.6vw, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45em;
  width: 11.5em;
}
.buy {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0 0.5em;
  text-align: left;
  color: #fff;
  background: linear-gradient(#f0606a, #d4323f);
  border: 0.14em solid var(--ink);
  border-radius: 0.6em;
  padding: 0.3em 0.7em 0.35em;
  box-shadow: 0 0.24em 0 var(--red-dark);
  font-size: 0.82em;
}
.buy b { font-weight: 700; }
.buy .price { font-weight: 700; color: #ffe27a; }
.buy small { grid-column: 1 / -1; font-size: 0.72em; font-weight: 500; opacity: 0.92; }
.buy:active:not([disabled]) { transform: translateY(0.16em); box-shadow: 0 0.08em 0 var(--red-dark); }
.buy[disabled] { filter: saturate(0.3) brightness(0.92); cursor: default; }
.buy:focus-visible, #btnSound:focus-visible, #btnGift:focus-visible, #btnGold:focus-visible, #btnSell:focus-visible, .tab:focus-visible {
  outline: 0.14em solid #fff;
  outline-offset: 0.14em;
}

/* under the money: the Flavour Book, then the daily gift while today's is waiting */
#side {
  position: absolute;
  top: calc(max(2.2vh, env(safe-area-inset-top)) + 2.75em);
  left: max(1.6vw, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5em;
}
#btnBook {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.2em 0.45em 0.2em 0.35em;
  color: #fff;
  background: linear-gradient(#86a4f6, #5277de);
  border: 0.16em solid var(--ink);
  border-radius: 99px;
  box-shadow: 0 0.2em 0 #2c448f;
  font-weight: 700;
}
#btnBook svg { width: 1.6em; height: 1.6em; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
#btnBook .pages { fill: var(--cream); }
#btnBook .cover { fill: var(--pink); }
#btnBook .spine { fill: none; stroke: #b83c74; stroke-width: 1.6; }
#btnBook .dn { fill: #f4c886; }
#btnBook .hole { fill: var(--pink); }
#btnBook small { font-size: 0.72em; padding: 0.1em 0.5em; border-radius: 99px; background: rgba(44, 68, 143, 0.55); }
/* the dot: a new Donut of the Day since the book was last opened */
#btnBook .dot {
  position: absolute;
  top: -0.3em;
  right: -0.3em;
  width: 0.8em;
  height: 0.8em;
  border-radius: 50%;
  background: #ffe27a;
  border: 0.14em solid var(--ink);
  animation: dot 1.4s ease-in-out infinite;
}
@keyframes dot { 50% { transform: scale(1.3); } }
#btnBook.pop { animation: pop 0.5s cubic-bezier(0.3, 1.6, 0.6, 1); }
@keyframes pop { 30% { transform: scale(1.18); } }
#btnBook:active { transform: translateY(0.12em); box-shadow: 0 0.06em 0 #2c448f; }
#btnBook:focus-visible { outline: 0.14em solid #fff; outline-offset: 0.14em; }

/* the daily gift */
#btnGift {
  display: flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.2em 0.8em 0.2em 0.35em;
  color: #fff;
  background: linear-gradient(#45b884, var(--mint));
  border: 0.16em solid var(--ink);
  border-radius: 99px;
  box-shadow: 0 0.2em 0 #1d5a3f;
  font-size: 0.8em;
  font-weight: 700;
  animation: nudge 2.4s ease-in-out infinite;
}
#btnGift svg { width: 1.6em; height: 1.6em; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
#btnGift .box { fill: #ea6aa2; }
#btnGift .lid { fill: #f48bbb; }
#btnGift .rib, #btnGift .bow { fill: #ffe27a; }
#btnGift .rib { stroke: #ffe27a; stroke-width: 2.6; }
@keyframes nudge { 0%, 80%, 100% { transform: none; } 86% { transform: rotate(-5deg) scale(1.05); } 93% { transform: rotate(4deg) scale(1.05); } }
#btnGift:active { transform: translateY(0.12em); box-shadow: 0 0.06em 0 #1d5a3f; }

/* selling the factory: gold, a price tag, how many Golden Sprinkles it gives */
#btnSell {
  display: flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.2em 0.5em 0.2em 0.35em;
  color: var(--ink);
  background: linear-gradient(#ffe27a, #f0b02c);
  border: 0.16em solid var(--ink);
  border-radius: 99px;
  box-shadow: 0 0.2em 0 #b8700f;
  font-size: 0.8em;
  font-weight: 700;
  animation: nudge 3.2s ease-in-out infinite;
}
#btnSell svg { width: 1.6em; height: 1.6em; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
#btnSell .tag { fill: #fff6f0; }
#btnSell .hole { fill: #f0b02c; }
#btnSell .line { fill: none; stroke-linecap: round; opacity: 0.6; }
#btnSell small { font-size: 0.8em; padding: 0.05em 0.45em; border-radius: 99px; color: #fff; background: rgba(160, 97, 12, 0.85); }
#btnSell:active { transform: translateY(0.12em); box-shadow: 0 0.06em 0 #b8700f; }

/* the goals: purple, a target, one goal and a bar for how far along it is (its count beside); gold when one is done */
#btnGoals {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35em;
  max-width: 14em;
  padding: 0.2em 0.45em 0.2em 0.35em;
  color: #fff;
  background: linear-gradient(#b08cf0, #8558d6);
  border: 0.16em solid var(--ink);
  border-radius: 99px;
  box-shadow: 0 0.2em 0 #4f2d8f;
  font-size: 0.8em;
  font-weight: 700;
}
#btnGoals svg { flex: none; width: 1.6em; height: 1.6em; stroke: var(--ink); stroke-width: 1.4; }
#btnGoals .r1, #btnGoals .r3 { fill: var(--red); }
#btnGoals .r2 { fill: #fff; }
#btnGoals .what { display: flex; flex-direction: column; gap: 0.2em; min-width: 4.6em; text-align: left; }
#btnGoals .what span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.92em; line-height: 1.1; }
#btnGoals .bar, .goal .bar { position: relative; display: block; width: auto; height: 0.42em; border-radius: 99px; background: rgba(58, 34, 48, 0.35); overflow: hidden; }
#btnGoals .bar i, .goal .bar i { position: absolute; inset: 0; border-radius: inherit; background: #ffe27a; transform-origin: left; transition: transform 0.25s; }
#btnGoals small { flex: none; font-size: 0.8em; padding: 0.1em 0.5em; border-radius: 99px; background: rgba(79, 45, 143, 0.6); }
#btnGoals.done { color: var(--ink); background: linear-gradient(#ffe27a, #f0b02c); box-shadow: 0 0.2em 0 #b8700f; animation: nudge 2s ease-in-out infinite; }
#btnGoals.done .bar { display: none; }
#btnGoals.done small { color: #fff; background: var(--mint); }
#btnGoals.pop { animation: pop 0.5s cubic-bezier(0.3, 1.6, 0.6, 1); }
#btnGoals:active { transform: translateY(0.12em); box-shadow: 0 0.06em 0 #4f2d8f; }
#btnGoals.done:active { box-shadow: 0 0.06em 0 #b8700f; }
#btnGoals:focus-visible, #hud .goal .claim:focus-visible { outline: 0.14em solid #fff; outline-offset: 0.14em; }
/* the first goal done: the guided start's gold ring round it */
#btnGoals.guide { animation: guide-goals 1s ease-in-out infinite; }
@keyframes guide-goals {
  0%, 100% { box-shadow: 0 0.2em 0 #b8700f, 0 0 0 0.16em var(--guide); }
  50% { box-shadow: 0 0.2em 0 #b8700f, 0 0 0 0.36em rgba(255, 207, 64, 0.7); }
}

/* the goals panel: a card for each goal, its colour dot (--c), what it asks, the reward, the bar or Collect */
#hud #goals .panel { width: min(92vw, 19em); }
.goals { display: flex; flex-direction: column; gap: 0.45em; margin-top: 0.5em; }
.goal {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.3em 0.5em;
  padding: 0.4em 0.65em 0.5em;
  text-align: left;
  background: #fff;
  border: 0.13em solid var(--ink);
  border-radius: 0.6em;
  box-shadow: 0 0.18em 0 rgba(58, 34, 48, 0.3);
  font-size: 0.8em;
}
.goal .dot { width: 1.1em; height: 1.1em; border-radius: 50%; border: 0.12em solid var(--ink); background: var(--c); }
.goal b { font-weight: 700; line-height: 1.15; }
.goal em { font-style: normal; font-weight: 700; color: var(--mint); white-space: nowrap; }
.goal .bar { grid-column: 2; background: #efe6df; }
.goal .bar i { background: #8558d6; }
.goal small { font-size: 0.85em; font-weight: 700; opacity: 0.75; }
#hud .goal .claim { grid-column: 2 / -1; padding: 0.25em 0.8em 0.3em; font-size: 0.9em; }
.goal.done { background: #fff3c4; border-color: #b8700f; box-shadow: 0 0 0 0.14em #f0b02c, 0 0.18em 0 rgba(58, 34, 48, 0.3); }

/* a customer's order: a paper ticket on the floor at the bottom left (under the side buttons it ran onto the belt on a
   phone once the gift and Sell factory showed too) */
#order {
  pointer-events: auto; /* (a tap on the ticket's paper fried a donut on the fryer under it: the screen audit) */
  position: absolute;
  left: max(1.6vw, env(safe-area-inset-left));
  bottom: max(2.6vh, env(safe-area-inset-bottom));
  width: 9.6em;
  padding: 0.35em 0.5em 0.55em;
  font-size: 0.78em;
  background: var(--cream);
  border: 0.16em solid var(--ink);
  border-radius: 0.55em;
  box-shadow: 0 0.22em 0 rgba(58, 34, 48, 0.3);
  overflow: hidden;
  animation: order-in 0.45s cubic-bezier(0.3, 1.5, 0.6, 1);
}
@keyframes order-in { 0% { transform: translateX(-120%) rotate(-6deg); } }
#order .head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.4em; }
#order .head b { font-size: 0.72em; letter-spacing: 0.06em; text-transform: uppercase; color: #b83c74; }
#order .head em { font-style: normal; font-size: 0.72em; font-weight: 700; color: var(--mint); white-space: nowrap; }
#order .what { display: flex; align-items: center; gap: 0.35em; margin: 0.15em 0 0.25em; }
#order .pic { flex: none; width: 2.6em; }
#order .name { font-size: 0.72em; font-weight: 600; line-height: 1.15; text-wrap: pretty; }
#order .name small { display: block; font-weight: 500; opacity: 0.65; }
#order .foot { display: flex; align-items: center; justify-content: space-between; gap: 0.4em; min-height: 1.6em; }
#order .count { font-size: 1.05em; }
#order .count.pop { animation: pop 0.4s cubic-bezier(0.3, 1.6, 0.6, 1); }
#order .make { font-size: 0.72em; padding: 0.2em 0.7em 0.25em; }
#order .ok { font-size: 0.66em; color: var(--mint); }
/* the time left: a bar along the bottom, red near the end */
#order .time { position: absolute; left: 0; right: 0; bottom: 0; height: 0.3em; background: #efe6df; }
#order .time i { position: absolute; inset: 0; background: #45b884; transform-origin: left; }
#order.late .time i { background: var(--red); }
#order.late { animation: order-late 0.8s ease-in-out infinite; }
@keyframes order-late { 50% { transform: rotate(-1.5deg); } }

/* a golden rush: a gold banner at the top middle, its time draining away along the bottom; the toasts go under it */
#rush {
  position: absolute;
  top: max(2.2vh, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  padding: 0.22em 1.05em 0.42em;
  color: var(--ink);
  background: linear-gradient(#ffe48a, #f6b42c);
  border: 0.16em solid var(--ink);
  border-radius: 99px;
  box-shadow: 0 0.2em 0 rgba(58, 34, 48, 0.3);
  overflow: hidden;
  white-space: nowrap;
  animation: rush-in 0.45s cubic-bezier(0.3, 1.6, 0.6, 1);
}
#rush b { font-size: 1em; }
#rush span { font-size: 0.8em; font-weight: 700; color: #8a4b06; }
#rush .time { position: absolute; left: 0; right: 0; bottom: 0; height: 0.3em; background: rgba(58, 34, 48, 0.18); }
#rush .time i { position: absolute; inset: 0; background: #fff4c8; transform-origin: left; }
@keyframes rush-in { 0% { transform: translateX(-50%) scale(0.4); opacity: 0; } }
#hud.rushing #toasts { top: calc(max(2.2vh, env(safe-area-inset-top)) + 2.4em); }

/* toasts: a new donut, the gift; top middle, over the wall */
#toasts {
  position: absolute;
  top: max(2.2vh, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35em;
  width: min(60vw, 26em);
}
#toasts p {
  margin: 0;
  padding: 0.3em 0.9em;
  color: var(--ink);
  background: var(--cream);
  border: 0.14em solid var(--ink);
  border-radius: 99px;
  box-shadow: 0 0.2em 0 rgba(58, 34, 48, 0.25);
  font-size: 0.78em;
  font-weight: 500;
  text-align: center;
  animation: toast 3.2s ease forwards;
}
#toasts b { font-weight: 700; }
#toasts em { font-style: normal; font-weight: 700; color: var(--mint); }
@keyframes toast { 0% { opacity: 0; transform: translateY(-0.6em) scale(0.9); } 8%, 82% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-0.3em); } }

/* a panel in the middle of the screen (welcome back) */
.panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  width: min(86vw, 17em);
  padding: 0.8em 1.1em 1em;
  text-align: center;
  background: var(--cream);
  border: 0.18em solid var(--ink);
  border-radius: 1em;
  box-shadow: 0 0.35em 0 rgba(58, 34, 48, 0.35), 0 0 0 100vmax rgba(42, 29, 38, 0.45);
  animation: panel 0.35s cubic-bezier(0.3, 1.5, 0.6, 1);
}
.panel h2 { margin: 0 0 0.2em; font-size: 1.25em; }
.panel p { margin: 0.2em 0; font-size: 0.8em; font-weight: 500; text-wrap: pretty; }
.panel .big { display: flex; align-items: center; justify-content: center; gap: 0.35em; margin: 0.35em 0 0.6em; font-size: 1.6em; font-weight: 700; }
.panel .big i { width: 1.1em; height: 1.1em; border-radius: 50%; background: radial-gradient(circle at 38% 30%, #ffe27a, #f0b02c 70%); border: 0.12em solid #b8700f; }
.panel .row { display: flex; gap: 0.5em; justify-content: center; }
.panel .buy { display: block; flex: 1; text-align: center; font-size: 0.9em; font-weight: 700; padding: 0.4em 0.8em 0.45em; }
.panel .buy.gold { color: var(--ink); background: linear-gradient(#ffe27a, #f0b02c); box-shadow: 0 0.24em 0 #b8700f; }
.panel .buy.plain { color: var(--ink); background: #fff; box-shadow: 0 0.24em 0 rgba(58, 34, 48, 0.35); }
.panel .note { color: var(--red-dark); }
/* Golden Sprinkles in a panel: a gold sprinkle where the coin goes */
.panel .big.gold { color: #a0610c; font-size: 1.3em; }
.panel .big.gold i { width: 1.2em; height: 0.48em; border-radius: 99px; background: linear-gradient(#ffe27a, #f0b02c); border-color: var(--ink); transform: rotate(-30deg); }
#hud #sell .panel { width: min(92vw, 20em); max-height: 96vh; max-height: 96dvh; overflow-y: auto; }
.sell .new { font-weight: 700; color: #c2306e; }
.sell .small { font-size: 0.66em; opacity: 0.8; }
.sell .big { margin: 0.25em 0 0.3em; }
#sell .row { margin-top: 0.6em; }
@keyframes panel { from { opacity: 0; transform: translate(-50%, -50%) scale(0.85); } }

/* the flavour chips, one under each station (src/main.js moves them with the camera); --c is the flavour's colour.
   (#hud in front: `#hud button { font: inherit }` would beat a plain class's font-size) */
#chips { position: absolute; inset: 0; overflow: hidden; }
#hud .chip {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.15em 0.55em 0.15em 0.25em;
  color: var(--ink);
  background: var(--cream);
  border: 0.13em solid var(--ink);
  border-radius: 99px;
  box-shadow: 0 0.16em 0 rgba(58, 34, 48, 0.35);
  font-size: 0.66em;
  font-weight: 700;
  white-space: nowrap;
}
.chip::after { content: ""; width: 0.36em; height: 0.36em; margin: -0.2em 0 0 0.1em; border: solid var(--ink); border-width: 0 0.14em 0.14em 0; transform: rotate(45deg); }
.chip i, .flavour i { flex: none; width: 1.15em; height: 1.15em; border-radius: 50%; border: 0.12em solid var(--ink); background: var(--c, transparent); }
.chip:focus-visible, .flavour:focus-visible { outline: 0.14em solid #fff; outline-offset: 0.14em; }

/* the flavour picker: a full-window layer (a tap on it outside the panel closes it) with the panel in the middle */
.modal { position: absolute; inset: 0; pointer-events: auto; }
#hud .panel .x {
  position: absolute;
  top: 0.3em;
  right: 0.4em;
  width: 1.5em;
  height: 1.5em;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
  font-size: 1.2em;
  font-weight: 700;
  line-height: 1;
}
.flavours { display: flex; flex-direction: column; gap: 0.4em; margin-top: 0.5em; max-height: 62vh; max-height: 62dvh; overflow-y: auto; }
#hud .flavour {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0 0.5em;
  padding: 0.3em 0.65em;
  text-align: left;
  color: var(--ink);
  background: #fff;
  border: 0.13em solid var(--ink);
  border-radius: 0.6em;
  box-shadow: 0 0.18em 0 rgba(58, 34, 48, 0.3);
  font-size: 0.8em;
}
.flavour b { font-weight: 700; }
.flavour .add { font-weight: 700; color: var(--mint); }
.flavour .cost { font-weight: 700; color: #fff; background: linear-gradient(#f0606a, #d4323f); border-radius: 99px; padding: 0.05em 0.55em; }
.flavour em { grid-column: 2 / -1; font-style: normal; font-size: 0.78em; font-weight: 700; color: #c2306e; }
#hud .flavour.on { background: #fff3c4; border-color: #b8700f; box-shadow: 0 0 0 0.14em #f0b02c, 0 0.18em 0 rgba(58, 34, 48, 0.3); }
#hud .flavour.locked { background: #f4ece6; }
.flavour.none i { background: repeating-linear-gradient(-45deg, transparent 0 0.18em, var(--ink) 0.18em 0.3em); opacity: 0.35; }
.flavour[disabled] { opacity: 0.55; cursor: default; }
.flavour:active:not([disabled]) { transform: translateY(0.12em); }
.flavour em.of-day { color: #a0610c; }

/* a donut's picture in the HTML: the plain donut (301 x 237 px, its outline included) with its glaze and topping
   (288 x 224, no outline) laid over it, 6.4 px in (src/main.js donutPicture) */
.dn { position: relative; display: block; aspect-ratio: 301 / 237; pointer-events: none; }
.dn img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; -webkit-user-drag: none; }
.dn img.l { left: 2.13%; top: 2.7%; width: 95.68%; height: 94.51%; }

/* the Flavour Book: the Donut of the Day on a chalkboard (like the one on the wall), then the grid of this city's
   donuts, glazes down and toppings across; a tap on one says more underneath */
#hud .panel.wide { width: min(96vw, 34em); max-height: 96vh; max-height: 96dvh; overflow-y: auto; padding: 0.6em 0.9em 0.7em; }
.panel .sub { margin: 0 0 0.45em; font-size: 0.72em; opacity: 0.8; }
.pages { display: flex; gap: 0.75em; align-items: stretch; }
.day-card {
  flex: 0 0 8.6em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15em;
  padding: 0.55em 0.45em;
  color: #f4efe6;
  background: linear-gradient(#3a4d51, #26363a);
  border: 0.14em solid var(--ink);
  border-radius: 0.7em;
  box-shadow: inset 0 0 0 0.24em #a8653a, 0 0.18em 0 rgba(58, 34, 48, 0.3);
}
.day-card .eyebrow { font-size: 0.62em; letter-spacing: 0.04em; text-transform: uppercase; }
.day-card .pic { display: block; width: 5.2em; }
.day-card .name { font-size: 0.72em; line-height: 1.15; }
.day-card .times { font-size: 0.85em; font-weight: 700; color: #ffe27a; }
.day-card .left { font-size: 0.58em; opacity: 0.75; }
.day-card .do { margin-top: 0.25em; font-size: 0.66em; line-height: 1.2; }
.need { color: #ffc2a8; font-weight: 700; }
.about .need { color: var(--red-dark); }
.ok { color: #7fe0b0; font-weight: 700; }
.about .ok { color: var(--mint); }
#hud .make {
  padding: 0.25em 0.9em 0.3em;
  color: #fff;
  background: linear-gradient(#45b884, var(--mint));
  border: 0.13em solid var(--ink);
  border-radius: 99px;
  box-shadow: 0 0.18em 0 #1d5a3f;
  font-weight: 700;
  white-space: nowrap;
}
#hud .make:active { transform: translateY(0.12em); box-shadow: 0 0.06em 0 #1d5a3f; }
/* the filling tabs over the grid (Big City on) */
.page { flex: 1; display: flex; flex-direction: column; gap: 0.35em; min-width: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.25em; }
#hud .tab {
  display: flex;
  align-items: center;
  gap: 0.25em;
  padding: 0.1em 0.5em 0.1em 0.25em;
  color: var(--ink);
  background: #efe6df;
  border: 0.12em solid var(--ink);
  border-radius: 99px;
  font-size: 0.6em;
  font-weight: 700;
}
.tab i { flex: none; width: 0.95em; height: 0.95em; border-radius: 50%; border: 0.12em solid var(--ink); background: var(--c); }
.tab.none i { background: repeating-linear-gradient(-45deg, transparent 0 0.15em, var(--ink) 0.15em 0.26em); opacity: 0.35; }
.tab small { font-size: 0.85em; font-weight: 500; opacity: 0.75; }
#hud .tab.on { background: #fff3c4; border-color: #b8700f; box-shadow: 0 0 0 0.12em #f0b02c; }
/* (minmax(0, 1fr): every donut column as wide as the others, whatever its heading) */
.grid { flex: 1; display: grid; grid-template-columns: auto repeat(var(--cols, 4), minmax(0, 1fr)); gap: 0.25em; align-items: center; }
.grid .h { display: flex; align-items: center; justify-content: center; gap: 0.25em; font-size: 0.6em; font-weight: 700; line-height: 1.1; text-align: center; }
.grid .h i { flex: none; width: 0.95em; height: 0.95em; border-radius: 50%; border: 0.12em solid var(--ink); background: var(--c); }
.grid .h.none { opacity: 0.6; }
.grid.many .h:not(.row) { font-size: 0.52em; }
.grid .h.row { justify-content: flex-start; text-align: left; } /* (the glazes, down the side) */
#hud .cell {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1.3;
  padding: 0.1em 0.2em;
  background: #efe6df;
  border: 0.12em solid var(--ink);
  border-radius: 0.5em;
}
.cell .dn { width: 86%; }
.cell:not(.found) .dn { filter: brightness(0); opacity: 0.14; }
.cell b { position: absolute; font-size: 0.85em; color: rgba(58, 34, 48, 0.5); }
#hud .cell.found { background: #fff; }
.cell.found b { display: none; }
#hud .cell.of-day { border-color: #b8700f; box-shadow: 0 0 0 0.14em #f0b02c; }
.cell.of-day::after {
  content: attr(data-times);
  position: absolute;
  top: -0.45em;
  right: -0.35em;
  padding: 0 0.3em;
  font-size: 0.55em;
  font-weight: 700;
  color: var(--ink);
  background: #ffe27a;
  border: 0.12em solid var(--ink);
  border-radius: 99px;
}
#hud .cell.chosen { background: #fff3c4; box-shadow: 0 0 0 0.16em var(--pink); }
#hud .cell.chosen.of-day { box-shadow: 0 0 0 0.16em var(--pink), 0 0 0 0.3em #f0b02c; }
.cell:focus-visible, #hud .make:focus-visible { outline: 0.14em solid #fff; outline-offset: 0.14em; }
.about { display: flex; align-items: center; justify-content: center; gap: 0.7em; min-height: 2.5em; margin-top: 0.5em; font-size: 0.7em; text-align: left; }
.about p { margin: 0; font-size: 1em; }
.about em { font-style: normal; font-weight: 700; color: var(--mint); }

#hint {
  position: absolute;
  left: 50%;
  bottom: max(2.6vh, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  margin: 0;
  color: #fff;
  font-size: 0.85em;
  font-weight: 500;
  background: rgba(58, 34, 48, 0.62);
  padding: 0.3em 0.35em 0.3em 0.95em;
  border-radius: 99px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.7em;
}
/* Skip: small to look at, with a tap area bigger than it (phones) */
#hud #hintSkip {
  position: relative;
  color: #fff;
  font-size: 0.85em;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.16);
  border: 0.1em solid rgba(255, 255, 255, 0.6);
  border-radius: 99px;
  padding: 0.1em 0.8em 0.15em;
}
#hintSkip::after { content: ""; position: absolute; inset: -0.7em -0.5em; }
#hintSkip:hover { background: rgba(255, 255, 255, 0.3); }
#hintSkip:focus-visible { outline: 0.14em solid #fff; outline-offset: 0.14em; }
/* the guided start's "buy this": a gold ring pulsing round the shop button, and a gold arrow nudging at it */
.buy.guide { position: relative; animation: guide 1s ease-in-out infinite; }
.buy.guide::before {
  content: "";
  position: absolute;
  right: calc(100% + 0.45em);
  top: 50%;
  border-style: solid;
  border-width: 0.6em 0 0.6em 0.85em;
  border-color: transparent transparent transparent var(--guide);
  filter: drop-shadow(0.06em 0.1em 0 var(--ink));
  transform: translateY(-50%);
  animation: guide-point 1s ease-in-out infinite;
}
@keyframes guide {
  0%, 100% { box-shadow: 0 0.24em 0 var(--red-dark), 0 0 0 0.16em var(--guide); }
  50% { box-shadow: 0 0.24em 0 var(--red-dark), 0 0 0 0.36em rgba(255, 207, 64, 0.7); }
}
@keyframes guide-point { 50% { transform: translate(-0.45em, -50%); } }
/* the first customer's Make it: the same gold ring (no arrow: the ticket sits at the screen's edge) */
#order .make.guide { animation: guide-make 1s ease-in-out infinite; }
@keyframes guide-make {
  0%, 100% { box-shadow: 0 0.18em 0 #1d5a3f, 0 0 0 0.16em var(--guide); }
  50% { box-shadow: 0 0.18em 0 #1d5a3f, 0 0 0 0.36em rgba(255, 207, 64, 0.7); }
}
@media (prefers-reduced-motion: reduce) {
  .buy.guide, .buy.guide::before, #order, #order.late, #order .make.guide, #rush, #btnGoals.done, #btnGoals.guide { animation: none; }
  #btnGoals.guide { box-shadow: 0 0.2em 0 #b8700f, 0 0 0 0.22em var(--guide); }
  .buy.guide { box-shadow: 0 0.24em 0 var(--red-dark), 0 0 0 0.22em var(--guide); }
  #order .make.guide { box-shadow: 0 0.18em 0 #1d5a3f, 0 0 0 0.22em var(--guide); }
}
