:root {
  --sky-top: #6f8db9;
  --sky-mid: #adb7d1;
  --sky-low: #f0cbaa;
  --sun: rgba(255, 236, 205, 0.6);
  --ink: #1f2a44;
  --ink-soft: #4a5672;
  --wood: #7a4b33;
  --wood-hi: #a16b4a;
  --wood-lo: #4f2d1f;
  --glass: rgba(255, 255, 255, 0.92);
  --glass-fill: rgba(255, 255, 255, 0.16);
  --panel: rgba(255, 252, 248, 0.82);
  --sheet: #fffaf4;
  --bw: 56px;
  --pour-ms: 400ms;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  font-family: "Baloo 2", ui-rounded, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 14%, var(--sun), transparent 38%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 48%, var(--sky-low) 100%);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

button { font: inherit; color: inherit; }

.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: calc(var(--sg-corner-top) - 6px) 16px calc(var(--safe-bottom) + 14px);
  max-width: 720px;
  margin: 0 auto;
}

/* Header */
.top {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  min-height: 56px;
}
.top h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 2px 0 rgba(31, 42, 68, 0.18);
}
.icon-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.24);
  cursor: pointer;
}
.icon-btn:disabled { opacity: 0.4; cursor: default; }
.icon-btn svg, .ctl svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn svg { stroke: #fff; }

.tip {
  margin: 2px auto 0;
  max-width: 30ch;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  color: #fff;
  text-shadow: 0 1px 0 rgba(31, 42, 68, 0.2);
}

/* Cat theme: paw-print accents, the shelf cat, the win cameo */
.top h1::before, .top h1::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin: 0 0.35em;
  vertical-align: 0.05em;
  background: currentColor;
  opacity: 0.55;
  -webkit-mask: var(--paw) center / contain no-repeat;
  mask: var(--paw) center / contain no-repeat;
}
.top h1::after { transform: rotate(18deg); }
.top h1::before { transform: rotate(-18deg); }
:root {
  --paw: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 88C30 88 24 70 34 60C42 52 58 52 66 60C76 70 70 88 50 88Z'/%3E%3Cellipse cx='22' cy='52' rx='10' ry='13' transform='rotate(-20 22 52)'/%3E%3Cellipse cx='40' cy='36' rx='10' ry='13' transform='rotate(-8 40 36)'/%3E%3Cellipse cx='60' cy='36' rx='10' ry='13' transform='rotate(8 60 36)'/%3E%3Cellipse cx='78' cy='52' rx='10' ry='13' transform='rotate(20 78 52)'/%3E%3C/svg%3E");
}
.cat-shelf {
  position: relative;
  flex: 0 0 auto;
  height: 54px;
  margin: 0 0 6px;
  pointer-events: none;
}
.cat-shelf::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--wood-hi) 0%, var(--wood) 45%, var(--wood-lo) 100%);
  box-shadow: 0 6px 12px -6px rgba(79, 45, 31, 0.45);
}
.shelf-cat {
  position: absolute;
  right: 14%;
  bottom: 8px;
  height: 66px;
  aspect-ratio: 270 / 320;
  z-index: 1;
}
.shelf-cat:empty { display: none; }
.cat-shelf.tight .shelf-cat { height: 40px; }
/* a few of Kento's Shelf's things beside the cat (newest nearest it) */
.shelf-things {
  position: absolute;
  left: 10%;
  right: calc(14% + 64px);
  bottom: 9px;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-end;
  gap: 4px;
  height: 40px;
  overflow: hidden;
}
.shelf-things .thing { flex: none; width: 40px; height: 40px; }
.shelf-things svg { width: 100%; height: 100%; display: block; }
.cat-shelf.tight .shelf-things { height: 28px; right: calc(14% + 40px); }
.cat-shelf.tight .shelf-things .thing { width: 28px; height: 28px; }
.shelf-cat svg { width: 100%; height: 100%; display: block; overflow: visible; }
.cat-head {
  transform-box: fill-box;
  transform-origin: 50% 95%;
  transform: rotate(var(--look, 0deg));
  transition: transform 0.35s ease;
}
.cat-tail { transform-box: fill-box; transform-origin: 0% 100%; }
.shelf-cat.flick .cat-tail { animation: tail-flick 0.9s ease-in-out; }
.shelf-cat.hop { animation: cat-hop 0.8s cubic-bezier(0.3, 0.7, 0.4, 1) 0.1s 2; }
@keyframes tail-flick {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-22deg); }
  45% { transform: rotate(14deg); }
  70% { transform: rotate(-10deg); }
}
@keyframes cat-hop {
  0%, 100% { transform: translateY(0); }
  35% { transform: translateY(-22px) rotate(-4deg); }
  60% { transform: translateY(0); }
}
.win-cat { display: flex; justify-content: center; margin: -8px 0 4px; }
.win-cat:empty { display: none; }
.win-cat svg { width: 64px; height: 64px; }
.sheet p.quip { margin: -2px 0 16px; font-size: 15px; font-style: italic; color: var(--ink-soft); }

/* Board and shelves */
.board {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: calc(var(--bw) * 0.15 + 22px);
}
.row {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: calc(var(--bw) * var(--gapf, 0.32));
  padding: calc(var(--bw) * 0.5) calc(var(--bw) * 0.3) 0;
}
.row::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -11px;
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--wood-hi) 0%, var(--wood) 45%, var(--wood-lo) 100%);
  box-shadow: 0 8px 14px -6px rgba(79, 45, 31, 0.45);
}

.slot {
  position: relative;
  width: var(--bw);
  height: calc(var(--bw) * 3.1);
}

