:root {
  --sky-top: #6f8db9;
  --sky-mid: #a7b6d3;
  --sky-low: #ebc8a9;
  --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(--safe-top) + 8px) 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);
}

/* 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 + 14px);
}
.row {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: calc(var(--bw) * 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; }
}
.win-look {
  margin: -6px 0 14px;
  padding: 12px;
  border-radius: 16px;
  background: #fff3d6;
}
.win-look p { margin: 0 0 10px; font-weight: 700; color: var(--ink); font-size: 16px; }
.win-look .secondary { min-height: 44px; font-size: 16px; }

#menu { text-align: left; max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
#menu h2 { margin-bottom: 4px; }
.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%);
}
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  font-size: 19px;
  font-weight: 700;
  border-bottom: 1px solid rgba(31, 42, 68, 0.1);
  cursor: pointer;
}
.switch-row input {
  appearance: none;
  -webkit-appearance: none;
  width: 52px;
  height: 32px;
  border-radius: 999px;
  background: #cdd3de;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  margin: 0;
}
.switch-row input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}
.switch-row input:checked { background: #3c9a6c; }
.switch-row input:checked::after { transform: translateX(20px); }
.switch-row input:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
#menu .note { font-size: 15px; margin: 14px 0 0; line-height: 1.35; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }

/* Looks list in the menu */
.looks-section { margin-top: 18px; }
#menu .looks-title { font-size: 24px; margin: 0; }
#menu .looks-section > .note { margin: 2px 0 6px; }
.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 {
  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; }
/* 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%); }
/* Background swatches */
.swatch-sunset .swatch { background: linear-gradient(#6f8db9, #a7b6d3 50%, #ebc8a9); }
.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-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); }

/* ---------- 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); }

/* ---------- 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%);
}

@media (prefers-reduced-motion: reduce) {
  .bottle, .ctl, .toast { transition: 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 { animation: none !important; }
}
