/* Color Tubes: tubes, balls, tips and tools */
.tip {
  min-height: 1.7em;
  margin: 0 0 6px;
  max-width: 560px;
  text-align: center;
  font-size: 1.08rem;
  color: var(--muted);
  line-height: 1.35;
}
.tip strong { color: var(--ink); }
.swatch {
  display: inline-block;
  width: 0.9em; height: 0.9em;
  border-radius: 50%;
  background: var(--c);
  vertical-align: -0.08em;
  margin-right: 6px;
}

.tubes-board {
  --ball: 40px;
  --cap: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  align-items: flex-end;
  gap: var(--gy, 18px) var(--gx, 14px);
  flex: 1;
  max-width: 100%;
}

.tube {
  position: relative;
  width: calc(var(--ball) + 14px);
  height: calc(var(--cap) * (var(--ball) + 4px) + 14px);
  margin-top: calc(var(--ball) * 0.9);
  padding: 5px 0 7px;
  border: 3px solid rgba(124, 108, 242, 0.28);
  border-top-color: rgba(124, 108, 242, 0.12);
  border-radius: 10px 10px calc(var(--ball) / 2 + 8px) calc(var(--ball) / 2 + 8px);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.45));
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  box-shadow: 0 6px 14px rgba(59, 51, 85, 0.08);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.tube:hover { border-color: rgba(124, 108, 242, 0.45); }
.tube.selected { transform: translateY(-6px); border-color: var(--purple); }
.tube.done { border-color: var(--match); background: linear-gradient(90deg, #f1fdf5, #e3f8ea); }
.tube.done::after {
  content: "✓";
  position: absolute;
  bottom: -1.5em;
  left: 50%;
  transform: translateX(-50%);
  color: #3fae6c;
  font-weight: 800;
  font-size: 1rem;
}

.ball {
  flex: none;
  width: var(--ball);
  height: var(--ball);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.55), transparent 45%),
    var(--c);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  display: grid;
  place-items: center;
  transition: transform 0.18s ease;
  position: relative;
  z-index: 1;
}
.ball svg { width: 52%; height: 52%; fill: rgba(255, 255, 255, 0.82); }
.ball.drop { animation: drop 0.28s ease-out; }
@keyframes drop { from { transform: translateY(calc(var(--ball) * -1.2)); opacity: 0.3; } }

.tube.nope { animation: nope 0.3s ease; }
@keyframes nope {
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.tube.hint-from, .tube.hint-to { animation: glow 0.9s ease-in-out 3; border-color: var(--star); }
.tube.hint-to::before {
  content: "⬇";
  position: absolute;
  top: calc(var(--ball) * -0.95);
  left: 50%;
  transform: translateX(-50%);
  font-size: calc(var(--ball) * 0.6);
  color: #e0a800;
}
@keyframes glow { 50% { box-shadow: 0 0 0 7px rgba(255, 201, 60, 0.55); } }

.tools { display: flex; gap: 12px; justify-content: center; margin-top: 18px; padding-bottom: 6px; }
.tools .btn { font-size: 1.15rem; padding: 10px 18px; min-width: 120px; }
.tools .btn:disabled { opacity: 0.45; cursor: default; }
