/* ===== Solitaire Potions theme layer (after art.css). Layout untouched: only skins.
   The gold category card is a potion: --fill (0-100%, set by potFill in app.js from the word count) raises a liquid in the
   category's own colour (--cc), with a glass highlight and a sloshing surface when a word lands (.hit). */
.k-c .front {
  background:
    linear-gradient(
      90deg,
      transparent 9%,
      rgba(255, 255, 255, 0.42) 12%,
      rgba(255, 255, 255, 0.08) 17%,
      transparent 21%
    ),
    linear-gradient(165deg, #fff1b0, #ffd35a 40%, #f5a524);
}
.k-c .front > * {
  z-index: 1;
}
.k-c .front::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--fill, 0%);
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.85) 0 calc(var(--cw) * 0.025),
      transparent calc(var(--cw) * 0.025)
    ),
    radial-gradient(
        circle at 30% 70%,
        rgba(255, 255, 255, 0.55) 0 calc(var(--cw) * 0.025),
        transparent calc(var(--cw) * 0.03)
      )
      0 0 / calc(var(--cw) * 0.34) calc(var(--cw) * 0.34),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--cc, #3ee0c8) 46%, #fff),
      color-mix(in srgb, var(--cc, #3ee0c8) 66%, #fff)
    );
  opacity: 0.86;
  transition: height 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: potBub 2.4s linear infinite;
}
/* bubbles drift up inside the liquid */
@keyframes potBub {
  to {
    background-position:
      0 0,
      0 calc(var(--cw) * -0.34),
      0 0;
  }
}
.k-c.hit .front::after {
  animation:
    potBub 2.4s linear infinite,
    potSlosh 0.5s ease-out;
}
@keyframes potSlosh {
  30% {
    transform: skewY(-4deg) scaleY(1.06);
  }
  60% {
    transform: skewY(3deg);
  }
  100% {
    transform: none;
  }
}
.k-c.covered .front::after {
  display: none;
}
/* full bottle: the glass glows in its colour */
.k-c.full .front {
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.7),
    0 0 0 3px var(--cc),
    0 0 18px 4px color-mix(in srgb, var(--cc) 70%, transparent),
    0 6px 14px rgba(40, 10, 0, 0.35);
}
.k-c .crown {
  width: 28%;
  top: 7%;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.6));
}
.k-c .crown svg {
  color: #9a4f06;
}
/* card backs: deep violet glass with tiny stars, gold rim (the world colours still tint them) */
.back {
  background:
    radial-gradient(circle, rgba(255, 240, 190, 0.28) 0 7%, transparent 9%) 0 0 / calc(var(--cw) * 0.22)
      calc(var(--cw) * 0.22),
    radial-gradient(circle, rgba(160, 255, 235, 0.18) 0 5%, transparent 7%) calc(var(--cw) * 0.11)
      calc(var(--cw) * 0.11) / calc(var(--cw) * 0.22) calc(var(--cw) * 0.22),
    radial-gradient(
      120% 90% at 50% 20%,
      color-mix(in srgb, var(--b1) 55%, #8b5cf0),
      color-mix(in srgb, var(--b2) 45%, #2b1d3d)
    );
  box-shadow:
    inset 0 0 0 calc(var(--cw) * 0.045) #f6d27a,
    inset 0 0 0 calc(var(--cw) * 0.065) rgba(40, 10, 60, 0.35),
    0 2px 0 rgba(40, 15, 50, 0.38),
    0 5px 12px rgba(20, 5, 35, 0.3);
}
.back::after {
  inset: 26% 22%;
}
.card.deep .back {
  box-shadow:
    inset 0 0 0 calc(var(--cw) * 0.045) #f6d27a,
    0 1px 0 rgba(40, 15, 50, 0.3);
}
/* empty foundation slots: a dashed flask spot in magic teal */
.slot.f {
  border-color: rgba(120, 240, 215, 0.4);
  background: rgba(62, 224, 200, 0.06);
  color: rgba(140, 245, 225, 0.5);
}
.mini.cat {
  background: linear-gradient(165deg, #fff1b0, #ffd35a 40%, #f5a524);
}
@media (prefers-reduced-motion: reduce) {
  .k-c .front::after {
    animation: none;
  }
}
.calm .k-c .front::after {
  animation: none !important;
  transition-duration: 0.2s;
}
/* bubbles inside the bottle (potBubbles): from the bottom to the liquid surface, then pop */
.pBub {
  position: absolute;
  bottom: 5%;
  width: calc(var(--cw) * var(--s, 0.07));
  aspect-ratio: 1;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    circle at 35% 32%,
    #fff 0 16%,
    rgba(255, 255, 255, 0.4) 20%,
    rgba(255, 255, 255, 0.1) 58%,
    transparent 70%
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  animation: pBubUp var(--d, 0.8s) cubic-bezier(0.3, 0.6, 0.5, 1) both;
}
@keyframes pBubUp {
  0% {
    transform: translateY(0) scale(0.35);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
    transform: translate(calc(var(--cw) * 0.02), calc(var(--ch) * -0.95 * var(--h, 0.5))) scale(1);
  }
  100% {
    transform: translate(calc(var(--cw) * 0.02), calc(var(--ch) * -0.95 * var(--h, 0.5))) scale(1.6);
    opacity: 0;
  }
}
/* Minty's teleport (buddy.js bdInk): violet magic smoke instead of the octopus ink */
#buddy .ink {
  background: radial-gradient(
    circle,
    #f4e6ff 0 20%,
    #b58cff 45%,
    rgba(139, 92, 240, 0.55) 65%,
    transparent 72%
  );
  box-shadow: 0 0 10px 3px rgba(181, 140, 255, 0.55);
  width: 18px;
  height: 18px;
}

/* ---------- the match is played on a witch's alchemy table (no blurred map behind the cards).
   table-v in portrait, table-h in landscape; the world tints the velvet a little (--t1), and the candles flicker. */
/* the edges where the HUD and the boosters sit are dimmed, so their text reads over the candles and crystals */
/* one painted table per world: potTable() (src/potions.js) sets --tv / --th */
#artBg .ab-table {
  inset: -2%;
  background-image:
    linear-gradient(
      180deg,
      rgba(14, 6, 26, 0.72),
      rgba(14, 6, 26, 0.25) 9%,
      transparent 15%,
      transparent 82%,
      rgba(14, 6, 26, 0.35) 90%,
      rgba(14, 6, 26, 0.78)
    ),
    var(--tv, url(../assets/game/table-v.webp));
}
@media (min-aspect-ratio: 1/1) {
  #artBg .ab-table {
    background-image:
      linear-gradient(
        90deg,
        rgba(14, 6, 26, 0.78),
        rgba(14, 6, 26, 0.35) 9%,
        transparent 16%,
        transparent 84%,
        rgba(14, 6, 26, 0.35) 91%,
        rgba(14, 6, 26, 0.78)
      ),
      var(--th, url(../assets/game/table-h.webp));
  }
}
#artBg .ab-table::after {
  content: "";
  position: absolute;
  inset: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  background:
    radial-gradient(28% 22% at 6% 8%, rgba(255, 170, 70, 0.35), transparent 70%),
    radial-gradient(28% 22% at 94% 8%, rgba(255, 170, 70, 0.3), transparent 70%),
    radial-gradient(28% 22% at 6% 94%, rgba(255, 170, 70, 0.3), transparent 70%),
    radial-gradient(28% 22% at 94% 94%, rgba(255, 170, 70, 0.35), transparent 70%);
  animation: candle 3.1s steps(1) infinite;
}
@keyframes candle {
  0% {
    opacity: 0.85;
  }
  12% {
    opacity: 1;
  }
  19% {
    opacity: 0.75;
  }
  31% {
    opacity: 0.95;
  }
  46% {
    opacity: 0.8;
  }
  58% {
    opacity: 1;
  }
  71% {
    opacity: 0.86;
  }
  84% {
    opacity: 0.97;
  }
}
body[data-scr="game"] #artBg .ab-table {
  opacity: 1;
}
body[data-scr="game"] #artBg .ab-w.on {
  opacity: 0;
}
.calm #artBg .ab-table::after {
  animation: none;
}

