/* ============================================================
   MEXHICKENS — Reusable Components
   ============================================================ */

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: none;
  transition:
    transform var(--dur-fast) var(--ease-bounce),
    box-shadow var(--dur-fast),
    background var(--dur-fast),
    opacity var(--dur-fast);
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: var(--color-teal);
  color: #fff;
}
.btn--primary:hover:not(:disabled) {
  background: var(--color-teal-deep);
  box-shadow: var(--shadow-glow-teal);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-mid);
}
.btn--ghost:hover:not(:disabled) {
  background: var(--bg-raised);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn--lg {
  padding: var(--space-4) var(--space-7);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

/* Submit vote button — pulsing when enabled */
.btn--submit {
  background: linear-gradient(135deg, var(--color-teal), var(--color-magenta));
  color: #fff;
  font-size: var(--text-base);
  padding: var(--space-4) var(--space-7);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  min-width: 200px;
}
.btn--submit:not(:disabled) {
  animation: submit-pulse 2.5s ease-in-out infinite;
}
.btn--submit:hover:not(:disabled) {
  box-shadow: var(--shadow-glow-teal), var(--shadow-glow-magenta);
  animation: none;
  transform: scale(1.03);
}

@keyframes submit-pulse {
  0%, 100% { box-shadow: var(--shadow-md); }
  50%       { box-shadow: var(--shadow-glow-teal); }
}

/* ─── Style badge (lucha / tarot / etc.) ─── */
.style-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  color: var(--text-secondary);
}

/* ─── Medal badge (small, for tallies) ─── */
.medal-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
}
.medal-badge--gold   { background: rgba(245,166,35,0.15); color: var(--medal-gold); }
.medal-badge--silver { background: rgba(155,180,194,0.15); color: var(--medal-silver); }
.medal-badge--bronze { background: rgba(196,105,58,0.15); color: var(--medal-bronze); }

/* ─── Chicken card (used in archive + leaderboard) ─── */
.chicken-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-subtle);
  transition: transform var(--dur-med) var(--ease-bounce), box-shadow var(--dur-med);
}
.chicken-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.chicken-card__image-wrap {
  position: relative;
  overflow: hidden;
}

.chicken-card__image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-raised);
  display: block;
}

.chicken-card__fallback {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: var(--bg-raised);
}

/* .chicken-card__body and .chicken-card__info are interchangeable */
.chicken-card__info,
.chicken-card__body {
  padding: var(--space-3) var(--space-4);
}

.chicken-card__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chicken-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chicken-card__tallies {
  display: flex;
  gap: var(--space-2);
}

/* ─── Rank badge (absolute, top-left of card image-wrap) ─── */
.rank-badge {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg-overlay);
  border: 1px solid var(--border-mid);
  font-size: var(--text-xs);
  font-weight: 800;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  z-index: 1;
}

/* ─── Tally bar ─── */
.tally-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.tally-label {
  font-size: var(--text-xs);
  font-weight: 700;
  width: 56px;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.tally-track {
  flex: 1;
  height: 10px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.tally-fill {
  height: 100%;
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 1s var(--ease-smooth);
}
.tally-fill--gold   { background: linear-gradient(90deg, var(--medal-gold), #FFD54F); }
.tally-fill--silver { background: linear-gradient(90deg, var(--medal-silver), #CFD8DC); }
.tally-fill--bronze { background: linear-gradient(90deg, var(--medal-bronze), #FF8A65); }

.tally-count {
  font-size: var(--text-xs);
  font-weight: 700;
  width: 28px;
  text-align: right;
  flex-shrink: 0;
  color: var(--text-secondary);
}
