:root {
  --bg: #0b0b12;
  --panel: #15151f;
  --text: #eee;
  --muted: #9391a8;

  --c-commune: #9ca3af;
  --c-rare: #3b82f6;
  --c-epique: #a855f7;
  --c-legendaire: #f59e0b;
  --c-mythique: #ef4444;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, #1c1c2b, var(--bg) 60%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: 80px;
}

.topbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px 10px;
  text-align: center;
}

.topbar h1 {
  margin: 0;
  font-size: 1.4rem;
}

.stats {
  display: flex;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

.pull-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 12px;
}

.btn-pull {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: none;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: white;
  background: conic-gradient(from 0deg, #ef4444, #f59e0b, #a855f7, #3b82f6, #ef4444);
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.5), inset 0 0 20px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.btn-pull:active {
  transform: scale(0.94);
}

.btn-pull:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn-pull.spinning {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.collection {
  padding: 10px 16px 20px;
}

.collection h2,
.leaderboard h2 {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 600;
  margin: 20px 0 12px;
}

.leaderboard {
  padding: 10px 16px 0;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid #23232f;
}

.leaderboard-item.me {
  border-color: #a855f7;
  background: color-mix(in srgb, #a855f7 15%, var(--panel));
}

.leaderboard-rank {
  width: 22px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  flex-shrink: 0;
}

.leaderboard-name {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-score {
  font-weight: 800;
  flex-shrink: 0;
}

.leaderboard-breakdown {
  font-size: 0.7rem;
  color: var(--muted);
  width: 100%;
  margin-top: 2px;
}

.pseudo-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-color: #a855f7;
  box-shadow: 0 0 50px rgba(168, 85, 247, 0.4);
}

.pseudo-title {
  font-weight: 800;
  font-size: 1.1rem;
  margin: 0;
}

.pseudo-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.pseudo-input {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #2a2a38;
  background: #0e0e16;
  color: var(--text);
  font-size: 1rem;
  text-align: center;
}

.pseudo-error {
  margin: 0;
  min-height: 18px;
  color: #ef4444;
  font-size: 0.8rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}

.slot {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  text-align: center;
  padding: 4px;
  border: 2px solid transparent;
  background: var(--panel);
  color: var(--muted);
}

.slot.locked {
  border-style: dashed;
  border-color: #2a2a38;
}

.slot.unlocked {
  color: white;
  font-weight: 700;
  box-shadow: 0 0 10px 0 var(--tier-color, transparent);
  border-color: var(--tier-color, transparent);
  background: color-mix(in srgb, var(--tier-color, #333) 22%, var(--panel));
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 20px;
}

.overlay.hidden {
  display: none;
}

.reveal-card {
  background: var(--panel);
  border-radius: 18px;
  padding: 18px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  border: 2px solid var(--tier-color, #333);
  box-shadow: 0 0 50px var(--tier-color, transparent);
  animation: pop 0.35s ease;
}

@keyframes pop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.reveal-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #111;
  background: var(--tier-color, #999);
  margin-bottom: 12px;
}

.reveal-video-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: black;
}

.reveal-video-wrap video {
  width: 100%;
  max-height: 55vh;
  display: block;
}

.btn-unmute {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.6);
  border: none;
  color: white;
  font-size: 1.1rem;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.reveal-name {
  margin: 14px 0 2px;
  font-weight: 700;
}

.reveal-new {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

.btn-close {
  border: none;
  background: #2a2a38;
  color: white;
  padding: 10px 24px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 25;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding: 10px;
  background: linear-gradient(to top, var(--bg) 60%, transparent);
}

.btn-reset {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
}
