/* GuessTheIMP - Components */

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  outline: none;
  transition: transform var(--trans-fast), filter var(--trans-fast), background var(--trans-fast);
  text-decoration: none;
  touch-action: manipulation;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.96);
}

.btn-lg {
  height: var(--btn-height-lg);
  font-size: 1.05rem;
  padding: 0 20px;
  letter-spacing: 0.02em;
}

.btn-md {
  height: var(--btn-height-md);
  font-size: 0.95rem;
  padding: 0 16px;
}

.btn-sm {
  height: var(--btn-height-sm);
  font-size: 0.82rem;
  padding: 0 12px;
  border-radius: var(--radius-xs);
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--imp-red) 0%, #d81140 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px var(--imp-red-glow);
}
.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-cyan {
  background: linear-gradient(135deg, var(--innocent-cyan) 0%, #00b4d8 100%);
  color: #05131e;
  box-shadow: 0 4px 15px var(--innocent-cyan-glow);
}
.btn-cyan:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-icon {
  width: var(--btn-height-md);
  height: var(--btn-height-md);
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon-sm {
  width: var(--btn-height-sm);
  height: var(--btn-height-sm);
  padding: 0;
  border-radius: var(--radius-xs);
}

/* --- Cards & Surfaces --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  position: relative;
}

.card-clickable {
  cursor: pointer;
  transition: transform var(--trans-fast), border-color var(--trans-fast), background var(--trans-fast);
}
.card-clickable:active {
  transform: scale(0.98);
}
.card-clickable.selected {
  border-color: var(--innocent-cyan);
  background: rgba(0, 229, 255, 0.06);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.15);
}

/* --- Badges & Status Pills --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-imp {
  background: rgba(255, 42, 85, 0.15);
  color: var(--imp-red);
  border: 1px solid var(--border-imp);
}

.badge-innocent {
  background: rgba(0, 229, 255, 0.15);
  color: var(--innocent-cyan);
  border: 1px solid var(--border-cyan);
}

.badge-neutral {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* --- Horizontal Selectors / Segmented Controls --- */
.segment-group {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  width: 100%;
}

.segment-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 4px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--trans-fast);
  text-align: center;
}

.segment-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* --- Category Chips Grid (Compact Horizontal/Wrap) --- */
.category-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
}

.chip-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  cursor: pointer;
  transition: all var(--trans-fast);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
}

.chip-btn:active {
  transform: scale(0.95);
}

.chip-btn.active {
  background: rgba(0, 229, 255, 0.12);
  border-color: var(--innocent-cyan);
  color: var(--text-primary);
}

.chip-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

/* --- Player Avatar Chips --- */
.player-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.player-avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}

.player-avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 1.4rem;
}

/* Compact Player List / Grid */
.compact-player-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
}

.player-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  gap: 8px;
}

.player-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.player-item-name {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Stepper Controls --- */
.stepper-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
}

.stepper-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  border: none;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--trans-fast);
}

.stepper-btn:active {
  transform: scale(0.92);
}

.stepper-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* --- SVG Icon Common Styling --- */
.imp-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.imp-icon-sm {
  width: 16px;
  height: 16px;
}

.imp-icon-lg {
  width: 28px;
  height: 28px;
}

/* --- Input Fields --- */
.input-control {
  width: 100%;
  height: var(--btn-height-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  transition: border-color var(--trans-fast);
}

.input-control:focus {
  border-color: var(--innocent-cyan);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.2);
}

.input-control::placeholder {
  color: var(--text-muted);
}

/* --- Modal Overlay (Compact Sheet) --- */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.chat-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.chat-drawer-overlay.active {
  display: flex !important;
}

.modal-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.modal-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Edit Player Color Swatches */
.edit-colors-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  outline: none;
  transition: transform var(--trans-fast), border-color var(--trans-fast);
}

.color-swatch:active {
  transform: scale(0.92);
}

.color-swatch.selected {
  border-color: #ffffff;
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.player-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Universal Fast Touch Feedback & Delay Elimination */
.btn,
.mode-card,
.vote-card,
.chip-btn,
.stepper-btn,
.category-chip,
.timer-segment,
.imposter-segment,
.chat-chip,
.btn-reroll-speaker,
.color-swatch,
.player-row-item {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.btn:active,
.mode-card:active,
.vote-card:active,
.chip-btn:active,
.stepper-btn:active,
.category-chip:active,
.timer-segment:active,
.imposter-segment:active,
.chat-chip:active,
.btn-reroll-speaker:active,
.color-swatch:active {
  transform: scale(0.96) !important;
  transition: transform 0.05s ease !important;
}

