/* ─── Player Color Picker ─── */
/* Two colored dots in the header. Tap to pick your color. */

/* ─── Picker Container (top-left of header) ─── */
.player-picker {
  position: absolute;
  top: 30px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

/* ─── Clickable Player Dot ─── */
.player-picker-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.player-picker-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2.5px solid #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 800;
  color: #000;
  transition: all 0.2s ease;
  user-select: none;
  filter: url(#squiggly);
  position: relative;
}

.player-picker-dot:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.player-picker-dot:active {
  transform: scale(0.95);
}

/* Dark-text dots need white label text */
.player-picker-dot[data-light='true'] {
  color: #fff;
}

/* ─── Swatch Fan-out ─── */
.player-picker-swatches {
  position: absolute;
  top: 38px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px;
  background: #fff;
  border: 2px solid #000;
  border-radius: 12px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.1);
  z-index: 20;
  width: 115px;
  justify-content: center;
}

.player-picker-swatches.open {
  display: flex;
  animation: pickerFanOut 0.2s ease both;
}

@keyframes pickerFanOut {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(0.85) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1) translateY(0);
  }
}

/* ─── Individual Swatch ─── */
.player-picker-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  background: none;
}

.player-picker-swatch:hover {
  transform: scale(1.2);
  border-color: #000;
}

/* Currently selected */
.player-picker-swatch.active {
  border-color: #000;
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px #000;
}

/* Taken by the other player — dimmed */
.player-picker-swatch.taken {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── Mobile ─── */
@media (max-width: 640px) {
  .player-picker {
    position: relative;
    top: auto;
    left: auto;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 100%;
  }

  .player-picker-dot {
    width: 26px;
    height: 26px;
    font-size: 0.45rem;
  }

  .player-picker-swatches {
    top: 32px;
    width: 100px;
    padding: 6px;
    gap: 4px;
  }

  .player-picker-swatch {
    width: 18px;
    height: 18px;
  }
}