/* Bottle: a test tube with a rim. transform-origin is the mouth, which pours. */
.bottle {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform-origin: 50% 0;
  transition: transform 0.18s cubic-bezier(0.3, 0.7, 0.4, 1);
  z-index: 1;
}
.bottle:focus-visible { outline: none; }
.bottle:focus-visible .tube { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ink); }
.bottle.selected { transform: translateY(calc(var(--bw) * -0.45)); }
.bottle.pouring { z-index: 30; }

.rim {
  position: absolute;
  top: 0;
  left: -9%;
  right: -9%;
  height: calc(var(--bw) * 0.14);
  border: 2.5px solid var(--glass);
  border-radius: calc(var(--bw) * 0.07);
  background: rgba(255, 255, 255, 0.3);
  z-index: 2;
}
.tube {
  position: absolute;
  top: calc(var(--bw) * 0.1);
  left: 0;
  right: 0;
  bottom: 0;
  border: 2.5px solid var(--glass);
  border-top: 0;
  border-radius: 0 0 calc(var(--bw) * 0.5) calc(var(--bw) * 0.5);
  background: var(--glass-fill);
  box-shadow: inset 0 0 0 1px rgba(31, 42, 68, 0.1), 0 10px 16px -10px rgba(31, 42, 68, 0.45);
}
.tube::after {
  content: "";
  position: absolute;
  top: 10%;
  bottom: 14%;
  left: 14%;
  width: 11%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.08));
  pointer-events: none;
  z-index: 2;
}
.liquid {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  top: calc(var(--bw) * 0.2);
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  border-radius: 0 0 calc(var(--bw) * 0.5 - 3px) calc(var(--bw) * 0.5 - 3px);
}
.unit {
  flex: none;
  height: 25%;
  display: grid;
  place-items: center;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--c) 76%, #000) 0%,
    var(--c) 26%,
    color-mix(in srgb, var(--c) 80%, #fff) 52%,
    var(--c) 74%,
    color-mix(in srgb, var(--c) 78%, #000) 100%);
  transition: height var(--pour-ms) linear;
  font-size: calc(var(--bw) * 0.32);
  line-height: 1;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.unit:last-child { box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.38); }
body.marks .unit::before { content: attr(data-mark); }

/* Cork appears on finished bottles */
.cork {
  position: absolute;
  left: 20%;
  right: 20%;
  top: calc(var(--bw) * -0.16);
  height: calc(var(--bw) * 0.34);
  border-radius: calc(var(--bw) * 0.06) calc(var(--bw) * 0.06) calc(var(--bw) * 0.1) calc(var(--bw) * 0.1);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25) 0 12%, transparent 13%),
    linear-gradient(180deg, #d4a676, #a8774d);
  box-shadow: inset 0 -3px 0 rgba(79, 45, 31, 0.25);
  z-index: 3;
  opacity: 0;
}
.bottle.done { cursor: default; }
.bottle.done .cork { opacity: 1; }
.bottle.just-done .cork { animation: cork-in 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.bottle.just-done .tube { animation: glint 0.7s ease-out; }
@keyframes cork-in {
  from { opacity: 0; transform: translateY(calc(var(--bw) * -0.6)) scale(0.8); }
  to { opacity: 1; transform: none; }
}
@keyframes glint {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.9); }
  100% { box-shadow: 0 0 0 calc(var(--bw) * 0.3) rgba(255, 255, 255, 0); }
}

