/* Drop / Gota: the paint mixing game. The frame (bar, tries, dialogs) comes from game.css. */
.game.drop { --accent: var(--today); }

/* ---------- the bowl ---------- */
.bowl-area { width: 100%; display: grid; justify-items: center; gap: 12px; }
.bowl-frame { position: relative; width: min(84vw, 420px, 46vh); aspect-ratio: 1; }
@media (min-width: 900px) { .bowl-frame { width: min(100%, 460px, 62vh); } }
.gauge { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 2.6; }
.g-track { stroke: var(--line); }
.g-fill { stroke: var(--ink); stroke-linecap: round; stroke-dasharray: 0 100; opacity: 0; transition: stroke-dasharray .9s var(--ease-out), stroke .4s, opacity .3s; }
.g-fill.on { opacity: 1; }
.g-fill.full { stroke: var(--ok); }
.bowl { position: absolute; inset: 4.6%; border-radius: 50%; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06), 0 24px 40px -28px rgba(10, 10, 30, .6); isolation: isolate; }
.half { position: relative; }
.target { background: var(--today); }
.mine { background: var(--mix, transparent); }
.mine.empty { background: repeating-linear-gradient(135deg, var(--paper) 0 10px, color-mix(in srgb, var(--line) 70%, var(--paper)) 10px 12px); }
/* unmixed drops sit on a pale ceramic dish (the same in dark mode, so black and blue drops still show) */
.mine.unstirred { background: radial-gradient(130% 80% at 0% 50%, #fcfbf7 0 50%, #ece9e1 100%); }
#mix-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.seam { position: absolute; left: 50%; top: -2%; bottom: -2%; width: 4px; margin-left: -2px; background: var(--paper); z-index: 3; transition: transform .7s var(--ease-out); transform-origin: 50% 50%; }
.bowl.merged .seam { transform: scaleY(0); }
.bowl.merged { animation: glow 1.4s var(--ease-out); }
@keyframes glow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--today) 70%, transparent); } 100% { box-shadow: 0 0 0 28px transparent; } }
.bowl.wobble { animation: wobble .5s var(--ease-out); }
@keyframes wobble { 20% { transform: scale(1.025, .975); } 45% { transform: scale(.985, 1.015); } 70% { transform: scale(1.006); } }
.bowl-pct { position: absolute; left: 50%; bottom: 1.4%; transform: translateX(-50%); z-index: 4; background: var(--ink); color: var(--paper); font: 800 1.05rem/1 var(--display); padding: 8px 13px; border-radius: 999px; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 4px var(--wall); }
.bowl-pct.pop { animation: pct-pop .5s var(--spring); }
/* once the mix changes, the % on the bowl belongs to the last try, so it fades back */
.bowl-pct { transition: opacity .3s; }
.bowl-pct.stale { opacity: .45; }
.g-fill.on.stale { opacity: .3; }
@keyframes pct-pop { from { transform: translateX(-50%) scale(.4); opacity: 0; } }
.bowl-labels { display: grid; grid-template-columns: 1fr 1fr; text-align: center; width: min(84vw, 420px); font-size: .93rem; color: var(--muted); line-height: 1.35; }
.bowl-labels b { display: block; color: var(--ink); font-size: 1.02rem; }
.bowl-labels.done-label { grid-template-columns: 1fr; margin: 0; }
.done-label b { font: 800 1.45rem/1.15 var(--display); margin-bottom: 2px; }
.game.is-done .pots { display: none; }

/* a drop in flight, and the splash where it lands */
.flying { position: fixed; left: 0; top: 0; width: 22px; height: 28px; margin: -14px 0 0 -11px; z-index: 30; pointer-events: none; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: var(--c); box-shadow: inset -3px -4px 0 rgba(0, 0, 0, .14), inset 3px 3px 0 rgba(255, 255, 255, .25); }
.flying::before { content: ""; position: absolute; left: 50%; top: -9px; margin-left: -6px; border: 6px solid transparent; border-bottom: 10px solid var(--c); }
.splash { position: absolute; z-index: 2; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .75); pointer-events: none; animation: splash .6s ease-out forwards; }
@keyframes splash { from { transform: scale(.2); opacity: .95; } to { transform: scale(3.4); opacity: 0; } }

