/* The stamp combo (js/works/works-combo.js): the boiler's gauge glass on the press, the count over the boiler, and the
   dock's little glass on phones. The liquid and the count take one colour per step: cream, brass, potion green (the boost),
   magenta (the money). Everything moves by transform, opacity or height only. */
.ccombo { container-type: inline-size; }
.ct1 { --l0: #8a7a5a; --l1: #e8dcc0; --l2: #fff8e8; --lg: rgba(240, 236, 224, 0.35); --cn: #f0ece0; }
.ct2 { --l0: #8a5a10; --l1: #f2b632; --l2: #ffe39a; --lg: rgba(242, 182, 50, 0.6); --cn: #f2b632; }
.ct3 { --l0: #2a8a10; --l1: #7aff2a; --l2: #c8ff9a; --lg: rgba(122, 255, 42, 0.7); --cn: #7aff2a; }
.ct4 { --l0: #8a1062; --l1: #ff3ac0; --l2: #ffb0e8; --lg: rgba(255, 58, 192, 0.8); --cn: #ff3ac0; }
.cbroke { --l0: #8a2010; --l1: #ff5a3a; --l2: #ffb09a; --lg: rgba(255, 90, 58, 0.6); --cn: #8d877b; }

/* the liquid: shaded round like the glass, with its surface seen from a little above (an ellipse as wide as the glass,
   as deep as the camera's tilt makes it: 0.3 of its width) */
.cglass, .cmini { overflow: hidden; }
.cglass { border-radius: 4px; }
.ccombo .cglass, .ccombo .cnum { position: absolute; }
.cglass .liq, .cmini .liq { position: absolute; left: 0; right: 0; bottom: 0; height: var(--f, 0%); transition: height 0.25s, background 0.3s;
  background: linear-gradient(90deg, var(--l0), var(--l1) 16%, #fff 22%, var(--l2) 27%, var(--l1) 40%, var(--l1) 68%, var(--l0)); box-shadow: 0 0 10px var(--lg); }
.cglass .liq::before, .cmini .liq::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 1 / 0.27; transform: translateY(-50%); border-radius: 50%;
  background: radial-gradient(ellipse at 50% 35%, var(--l2), var(--l1) 75%); box-shadow: inset 0 -1.5px 0 #fff, inset 0 2px 0 var(--l0); }
/* the glass's three brass rings (baked behind), drawn again in front of the liquid */
.cglass u { position: absolute; left: 0; width: 100%; aspect-ratio: 1 / 0.27; transform: translateY(50%); border-radius: 50%; border-bottom: 2px solid #c8902a; z-index: 2; }
.cglass u:nth-of-type(1) { bottom: 25%; } .cglass u:nth-of-type(2) { bottom: 50%; } .cglass u:nth-of-type(3) { bottom: 75%; }
.cstart .liq { opacity: 0; }
.liq i { position: absolute; left: var(--x); bottom: 0; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #fff8ec; opacity: 0.9; animation: cbub var(--d) linear var(--o) infinite; }
@keyframes cbub { to { transform: translateY(-160px); opacity: 0; } }
.ct1 .liq i { display: none; }
.cmax .liq i { animation-duration: calc(var(--d) * 0.45); }
.cmax .cglass, .cmax .cmini { box-shadow: 0 0 16px 4px var(--lg); }
.cmax .liq { animation: cboil 0.18s ease-in-out infinite alternate; }
@keyframes cboil { to { filter: brightness(1.35); } }
.cbroke .liq { animation: cdrain 0.9s ease-in; }
.cbroke .cglass, .cbroke .cmini { animation: cflash 0.9s ease-out; }
@keyframes cdrain { from { height: 60%; } }
@keyframes cflash { from { box-shadow: 0 0 18px 6px rgba(255, 80, 40, 0.8); } }

/* the count: its colour by step, and a shake that grows with each step */
.cnum { transform: translate(-50%, -100%); text-align: center; white-space: nowrap; }
.cnum b { display: block; font: 400 5.4cqw/1 Rye, Georgia, serif; color: var(--cn); text-shadow: 3px 3px 0 #0a0612; animation: cshake var(--sd, 0s) linear infinite; }
.cnum small { display: block; font: 800 max(9px, 1.4cqw) var(--f-ui); letter-spacing: 0.08em; text-transform: uppercase; color: #f2b632; text-shadow: 1px 1px 0 #0a0612; }
.ct2 .cnum b { --a: 1px; --sd: 0.32s; }
.ct3 .cnum b { --a: 2px; --sd: 0.2s; font-size: 6.2cqw; text-shadow: 0 0 12px var(--lg), 3px 3px 0 #0a0612; }
.ct4 .cnum b { --a: 3.5px; --sd: 0.12s; font-size: 7cqw; text-shadow: 0 0 16px var(--lg), 3px 3px 0 #0a0612; }
.cstart .cnum { opacity: 0; }
.cbroke .cnum b { animation: cdrop 0.9s ease-in; }
@keyframes cshake { 25% { translate: var(--a) calc(var(--a) * -0.6); rotate: -2deg; } 50% { translate: calc(var(--a) * -0.8) calc(var(--a) * 0.4); rotate: 1.5deg; } 75% { translate: calc(var(--a) * 0.5) var(--a); rotate: -1deg; } }
@keyframes cdrop { 0% { translate: 0 -10px; } 60% { translate: 0 0; } 70% { translate: -3px 0; } 80% { translate: 3px 0; } }

/* the dock: a little glass with the same three rings, and the count where the hint was */
.cmini { display: none; }
@media (max-width: 720px) {
  .cmini { display: block; position: relative; flex: none; width: 20px; height: 72px; border: 3px solid #0a0612; border-radius: 10px; background: #1c3a34; box-shadow: inset 0 0 0 2px #c8902a; }
  .cmini u { position: absolute; left: 0; right: 0; height: 2px; background: #c8902a; z-index: 2; }
  .cmini u:nth-of-type(1) { bottom: 25%; } .cmini u:nth-of-type(2) { bottom: 50%; } .cmini u:nth-of-type(3) { bottom: 75%; }
  .cmini .liq i { animation-name: cbubs; }
  .cmax .cmini { box-shadow: inset 0 0 0 2px #ff3ac0, 0 0 14px var(--lg); }
  .wkdock .cdock { transform: none; text-align: left; }
  .wkdock .cdock b { font-size: 26px; }
  .wkdock.ct3 .cdock b, .wkdock.ct4 .cdock b { font-size: 30px; }
  .wkdock .cdock small { font-size: 10px; }
}
@keyframes cbubs { to { transform: translateY(-60px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cnum b, .liq, .liq i, .cglass, .cmini { animation: none !important; } }
