/**
 * Games Premium Design System
 * Visual premium, animações fluidas, efeitos imersivos
 */

/* ── CSS Variables ─────────────────────────────────────────────────── */
:root {
  /* Cores base do app (fallback) */
  --gp-primary: #059669;
  --gp-primary-light: #10b981;
  --gp-primary-dark: #047857;
  --gp-accent: #f59e0b;
  --gp-accent-light: #fbbf24;
  --gp-danger: #ef4444;
  --gp-danger-light: #f87171;
  --gp-info: #3b82f6;
  --gp-info-light: #60a5fa;
  
  /* Superfícies */
  --gp-bg: #0f172a;
  --gp-surface: rgba(30, 41, 59, 0.85);
  --gp-surface-solid: #1e293b;
  --gp-border: rgba(148, 163, 184, 0.15);
  --gp-border-hover: rgba(148, 163, 184, 0.3);
  
  /* Texto */
  --gp-text: #f1f5f9;
  --gp-text-muted: #94a3b8;
  --gp-text-dim: #64748b;
  
  /* Glows */
  --gp-glow-primary: rgba(5, 150, 105, 0.4);
  --gp-glow-accent: rgba(245, 158, 11, 0.4);
  --gp-glow-danger: rgba(239, 68, 68, 0.4);
  --gp-glow-info: rgba(59, 130, 246, 0.4);
  
  /* Tipografia */
  --gp-font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --gp-radius-sm: 8px;
  --gp-radius: 16px;
  --gp-radius-lg: 24px;
  --gp-radius-xl: 32px;
  
  /* Transições */
  --gp-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --gp-transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --gp-transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset específico para jogos ──────────────────────────────────── */
.gp-game-board {
  font-family: var(--gp-font-display);
  color: var(--gp-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.gp-game-board * {
  box-sizing: border-box;
}

/* ── Keyframe Animations ───────────────────────────────────────────── */
@keyframes gp-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes gp-fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gp-fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gp-scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes gp-slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes gp-slideOutLeft {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-40px); }
}

@keyframes gp-slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

@keyframes gp-pulseGlow {
  0%, 100% { box-shadow: 0 0 20px var(--gp-glow-primary); }
  50% { box-shadow: 0 0 40px var(--gp-glow-primary), 0 0 60px var(--gp-glow-primary); }
}

@keyframes gp-pulseGlowAccent {
  0%, 100% { box-shadow: 0 0 20px var(--gp-glow-accent); }
  50% { box-shadow: 0 0 40px var(--gp-glow-accent), 0 0 60px var(--gp-glow-accent); }
}

@keyframes gp-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes gp-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes gp-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-12px) scale(1.05); }
}

@keyframes gp-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes gp-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes gp-countUp {
  from { opacity: 0; transform: translateY(10px) scale(0.8); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes gp-flipFront {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(180deg); }
}

@keyframes gp-flipBack {
  0% { transform: rotateY(180deg); }
  100% { transform: rotateY(0deg); }
}

@keyframes gp-soundWave {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

@keyframes gp-meteor {
  0% { transform: translateY(-100%) translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(120vh) translateX(20px) rotate(10deg); opacity: 0.3; }
}

@keyframes gp-confettiFall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0.6; }
}

@keyframes gp-flame {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  25% { transform: scale(1.05) rotate(2deg); }
  50% { transform: scale(0.95) rotate(-1deg); }
  75% { transform: scale(1.08) rotate(1deg); }
}

@keyframes gp-starTwinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes gp-popIn {
  0% { opacity: 0; transform: scale(0) rotate(-10deg); }
  70% { transform: scale(1.1) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes gp-progressFill {
  from { width: 0%; }
}

@keyframes gp-glowPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}

@keyframes gp-radar {
  0% { transform: scale(0); opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}

@keyframes gp-heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.15); }
  30% { transform: scale(1); }
  45% { transform: scale(1.1); }
}