/* ---------- painted board icons (assets/game): card back, the potion on the category card, empty flask spots, the joker wand */
.art .back {
  background:
    url(../assets/game/card-back.webp) center/cover no-repeat,
    #3a1f63;
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 140, 0.5),
    0 2px 0 rgba(40, 15, 50, 0.38),
    0 5px 12px rgba(20, 5, 35, 0.3);
}
.art .back::after {
  display: none;
}
.art .card.deep .back {
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 140, 0.5),
    0 1px 0 rgba(40, 15, 50, 0.3);
}
.art .k-c .crown {
  background: url(../assets/game/potion-cat.webp) center/contain no-repeat;
  width: 34%;
  top: 5%;
  filter: drop-shadow(0 2px 2px rgba(90, 40, 0, 0.35));
}
.art .k-c .crown svg {
  visibility: hidden;
}
.art .slot.f {
  background:
    url(../assets/game/flask-empty.webp) center/46% no-repeat,
    rgba(62, 224, 200, 0.06);
}
.art .slot.f svg {
  visibility: hidden;
}
.art .k-j .jstar {
  background: url(../assets/game/joker.webp) center/contain no-repeat;
  filter: drop-shadow(0 2px 2px rgba(40, 0, 40, 0.35));
}
.art .k-j .jstar svg {
  visibility: hidden;
}

