@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&display=swap");

:root {
  font-family: "Fredoka", ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #32346b;
  background: #6ad3cb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --c0: #d42931;
  --c1: #ffd241;
  --c2: #18cf49;
  --c3: #27d0d2;
  --c4: #7b36d5;
  --c5: #ff4ba5;
  --c6: #c23b32;
  --c7: #39a8f2;
  --c8: #ff8e2c;
  --hidden: #8e8e8e;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  display: grid;
  align-items: start;
  justify-items: center;
  background: #72d8d0;
}

#app {
  width: min(100vw, 430px);
  height: 100dvh;
  min-height: 0;
  box-shadow: none;
}

button {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.94);
  outline-offset: 2px;
}

.phone-game {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 184, 190, 0.35), rgba(255, 255, 255, 0)),
    var(--game-bg) center / cover no-repeat,
    #ee9fab;
}

.phone-game::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 60% 64%, rgba(255, 255, 255, 0.24), transparent 18%);
  content: "";
}

.screen-content {
  position: relative;
  z-index: 1;
  height: 100%;
}

.game-screen {
  display: grid;
  grid-template-rows: clamp(76px, 15dvh, 88px) minmax(0, 1fr) clamp(76px, 14dvh, 84px);
  height: 100%;
}

.top-line {
  position: relative;
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(88px, auto) minmax(0, 1fr);
  align-items: center;
  gap: clamp(10px, 3vw, 18px);
  padding: 10px clamp(14px, 5vw, 24px) 8px;
  border-top: 4px solid rgba(34, 45, 116, 0.22);
  border-bottom: 4px solid rgba(99, 73, 112, 0.22);
  background: linear-gradient(180deg, #ff9b9d, #f7b5b8);
}

.home-button,
.toolbar button,
.bottom-nav button {
  border: 0;
  cursor: pointer;
}

.home-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  line-height: 1;
}

.home-button img {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.lucide-icon {
  display: block;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-chip {
  justify-self: start;
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: flex-start;
  width: auto;
  height: 34px;
  margin-top: 0;
  padding: 0;
  border: 0;
  color: #fff;
  background: transparent;
  box-shadow: none;
  font-family: "Fredoka", Arial, sans-serif;
  font-size: 17px;
  font-weight: 900;
  text-shadow:
    -1px -1px 0 #55568c,
    1px -1px 0 #55568c,
    -1px 1px 0 #55568c,
    1px 1px 0 #55568c,
    0 3px 0 rgba(55, 45, 98, 0.28);
}

.stat-chip img {
  position: relative;
  z-index: 1;
  display: block;
  width: 32px;
  height: 32px;
  margin-right: 4px;
  object-fit: contain;
}

.stat-chip span {
  position: relative;
  z-index: 1;
  display: block;
  min-width: 24px;
  text-align: center;
}

.coin-dot {
  display: inline-block;
  width: 21px;
  height: 21px;
  margin-right: 4px;
  border: 2px solid #f59f13;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #fff3a2 0 16%, transparent 17%),
    linear-gradient(135deg, #ffe45a, #e6a619);
  box-shadow: 0 2px 0 #b36c0c;
  vertical-align: middle;
}

.score-box {
  min-width: 82px;
}

.stage-title {
  justify-self: end;
  align-self: center;
  max-width: 100%;
  color: #f6f7ff;
  font-size: clamp(18px, 5vw, 22px);
  line-height: 1;
  white-space: nowrap;
  text-shadow:
    -2px -2px 0 #55568c,
    2px -2px 0 #55568c,
    -2px 2px 0 #55568c,
    2px 2px 0 #55568c,
    0 4px 0 rgba(55, 45, 98, 0.22);
}

.playfield {
  position: relative;
  display: grid;
  align-items: start;
  justify-items: center;
  min-height: 0;
  padding: clamp(18px, 5dvh, 34px) clamp(10px, 4vw, 20px) 6px;
  overflow: visible;
}

.pixi-board {
  width: min(100%, 390px);
  max-height: 100%;
  aspect-ratio: 344 / 420;
  display: grid;
  place-items: center;
  touch-action: manipulation;
}

.pixi-board canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.tube-rack {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--rack-cols, 4), 42px);
  justify-content: center;
  align-content: center;
  align-items: end;
  gap: 44px 14px;
  width: 100%;
  max-width: 360px;
  min-height: 330px;
}

.tube-count-3 {
  --rack-cols: 3;
}

.tube-count-4,
.tube-count-5 {
  --rack-cols: 4;
}

.tube-count-6,
.tube-count-7,
.tube-count-8,
.tube-count-9,
.tube-count-10,
.tube-count-11 {
  --rack-cols: 5;
}

.tube {
  position: relative;
  display: block;
  width: 42px;
  height: 142px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform-origin: 50% 14%;
  filter: drop-shadow(0 3px 0 rgba(44, 43, 80, 0.24));
  transition: transform 170ms cubic-bezier(0.25, 0.9, 0.2, 1.2), filter 170ms ease;
}

.tube.is-selected {
  transform: translateY(-18px);
  filter:
    drop-shadow(0 3px 0 rgba(44, 43, 80, 0.24))
    drop-shadow(0 0 8px rgba(255, 255, 255, 0.85));
}

.tube.is-invalid {
  animation: tube-invalid 260ms ease both;
}

.tube.is-pouring-from {
  z-index: 30;
  animation: none;
  transition: none;
}

.tube.is-pouring-to {
  z-index: 4;
  animation: tube-receive 1180ms ease both;
}

.tube-body,
.liquid-mask {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.tube-body {
  z-index: 4;
  object-fit: contain;
}

.tube-rim {
  position: absolute;
  z-index: 8;
  top: -2px;
  left: -1px;
  width: calc(100% + 2px);
  height: auto;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.3));
}