/* ── Utility Classes ───────────────────────────────────────────────── */
.gp-anim-fadeIn { animation: gp-fadeIn var(--gp-transition) forwards; }
.gp-anim-fadeInUp { animation: gp-fadeInUp var(--gp-transition) forwards; }
.gp-anim-fadeInDown { animation: gp-fadeInDown var(--gp-transition) forwards; }
.gp-anim-scaleIn { animation: gp-scaleIn var(--gp-transition) forwards; }
.gp-anim-slideInRight { animation: gp-slideInRight var(--gp-transition-fast) forwards; }
.gp-anim-slideOutLeft { animation: gp-slideOutLeft var(--gp-transition-fast) forwards; }
.gp-anim-shake { animation: gp-shake 0.4s ease-in-out; }
.gp-anim-float { animation: gp-float 3s ease-in-out infinite; }
.gp-anim-bounce { animation: gp-bounce 0.6s ease-in-out; }
.gp-anim-pulseGlow { animation: gp-pulseGlow 2s ease-in-out infinite; }
.gp-anim-flame { animation: gp-flame 0.5s ease-in-out infinite; }
.gp-anim-popIn { animation: gp-popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.gp-anim-heartbeat { animation: gp-heartbeat 1s ease-in-out; }

/* ── Component: Button Premium ─────────────────────────────────────── */
.gp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--gp-font-display);
  color: #fff;
  background: linear-gradient(135deg, var(--gp-primary), var(--gp-primary-light));
  border: none;
  border-radius: var(--gp-radius);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: all var(--gp-transition-fast);
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.gp-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity var(--gp-transition-fast);
}

.gp-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.45), inset 0 1px 0 rgba(255,255,255,0.2);
}

.gp-btn:hover::before { opacity: 1; }

.gp-btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.gp-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Variantes de botão */
.gp-btn--accent {
  background: linear-gradient(135deg, var(--gp-accent), var(--gp-accent-light));
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}
.gp-btn--accent:hover { box-shadow: 0 8px 24px rgba(245, 158, 11, 0.45); }

.gp-btn--danger {
  background: linear-gradient(135deg, var(--gp-danger), var(--gp-danger-light));
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}
.gp-btn--danger:hover { box-shadow: 0 8px 24px rgba(239, 68, 68, 0.45); }

.gp-btn--info {
  background: linear-gradient(135deg, var(--gp-info), var(--gp-info-light));
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}
.gp-btn--info:hover { box-shadow: 0 8px 24px rgba(59, 130, 246, 0.45); }

.gp-btn--ghost {
  background: transparent;
  border: 2px solid var(--gp-border-hover);
  color: var(--gp-text);
  box-shadow: none;
}
.gp-btn--ghost:hover {
  border-color: var(--gp-primary-light);
  color: var(--gp-primary-light);
  box-shadow: 0 0 20px var(--gp-glow-primary);
}

.gp-btn--lg {
  padding: 1.125rem 2.5rem;
  font-size: 1.125rem;
  border-radius: var(--gp-radius-lg);
}

.gp-btn--xl {
  padding: 1.25rem 3rem;
  font-size: 1.25rem;
  border-radius: var(--gp-radius-xl);
}

/* ── Component: Card Premium ───────────────────────────────────────── */
.gp-card {
  background: var(--gp-surface);
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius);
  padding: 1.5rem;
  transition: all var(--gp-transition-fast);
  position: relative;
  overflow: hidden;
}

.gp-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gp-primary), var(--gp-primary-light));
  opacity: 0.6;
  transition: opacity var(--gp-transition-fast);
}

.gp-card:hover {
  border-color: var(--gp-border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(5, 150, 105, 0.1);
}

.gp-card:hover::before { opacity: 1; }

/* ── Component: Progress Bar ───────────────────────────────────────── */
.gp-progress {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.gp-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gp-primary), var(--gp-primary-light), var(--gp-primary));
  background-size: 200% 100%;
  border-radius: 999px;
  transition: width var(--gp-transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  animation: gp-shimmer 2s linear infinite;
}

.gp-progress__bar::after {
  content: '';
  position: absolute;
  right: 0;
  top: -2px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 12px var(--gp-glow-primary);
}

/* ── Component: Pill Badge ─────────────────────────────────────────── */
.gp-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.875rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(5, 150, 105, 0.15);
  color: var(--gp-primary-light);
  border: 1px solid rgba(5, 150, 105, 0.25);
  transition: all var(--gp-transition-fast);
}

.gp-pill--accent {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gp-accent-light);
  border-color: rgba(245, 158, 11, 0.25);
}

.gp-pill--danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--gp-danger-light);
  border-color: rgba(239, 68, 68, 0.25);
}

.gp-pill--glow {
  box-shadow: 0 0 12px var(--gp-glow-primary);
}

/* ── Component: Score Pop-up ──────────────────────────────────────── */
.gp-score-pop {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gp-accent-light);
  text-shadow: 0 0 20px var(--gp-glow-accent);
  animation: gp-countUp 0.8s ease-out forwards;
}