/* ---------- the cork that pops off a full bottle (potCork) */
.potCork {
  position: fixed;
  width: 44px;
  height: 44px;
  background: url(../assets/game/cork.webp) center/contain no-repeat;
  pointer-events: none;
  z-index: 62;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35));
}

/* ---------- potion shelf (openShelf): painted planks, one potion per category tinted to its colour, empty flasks for the rest */
.shelfBtn {
  position: relative;
  margin-left: auto;
  margin-right: 8px;
}
.shelfBtn .shIc {
  width: 62%;
  height: 62%;
  background: url(../assets/game/potion-cat.webp) center/contain no-repeat;
}
.shelfBtn .dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 84, 104, 0.3);
}
.sheet.shelfSheet {
  width: min(860px, 96vw);
  max-width: none;
  max-height: 94vh;
  gap: 10px;
  padding: 14px 16px 12px;
}
/* painted crest with the title on its empty panel */
.shCrest {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 900/295;
  margin: -4px auto -6px;
  background: url(../assets/game/shelf-crest.webp) center/contain no-repeat;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
}
.shCrest b {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 40%;
  bottom: 16%;
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff;
  font: 800 clamp(17px, 4.6vw, 30px)/1 var(--f-display);
  white-space: nowrap;
  text-shadow:
    0 2px 0 #3a1608,
    0 0 2px #3a1608,
    0 0 14px rgba(255, 214, 120, 0.45);
}
.shProg {
  position: relative;
  height: 30px;
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.14);
  overflow: hidden;
  margin: 0 2px;
}
.shProg > i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  min-width: 30px;
  border-radius: 15px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.55) 0 2px, transparent 3px) 0 0/22px 22px,
    linear-gradient(90deg, #24b98e, #3ee0c8);
  box-shadow: 0 0 14px rgba(62, 224, 200, 0.7);
  animation: shBub 3s linear infinite;
}
@keyframes shBub {
  to {
    background-position:
      22px -22px,
      0 0;
  }
}
.shProg > b {
  position: relative;
  display: block;
  text-align: center;
  font: 800 14px/30px var(--f-card);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}