.liquid-mask {
  z-index: 2;
  overflow: hidden;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.tube-fill {
  position: absolute;
  right: 4px;
  bottom: 8px;
  left: 4px;
  height: 115px;
  overflow: hidden;
  border-radius: 4px 4px 22px 22px;
}

.liquid-unit {
  position: absolute;
  right: 0;
  bottom: var(--unit-bottom);
  left: 0;
  display: grid;
  place-items: center;
  height: var(--unit-height);
  overflow: hidden;
  box-shadow:
    inset 8px 0 12px rgba(255, 255, 255, 0.28),
    inset -6px 0 8px rgba(0, 0, 0, 0.13);
}

.liquid-unit.is-empty {
  opacity: 0;
}

.liquid-unit.is-draining {
  transform-origin: 50% 0;
  clip-path: polygon(0 0, 100% var(--liquid-slope), 100% 100%, 0 100%);
}

.liquid-unit.is-incoming {
  opacity: 0;
  transform: scaleY(0);
  transform-origin: 50% 100%;
}

.source-mouth-bridge {
  position: absolute;
  top: 3px;
  z-index: 6;
  width: 19px;
  height: 10px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.35), transparent 55%),
    var(--bridge-color);
  box-shadow: inset 0 -2px 0 rgba(55, 44, 73, 0.16);
  opacity: 0;
  transform: scaleX(0);
  pointer-events: none;
}

.source-mouth-bridge.is-right {
  right: 0;
  transform-origin: 100% 50%;
}

.source-mouth-bridge.is-left {
  left: 0;
  transform-origin: 0 50%;
}

.liquid-shine {
  position: absolute;
  inset: 0 auto 0 18%;
  width: 22%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0));
}

.unknown-mark {
  z-index: 2;
  color: #fff;
  font-family: "Fredoka", Arial, sans-serif;
  font-size: 16px;
  font-weight: 900;
  text-shadow: 0 1px 0 #5f5f5f;
}

.liquid-surface-color {
  position: absolute;
  right: 5px;
  bottom: var(--surface-bottom);
  left: 5px;
  z-index: 5;
  height: 12px;
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0)),
    var(--surface-color);
  box-shadow: inset 0 -2px 0 rgba(55, 44, 73, 0.18);
  pointer-events: none;
}

.liquid-surface-color.is-source-surface {
  opacity: 1;
}

.liquid-surface-color.is-destination-surface {
  opacity: 0;
}

.liquid-unit[data-color="0"] {
  background: var(--c0);
}

.liquid-unit[data-color="1"] {
  background: var(--c1);
}

.liquid-unit[data-color="2"] {
  background: var(--c2);
}

.liquid-unit[data-color="3"] {
  background: var(--c3);
}

.liquid-unit[data-color="4"] {
  background: var(--c4);
}

.liquid-unit[data-color="5"] {
  background: var(--c5);
}

.liquid-unit[data-color="6"] {
  background: var(--c6);
}

.liquid-unit[data-color="7"] {
  background: var(--c7);
}

.liquid-unit[data-color="8"] {
  background: var(--c8);
}

.liquid-unit[data-color="hidden"] {
  background: var(--hidden);
}

.tube-cat {
  position: absolute;
  z-index: 9;
  top: -18px;
  left: 50%;
  width: 52px;
  height: 54px;
  object-fit: contain;
  transform: translateX(-50%);
  filter: drop-shadow(0 2px 0 rgba(70, 48, 78, 0.28));
  pointer-events: none;
}