/* ── Component: Option Button (Multiple Choice) ────────────────────── */
.gp-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--gp-text);
  background: var(--gp-surface);
  border: 2px solid var(--gp-border);
  border-radius: var(--gp-radius);
  cursor: pointer;
  transition: all var(--gp-transition-fast);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.gp-option:hover {
  border-color: var(--gp-primary-light);
  background: rgba(5, 150, 105, 0.08);
  transform: translateX(4px);
}

.gp-option:hover .gp-option__letter {
  background: var(--gp-primary);
  color: #fff;
}

.gp-option__letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gp-text-muted);
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--gp-radius-sm);
  transition: all var(--gp-transition-fast);
  flex-shrink: 0;
}

.gp-option--correct {
  border-color: var(--gp-primary-light) !important;
  background: rgba(5, 150, 105, 0.15) !important;
  animation: gp-pulseGlow 1.5s ease-in-out;
}

.gp-option--correct .gp-option__letter {
  background: var(--gp-primary) !important;
  color: #fff !important;
}

.gp-option--wrong {
  border-color: var(--gp-danger) !important;
  background: rgba(239, 68, 68, 0.1) !important;
  animation: gp-shake 0.4s ease-in-out;
}

.gp-option--wrong .gp-option__letter {
  background: var(--gp-danger) !important;
  color: #fff !important;
}

/* ── Component: Audio Play Button ──────────────────────────────────── */
.gp-audio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--gp-primary), var(--gp-primary-light));
  border: none;
  border-radius: var(--gp-radius-lg);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4);
  transition: all var(--gp-transition-fast);
  position: relative;
}

.gp-audio-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(5, 150, 105, 0.5), 0 0 40px var(--gp-glow-primary);
}

.gp-audio-btn:active { transform: scale(0.98); }

.gp-audio-btn--playing {
  animation: gp-pulseGlow 1.2s ease-in-out infinite;
}

.gp-audio-btn--playing .gp-audio-btn__wave {
  display: flex;
}

.gp-audio-btn__wave {
  display: none;
  align-items: center;
  gap: 3px;
  height: 20px;
}

.gp-audio-btn__wave span {
  display: block;
  width: 3px;
  height: 100%;
  background: #fff;
  border-radius: 999px;
  animation: gp-soundWave 0.6s ease-in-out infinite;
}

.gp-audio-btn__wave span:nth-child(2) { animation-delay: 0.1s; }
.gp-audio-btn__wave span:nth-child(3) { animation-delay: 0.2s; }
.gp-audio-btn__wave span:nth-child(4) { animation-delay: 0.3s; }

/* ── Component: Sound Wave Visualizer ──────────────────────────────── */
.gp-wave-visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 48px;
}

.gp-wave-visualizer__bar {
  width: 4px;
  background: linear-gradient(180deg, var(--gp-primary-light), var(--gp-primary));
  border-radius: 999px;
  animation: gp-soundWave 0.5s ease-in-out infinite;
  transition: height 0.1s ease;
}

/* ── Component: Memory Card (3D Flip) ─────────────────────────────── */
.gp-memory-card {
  aspect-ratio: 1;
  perspective: 800px;
  cursor: pointer;
}

.gp-memory-card__inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--gp-radius);
}

.gp-memory-card.flipped .gp-memory-card__inner {
  transform: rotateY(180deg);
}

.gp-memory-card__front,
.gp-memory-card__back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--gp-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  padding: 10px;
}

.gp-memory-card__front {
  background: linear-gradient(135deg, #1e293b, #334155);
  border: 2px solid var(--gp-border);
  color: var(--gp-text-muted);
  transition: all var(--gp-transition-fast);
}

.gp-memory-card:hover .gp-memory-card__front {
  border-color: var(--gp-primary-light);
  box-shadow: 0 0 20px var(--gp-glow-primary);
}

.gp-memory-card__back {
  background: linear-gradient(135deg, var(--gp-primary-dark), var(--gp-primary));
  border: 2px solid var(--gp-primary-light);
  color: #fff;
  transform: rotateY(180deg);
  box-shadow: 0 0 30px var(--gp-glow-primary);
}

.gp-memory-card.matched .gp-memory-card__back {
  background: linear-gradient(135deg, #b45309, var(--gp-accent));
  border-color: var(--gp-accent-light);
  box-shadow: 0 0 40px var(--gp-glow-accent);
  animation: gp-starTwinkle 0.5s ease-in-out;
}

/* ── Component: Tile (Word Builder) ────────────────────────────────── */
.gp-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gp-text);
  background: linear-gradient(180deg, #334155, #1e293b);
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius-sm);
  box-shadow: 0 4px 0 #0f172a, 0 6px 12px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: all var(--gp-transition-fast);
  user-select: none;
}