/* the cabinet: thick carved wood frame, violet back wall, vertical scroll only, light motes drifting over the glass */
.shCab {
  position: relative;
  border-radius: 22px;
  padding: 10px;
  background: linear-gradient(180deg, #7a4627, #4a2614 70%, #3a1d0f);
  box-shadow:
    inset 0 2px 0 rgba(255, 214, 150, 0.4),
    inset 0 -4px 0 rgba(0, 0, 0, 0.4),
    inset 0 0 0 2px rgba(255, 190, 90, 0.25),
    0 10px 24px rgba(0, 0, 0, 0.45);
}
.shScroll {
  max-height: max(260px, calc(94vh - 290px));
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 14px;
  padding: 18px 12px 6px;
  background:
    radial-gradient(70% 50% at 50% 0, rgba(160, 110, 255, 0.32), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 54px),
    linear-gradient(180deg, #311a4f, #1b0e30);
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.65);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}
.shCab .shMotes {
  inset: 10px;
  border-radius: 14px;
  z-index: 2;
}
.shRow {
  --pk: 30px;
  margin-bottom: 20px;
}
.shPots,
.shTags {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: 8px;
  padding: 0 3%;
}
.shPots {
  position: relative;
  z-index: 1;
  align-items: end;
}
.shItem {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: clamp(78px, 17vw, 112px);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
/* contact shadow: the bottle sits on the wood */
.shItem::after {
  content: "";
  position: absolute;
  left: 24%;
  right: 24%;
  bottom: -3px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(20, 6, 0, 0.6), transparent);
  z-index: -1;
}
.shPot {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  background: url(../assets/game/flask-shelf.webp) center bottom/contain no-repeat;
  opacity: 0.5;
  filter: saturate(0.6);
  transform-origin: 50% 100%;
}
.shItem.on .shPot {
  background-image: url(../assets/game/potion-shelf.webp);
  opacity: 1;
  filter: hue-rotate(var(--hue)) saturate(1.15);
}
.shGlow {
  position: absolute;
  left: 50%;
  top: 55%;
  width: 120%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--cc) 75%, transparent), transparent);
  animation: shGlow 2.6s ease-in-out infinite;
  pointer-events: none;
}
.shItem:nth-child(2n) .shGlow {
  animation-delay: -1.1s;
}
.shItem:nth-child(3n) .shGlow {
  animation-delay: -1.9s;
}
@keyframes shGlow {
  0%,
  100% {
    opacity: 0.45;
    scale: 0.9;
  }
  50% {
    opacity: 0.85;
    scale: 1.05;
  }
}
/* a glint runs over the glass of every brewed potion */
.shItem.on .shPot::after {
  content: "";
  position: absolute;
  left: 38%;
  top: 42%;
  width: 12%;
  aspect-ratio: 1;
  background: #fff;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: shTw 2.4s ease-in-out infinite;
  opacity: 0;
}
.shItem:nth-child(2n).on .shPot::after {
  animation-delay: -0.9s;
}
.shItem:nth-child(3n).on .shPot::after {
  animation-delay: -1.7s;
}
@keyframes shTw {
  0%,
  60%,
  100% {
    opacity: 0;
    transform: scale(0.3);
  }
  75% {
    opacity: 1;
    transform: scale(1) rotate(45deg);
  }
}
.shItem em {
  position: absolute;
  top: 2px;
  right: 8%;
  font: 800 12px/1 var(--f-card);
  font-style: normal;
  padding: 3px 7px;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffe07a, #f5a524);
  color: #5b2a00;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  z-index: 2;
}
/* the plank: its wood starts at 13.9% of the image height, the bottles' glass ends at the image bottom, so they meet */
.shPlank {
  display: block;
  height: var(--pk);
  margin: calc(var(--pk) * -0.139 - 2px) -1% 0;
  background: url(../assets/game/shelf.webp) center top/100% 100% no-repeat;
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.5));
}
.shTags {
  margin-top: 4px;
}
.shTag {
  justify-self: center;
  max-width: 100%;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.78);
  font: 700 clamp(10.5px, 2.9vw, 12px)/1.15 var(--f-card);
  text-align: center;
  overflow: hidden;
  overflow-wrap: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  align-self: start;
}
.shTag.on {
  background: color-mix(in srgb, var(--cc) 62%, #1a0630);
  color: #fff;
  box-shadow:
    0 0 0 1.5px color-mix(in srgb, var(--cc) 80%, #fff),
    0 2px 6px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}
.shFoot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
}
.shFoot .masc {
  --ms: 56px;
  margin: -14px 0 -6px;
}
.shLock {
  margin: 0;
  font: 700 13px/1.3 var(--f-card);
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
}
@media (min-width: 760px) {
  .shRow {
    --pk: 34px;
  }
  .shTag {
    font-size: 13px;
  }
  .shFoot .masc {
    --ms: 64px;
  }
}
.calm .shGlow,
.calm .shProg > i,
.calm .shItem.on .shPot::after {
  animation: none;
}
.calm .shMotes {
  display: none;
}

/* ---------- home: bubbles and goo drops from the cauldron, light motes over the menu */
.hfx,
.hmotes {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
/* a steam bubble: the outer <i> rises (WAAPI), the inner <b> wobbles; on pop the film goes and a ring + droplets flash */
.hfx .hb {
  position: absolute;
}
.hfx .hb > b {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at 34% 30%,
    rgba(255, 255, 255, 0.95) 0 13%,
    rgba(190, 255, 225, 0.35) 22%,
    rgba(60, 230, 160, 0.18) 55%,
    rgba(120, 255, 200, 0.75) 70%,
    rgba(60, 220, 150, 0) 76%
  );
  box-shadow: 0 0 10px 2px rgba(90, 255, 180, 0.35);
  animation: hbWob var(--wt, 0.6s) ease-in-out infinite alternate;
}
@keyframes hbWob {
  from {
    transform: translateX(calc(var(--wob, 3px) * -1)) scale(1.07, 0.93);
  }
  to {
    transform: translateX(var(--wob, 3px)) scale(0.93, 1.07);
  }
}
.hfx .hb.pop > b {
  display: none;
}
.hfx .hb .hr {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(200, 255, 230, 0.9);
  box-shadow: 0 0 8px rgba(90, 255, 180, 0.6);
}
.hfx .hb .hs {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  margin: -1.5px;
  border-radius: 50%;
  background: #c8ffe4;
  box-shadow: 0 0 4px rgba(90, 255, 180, 0.8);
}
.hmotes i {
  position: absolute;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: #fff1c2;
  box-shadow: 0 0 8px 3px rgba(255, 214, 120, 0.55);
  opacity: 0;
  animation: hMote var(--d) ease-in-out infinite;
}
.hmotes i.t {
  background: #d8fff4;
  box-shadow: 0 0 8px 3px rgba(80, 240, 200, 0.5);
}
@keyframes hMote {
  0% {
    opacity: 0;
    transform: translate(0, 0);
  }
  20% {
    opacity: 0.9;
  }
  45% {
    opacity: 0.35;
  }
  60% {
    opacity: 0.85;
    transform: translate(var(--dx), -28px);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--dx) * -0.5), -64px);
  }
}
.calm .hmotes,
.calm .hfx {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .hmotes,
  .hfx {
    display: none;
  }
}