.pour-layer {
  position: absolute;
  z-index: 18;
  top: calc(50% + var(--stream-top));
  left: calc(50% + var(--stream-left));
  width: 8px;
  height: var(--stream-height);
  opacity: 0;
  transform: translate(-50%, -50%);
  transform-origin: 50% 0;
  pointer-events: none;
}

.pour-core {
  position: absolute;
  top: 0;
  left: 50%;
  width: 5px;
  height: 100%;
  border-radius: 999px;
  background: var(--stream-color);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.28);
  transform: translateX(-50%) scaleY(0);
  transform-origin: 50% 0;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(var(--toolbar-count, 1), 56px);
  align-items: start;
  justify-content: center;
  gap: clamp(4px, 1.6vw, 8px);
  padding-top: 2px;
  padding-inline: 14px;
}

.toolbar button {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 0;
  color: #fff;
  background: transparent;
  box-shadow: none;
  font-size: 24px;
  text-shadow: 0 2px 0 #075a9e;
}

.toolbar button img {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: none;
}

.badge {
  position: absolute;
  top: -6px;
  left: 7px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #fff;
  background: #55c8fb;
  font-family: "Fredoka", Arial, sans-serif;
  font-size: 10px;
  text-shadow: none;
}

.map-screen,
.menu-screen {
  height: 100%;
  min-height: 100%;
  padding: 6px 22px 88px;
  background:
    radial-gradient(circle at 4% 58%, rgba(255, 255, 255, 0.2) 0 9%, transparent 9.5%),
    radial-gradient(circle at 80% 44%, rgba(255, 255, 255, 0.22) 0 17%, transparent 17.5%),
    rgba(69, 61, 126, 0.48);
}

.map-screen {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.map-screen::-webkit-scrollbar {
  display: none;
}

.stage-path {
  display: grid;
  grid-template-columns: repeat(4, minmax(58px, 1fr));
  place-items: center;
  align-content: start;
  gap: 26px 14px;
  width: 100%;
  min-height: 100%;
  padding: 20px 0 34px;
}

.stage-node {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  color: #fff;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  text-shadow: 0 2px 0 #555;
}

.stage-tile {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.stage-node strong {
  position: relative;
  z-index: 2;
  transform: translateY(-1px);
}

.stage-stars {
  position: absolute;
  right: auto;
  bottom: -15px;
  left: 50%;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 0;
  width: 50px;
  pointer-events: none;
  transform: translateX(-50%);
}

.stage-stars img {
  width: 13px;
  height: 13px;
  object-fit: contain;
  margin: 0 -3px;
  filter: drop-shadow(0 1px 0 rgba(86, 55, 52, 0.38));
}

.stage-node.is-current {
  filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0.9));
}

.stage-node.is-cleared {
  filter: none;
}

.stage-node.is-special {
  width: 65px;
  height: 65px;
  font-size: 14px;
}

.back-to-game {
  position: sticky;
  top: 6px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  margin: 0 0 6px;
  padding: 4px 11px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: rgba(78, 58, 124, 0.64);
  box-shadow: 0 3px 0 rgba(54, 39, 89, 0.38);
  font-size: 15px;
  font-weight: 800;
  text-shadow: 0 2px 0 #4e3b72;
}

.back-to-game .lucide-icon {
  width: 18px;
  height: 18px;
}

.floating-back {
  position: absolute;
  top: 10px;
  left: 14px;
  margin: 0;
}