.gp-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #0f172a, 0 8px 16px rgba(0,0,0,0.3), 0 0 12px var(--gp-glow-primary);
  border-color: var(--gp-primary-light);
}

.gp-tile:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #0f172a, 0 3px 6px rgba(0,0,0,0.3);
}

.gp-tile--used {
  opacity: 0.3;
  pointer-events: none;
  transform: scale(0.9);
}

.gp-tile--slot {
  background: rgba(255,255,255,0.05);
  border-style: dashed;
  border-color: var(--gp-border-hover);
  box-shadow: none;
  font-size: 1.5rem;
}

.gp-tile--filled {
  background: linear-gradient(180deg, var(--gp-primary-light), var(--gp-primary));
  border-color: var(--gp-primary-light);
  box-shadow: 0 4px 0 var(--gp-primary-dark), 0 6px 12px rgba(5,150,105,0.3);
  color: #fff;
}

/* ── Component: Falling Word (Speed Translate) ─────────────────────── */
.gp-falling-word {
  position: absolute;
  padding: 0.5rem 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 0.9));
  border: 1px solid rgba(147, 197, 253, 0.4);
  border-radius: var(--gp-radius);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3), 0 4px 8px rgba(0,0,0,0.2);
  backdrop-filter: blur(4px);
  white-space: nowrap;
  pointer-events: none;
}

.gp-falling-word--danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9));
  border-color: rgba(252, 165, 165, 0.4);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.gp-falling-word--bonus {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.9), rgba(217, 119, 6, 0.9));
  border-color: rgba(252, 211, 77, 0.4);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

/* ── Component: Lives (Speed Translate) ────────────────────────────── */
.gp-lives {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gp-life {
  width: 28px;
  height: 28px;
  position: relative;
  transition: all var(--gp-transition-fast);
}

.gp-life::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gp-danger-light), var(--gp-danger));
  border-radius: 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 0 12px var(--gp-glow-danger);
}

.gp-life--lost {
  opacity: 0.2;
  transform: scale(0.8);
}

.gp-life--lost::before {
  background: var(--gp-text-dim);
  box-shadow: none;
}

/* ── Component: Microphone Button (Say It Right) ───────────────────── */
.gp-mic-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--gp-danger), var(--gp-danger-light));
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
  transition: all var(--gp-transition-fast);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gp-mic-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.5);
}

.gp-mic-btn--recording {
  animation: gp-pulseGlow 1s ease-in-out infinite;
}

.gp-mic-btn--recording::before,
.gp-mic-btn--recording::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--gp-danger-light);
  animation: gp-radar 1.5s ease-out infinite;
}

.gp-mic-btn--recording::after {
  animation-delay: 0.5s;
}

/* ── Component: Confidence Bar (Say It Right) ──────────────────────── */
.gp-confidence {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.gp-confidence__fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease, background 0.5s ease;
  position: relative;
}

.gp-confidence__fill--high {
  background: linear-gradient(90deg, var(--gp-primary), var(--gp-primary-light));
  box-shadow: 0 0 12px var(--gp-glow-primary);
}

.gp-confidence__fill--medium {
  background: linear-gradient(90deg, var(--gp-accent), var(--gp-accent-light));
  box-shadow: 0 0 12px var(--gp-glow-accent);
}

.gp-confidence__fill--low {
  background: linear-gradient(90deg, var(--gp-danger), var(--gp-danger-light));
  box-shadow: 0 0 12px var(--gp-glow-danger);
}

/* ── Component: Input Premium ──────────────────────────────────────── */
.gp-input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--gp-text);
  background: var(--gp-surface);
  border: 2px solid var(--gp-border);
  border-radius: var(--gp-radius);
  outline: none;
  transition: all var(--gp-transition-fast);
  font-family: var(--gp-font-display);
}

.gp-input:focus {
  border-color: var(--gp-primary-light);
  box-shadow: 0 0 20px var(--gp-glow-primary), inset 0 1px 0 rgba(255,255,255,0.05);
}

.gp-input::placeholder {
  color: var(--gp-text-dim);
}

/* ── Component: Streak Flame ───────────────────────────────────────── */
.gp-streak {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gp-accent-light);
}

.gp-streak__flame {
  display: inline-block;
  animation: gp-flame 0.5s ease-in-out infinite;
}

.gp-streak--hot {
  color: #f97316;
  text-shadow: 0 0 12px rgba(249, 115, 22, 0.4);
}