/* ---------- home: only Daily gift and Challenge under Play, side by side and as wide as Play (the Shop opens from the coins) */
.homeRow .htile {
  flex-direction: row;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 64px;
  font-size: 15px;
  text-align: left;
}
.homeRow .htile span {
  line-height: 1.15;
}
.art .homeRow .htile i {
  width: 54px;
  height: 54px;
  margin: -6px 0;
  flex: none;
}
@media (min-width: 1100px) and (min-height: 720px) {
  .homeRow .htile {
    min-height: 76px;
    font-size: 17px;
  }
  .art .homeRow .htile i {
    width: 62px;
    height: 62px;
  }
}
@media (max-height: 500px) {
  .homeRow .htile {
    min-height: 52px;
    padding: 6px 10px;
  }
  .art .homeRow .htile i {
    width: 42px;
    height: 42px;
  }
}

/* === UPGRADE 2026-11-09 === table finish, reward, journey (docs/o-que-melhoraria/jogo-20261109) */
/* 1 HUD on dark plates with a gold rim, readable over every painted table */
#hud .lvl,
#hud .menuBtn,
#hud .pill {
  background: linear-gradient(180deg, rgba(38, 16, 58, 0.82), rgba(16, 6, 28, 0.86));
  border: 1.5px solid rgba(255, 201, 74, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 4px 10px rgba(0, 0, 0, 0.38);
}
#hud .lvl {
  padding: 5px 10px 6px;
  border-radius: 16px;
}
#hud .moves.low {
  background: rgba(255, 60, 90, 0.42);
  border-color: var(--red);
}
#hLevel,
#hWorld,
.cmbTxt,
#hud .pill b {
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}
/* 2 the "how much is left" counter becomes a gold pill */
.progRow {
  width: min(170px, 100%);
  gap: 7px;
}
.prog {
  height: 9px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
#hCats {
  font: 800 14px/1 var(--f-display);
  color: var(--gold);
  padding: 3px 8px 2px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 201, 74, 0.5);
}
/* 6 thicker combo bar, so you can see it drain */
.cmbBar {
  width: min(130px, 100%);
  height: 9px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 176, 224, 0.35);
}
.cmbBar i {
  border-radius: 5px;
}
/* 3 category card: a parchment label on the bottle (liquid stays visible above and below it) */
.k-c:not(.covered) .front::before {
  inset: 31% 6% 20%;
  z-index: 1;
  border-radius: calc(var(--cw) * 0.06);
  border: 1px solid rgba(140, 80, 10, 0.55);
  background: linear-gradient(180deg, rgba(255, 251, 238, 0.93), rgba(250, 235, 200, 0.9));
  box-shadow:
    0 0 0 calc(var(--cw) * 0.016) rgba(255, 246, 220, 0.5),
    0 calc(var(--cw) * 0.014) calc(var(--cw) * 0.03) rgba(90, 40, 0, 0.3);
}
/* 4 word card: thin gold border and small corner studs (text untouched) */
.k-w:not(.covered) .front::before {
  border: 1px solid rgba(176, 122, 42, 0.5);
  box-shadow: inset 0 0 0 calc(var(--cw) * 0.012) rgba(255, 255, 255, 0.55);
}
.k-w:not(.covered) .front::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  --d: calc(var(--cw) * 0.1);
  --r: calc(var(--cw) * 0.016);
  background:
    radial-gradient(
      circle at var(--d) var(--d),
      rgba(176, 122, 42, 0.6) 0 var(--r),
      transparent calc(var(--r) + 1px)
    ),
    radial-gradient(
      circle at calc(100% - var(--d)) var(--d),
      rgba(176, 122, 42, 0.6) 0 var(--r),
      transparent calc(var(--r) + 1px)
    ),
    radial-gradient(
      circle at var(--d) calc(100% - var(--d)),
      rgba(176, 122, 42, 0.6) 0 var(--r),
      transparent calc(var(--r) + 1px)
    ),
    radial-gradient(
      circle at calc(100% - var(--d)) calc(100% - var(--d)),
      rgba(176, 122, 42, 0.6) 0 var(--r),
      transparent calc(var(--r) + 1px)
    );
}
/* 5 name plates under the tools */
.boost .nm {
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(16, 6, 28, 0.76);
  border: 1px solid rgba(255, 201, 74, 0.42);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}
