/* ═══ Gamification Popup ═══ */

.game-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.game-popup {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 520px;
  width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  from { transform: translateY(20px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.game-popup__close {
  position: absolute;
  top: 12px; right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.game-popup__title {
  font-size: var(--font-h2);
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.game-popup__subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.game-email {
  width: 100%;
  margin-bottom: 8px;
}

.game-popup__consent {
  font-size: var(--font-caption);
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 20px;
}
.game-popup__consent a { color: var(--text-accent); }

/* Game choices */
.game-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) { .game-choices { grid-template-columns: 1fr; } }

.game-choice {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-primary);
  font-family: var(--font-family);
}
.game-choice:hover:not(:disabled) {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}
.game-choice:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.game-choice__title {
  display: block;
  font-weight: 700;
  margin-top: 8px;
}
.game-choice__desc {
  display: block;
  font-size: var(--font-caption);
  color: var(--text-muted);
  margin-top: 4px;
}

/* Roulette */
.roulette-container {
  position: relative;
  width: 300px;
  margin: 0 auto;
}
@media (max-width: 480px) {
  .roulette-container { width: 260px; }
  #roulette-canvas { width: 260px; height: 260px; }
}
.roulette-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 24px;
  color: var(--accent-primary);
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 360px;
  margin: 16px auto;
}

.game-card {
  width: 100%;
  aspect-ratio: 5/7;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}
.game-card:hover:not(.game-card--open):not(.game-card--disabled) {
  transform: scale(1.05);
  border-color: var(--accent-primary);
}
.game-card--open {
  cursor: default;
  animation: cardFlip 0.4s ease;
}
@keyframes cardFlip {
  0% { transform: rotateY(0); }
  50% { transform: rotateY(90deg); }
  100% { transform: rotateY(0); }
}
.game-card--disabled {
  opacity: 0.3;
  pointer-events: none;
}
.game-card__hidden {
  font-size: 32px;
  color: var(--text-muted);
  font-weight: 700;
}
.game-card__value {
  font-size: 24px;
  font-weight: 800;
}

.game-cards__counter,
.game-cards__best {
  text-align: center;
  font-size: var(--font-small);
  color: var(--text-secondary);
}

/* Result */
.game-result__title {
  font-size: var(--font-h1) !important;
  animation: resultPop 0.5s ease;
}
@keyframes resultPop {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.game-result__code {
  font-family: monospace;
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  padding: 16px;
  border: 2px dashed var(--border-accent);
  border-radius: var(--radius-md);
  margin: 16px 0 12px;
  letter-spacing: 3px;
  color: var(--accent-primary);
}

.game-result__info {
  text-align: center;
  font-size: var(--font-caption);
  color: var(--text-muted);
}

.game-step { text-align: center; }