/* ---------- controls ---------- */
/* on busy days the row of drops keeps one line and the counter moves under it, to the right */
.meter { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; justify-content: space-between; min-height: 34px; }
.slots { list-style: none; margin: 0; padding: 0; display: flex; gap: 5px; flex-wrap: wrap; }
.slots li { width: 24px; height: 30px; display: grid; place-items: center; }
.slot-empty { width: 18px; height: 23px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; border: 1.8px dashed var(--line); }
.slot-drop { width: 22px; height: 28px; border: 0; padding: 0; cursor: pointer; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: var(--c); box-shadow: inset -2px -3px 0 rgba(0, 0, 0, .16), 0 0 0 1.5px rgba(0, 0, 0, .14); position: relative; transition: transform .15s; }
.slot-drop.in { animation: slot-in .4s var(--spring); }
@keyframes slot-in { from { transform: scale(0) translateY(-10px); } }
.slot-drop::after { content: "×"; position: absolute; inset: 0; display: grid; place-items: center; font: 700 15px/1 var(--text); color: #fff; text-shadow: 0 0 3px rgba(0, 0, 0, .6); opacity: 0; transition: opacity .15s; }
.slot-drop:hover::after, .slot-drop:focus-visible::after { opacity: 1; }
.slot-drop:hover { transform: translateY(-2px); }
.slots.shake { animation: shake .42s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.count { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: auto; }
.count.full { color: var(--ok); }

.pots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; list-style: none; margin: 0; padding: 0; }
.pot-cell { display: grid; justify-items: center; gap: 6px; }
.pot { position: relative; width: 100%; max-width: 76px; aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  background: radial-gradient(circle at 50% 40%, #e9ecf1 0 58%, #b9c0cc 70%, #8e96a4 100%);
  box-shadow: 0 6px 0 -1px #7d8594, 0 10px 18px -10px rgba(0, 0, 0, .5);
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform .14s var(--ease-out), box-shadow .14s; }
.pot-paint { position: absolute; inset: 11%; border-radius: 50%; background: var(--pig);
  box-shadow: inset 0 -7px 12px rgba(0, 0, 0, .22), inset 0 4px 8px rgba(255, 255, 255, .28), 0 0 0 2px rgba(0, 0, 0, .12); transition: transform .25s var(--spring); }
.pot-shine { position: absolute; left: 26%; top: 20%; width: 26%; height: 15%; border-radius: 50%; background: rgba(255, 255, 255, .55); transform: rotate(-24deg); filter: blur(.4px); }
.pot.pig-white .pot-paint { box-shadow: inset 0 -7px 12px rgba(0, 0, 0, .14), 0 0 0 2px rgba(0, 0, 0, .12); }
.pot:hover .pot-paint { transform: scale(1.04); }
.pot:active, .pot.pressed { transform: translateY(4px) scale(.96); box-shadow: 0 2px 0 -1px #7d8594, 0 4px 10px -8px rgba(0, 0, 0, .5); }
.pot.pressed .pot-paint { transform: scale(.9); }
.pot.pouring { animation: pour .5s ease-in-out infinite alternate; }
@keyframes pour { to { transform: translateY(3px) rotate(-7deg) scale(.97); } }
.pot:disabled { cursor: default; filter: saturate(.5) opacity(.55); }
.pot .n { position: absolute; right: -6px; top: -6px; min-width: 27px; height: 27px; padding: 0 7px; border-radius: 14px; background: var(--ink); color: var(--paper); font: 700 .95rem/27px var(--text); z-index: 2; box-shadow: 0 0 0 2.5px var(--wall); }
.pot .n:empty { display: none; }
.pot .n.bump { animation: bump .35s var(--spring); }
.pot-name { font-size: .86rem; color: var(--muted); text-align: center; line-height: 1.2; font-weight: 700; }
.minus { width: 44px; height: 34px; border-radius: 17px; border: 1.5px solid var(--line); background: transparent; cursor: pointer; font: 700 1.2rem/1 var(--text); transition: border-color .2s, opacity .2s; }
.minus:hover:not(:disabled) { border-color: var(--ink); }
.minus:disabled { opacity: .3; cursor: default; }


/* ---------- tries ---------- */
.try-swatch { width: 38px; height: 38px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.hints { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; }
.hint { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px 4px 4px; border-radius: 999px; border: 1.5px solid var(--line); font: 700 .92rem/1 var(--text); background: var(--paper); }
.hint .dot { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.hint svg, .dm-chip svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hint.ok { border-color: var(--ok); color: var(--ok); background: color-mix(in srgb, var(--ok) 9%, var(--paper)); }
.hint.no { border-color: var(--ink); }
.hint.no svg { stroke-width: 2.4; }
.tries li.new .hint { animation: chip-in .42s var(--spring) both; animation-delay: calc(var(--k) * 120ms); }
/* how many of the five pots had exactly the right drops (never which ones) */
.exact { display: inline-flex; align-items: center; gap: 3px; flex: none; padding: 6px 10px 6px 8px; border-radius: 999px; border: 1.5px solid var(--ok); color: var(--ok); background: color-mix(in srgb, var(--ok) 9%, var(--paper)); font: 800 1rem/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; transition: background-color .3s, color .3s, border-color .3s; }
.exact svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.exact b { font: inherit; }
.exact.none { border-color: var(--line); color: var(--muted); background: var(--paper); }
.exact.all { background: var(--ok); border-color: var(--ok); color: #fff; }
.exact.tick { animation: bump .32s var(--spring); }
@keyframes chip-in { from { opacity: 0; transform: translateY(8px) scale(.6) rotateX(70deg); } }
.pct { font: 800 1.15rem/1 var(--display); font-variant-numeric: tabular-nums; min-width: 3.2ch; text-align: right; }
.pct.full { color: var(--ok); }

/* ---------- results dialog ---------- */
.res-colour { display: flex; gap: 16px; align-items: center; background: var(--wall); border-radius: 20px; padding: 14px; }
.res-disc { width: 92px; height: 92px; border-radius: 50%; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; flex: none; box-shadow: 0 0 0 4px var(--paper); }
.res-disc .t { background: var(--today); }
.res-disc .m { background: var(--best, var(--today)); }
.res-k { font-size: .88rem; color: var(--muted); }
.res-name { font: 800 1.4rem/1.1 var(--display); margin: 2px 0 8px !important; }
.recipe { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-weight: 700; }
.recipe .dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; vertical-align: -2px; margin-right: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }

/* ---------- help dialog with small looping demos ---------- */
.dm-bowl { width: 58px; height: 58px; border-radius: 50%; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; box-shadow: 0 0 0 3px var(--paper); }
.dm-bowl .t { background: #468a48; }
.dm-bowl .m { position: relative; background: #f1eee7; }
.dm-bowl .m::after { content: ""; position: absolute; inset: 0; background: #468a48; opacity: 0; animation: dm-stirred 5s ease-in-out infinite; }
@keyframes dm-stirred { 0%, 56% { opacity: 0; } 64%, 92% { opacity: 1; } 100% { opacity: 0; } }
.dm-bowl .m i { position: absolute; left: var(--x); top: var(--y); width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px rgba(0, 0, 0, .22); transform: scale(0); animation: dm-blob 5s var(--spring) infinite; animation-delay: calc(var(--k) * .3s); }
@keyframes dm-blob { 0% { transform: scale(0); } 6%, 55% { transform: scale(1); } 60%, 100% { transform: scale(0); } }
.dm-pot { width: 40px; height: 40px; border-radius: 50%; background: #f7c815; box-shadow: 0 0 0 4px #c9ced8, 0 5px 0 1px #8e96a4; position: absolute; bottom: 14px; animation: dm-press 1.6s ease-in-out infinite; }
@keyframes dm-press { 0%, 30%, 100% { transform: none; } 15% { transform: translateY(3px) scale(.92); } }
.dm-drop { position: absolute; width: 12px; height: 15px; left: 50%; margin-left: -6px; top: 34px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: #f7c815; animation: dm-fly 1.6s ease-out infinite; opacity: 0; }
@keyframes dm-fly { 0%, 14% { transform: translateY(0); opacity: 0; } 18% { opacity: 1; } 60% { transform: translateY(-26px); opacity: 1; } 80%, 100% { transform: translateY(-30px) scale(.4); opacity: 0; } }
.dm-count { position: absolute; top: 9px; left: 50%; width: 46px; margin-left: -23px; height: 10px; border-radius: 5px; background: repeating-linear-gradient(90deg, #f7c815 0 8px, transparent 8px 12px); clip-path: inset(0 100% 0 0); animation: dm-fill 4.8s steps(4) infinite; }
@keyframes dm-fill { to { clip-path: inset(0 0 0 0); } }
.hstep-2 .hdemo { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 6px; }
.dm-try { display: flex; align-items: center; gap: 4px; }
.dm-sw { width: 20px; height: 20px; border-radius: 50%; flex: none; background: #3f8a8a; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.dm-exact { display: inline-flex; align-items: center; gap: 2px; padding: 3px 6px 3px 4px; border-radius: 999px; border: 1.5px solid var(--ok); color: var(--ok); background: var(--paper); font: 800 .8rem/1 var(--display); font-variant-numeric: tabular-nums; }
.dm-exact svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.dm-n { display: inline-block; height: 1em; overflow: hidden; line-height: 1; vertical-align: top; }
.dm-n i { display: block; font-style: normal; animation: dm-count 4s steps(1, end) infinite; }
@keyframes dm-count { 0%, 22% { transform: translateY(0); } 32% { transform: translateY(-1em); } 42% { transform: translateY(-2em); } 52%, 100% { transform: translateY(-3em); } }
.dm-cap { font: 700 .66rem/1.1 var(--text); color: var(--muted); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .dm-bowl .m i { transform: none; animation: none; }
  .dm-bowl .m::after { animation: none; }
  .dm-n i { animation: none; transform: translateY(-3em); }
  .dm-drop { opacity: 0; }
  .dm-count { clip-path: inset(0 25% 0 0); }
}