.boost:not(.b-more) .nm {
  color: var(--txt);
}
/* 8 the corked potion that flies to the progress bar */
.potFly {
  position: fixed;
  left: 0;
  top: 0;
  width: clamp(42px, 6vw, 60px);
  aspect-ratio: 3/4;
  background: url(../assets/game/potion-shelf.webp) center/contain no-repeat;
  filter: hue-rotate(var(--hue)) saturate(1.15) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
  pointer-events: none;
  z-index: 62;
  will-change: transform;
}
/* 7 win sheet: the level's potions, a brighter Perfect line, rays behind the coins */
.wpots {
  display: flex;
  justify-content: center;
  gap: clamp(3px, 1.4vw, 10px);
  margin: -6px 0 4px;
}
.wpot {
  width: clamp(28px, 8vw, 42px);
  aspect-ratio: 3/4;
  background: url(../assets/game/potion-shelf.webp) center bottom/contain no-repeat;
  filter: hue-rotate(var(--hue)) saturate(1.15) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.45));
  opacity: 0;
  transform: translateY(10px) scale(0.5);
}
.wpot.on {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.2s,
    transform 0.45s var(--spring);
}
.calm .wpot {
  opacity: 1;
  transform: none;
  transition: none;
}
.win .wrow {
  box-shadow: inset 0 0 0 1px rgba(255, 201, 74, 0.25);
}
.win .wrow.perfect {
  background: linear-gradient(90deg, rgba(63, 214, 166, 0.42), rgba(63, 214, 166, 0.14));
  box-shadow:
    inset 0 0 0 1.5px rgba(157, 255, 224, 0.75),
    0 0 14px rgba(63, 214, 166, 0.35);
  color: #d2fff2;
  font-size: 17px;
}
.win .wrow.tot {
  box-shadow: inset 0 0 0 1.5px rgba(255, 201, 74, 0.65);
}
.win .sheetCoins {
  position: relative;
  isolation: isolate;
}
.win .sheetCoins::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 170px;
  height: 170px;
  margin: -85px 0 0 -85px;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  background: repeating-conic-gradient(rgba(255, 224, 130, 0.4) 0 9deg, transparent 9deg 24deg);
  -webkit-mask: radial-gradient(closest-side, #000 25%, transparent);
  mask: radial-gradient(closest-side, #000 25%, transparent);
  animation: wRays 12s linear infinite;
}
@keyframes wRays {
  to {
    rotate: 360deg;
  }
}
.calm .win .sheetCoins::before {
  animation: none;
}
@media (max-height: 500px) {
  .wpots {
    display: none;
  }
  .win .sheetCoins::before {
    width: 110px;
    height: 110px;
    margin: -55px 0 0 -55px;
  }
}
/* 9 map: glowing travelled path, bigger stars, a halo on the current level, quieter locked levels, wider on desktop */
.pdone {
  stroke-width: 9px;
  filter: drop-shadow(0 0 5px rgba(255, 211, 90, 0.85));
}
.art .node .ns i {
  width: 20px;
  height: 20px;
}
.art .node .ns i:nth-child(2) {
  width: 24px;
  height: 24px;
  margin-top: 3px;
}
.node.cur::before {
  content: "";
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(closest-side, transparent 68%, rgba(255, 226, 120, 0.7) 74%, transparent);
  animation: curGlow 1.6s ease-in-out infinite;
}
@keyframes curGlow {
  50% {
    transform: scale(1.12);
    opacity: 0.55;
  }
}
.node.lock {
  filter: saturate(0.55) brightness(0.85);
}
.calm .node.cur::before {
  animation: none;
}
@media (min-width: 1100px) and (min-height: 720px) {
  #mapInner {
    width: min(720px, 100%);
  }
}
/* 11 home: a soft cauldron glow behind the logo */
.art .logoArt {
  isolation: isolate;
}
.art .logoArt::before {
  content: "";
  position: absolute;
  inset: -14% -10%;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    rgba(110, 255, 205, 0.26),
    rgba(150, 95, 255, 0.14) 55%,
    transparent
  );
  animation: cauldGlow 4.2s ease-in-out infinite;
}
@keyframes cauldGlow {
  50% {
    opacity: 0.6;
    transform: scale(0.94);
  }
}
.calm .logoArt::before {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .logoArt::before,
  .node.cur::before,
  .win .sheetCoins::before {
    animation: none;
  }
}
@media (max-width: 420px) {
  #hud {
    gap: 6px;
  }
  #hud .lvl {
    padding-inline: 5px;
  }
  .cmbTxt {
    font-size: clamp(13px, 4.1vw, 17px);
  }
}
/* === /UPGRADE 2026-11-09 === */

