#hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px 8px;
  min-height: 56px;
}

.hud-box {
  text-align: center;
  min-width: 70px;
}

.hud-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b93b8;
}

.hud-value {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.hud-actions {
  display: flex;
  gap: 8px;
}

#board-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

#tubes {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: calc(var(--ball, 42px) * 0.35) calc(var(--ball, 42px) * 0.25);
  width: 100%;
  height: 100%;
}

.tube {
  width: calc(var(--ball) + 8px);
  height: calc(var(--ball) * 4 + 14px);
  border: 3px solid #2a3358;
  border-top: none;
  border-radius: 0 0 calc(var(--ball) * 0.5) calc(var(--ball) * 0.5);
  background: #151a2e;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  padding-bottom: 4px;
  transition: border-color 0.15s;
}

.tube.selected {
  border-color: #4da3ff;
}

.tube.selected .ball.top-run {
  transform: translateY(calc(var(--ball) * -0.35));
}

.ball {
  width: var(--ball);
  height: var(--ball);
  border-radius: 50%;
  margin-top: 2px;
  transition: transform 0.18s ease;
  position: relative;
  flex-shrink: 0;
}

.ball.drop {
  animation: dropIn 0.18s ease-out;
}

@keyframes dropIn {
  from {
    transform: translateY(calc(var(--ball) * -0.7));
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 12-ball palette, c1..c12 */
.ball.c1 { background: radial-gradient(circle at 30% 30%, #79bdff, #4da3ff 60%, #2f7fd4); }
.ball.c2 { background: radial-gradient(circle at 30% 30%, #ff8490, #ff5d6c 60%, #d43a48); }
.ball.c3 { background: radial-gradient(circle at 30% 30%, #79eba4, #4ade80 60%, #22a355); }
.ball.c4 { background: radial-gradient(circle at 30% 30%, #ffd064, #fbbf24 60%, #d19200); }
.ball.c5 { background: radial-gradient(circle at 30% 30%, #c4b0fb, #a78bfa 60%, #7d5fe0); }
.ball.c6 { background: radial-gradient(circle at 30% 30%, #fdae61, #fb923c 60%, #d96c0e); }
.ball.c7 { background: radial-gradient(circle at 30% 30%, #5ee8d8, #2dd4bf 60%, #0e9e8c); }
.ball.c8 { background: radial-gradient(circle at 30% 30%, #f998cd, #f472b6 60%, #d4437f); }
.ball.c9 { background: radial-gradient(circle at 30% 30%, #b8e063, #84cc16 60%, #5a8f08); }
.ball.c10 { background: radial-gradient(circle at 30% 30%, #93c5fd, #60a5fa 60%, #3b7dd8); }
.ball.c11 { background: radial-gradient(circle at 30% 30%, #fca5a5, #ef4444 60%, #b91c1c); }
.ball.c12 { background: radial-gradient(circle at 30% 30%, #e2e8f0, #94a3b8 60%, #64748b); }
