/* badges.css — Square stacked achievement cards for Prinda home tab */

/* ── Strip container ── */
.badge-strip-section {
  margin: 0;
  padding: 0 16px;
}

/* ── Horizontal scroll strip (no wrap) ── */
.badge-strip {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 2px 0 6px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.badge-strip::-webkit-scrollbar {
  height: 3px;
}

.badge-strip::-webkit-scrollbar-track {
  background: transparent;
}

.badge-strip::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 2px;
}

/* ── Square badge card ── */
.badge-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 8px 6px 7px;
  border-radius: 12px;
  background: var(--bg2, #1e293b);
  border: 1px solid var(--border, #334155);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.badge-chip:hover {
  transform: translateY(-2px);
  border-color: var(--blue, #6C3CE1);
  box-shadow: 0 4px 14px rgba(108, 60, 225, 0.2);
}

.badge-chip:active {
  transform: translateY(0);
}

.badge-chip:focus-visible {
  outline: 2px solid var(--blue, #6C3CE1);
  outline-offset: 2px;
}

/* Locked / not yet earned */
.badge-chip.locked {
  opacity: 0.45;
  filter: grayscale(0.7);
}

.badge-chip.locked:hover {
  opacity: 0.7;
  filter: grayscale(0.3);
}

/* Tier colour tints */
.badge-chip.tier-bronze {
  border-color: rgba(205, 127, 50, 0.5);
  background: linear-gradient(160deg, rgba(205, 127, 50, 0.1) 0%, var(--bg2, #1e293b) 100%);
}

.badge-chip.tier-silver {
  border-color: rgba(192, 192, 192, 0.4);
  background: linear-gradient(160deg, rgba(192, 192, 192, 0.07) 0%, var(--bg2, #1e293b) 100%);
}

.badge-chip.tier-gold {
  border-color: rgba(255, 215, 0, 0.55);
  background: linear-gradient(160deg, rgba(255, 215, 0, 0.12) 0%, var(--bg2, #1e293b) 100%);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.08);
}

.badge-chip.tier-platinum {
  border-color: rgba(100, 180, 255, 0.55);
  background: linear-gradient(160deg, rgba(100, 180, 255, 0.12) 0%, var(--bg2, #1e293b) 100%);
  box-shadow: 0 0 12px rgba(100, 180, 255, 0.12);
}

.badge-chip.tier-diamond {
  border-color: rgba(120, 220, 255, 0.65);
  background: linear-gradient(160deg, rgba(120, 220, 255, 0.15) 0%, rgba(180, 120, 255, 0.06) 100%);
  box-shadow: 0 0 16px rgba(120, 220, 255, 0.15);
}

/* ── Tier gem (replaces badge icon) ── */
.badge-chip-tier {
  font-size: 1.25rem;
  line-height: 1;
  display: block;
}

/* ── Name ── */
.badge-chip-name {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text, #f1f5f9);
  line-height: 1.25;
  word-break: break-word;
  max-width: 100%;
}

/* ── Indicator row — sits below name ── */
.badge-chip-indicator {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
}

/* Tier pip dots (earned badge) */
.badge-chip-dots {
  display: flex;
  gap: 3px;
  justify-content: center;
}

/* Thin progress bar (in-progress / locked / earned — reused for both) */
.badge-chip-bar-wrap {
  width: 100%;
  height: 3px;
  background: rgba(148, 163, 184, 0.13);
  border-radius: 2px;
  overflow: hidden;
}

.badge-chip-bar {
  height: 100%;
  border-radius: 2px;
  background: var(--blue, #6C3CE1);
  transition: width 0.4s ease;
}

.badge-chip-bar.tier-bronze   { background: #cd7f32; }
.badge-chip-bar.tier-silver   { background: #c0c0c0; }
.badge-chip-bar.tier-gold     { background: #ffd700; }
.badge-chip-bar.tier-platinum { background: linear-gradient(90deg, #64b4ff, #a0d4ff); }
.badge-chip-bar.tier-diamond  { background: linear-gradient(90deg, #78dcff, #b478ff); }

/* ── Skeleton shimmer cards (same square shape) ── */
.badge-chip-sk {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 6px 7px;
  border-radius: 12px;
  background: var(--bg2, #1e293b);
  border: 1px solid var(--border, #334155);
  pointer-events: none;
  animation: badge-sk-pulse 1.5s ease-in-out infinite;
}

.badge-chip-sk:nth-child(2) { animation-delay: 0.1s; opacity: 0.85; }
.badge-chip-sk:nth-child(3) { animation-delay: 0.2s; opacity: 0.7;  }
.badge-chip-sk:nth-child(4) { animation-delay: 0.3s; opacity: 0.55; }
.badge-chip-sk:nth-child(5) { animation-delay: 0.4s; opacity: 0.4;  }

.sk-chip-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.13);
}

.sk-chip-label {
  height: 8px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.1);
  width: 52px;
}

.sk-chip-bar {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: rgba(148, 163, 184, 0.08);
  margin-top: 2px;
}

@keyframes badge-sk-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── Badge modal ── */
.badge-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: badge-fade-in 0.15s ease;
}

@keyframes badge-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.badge-modal {
  background: var(--bg2, #1e293b);
  border: 1px solid var(--border, #334155);
  border-radius: 16px;
  padding: 28px 24px 24px;
  max-width: 360px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: badge-slide-up 0.2s ease;
}

@keyframes badge-slide-up {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.badge-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted, #94a3b8);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s;
}

.badge-modal-close:hover { color: var(--text, #f1f5f9); }

.badge-modal-icon {
  font-size: 2.6rem;
  display: block;
  text-align: center;
  margin-bottom: 10px;
}

.badge-modal-name {
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  color: var(--text, #f1f5f9);
  margin-bottom: 4px;
}

.badge-modal-desc {
  font-size: 0.83rem;
  color: var(--muted, #94a3b8);
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.5;
}

.badge-modal-tiers {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.badge-modal-tier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: var(--bg3, #334155);
  border-radius: 8px;
  font-size: 0.82rem;
}

.badge-modal-tier-row.earned {
  border-left: 3px solid var(--green, #22c55e);
}

.badge-modal-tier-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.badge-modal-tier-threshold {
  color: var(--muted, #94a3b8);
  font-size: 0.76rem;
}

.badge-modal-progress-section {
  margin-top: 2px;
}

.badge-modal-progress-label {
  font-size: 0.76rem;
  color: var(--muted, #94a3b8);
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
}

.badge-modal-progress-wrap {
  width: 100%;
  height: 5px;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 4px;
  overflow: hidden;
}

.badge-modal-progress-bar {
  height: 100%;
  border-radius: 4px;
  background: var(--blue, #6C3CE1);
  transition: width 0.5s ease;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .badge-chip,
  .badge-chip-bar,
  .badge-modal,
  .badge-modal-overlay,
  .badge-chip-sk {
    animation: none;
    transition: none;
  }
}