/* alchemy circle under a finished potion (potRunes in potions.js) */
.pRunes {
  position: absolute;
  width: calc(var(--cw) * 2.5);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 0 5px var(--rc)) drop-shadow(0 0 1px #fff6d0);
}
.pRunes svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: color-mix(in srgb, var(--rc) 40%, #ffe7a0);
  stroke-width: 1.3;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.pRunes .f {
  fill: color-mix(in srgb, var(--rc) 40%, #ffe7a0);
  stroke: none;
}
.pRunes .rr {
  animation: pRspin 7s linear infinite;
}
.pRunes .ri {
  animation: pRspin 4.5s linear infinite reverse;
}
@keyframes pRspin {
  to {
    rotate: 360deg;
  }
}
.calm .pRunes .rr,
.calm .pRunes .ri {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .pRunes .rr,
  .pRunes .ri {
    animation: none;
  }
}

/* painted tutorial hand (assets/game/hand.webp); fingertip stays where the svg one was (~42% x, top) */
.art #hand {
  width: 58px;
  height: 72px;
  background: url(../assets/game/hand.webp) center top/contain no-repeat;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.4));
}
.art #hand svg {
  visibility: hidden;
}
/* "0/4" sits inside a thicker bar, so the bar is centred under the level name */
.progRow {
  position: relative;
  width: min(150px, 100%);
  display: block;
}
.prog {
  height: 18px;
  border-radius: 9px;
  border: 1px solid rgba(255, 201, 74, 0.55);
}
.prog i {
  border-radius: 9px;
}
#hCats {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: #fff;
  font: 800 13px/1 var(--f-display);
  text-shadow:
    0 1px 0 #3a1d00,
    1px 0 0 #3a1d00,
    -1px 0 0 #3a1d00,
    0 -1px 0 #3a1d00,
    0 2px 3px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
