/* ============================================================
   setup.css – Setup Screen, Player List, Drag & Drop
   ============================================================ */

/* ── Setup Screen Header ── */
.setup-header {
  padding: var(--space-lg) var(--space-md) var(--space-md);
  text-align: center;
}

.setup-header__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
}

.setup-header__subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

/* ── Setup Section ── */
.setup-section {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.setup-section__title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-md);
}

/* ── Config Grid ── */
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

@media (min-width: 480px) {
  .config-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.config-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.config-field--full {
  grid-column: 1 / -1;
}

.config-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ── Player List ── */
.player-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.player-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.player-list-header__hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.player-list-header__actions {
  display: flex;
  gap: var(--space-xs);
}

/* ── Player Row ── */
.player-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 56px;
}

.player-row.dragging {
  background: var(--color-surface-2);
  box-shadow: var(--shadow-md);
  opacity: 0.9;
  z-index: 50;
}

.player-row.drag-over {
  border-color: var(--color-accent);
  background: var(--color-surface);
}

.player-row__handle {
  color: var(--color-border);
  cursor: grab;
  padding: var(--space-xs);
  touch-action: none;
  flex-shrink: 0;
}

.player-row__handle:active { cursor: grabbing; }
.player-row__handle svg { width: 16px; height: 16px; }

.player-row__number {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-muted);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.player-row__input-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
}

.player-row__input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  padding: 4px 0;
  font-size: var(--font-size-base);
  color: var(--color-text);
  outline: none;
  min-height: auto;
  transition: border-color var(--transition-fast);
}

.player-row__input:focus {
  border-bottom-color: var(--color-accent);
}

.player-row__input::placeholder {
  color: var(--color-text-muted);
}

.player-row__suggestions {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 50;
  max-height: 180px;
  overflow-y: auto;
}

.player-row__suggestion {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.player-row__suggestion:hover {
  background: var(--color-surface);
}

.player-row__delete {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.player-row__delete:hover {
  color: var(--color-danger);
  background: var(--color-surface-2);
}

.player-row__delete svg { width: 16px; height: 16px; }

/* ── Add Player Button ── */
.add-player-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  width: 100%;
  transition: border-color var(--transition-fast), color var(--transition-fast),
              background var(--transition-fast);
  min-height: 48px;
}

.add-player-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-surface);
}

.add-player-btn svg { width: 16px; height: 16px; }

/* ── Setup Footer ── */
.setup-footer {
  padding: var(--space-lg) var(--space-md);
  padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom));
}

/* ── Number Stepper ── */
.number-stepper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px var(--space-sm);
  min-height: 44px;
}

.number-stepper__btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
  transition: background var(--transition-fast);
}

.number-stepper__btn:hover { background: var(--color-border); }
.number-stepper__btn:disabled { opacity: 0.3; pointer-events: none; }

.number-stepper__value {
  flex: 1;
  text-align: center;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
}

/* ── Bull-off Screen ── */
.bulloff-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  padding: var(--space-xl) var(--space-md);
  min-height: 100dvh;
  text-align: center;
}

.bulloff-screen__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
}

.bulloff-screen__subtitle {
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
}

.bulloff-coin {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  border: 3px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xl);
}

.bulloff-coin.spinning {
  animation: coin-spin 1.5s ease-in-out;
}

@keyframes coin-spin {
  0%   { transform: rotateY(0deg); }
  50%  { transform: rotateY(900deg); }
  100% { transform: rotateY(1080deg); }
}

.bulloff-result {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-accent);
}

.bulloff-players {
  display: flex;
  gap: var(--space-xl);
  justify-content: center;
}

.bulloff-player-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  min-width: 120px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.bulloff-player-btn.selected {
  border-color: var(--color-accent);
  background: var(--color-surface);
}

.bulloff-player-btn__name {
  font-weight: var(--font-weight-semibold);
}