.bottle.shake { animation: shake 0.32s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.bottle.hint-from, .bottle.hint-to { animation: hint 0.75s ease-in-out 3; }
.bottle.hint-from.selected { animation: none; }
@keyframes hint {
  0%, 100% { filter: none; }
  50% { filter: drop-shadow(0 0 8px #fff) drop-shadow(0 0 2px #fff); }
}

.stream {
  position: fixed;
  left: 0;
  top: 0;
  width: 6px;
  height: 0;
  border-radius: 3px;
  pointer-events: none;
  z-index: 25;
  opacity: 0;
  transform-origin: 50% 0;
}

/* Bottom controls */
.controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding-top: 18px;
}
.ctl {
  flex: 1;
  max-width: 132px;
  min-height: 60px;
  border: 0;
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 6px 14px -8px rgba(31, 42, 68, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s;
}
.ctl:active:not(:disabled) { transform: scale(0.95); }
.ctl:disabled { opacity: 0.45; cursor: default; }
.ctl:focus-visible, .icon-btn:focus-visible, .primary:focus-visible, .secondary:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 104px);
  transform: translate(-50%, 12px);
  width: max-content;
  max-width: calc(100vw - 48px);
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(31, 42, 68, 0.94);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
}

/* Dialogs */
.sheet {
  width: min(340px, calc(100vw - 40px));
  border: 0;
  border-radius: 26px;
  padding: 26px 22px 22px;
  background: var(--sheet);
  color: var(--ink);
  box-shadow: 0 24px 60px -20px rgba(31, 42, 68, 0.6);
  text-align: center;
}
.sheet::backdrop { background: rgba(31, 42, 68, 0.38); }
.sheet[open] { animation: sheet-in 0.28s cubic-bezier(0.3, 1.3, 0.5, 1); }
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.sheet h2 { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.1; }
.sheet p { margin: 6px 0 18px; font-size: 17px; color: var(--ink-soft); }

.primary, .secondary {
  display: block;
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.primary { border: 0; background: var(--ink); color: #fff; }
.secondary { border: 2px solid rgba(31, 42, 68, 0.18); background: transparent; color: var(--ink); }

/* Win sheet stars */
.win-stars {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 8px;
  height: 64px;
  margin-bottom: 10px;
}
.star {
  width: 46px;
  height: 46px;
  background: #d9dee8;
  clip-path: polygon(50% 0%, 61.8% 35%, 98% 35%, 68.5% 57%, 79.4% 91%, 50% 70%, 20.6% 91%, 31.5% 57%, 2% 35%, 38.2% 35%);
}
.star.big { width: 58px; height: 58px; margin-bottom: 4px; }
.star.earned.pop {
  background: linear-gradient(160deg, #ffe58a 0%, #f7c948 45%, #e09a1b 100%);
  animation: star-pop 0.42s cubic-bezier(0.3, 1.8, 0.5, 1) both;
}
@keyframes star-pop {
  from { transform: scale(0.2) rotate(-25deg); }
  to { transform: none; }
}
/* What clearing the level unlocked (Kento's Shelf and Looks): a row each */
.win-unlocks {
  display: grid;
  gap: 6px;
  margin: -6px 0 14px;
  padding: 8px;
  border-radius: 16px;
  background: #fff3d6;
  list-style: none;
  text-align: left;
}
.win-unlocks[hidden] { display: none; }
.unlock { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.unlock-pic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; }
.unlock-pic svg { width: 44px; height: 44px; display: block; overflow: visible; }
.unlock-pic .swatch { width: 40px; height: 40px; }
.unlock-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.unlock-text small { font-size: 13px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; }
.unlock-text b { font-size: 17px; color: var(--ink); }
.unlock .unlock-try { flex: none; width: auto; min-height: 44px; padding: 0 12px; font-size: 15px; border-radius: 12px; background: #fff; }
.unlock .unlock-try:disabled { color: #2b7a53; border-color: #3c9a6c; cursor: default; }
.unlock-more { font-size: 14px; font-weight: 700; color: var(--ink-soft); padding: 0 4px 2px; }

/* Title screen: the shared layout (shared/mainmenu.js); these are only Pour Decisions' colors. */
#mm {
  --sg-bg: radial-gradient(circle at 82% 14%, var(--sun), transparent 38%), linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 48%, var(--sky-low) 100%);
  --sg-ink: var(--ink); --sg-ink-soft: var(--ink-soft);
  --sg-title: #fff; --sg-title-shadow: 0 3px 0 var(--wood-lo), 0 8px 14px rgba(31, 42, 68, 0.35);
  --sg-accent: var(--wood); --sg-accent-ink: #fff;
  --sg-card: var(--panel); --sg-card-ink: var(--ink); --sg-line: rgba(31, 42, 68, 0.14);
}
.sg-sheet { --sg-sheet-bg: var(--sheet); --sg-sheet-ink: var(--ink); --sg-accent: var(--wood); --sg-accent-ink: #fff; --sg-ink-soft: var(--ink-soft); }
.star-total {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px !important;
  font-weight: 700;
  color: var(--ink) !important;
}
.star-icon {
  width: 22px;
  height: 22px;
  background: linear-gradient(160deg, #ffe58a, #f7c948 45%, #e09a1b);
  clip-path: polygon(50% 0%, 61.8% 35%, 98% 35%, 68.5% 57%, 79.4% 91%, 50% 70%, 20.6% 91%, 31.5% 57%, 2% 35%, 38.2% 35%);
}
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }

/* Kento's Shelf: the title screen's picture and the sheet */
.shelf-art { width: 100%; height: 150px; display: grid; place-items: end center; }
.shelf-art svg { width: 100%; height: 100%; display: block; overflow: visible; }
.shelf-art .cat-head { transform: none; }
.shelf-box { text-align: left; }
.shelf-box h3 { margin: 16px 0 8px; font-size: 17px; font-weight: 800; color: var(--ink); }
.shelf-art-sheet { height: 120px; margin: -4px 0 8px; border-radius: 16px; background: linear-gradient(180deg, var(--sky-top), var(--sky-mid) 60%, var(--sky-low)); padding: 8px 6px 4px; }
.shelf-next { padding: 10px 12px 12px; border-radius: 16px; background: #fff3d6; }
.shelf-next-line { display: flex; align-items: center; gap: 12px; margin: 0 0 10px !important; }
.shelf-next-pic { flex: none; width: 48px; height: 48px; }
.shelf-next-pic svg { width: 48px; height: 48px; display: block; }
.shelf-next-line > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.shelf-next-line small { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-soft); }
.shelf-next-line b { font-size: 19px; color: var(--ink); }
.shelf-next-line em { font-style: normal; font-size: 15px; font-weight: 600; color: var(--ink-soft); }
.shelf-bar { height: 12px; border-radius: 6px; background: rgba(122, 75, 51, 0.18); overflow: hidden; }
.shelf-bar i { display: block; height: 100%; min-width: 12px; border-radius: 6px; background: linear-gradient(180deg, #ffd56e, #e9a325); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.shelf-box .shelf-note { margin: 8px 2px 0 !important; font-size: 15px !important; line-height: 1.35; color: var(--ink-soft); }
.shelf-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 7px; }
.shelf-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  min-height: 96px;
  padding: 6px 4px 8px;
  border: 2px solid rgba(31, 42, 68, 0.1);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(31, 42, 68, 0.06);
}
.shelf-tile:active:not(:disabled) { transform: scale(0.96); }
.shelf-tile[aria-pressed="true"] { border-color: #3c9a6c; background: #eef8f2; }
.shelf-tile:disabled { background: rgba(255, 255, 255, 0.45); cursor: default; box-shadow: none; }
.shelf-tile:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.tile-pic { display: grid; place-items: center; width: 52px; height: 52px; }
.tile-pic svg { width: 52px; height: 52px; display: block; overflow: visible; }
.cat-tile .tile-pic, .cat-tile .tile-pic svg { width: 56px; height: 56px; }
.locked-pic { display: block; opacity: 0.45; filter: grayscale(1); }
.tile-name { font-size: 14px; font-weight: 700; line-height: 1.1; text-align: center; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
@media (max-width: 370px) { .shelf-tile { padding-left: 1px; padding-right: 1px; } .tile-name { font-size: 13px; letter-spacing: -0.01em; } }
.tile-sub { font-size: 13px; font-weight: 600; line-height: 1.1; color: var(--ink-soft); text-align: center; }
.shelf-tile:disabled .tile-name { color: var(--ink-soft); }
.shelf-tile[aria-pressed="true"] .tile-sub { color: #2b7a53; }
.tile-sub:empty { display: none; }

/* Looks list in the menu */
.looks-section { margin-top: 4px; }
#looks-box > .note { font-size: 15px; margin: 2px 0 6px; line-height: 1.35; color: var(--ink-soft); }
.look-group h3 { margin: 12px 0 6px; font-size: 16px; font-weight: 700; color: var(--ink-soft); }
.look-list { display: grid; gap: 6px; }
.look-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 6px 12px 6px 6px;
  border: 2px solid rgba(31, 42, 68, 0.1);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.look-item[aria-pressed="true"] { border-color: #3c9a6c; background: #eef8f2; }
.look-item:disabled { cursor: default; background: transparent; }
.look-item:disabled .swatch { opacity: 0.45; filter: grayscale(0.6); }
.look-item:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.look-name { font-size: 17px; font-weight: 700; line-height: 1.15; }
.look-item:disabled .look-name { color: var(--ink-soft); }
.look-status { font-size: 15px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.look-item[aria-pressed="true"] .look-status { color: #2b7a53; }
.swatch {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #e8ecf3;
  position: relative;
  overflow: hidden;
}
/* Bottle swatches: a little bottle drawn with borders */
.swatch-tube .swatch::after, .swatch-flask .swatch::after, .swatch-potion .swatch::after, .swatch-gold .swatch::after, .swatch-crystal .swatch::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 6px;
  bottom: 5px;
  border: 2.5px solid #7d8aa5;
  border-top: 0;
  border-radius: 0 0 9px 9px;
  background: linear-gradient(transparent 30%, #e5484d 30% 55%, #4da8f0 55%);
}
.swatch-flask .swatch::after { left: 9px; right: 9px; top: 10px; border-top: 2.5px solid #7d8aa5; border-radius: 40% 40% 50% 50% / 30% 30% 50% 50%; }
.swatch-potion .swatch::after { left: 10px; right: 10px; top: 12px; border-top: 2.5px solid #7d8aa5; border-radius: 6px 6px 8px 8px; }
.swatch-gold .swatch::after { border-color: #d9a520; }
.swatch-crystal .swatch { background: linear-gradient(135deg, #f4f8ff, #dfe9fb 50%, #c9d8f3); }
.swatch-crystal .swatch::after {
  border-color: #8fb4e8;
  background:
    linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.9) 40% 46%, transparent 48%),
    linear-gradient(transparent 30%, #e5484d 30% 55%, #4da8f0 55%);
}
/* Liquid swatches */
.swatch-glossy .swatch { background: linear-gradient(90deg, #b8333a, #e5484d 30%, #f08488 52%, #e5484d 75%, #b8333a); }
.swatch-glitter .swatch {
  background:
    radial-gradient(circle, #fff 0 0.7px, transparent 1.2px) 1px 2px / 7px 9px,
    radial-gradient(circle, rgba(255, 255, 255, 0.75) 0 0.6px, transparent 1.1px) 4px 6px / 11px 7px,
    radial-gradient(circle, #fffce1 0 1px, transparent 1.7px) 2px 1px / 17px 13px,
    linear-gradient(90deg, #6e3fb0, #8e5bd0 40%, #b48ae6 60%, #8e5bd0);
}
.swatch-lava .swatch { background: radial-gradient(ellipse at 50% 35%, #ffd27a, #f28c28 45%, #b8331b 100%); }
.swatch-pearl .swatch { background: linear-gradient(115deg, #f0a7c4, #ffe9f2 35%, #d8e7ff 55%, #f6d6ff 72%, #e98fb6); }
.swatch-galaxy .swatch {
  background:
    radial-gradient(circle, #fff 0 0.8px, transparent 1.3px) 3px 4px / 9px 11px,
    radial-gradient(circle, rgba(255, 240, 255, 0.8) 0 0.6px, transparent 1.1px) 6px 1px / 13px 7px,
    radial-gradient(ellipse 60% 40% at 35% 45%, rgba(240, 110, 190, 0.85), transparent 70%),
    linear-gradient(135deg, #1b1446, #4b2a8c 50%, #1e2f74);
}
/* Background swatches */
.swatch-sunset .swatch { background: radial-gradient(circle at 50% 35%, #8a6a4a, #3a2c26 60%, #221a1a); }
.swatch-night .swatch {
  background:
    radial-gradient(circle at 72% 28%, #fff7d6 0 5px, transparent 6px),
    radial-gradient(circle, #fff 0 0.8px, transparent 1.2px) 3px 4px / 10px 9px,
    linear-gradient(#141b3a, #2a2f6b 60%, #5b3f7a);
}
.swatch-meadow .swatch {
  background:
    radial-gradient(ellipse 60% 30% at 20% 100%, #5fae4c 98%, transparent 100%),
    radial-gradient(ellipse 70% 34% at 85% 100%, #78c35a 98%, transparent 100%),
    linear-gradient(#7cc3f0, #c8ecff);
}
.swatch-blossom .swatch {
  background:
    radial-gradient(ellipse 3px 2px at 50% 50%, #fff 0 60%, transparent 100%) 4px 6px / 13px 11px,
    radial-gradient(ellipse 3px 2px at 50% 50%, #ffc1d9 0 60%, transparent 100%) 9px 1px / 17px 15px,
    linear-gradient(#f3a9c8, #f8d3e3 55%, #fff1e6);
}
.swatch-aurora .swatch {
  background:
    radial-gradient(ellipse 80% 22% at 40% 38%, rgba(110, 255, 190, 0.85), transparent 70%),
    radial-gradient(ellipse 60% 18% at 70% 58%, rgba(190, 120, 255, 0.7), transparent 70%),
    radial-gradient(circle, #fff 0 0.8px, transparent 1.2px) 3px 4px / 10px 9px,
    linear-gradient(#071a33, #12345a 60%, #1d5a6e);
}
.swatch-sea .swatch {
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.7) 0 1.5px, transparent 2px) 6px 8px / 14px 16px,
    linear-gradient(#0f5c78, #1c8aa0 55%, #57c4c0);
}

/* ---------- Hidden colors ---------- */
.unit.hidden {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0 5px, transparent 5px 10px),
    linear-gradient(90deg, #6d7891, #98a3ba 45%, #b3bccd 55%, #8a95ad);
  color: #fff;
}
.unit.hidden::before { content: "?" !important; font-weight: 800; text-shadow: 0 1px 2px rgba(31, 42, 68, 0.5); }
.unit.revealing { animation: reveal 0.45s cubic-bezier(0.3, 1.3, 0.5, 1); }
@keyframes reveal {
  from { transform: scaleX(0.1); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}

/* ---------- Looks: bottle shapes ---------- */
body.look-flask .tube {
  left: -10%;
  right: -10%;
  top: calc(var(--bw) * 0.3);
  border-top: 2.5px solid var(--glass);
  border-radius: 40% 40% 50% 50% / 15% 15% 30% 30%;
}
body.look-flask .liquid { border-radius: 36% 36% 48% 48% / 13% 13% 28% 28%; top: calc(var(--bw) * 0.1); }
body.look-flask .rim { left: 12%; right: 12%; }
body.look-flask .bottle::before {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  top: calc(var(--bw) * 0.12);
  height: calc(var(--bw) * 0.2);
  border-left: 2.5px solid var(--glass);
  border-right: 2.5px solid var(--glass);
  background: var(--glass-fill);
}
body.look-flask .tube::after { top: 16%; left: 16%; }

body.look-potion .tube {
  left: -8%;
  right: -8%;
  top: calc(var(--bw) * 0.34);
  border-top: 2.5px solid var(--glass);
  border-radius: 22% 22% 26% 26% / 8% 8% 12% 12%;
}
body.look-potion .liquid { border-radius: 18% 18% 22% 22% / 7% 7% 10% 10%; top: calc(var(--bw) * 0.08); }
body.look-potion .rim {
  left: 28%;
  right: 28%;
  height: calc(var(--bw) * 0.38);
  border-radius: calc(var(--bw) * 0.06) calc(var(--bw) * 0.06) 0 0;
  border-bottom: 0;
}
body.look-potion .cork { left: 25%; right: 25%; }

body.look-gold .bottle { --glass: #f2c14e; }
body.look-gold .rim { background: linear-gradient(180deg, #fff1b8, #e0a92a); }
body.look-gold .tube { box-shadow: inset 0 0 0 1px rgba(150, 100, 10, 0.25), 0 10px 16px -10px rgba(31, 42, 68, 0.45); }

body.look-crystal .bottle { --glass: #b9d4f6; }
body.look-crystal .rim { background: linear-gradient(90deg, #ffd1e6, #fff6c4 25%, #c8ffe8 50%, #c9dcff 75%, #f0d0ff); }
body.look-crystal .tube {
  border-radius: 0 0 calc(var(--bw) * 0.18) calc(var(--bw) * 0.18);
  box-shadow: inset 0 0 0 1px rgba(150, 190, 240, 0.55), 0 0 14px -4px rgba(200, 225, 255, 0.9), 0 10px 16px -10px rgba(31, 42, 68, 0.45);
}
body.look-crystal .liquid { border-radius: 0 0 calc(var(--bw) * 0.14) calc(var(--bw) * 0.14); }
body.look-crystal .tube::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(100deg, transparent 18%, rgba(255, 255, 255, 0.5) 19% 23%, transparent 24%),
    linear-gradient(100deg, transparent 70%, rgba(255, 255, 255, 0.28) 71% 74%, transparent 75%);
}

/* ---------- Looks: liquids ---------- */
.unit { position: relative; }
body.look-glitter .unit:not(.hidden)::after,
body.look-lava .unit:not(.hidden)::after {
  content: "";
  position: absolute;
  inset: -40% 0;
  pointer-events: none;
}
body.look-glitter .unit:not(.hidden)::after {
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 0.7px, transparent 1.2px) 1px 2px / 7px 9px,
    radial-gradient(circle, rgba(255, 255, 255, 0.7) 0 0.6px, transparent 1.1px) 4px 6px / 11px 7px,
    radial-gradient(circle, rgba(255, 252, 225, 0.95) 0 1px, transparent 1.7px) 2px 1px / 17px 13px;
  animation: drift 3.2s linear infinite;
}
@keyframes drift {
  from { transform: translateY(0); opacity: 0.9; }
  50% { opacity: 0.5; }
  to { transform: translateY(-20px); opacity: 0.9; }
}
body.look-lava .unit:not(.hidden) {
  background: radial-gradient(ellipse 70% 90% at 50% 40%,
    color-mix(in srgb, var(--c) 45%, #fff3c4) 0%,
    var(--c) 55%,
    color-mix(in srgb, var(--c) 65%, #2b0a00) 100%);
  box-shadow: inset 0 0 calc(var(--bw) * 0.18) rgba(255, 210, 140, 0.45);
}
body.look-lava .unit:not(.hidden)::after {
  background: radial-gradient(circle at 30% 60%, rgba(255, 240, 200, 0.35) 0 18%, transparent 30%),
    radial-gradient(circle at 70% 30%, rgba(255, 240, 200, 0.25) 0 12%, transparent 24%);
  animation: blob 4.5s ease-in-out infinite alternate;
}
@keyframes blob {
  from { transform: translateY(8%) scale(1); }
  to { transform: translateY(-8%) scale(1.15); }
}
body.look-lava .tube { box-shadow: inset 0 0 0 1px rgba(31, 42, 68, 0.1), 0 0 18px -4px rgba(255, 150, 60, 0.55); }
body.look-pearl .unit:not(.hidden) {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--c) 80%, #2a1a3a) 0%,
    color-mix(in srgb, var(--c) 55%, #ffffff) 38%,
    color-mix(in srgb, var(--c) 40%, #fff4fb) 50%,
    color-mix(in srgb, var(--c) 70%, #d7e6ff) 64%,
    color-mix(in srgb, var(--c) 85%, #2a1a3a) 100%);
}
body.look-pearl .unit:not(.hidden)::after,
body.look-galaxy .unit:not(.hidden)::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
body.look-pearl .unit:not(.hidden)::after {
  background: linear-gradient(115deg, transparent 30%, rgba(255, 210, 240, 0.35) 42%, rgba(200, 235, 255, 0.4) 50%, transparent 62%) 0 0 / 300% 100%;
  animation: sheen 5s ease-in-out infinite alternate;
}
@keyframes sheen {
  from { background-position: 0% 0; }
  to { background-position: 100% 0; }
}
body.look-galaxy .unit:not(.hidden) {
  background: radial-gradient(ellipse 80% 70% at 40% 45%,
    color-mix(in srgb, var(--c) 85%, #ffffff) 0%,
    var(--c) 35%,
    color-mix(in srgb, var(--c) 45%, #120a30) 100%);
}
body.look-galaxy .unit:not(.hidden)::after {
  inset: -40% 0;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 0.7px, transparent 1.2px) 2px 3px / 9px 11px,
    radial-gradient(circle, rgba(255, 236, 255, 0.8) 0 0.6px, transparent 1.1px) 5px 1px / 13px 8px,
    radial-gradient(circle, rgba(200, 230, 255, 0.9) 0 1px, transparent 1.6px) 1px 6px / 19px 15px;
  animation: twinkle 3.6s ease-in-out infinite alternate;
}
@keyframes twinkle {
  from { opacity: 0.55; transform: translateY(0); }
  to { opacity: 1; transform: translateY(-6px); }
}

/* ---------- Looks: backgrounds ---------- */
.app { position: relative; z-index: 1; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
body.look-night {
  --sky-top: #141b3a;
  --sky-mid: #2a2f6b;
  --sky-low: #5b3f7a;
  --sun: rgba(255, 247, 214, 0.35);
}
body.look-night::before {
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1.1px, transparent 1.6px) 13px 17px / 71px 67px,
    radial-gradient(circle, rgba(255, 255, 255, 0.65) 0 0.9px, transparent 1.4px) 41px 5px / 103px 89px,
    radial-gradient(circle, rgba(255, 255, 255, 0.5) 0 0.7px, transparent 1.2px) 67px 53px / 131px 113px,
    radial-gradient(circle, rgba(255, 240, 200, 0.85) 0 1.4px, transparent 2px) 97px 31px / 173px 157px;
}
/* Tilting the tiled star layer hides its grid. */
body.look-night::before { inset: -50%; transform: rotate(17deg); }
body.look-night, body.look-sea { --panel: rgba(255, 252, 248, 0.94); }
body.look-meadow {
  --sky-top: #5fb3ea;
  --sky-mid: #a6dcf7;
  --sky-low: #e2f6ff;
  --sun: rgba(255, 250, 220, 0.75);
}
body.look-meadow::before {
  background:
    radial-gradient(ellipse 70% 22% at 15% 100%, #5fae4c 98%, transparent 100%),
    radial-gradient(ellipse 80% 26% at 90% 102%, #78c35a 98%, transparent 100%),
    radial-gradient(ellipse 30% 9% at 30% 30%, rgba(255, 255, 255, 0.9) 98%, transparent 100%),
    radial-gradient(ellipse 22% 7% at 70% 20%, rgba(255, 255, 255, 0.8) 98%, transparent 100%);
}
body.look-sea {
  --sky-top: #0b4a63;
  --sky-mid: #187f95;
  --sky-low: #4fb8b2;
  --sun: rgba(200, 255, 245, 0.25);
}
body.look-sea::before {
  background:
    repeating-linear-gradient(105deg, rgba(255, 255, 255, 0.07) 0 40px, transparent 40px 110px),
    radial-gradient(circle, rgba(255, 255, 255, 0.4) 0 1.5px, transparent 2.1px) 12px 30px / 67px 89px,
    radial-gradient(circle, transparent 0 2.4px, rgba(255, 255, 255, 0.45) 2.5px 3.3px, transparent 3.8px) 40px 10px / 113px 131px,
    radial-gradient(circle, rgba(255, 255, 255, 0.25) 0 2.6px, transparent 3.2px) 83px 61px / 157px 149px,
    radial-gradient(ellipse 80% 12% at 50% 102%, #e9d6a3 98%, transparent 100%);
}

body.look-blossom {
  --sky-top: #e98fb5;
  --sky-mid: #f5c3d8;
  --sky-low: #fff0e3;
  --sun: rgba(255, 246, 236, 0.7);
}
body.look-blossom::before {
  background:
    radial-gradient(ellipse 4px 2.6px at 50% 50%, rgba(255, 255, 255, 0.95) 0 60%, transparent 100%) 11px 23px / 83px 71px,
    radial-gradient(ellipse 3.6px 2.4px at 50% 50%, rgba(255, 196, 220, 0.95) 0 60%, transparent 100%) 47px 9px / 109px 97px,
    radial-gradient(ellipse 3px 2px at 50% 50%, rgba(255, 228, 238, 0.9) 0 60%, transparent 100%) 71px 57px / 137px 121px,
    radial-gradient(ellipse 60% 16% at 0% 4%, rgba(255, 190, 215, 0.95) 98%, transparent 100%),
    radial-gradient(ellipse 40% 12% at 100% 0%, rgba(255, 205, 225, 0.9) 98%, transparent 100%);
}
body.look-aurora {
  --sky-top: #061630;
  --sky-mid: #0f2f55;
  --sky-low: #1b5a6c;
  --sun: rgba(180, 255, 220, 0.2);
}
body.look-aurora::before {
  background:
    radial-gradient(ellipse 70% 14% at 30% 22%, rgba(90, 255, 180, 0.5), transparent 70%),
    radial-gradient(ellipse 55% 10% at 72% 32%, rgba(170, 110, 255, 0.4), transparent 70%),
    radial-gradient(ellipse 80% 9% at 55% 14%, rgba(120, 240, 255, 0.35), transparent 70%),
    radial-gradient(circle, rgba(255, 255, 255, 0.85) 0 1px, transparent 1.5px) 17px 13px / 79px 73px,
    radial-gradient(circle, rgba(255, 255, 255, 0.6) 0 0.8px, transparent 1.3px) 51px 37px / 113px 101px;
}
body.look-blossom, body.look-aurora { --panel: rgba(255, 252, 248, 0.94); }

@media (prefers-reduced-motion: reduce) {
  .bottle, .ctl, .toast, .cat-head { transition: none; }
  .shelf-cat.flick .cat-tail, .shelf-cat.hop { animation: none; }
  .shelf-tile:active:not(:disabled) { transform: none; }
  .sheet[open], .bottle.just-done .cork, .bottle.just-done .tube { animation: none; }
  .unit.revealing, .star.earned.pop,
  body.look-glitter .unit::after, body.look-lava .unit::after,
  body.look-pearl .unit::after, body.look-galaxy .unit::after { animation: none !important; }
}

/* ---------- The set (2026-11-22): a deep scene in layers, lit glass, solid shelves ----------
   set.js draws the scene's far and near layers and the drifting air; fx.js the stream and splashes.
   Everything below is looks only. */
.set { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.set-layer { position: absolute; inset: -28px; will-change: transform; }
.set-layer svg { width: 100%; height: 100%; display: block; }
.set-far { opacity: 0.6; }
.set-near { opacity: 0.75; }
/* the saturate is painted into the layer once (on the svg inside it), never re-run on the moving layer each frame */
.set-near svg { filter: saturate(0.85); }
/* The Wizard's rooms are whole walls, already dim: shown in full, the near props kept soft. */
.set[data-room] .set-far { opacity: 1; }
.set[data-room] .set-near { opacity: 0.6; }
.set-air { position: absolute; inset: 0; width: 100%; height: 100%; }
/* the key light: one soft, warm glow from the window side (no beams: they made the board busy) */
.set-light {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 40% at 85% 6%, var(--key, rgba(255, 220, 170, 0.5)), transparent 70%);
  opacity: 0.45;
}
.set-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 80% at 50% 45%, transparent 60%, rgba(18, 14, 40, 0.18) 100%);
}
.set[data-scene="aurora"] .aur { animation: aurora 7s ease-in-out infinite alternate; transform-origin: 50% 20%; }
@keyframes aurora { from { transform: translateX(-12px) scaleY(0.9); opacity: 0.7; } to { transform: translateX(14px) scaleY(1.15); opacity: 1; } }
/* the old flat painted shapes are now layers in set.js; the stars and sparkles stay */
body.look-meadow::before, body.look-sea::before { background: none; }
body.look-blossom::before {
  background:
    radial-gradient(ellipse 4px 2.6px at 50% 50%, rgba(255, 255, 255, 0.9) 0 60%, transparent 100%) 11px 23px / 83px 71px,
    radial-gradient(ellipse 3px 2px at 50% 50%, rgba(255, 228, 238, 0.85) 0 60%, transparent 100%) 71px 57px / 137px 121px;
  opacity: 0.6;
}
body.look-sea .set-light { background: radial-gradient(ellipse 90% 30% at 50% 0%, rgba(200, 255, 245, 0.35), transparent 70%); }

/* Shelves: a plank with a lit top, a grained front edge, brackets and a shadow on the wall */
.row::after, .cat-shelf::after {
  bottom: -15px;
  height: 20px;
  border-radius: 2px 2px 4px 4px;
  clip-path: polygon(1.2% 0, 98.8% 0, 100% 42%, 100% 100%, 0 100%, 0 42%);
  background:
    linear-gradient(180deg, rgba(255, 240, 220, 0.55), transparent 2px) top / 100% 9px no-repeat,
    linear-gradient(180deg, #b98560, #9a6644) top / 100% 9px no-repeat,
    repeating-linear-gradient(90deg, rgba(40, 20, 10, 0.07) 0 1px, transparent 1px 7px, rgba(255, 220, 190, 0.05) 7px 9px, transparent 9px 17px) bottom / 100% 11px no-repeat,
    linear-gradient(180deg, var(--wood) 0%, #6a3f2a 60%, var(--wood-lo) 100%) bottom / 100% 11px no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 10px 8px rgba(30, 14, 8, 0.35));
}
.row::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -30px;
  height: 16px;
  background:
    linear-gradient(135deg, var(--wood-lo) 50%, transparent 52%) left / 13px 16px no-repeat,
    linear-gradient(225deg, var(--wood-lo) 50%, transparent 52%) right / 13px 16px no-repeat;
  opacity: 0.9;
}
.cat-shelf::after { bottom: -6px; }

/* A soft contact shadow under each bottle; it shrinks and fades as the bottle lifts */
.slot::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -2%;
  bottom: -5px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 45% 50%, rgba(25, 12, 6, 0.5), rgba(25, 12, 6, 0.18) 55%, transparent 72%);
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}
.slot:has(.bottle.selected)::after, .slot:has(.bottle.pouring)::after { transform: scale(0.6); opacity: 0.35; }

/* Glass: clear in the middle, darker and brighter at the edges like a real cylinder, with a sharp highlight */
.bottle { --glass: rgba(255, 255, 255, 0.62); transition: transform 0.26s cubic-bezier(0.3, 1.5, 0.5, 1); }
.tube {
  border-width: 2px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.05) 20%, rgba(255, 255, 255, 0.03) 55%, rgba(255, 255, 255, 0.05) 82%, rgba(255, 255, 255, 0.18) 100%);
  box-shadow: inset 0 0 0 1px rgba(31, 42, 68, 0.12), inset -3px 0 6px rgba(20, 30, 60, 0.12);
}
.tube::after { display: none; }
.glass {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  background:
    linear-gradient(90deg, transparent 14%, rgba(255, 255, 255, 0.32) 18%, transparent 24%),
    linear-gradient(90deg, rgba(10, 15, 40, 0.16) 0%, transparent 16%, transparent 84%, rgba(10, 15, 40, 0.2) 100%);
  -webkit-mask: linear-gradient(180deg, #000 0 88%, rgba(0, 0, 0, 0.4) 100%);
  mask: linear-gradient(180deg, #000 0 88%, rgba(0, 0, 0, 0.4) 100%);
}
.rim {
  border-width: 1.5px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.22) 50%, rgba(190, 200, 225, 0.3) 100%);
  box-shadow: 0 1px 2px rgba(20, 30, 60, 0.12);
}
body.look-potion .rim { border-radius: calc(var(--bw) * 0.08) calc(var(--bw) * 0.08) 0 0; }
.unit:last-child { box-shadow: none; }
/* the liquid's top surface, seen from a little above */
.surface {
  position: absolute;
  left: 50%;
  width: 100%;
  height: calc(var(--bw) * 0.3);
  transform: translate(-50%, 50%);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 45%, color-mix(in srgb, var(--c, #fff) 78%, #fff) 0%, var(--c, #fff) 80%);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.18);
  z-index: 1;
  pointer-events: none;
  transition: bottom var(--pour-ms) linear, opacity 0.15s;
}
.surface.empty { opacity: 0; }
.bottle.pouring .surface { opacity: 0; }
/* picked up: it lifts with a spring, then floats */
.bottle.selected {
  animation: bob 1.9s ease-in-out 0.26s infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(calc(var(--bw) * -0.45)); }
  50% { transform: translateY(calc(var(--bw) * -0.53)) rotate(-1.2deg); }
}
.bottle.just-done .glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.45) 45%, transparent 55%) 0 0 / 300% 100% no-repeat;
  animation: shine 0.8s ease-out 0.1s both;
}
@keyframes shine { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.cork { box-shadow: inset 0 -3px 0 rgba(79, 45, 31, 0.25), 0 2px 3px rgba(40, 20, 10, 0.3); }
.fx-stream { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 25; opacity: 0; overflow: visible; }
.fx-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 26; }
.fx-canvas.idle { visibility: hidden; }

/* Buttons with a little depth */
.ctl {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), var(--panel));
  box-shadow: inset 0 -3px 0 rgba(31, 42, 68, 0.12), inset 0 1px 0 #fff, 0 8px 16px -8px rgba(31, 42, 68, 0.55);
}
.ctl:active:not(:disabled) { transform: translateY(2px) scale(0.97); box-shadow: inset 0 -1px 0 rgba(31, 42, 68, 0.12), 0 4px 8px -6px rgba(31, 42, 68, 0.5); }
.top h1 { text-shadow: 0 2px 0 rgba(31, 42, 68, 0.22), 0 6px 14px rgba(31, 42, 68, 0.25); }

@media (prefers-reduced-motion: reduce) {
  .set[data-scene="aurora"] .aur, .bottle.selected, .bottle.just-done .glass::after { animation: none !important; }
  .bottle.selected { transform: translateY(calc(var(--bw) * -0.45)); }
  .surface { transition: none; }
}

/* iPhone: no double-tap zoom anywhere. touch-action isn't inherited, so it goes on every element
   (anything with its own touch-action keeps it). Text fields stay selectable. */
* { touch-action: manipulation; }
input, textarea { -webkit-user-select: text; user-select: text; }