.gp-streak--hot .gp-streak__flame {
  animation-duration: 0.3s;
}

/* ── Component: Game Board Container ───────────────────────────────── */
.gp-board {
  background: linear-gradient(180deg, var(--gp-bg), #1a2332);
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius-lg);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  min-height: 400px;
}

.gp-board::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 30%, rgba(5, 150, 105, 0.03), transparent 50%);
  pointer-events: none;
}

/* Estados do board */
.gp-board--correct {
  animation: gp-glowPulse 0.6s ease-in-out;
  border-color: rgba(5, 150, 105, 0.4);
}

.gp-board--wrong {
  animation: gp-shake 0.4s ease-in-out;
  border-color: rgba(239, 68, 68, 0.4);
}

/* ── Component: Confetti Container ─────────────────────────────────── */
.gp-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}

.gp-confetti__piece {
  position: absolute;
  width: 10px;
  height: 10px;
  animation: gp-confettiFall 3s ease-in infinite;
}

/* ── Component: Mode Selector ──────────────────────────────────────── */
.gp-mode-selector {
  display: grid;
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.gp-mode-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  background: var(--gp-surface);
  border: 2px solid var(--gp-border);
  border-radius: var(--gp-radius);
  cursor: pointer;
  transition: all var(--gp-transition-fast);
  text-align: left;
}

.gp-mode-card:hover {
  border-color: var(--gp-primary-light);
  background: rgba(5, 150, 105, 0.06);
  transform: translateX(8px);
}

.gp-mode-card__icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.2), rgba(16, 185, 129, 0.1));
  border-radius: var(--gp-radius);
  flex-shrink: 0;
}

.gp-mode-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gp-text);
  margin-bottom: 0.25rem;
}

.gp-mode-card__desc {
  font-size: 0.875rem;
  color: var(--gp-text-muted);
}

.gp-mode-card--selected {
  border-color: var(--gp-primary-light);
  background: rgba(5, 150, 105, 0.1);
  box-shadow: 0 0 30px var(--gp-glow-primary);
}

/* ── Component: Result Screen ──────────────────────────────────────── */
.gp-result {
  text-align: center;
  padding: 2rem;
  animation: gp-scaleIn var(--gp-transition) forwards;
}

.gp-result__icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: inline-block;
  animation: gp-bounce 1s ease-in-out infinite;
}

.gp-result__score {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gp-primary-light), var(--gp-accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.gp-result__label {
  font-size: 1rem;
  color: var(--gp-text-muted);
  margin-bottom: 1.5rem;
}

.gp-result__stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.gp-result__stat {
  text-align: center;
}

.gp-result__stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gp-text);
}

.gp-result__stat-label {
  font-size: 0.8rem;
  color: var(--gp-text-muted);
}

/* ── Stats Bar (Game Header) ───────────────────────────────────────── */
.gp-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--gp-surface);
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius);
  margin-bottom: 1.5rem;
}

.gp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.gp-stat__value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gp-text);
  line-height: 1;
}

.gp-stat__label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gp-text-muted);
}

.gp-stat--accent .gp-stat__value { color: var(--gp-accent-light); }
.gp-stat--danger .gp-stat__value { color: var(--gp-danger-light); }

/* ── Game Header ───────────────────────────────────────────────────── */
.gp-game-header {
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
}

.gp-game-header__title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gp-text);
  margin-bottom: 0.25rem;
}

.gp-game-header__subtitle {
  font-size: 0.9rem;
  color: var(--gp-text-muted);
}

.gp-game-header__badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gp-primary-light);
  background: rgba(5, 150, 105, 0.12);
  border: 1px solid rgba(5, 150, 105, 0.25);
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

/* ── Timer Circular ────────────────────────────────────────────────── */
.gp-timer {
  position: relative;
  width: 56px;
  height: 56px;
}

.gp-timer__svg {
  transform: rotate(-90deg);
}

.gp-timer__bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 4;
}

.gp-timer__progress {
  fill: none;
  stroke: var(--gp-primary-light);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.gp-timer__text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gp-text);
}

/* ── Reduced Motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .gp-board {
    padding: 1.25rem;
    border-radius: var(--gp-radius);
  }
  
  .gp-btn--xl {
    padding: 1rem 2rem;
    font-size: 1.125rem;
  }
  
  .gp-result__score {
    font-size: 2.5rem;
  }
  
  .gp-mode-card {
    padding: 1.25rem;
  }
  
  .gp-mode-card__icon {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
  
  .gp-option {
    padding: 0.875rem 1rem;
  }
  
  .gp-tile {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}