.bottom-nav {
  position: absolute;
  right: 31px;
  bottom: 14px;
  left: 31px;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(var(--nav-count, 1), minmax(62px, 72px));
  justify-content: center;
  height: 64px;
  border: 2px solid rgba(120, 78, 123, 0.64);
  background: linear-gradient(90deg, #f6989b, #fdb0a0);
}

.bottom-nav button {
  display: grid;
  place-items: center;
  gap: 1px;
  min-width: 0;
  border-right: 1px solid rgba(145, 88, 121, 0.46);
  color: #fff;
  background: transparent;
  text-shadow: 0 2px 0 #4e487a;
}

.bottom-nav button:last-child {
  border-right: 0;
}

.bottom-nav button.is-active {
  background: linear-gradient(#8775b7, #574a8b);
}

.bottom-nav span {
  display: grid;
  place-items: center;
  line-height: 1;
}

.bottom-nav span img {
  display: block;
  width: 29px;
  height: 29px;
  object-fit: contain;
  filter: drop-shadow(0 2px 0 rgba(52, 44, 90, 0.35));
}

.bottom-nav small {
  font-family: "Fredoka", Arial, sans-serif;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.menu-screen h1 {
  margin: 0 0 20px;
  color: #fff;
  font-size: 38px;
  line-height: 1;
  text-align: center;
  text-shadow:
    -2px -2px 0 #333879,
    2px -2px 0 #333879,
    -2px 2px 0 #333879,
    2px 2px 0 #333879;
}

.continue-button,
.hint-buttons button,
.hint-overlay button {
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(#7ff04e, #46c928);
  box-shadow: 0 4px 0 #2c8e24;
  font-family: "Fredoka", Arial, sans-serif;
  font-weight: 900;
  cursor: pointer;
}

.settings-screen {
  text-align: center;
}

.sfx-toggle {
  display: inline-grid;
  gap: 5px;
  margin-top: 22px;
  color: #fff;
  font-size: 28px;
  text-shadow:
    -1px -1px 0 #55568c,
    1px -1px 0 #55568c,
    -1px 1px 0 #55568c,
    1px 1px 0 #55568c;
}

.sfx-toggle button {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 119px;
  height: 35px;
  padding: 4px 6px 4px 7px;
  border: 3px solid #895e65;
  border-radius: 5px;
  color: #75475f;
  background: linear-gradient(#ffdf93, #ffbd66);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55);
  box-sizing: border-box;
  cursor: pointer;
}

.sfx-toggle .lucide-icon {
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
}

.sfx-toggle i {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  height: 19px;
  border: 2px solid #88c07e;
  border-radius: 3px;
  background: #aaf39e;
  box-sizing: border-box;
}

.sfx-toggle button:not(.is-on) i {
  background: #c9c9c9;
}

.modal-shade {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(46, 31, 57, 0.45);
}

.completion-modal {
  align-content: start;
  justify-items: center;
  color: #fff;
  text-align: center;
  padding: clamp(72px, 12dvh, 96px) 20px 86px;
  overflow: hidden;
}

.win-burst,
.win-mascot {
  position: relative;
  pointer-events: none;
}

.win-burst {
  width: min(238px, 62vw);
  height: 122px;
  margin-bottom: -94px;
}

.win-burst img {
  position: absolute;
  object-fit: contain;
}

.win-rays {
  top: -58px;
  left: 0;
  width: 238px;
  height: 238px;
  opacity: 0.6;
  animation: slow-spin 6s linear infinite;
}

.win-glow {
  right: 10px;
  bottom: 20px;
  left: 10px;
  width: 218px;
  height: 76px;
  opacity: 0.86;
}

.win-mascot {
  z-index: 2;
  width: 160px;
  height: 124px;
  animation: pop 520ms ease both;
}

.win-mascot img {
  position: absolute;
  object-fit: contain;
}

.win-face {
  right: 0;
  bottom: 0;
  left: 0;
  width: 160px;
  height: auto;
}

.win-ear {
  z-index: 1;
  top: 1px;
  width: 49px;
  height: auto;
}

.win-ear-left {
  left: 12px;
}

.win-ear-right {
  right: 12px;
}

.win-eye {
  z-index: 2;
  top: 58px;
  width: 24px;
  height: auto;
}

.win-eye-left {
  left: 43px;
}

.win-eye-right {
  right: 43px;
}

.win-nose {
  z-index: 2;
  top: 71px;
  left: 72px;
  width: 16px;
  height: auto;
}

.win-mouth {
  z-index: 2;
  top: 85px;
  left: 66px;
  width: 26px;
  height: auto;
}

.complete-frame {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(292px, calc(100vw - 44px));
  margin-top: 4px;
  padding: 15px 15px 14px;
  border: 4px solid rgba(255, 242, 183, 0.72);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(112, 79, 132, 0.94), rgba(78, 58, 111, 0.93));
  box-shadow:
    0 7px 0 rgba(57, 43, 90, 0.34),
    inset 0 3px 0 rgba(255, 255, 255, 0.18);
}

.complete-title {
  z-index: 3;
  margin-top: 8px;
  color: transparent;
  background: linear-gradient(180deg, #fff7a8 0%, #ffd447 42%, #ff8a18 100%);
  background-clip: text;
  font-size: clamp(28px, 8vw, 38px);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter:
    drop-shadow(-2px 0 0 #5c3673)
    drop-shadow(2px 0 0 #5c3673)
    drop-shadow(0 -2px 0 #5c3673)
    drop-shadow(0 2px 0 #5c3673)
    drop-shadow(0 5px 0 rgba(67, 43, 94, 0.42));
}

.score-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  color: #fff8d4;
  background: transparent;
  font-size: 14px;
  text-shadow: 0 2px 0 #544070;
}

.score-summary img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 4px 0 rgba(128, 79, 14, 0.55));
}

.score-summary strong {
  color: #ffe765;
  font-size: 27px;
  line-height: 1;
}

.complete-stats {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  background: #594579;
}

.continue-button {
  position: relative;
  overflow: hidden;
  width: 174px;
  min-height: 43px;
  margin: 0 auto;
}

.continue-button {
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 0 20px 3px;
  border: 3px solid #d28609;
  border-radius: 10px;
  color: #fffdf2;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, #ffef3d 0%, #ffd322 52%, #f6a900 100%);
  box-shadow:
    0 5px 0 #a96f06,
    inset 0 3px 0 rgba(255, 255, 255, 0.42);
  font-size: 16px;
  font-weight: 900;
  text-shadow:
    -1px -1px 0 #6f3868,
    1px -1px 0 #6f3868,
    -1px 1px 0 #6f3868,
    1px 1px 0 #6f3868,
    0 2px 0 #6f3868;
}

.close-modal {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 28px;
  height: 28px;
  padding: 0;
  color: #fff;
  background: #a7a7a7 !important;
  box-shadow: 0 2px 0 #747474 !important;
  font-size: 22px;
  line-height: 1;
}

.hint-overlay {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  z-index: 60;
  display: flex;
  justify-content: space-between;
}

.hint-overlay button,
.hint-buttons button {
  min-width: 80px;
  min-height: 31px;
  background: linear-gradient(#88eaff, #4fc6e8);
  box-shadow: 0 3px 0 #2893b8;
}

.hint-complete h2 {
  align-self: start;
  margin-top: 82px;
  color: #fff;
  font-size: 26px;
  text-shadow:
    -2px -2px 0 #333879,
    2px -2px 0 #333879,
    -2px 2px 0 #333879,
    2px 2px 0 #333879;
}

.hint-buttons {
  position: absolute;
  right: 18px;
  bottom: 17px;
  left: 18px;
  display: flex;
  justify-content: space-between;
}

@keyframes tube-pour {
  0% {
    transform: translateY(-18px) rotate(0deg);
  }

  24% {
    transform: translate(calc(var(--move-x) * 0.5), calc(var(--move-y) * 0.64)) rotate(0deg);
  }

  38%,
  80% {
    transform: translate(var(--move-x), var(--move-y)) rotate(var(--move-rotate));
  }

  90% {
    transform: translate(var(--move-x), var(--move-y)) rotate(0deg);
  }

  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

@keyframes tube-receive {
  0%,
  100% {
    transform: translateY(0);
  }

  58% {
    transform: translateY(5px);
  }
}

@keyframes pour-layer {
  0%,
  33% {
    opacity: 0;
    transform: translate(-50%, -50%);
  }

  38%,
  80% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%);
  }
}

@keyframes pour-column {
  0%,
  33% {
    opacity: 0;
    transform: translateX(-50%) scaleY(0.08);
  }

  38%,
  80% {
    opacity: 1;
    transform: translateX(-50%) scaleY(1);
  }

  100% {
    opacity: 0;
    transform: translateX(-50%) scaleY(0.22);
  }
}

@keyframes drain-unit {
  0% {
    opacity: 1;
    transform: scaleY(1);
  }

  100% {
    opacity: 0;
    transform: scaleY(0);
  }
}

@keyframes fill-unit {
  0% {
    opacity: 0;
    transform: scaleY(0);
  }

  8% {
    opacity: 1;
    transform: scaleY(0.02);
  }

  100% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes source-surface {
  0% {
    bottom: var(--surface-start);
  }

  100% {
    bottom: var(--surface-end);
  }
}

@keyframes destination-surface {
  0% {
    opacity: 0;
    bottom: var(--surface-start);
  }

  8% {
    opacity: 1;
    bottom: var(--surface-start);
  }

  100% {
    opacity: 1;
    bottom: var(--surface-end);
  }
}

@keyframes tube-invalid {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  55% { transform: translateX(7px); }
  78% { transform: translateX(-4px); }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slow-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 390px) {
  .tube-rack {
    grid-template-columns: repeat(var(--rack-cols, 4), 38px);
    gap: 38px 11px;
  }

  .tube {
    width: 38px;
    height: 132px;
  }

  .toolbar {
    grid-template-columns: repeat(var(--toolbar-count, 1), 54px);
    gap: 4px;
    padding-inline: 8px;
  }

  .toolbar button,
  .toolbar button img {
    width: 54px;
    height: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