/* no ads: Continue alone, centred */
.win .wbtns {
  grid-template-columns: minmax(0, 300px);
  justify-content: center;
}
/* Minty bigger on the map */
.mapMasc,
.mapMasc .masc {
  --ms: 94px;
}
@media (min-width: 1100px) and (min-height: 720px) {
  .mapMasc,
  .mapMasc .masc {
    --ms: 108px;
  }
}
/* Minty docked in the left HUD column (desktop) faces the table */
#buddy.dock .masc img {
  scale: -1 1;
}
@media (min-aspect-ratio: 5/4) {
  #hud .lvl {
    padding-inline: 6px;
  }
  #hWorld {
    letter-spacing: 0.05em;
  }
}
#hWorld {
  letter-spacing: 0.05em;
}
/* the painted Minty swings like a pendulum when the whole picture rotates: no looping side-to-side rock (sway, excited head, wobble) */
.masc.masc[data-bd="bounce"] .mHead,
.masc.masc[data-bd="sway"] .mHead,
.masc.masc[data-bd="wobble"] .mHead {
  animation: none;
}
/* perf: the tinted potions and the rotating rays get their own layers, so the win sheet is not repainted every frame */
.wpot,
.win .sheetCoins::before {
  will-change: transform;
}
/* mobile Chrome/Safari: layered children of the front (label, text, counter) ignore backface-visibility and show mirrored through
   the card back. Hide the front while the card is face down; it switches halfway through the .44s flip, so the turn still reads. */
.card .front {
  transition: visibility 0s 0.2s;
}
.card.down .front {
  visibility: hidden;
}
/* End of css/potions.css */
