/* ===== TEMA - CSS Variables ===== */
:root {
  /* Base palette */
  --bg-primary:      #FAF7F2;
  --bg-secondary:    #FFFFFF;
  --bg-card:         #FFFFFF;
  --text-primary:    #2D2926;
  --text-secondary:  #6B5E57;

  /* Accent system */
  --accent-primary:   #2B9E8F;
  --accent-secondary: #E8913A;
  --accent-tertiary:  #9B7EC8;
  --accent-success:   #4CAF7D;
  --accent-danger:    #E85D5D;
  --accent-warning:   #F0B429;

  /* Legacy aliases — keeps existing game CSS working */
  --accent-pink:   var(--accent-secondary);
  --accent-purple: var(--accent-tertiary);
  --accent-blue:   var(--accent-primary);
  --accent-yellow: var(--accent-warning);
  --accent-green:  var(--accent-success);
  --accent-red:    var(--accent-danger);
  --accent-orange: var(--accent-secondary);

  /* Surfaces */
  --card-border:   1.5px solid #E8E2DA;
  --shadow:        0 2px 12px rgba(45,41,38,0.08);
  --shadow-lg:     0 6px 24px rgba(45,41,38,0.14);
  --overlay:       rgba(250,247,242,0.95);

  /* Shape */
  --border-radius: 16px;
  --radius-sm:     8px;
  --radius-md:     16px;
  --radius-lg:     24px;

  /* Spacing scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
}

[data-theme="dark"] {
  --bg-primary:      #1A1E2E;
  --bg-secondary:    #242838;
  --bg-card:         #2A2F42;
  --text-primary:    #F0EDE8;
  --text-secondary:  #A09890;
  --accent-primary:   #3DBFAD;
  --accent-secondary: #F0A050;
  --accent-tertiary:  #B090E0;
  --card-border:   1.5px solid #3A3F52;
  --shadow:        0 2px 12px rgba(0,0,0,0.25);
  --shadow-lg:     0 6px 24px rgba(0,0,0,0.35);
  --overlay:       rgba(26,30,46,0.95);
}

/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Bubblegum Sans', 'Comic Neue', cursive, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* ===== TELAS ===== */
.screen {
  display: none;
  min-height: 100vh;
  padding: 20px 20px 90px;
  animation: screenSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

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

@keyframes screenSlideIn {
  from { opacity: 0; transform: translateY(28px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ===== DARK MODE TOGGLE ===== */
.theme-toggle {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 100;
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, background 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1) rotate(20deg);
}

/* ===== BOTÃO MÚSICA ===== */
.music-toggle {
  position: fixed;
  top: 75px;
  right: 15px;
  z-index: 100;
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, background 0.3s ease;
}

.music-toggle:hover {
  transform: scale(1.1);
}

/* ===== MINIPLAYER MINIMIZE ===== */
.miniplayer-minimize {
  font-size: 14px;
  padding: 4px 6px;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-left: 2px;
}

.miniplayer.minimized .miniplayer-btns,
.miniplayer.minimized .miniplayer-progress {
  display: none;
}

.miniplayer.minimized {
  padding: 6px 16px;
}

.miniplayer.minimized .miniplayer-top {
  margin-bottom: 0;
}

/* ===== PAINEL DE MÚSICA ===== */
.music-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 150;
  display: none;
}

.music-panel-overlay.open {
  display: block;
}

.music-panel {
  position: fixed;
  bottom: -100%;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 96vw);
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  border: var(--card-border);
  border-bottom: none;
  box-shadow: var(--shadow-lg);
  z-index: 160;
  padding: 20px 20px 30px;
  transition: bottom 0.35s cubic-bezier(.32,1.25,.55,1);
  max-height: 80vh;
  overflow-y: auto;
}

.music-panel.open {
  bottom: 0;
}

.music-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 20px;
  color: var(--text-primary);
}

.music-panel-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.music-panel-close:hover {
  background: var(--bg-secondary);
}

.music-panel-global {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 14px;
  font-size: 17px;
  color: var(--text-primary);
  border-bottom: 2px solid var(--card-border);
  margin-bottom: 6px;
}

.music-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--card-border);
}

.music-item:last-child {
  border-bottom: none;
}

.music-item-name {
  font-size: 15px;
  color: var(--text-secondary);
  flex: 1;
  margin-right: 12px;
}

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-purple);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ===== BOTÃO VOLTAR ===== */
.btn-back {
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 100;
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.btn-back:hover {
  transform: scale(1.1);
}

/* ===== TELA DE BOAS-VINDAS ===== */
.welcome-title {
  font-size: 42px;
  color: var(--accent-pink);
  text-align: center;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.welcome-subtitle {
  font-size: 22px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 30px;
}

.welcome-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent-pink);
  box-shadow: var(--shadow-lg);
  margin-bottom: 30px;
  animation: float 3s ease-in-out infinite;
}

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

.name-input {
  font-family: inherit;
  font-size: 24px;
  padding: 15px 25px;
  border: 3px solid var(--accent-purple);
  border-radius: 15px;
  background: var(--bg-card);
  color: var(--text-primary);
  text-align: center;
  width: 300px;
  max-width: 90%;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.name-input:focus {
  border-color: var(--accent-pink);
  box-shadow: 0 0 15px rgba(255, 107, 157, 0.3);
}

.name-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

/* ===== BOTÕES ===== */
.btn {
  font-family: inherit;
  font-size: 24px;
  padding: 15px 40px;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow);
  color: white;
  min-height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(0) scale(0.97);
}

.btn-primary  { background: linear-gradient(135deg, var(--accent-primary), #3DBFAD); }
.btn-secondary { background: var(--bg-secondary); color: var(--text-primary); border: var(--card-border); }
.btn-pink { background: linear-gradient(135deg, #ff6b9d, #ff85b5); }
.btn-purple { background: linear-gradient(135deg, #a855f7, #c084fc); }
.btn-blue { background: linear-gradient(135deg, #38bdf8, #7dd3fc); }
.btn-green { background: linear-gradient(135deg, #22c55e, #4ade80); }
.btn-red { background: linear-gradient(135deg, #ef4444, #f87171); }
.btn-yellow { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #4a2040; }

.btn-large {
  font-size: 28px;
  padding: 20px 50px;
  min-height: 70px;
}

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

/* ===== MENU DE JOGOS ===== */
.menu-greeting {
  font-size: 28px;
  color: var(--accent-pink);
  text-align: center;
  margin-bottom: 5px;
}

.menu-subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 25px;
}

.game-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  max-width: 800px;
  margin-bottom: 25px;
}

.game-card {
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: var(--border-radius);
  padding: 25px 20px;
  width: 220px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: var(--shadow-lg);
}

.game-card-icon {
  font-size: 50px;
  margin-bottom: 10px;
}

.game-card-title {
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.game-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ===== SELETOR DE DIFICULDADE ===== */
.difficulty-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
}

.difficulty-label {
  font-size: 18px;
  color: var(--text-secondary);
  margin-right: 5px;
}

.difficulty-btn {
  font-family: inherit;
  font-size: 16px;
  padding: 10px 18px;
  border: 2px solid var(--accent-purple);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.difficulty-btn.active {
  background: var(--accent-purple);
  color: white;
  border-color: var(--accent-purple);
}

.difficulty-btn:hover:not(.active) {
  background: var(--bg-secondary);
  transform: translateY(-2px);
}

/* ===== MENU BUTTONS (stats/achievements) ===== */
.menu-actions {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.menu-action-btn {
  font-family: inherit;
  font-size: 16px;
  padding: 10px 20px;
  border: var(--card-border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.menu-action-btn:hover {
  transform: translateY(-2px);
}

/* ===== SCORE DISPLAY ===== */
.score-bar {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: 25px;
  padding: 8px 20px;
  font-size: 20px;
  box-shadow: var(--shadow);
  z-index: 90;
  display: none;
  align-items: center;
  gap: 8px;
}

.score-bar.visible {
  display: flex;
}

.score-stars {
  color: var(--accent-yellow);
}

/* ===== QUIZ (V/F e ADIVINHA) ===== */
.quiz-container {
  max-width: 600px;
  width: 100%;
  text-align: center;
}

.quiz-photo {
  width: 280px;
  height: 280px;
  object-fit: contain;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  border: 3px solid var(--accent-pink);
  box-shadow: var(--shadow-lg);
  margin-bottom: 20px;
}

.quiz-question {
  font-size: 26px;
  color: var(--text-primary);
  margin-bottom: 25px;
  padding: 0 10px;
  line-height: 1.4;
}

.quiz-progress {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.quiz-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.quiz-buttons .btn {
  min-width: 140px;
}

/* ===== TUTORIAL ===== */
.tutorial-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 210;
  animation: fadeIn 0.3s ease;
}

.tutorial-overlay.visible {
  display: flex;
}

.tutorial-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 28px 28px 24px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: var(--card-border);
  animation: screenSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.tutorial-floyd {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  display: block;
  border: 3px solid var(--accent-pink);
  animation: floydBounce 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.tutorial-badge {
  display: inline-block;
  background: var(--accent-purple);
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
  font-family: "Bubblegum Sans", cursive;
  letter-spacing: 0.5px;
}

.tutorial-title {
  font-size: 22px;
  font-family: "Bubblegum Sans", cursive;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.tutorial-text {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.4;
}

.tutorial-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tutorial-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 8px 12px;
  line-height: 1.3;
}

.tutorial-steps li .step-icon {
  font-size: 20px;
  flex-shrink: 0;
}

/* ===== FEEDBACK ===== */
.feedback-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.3s ease;
}

.feedback-overlay.visible {
  display: flex;
}

.feedback-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 24px 30px 30px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: var(--card-border);
}

/* ===== MASCOTE FLOYD NO FEEDBACK ===== */
.feedback-floyd {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 8px;
  border: 3px solid var(--accent-purple);
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.feedback-floyd.bounce {
  animation: floydBounce 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.feedback-floyd.wobble {
  animation: floydWobble 0.5s ease;
}

@keyframes floydBounce {
  0%   { transform: scale(0.6) translateY(10px); opacity: 0; }
  60%  { transform: scale(1.12) translateY(-6px); opacity: 1; }
  80%  { transform: scale(0.95) translateY(2px); }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes floydWobble {
  0%   { transform: scale(0.8) rotate(0deg);   opacity: 0; }
  30%  { transform: scale(1)   rotate(-8deg);  opacity: 1; }
  60%  { transform: scale(1)   rotate(6deg); }
  80%  { transform: scale(1)   rotate(-3deg); }
  100% { transform: scale(1)   rotate(0deg);   opacity: 1; }
}

.feedback-icon {
  font-size: 44px;
  margin-bottom: 10px;
}

.feedback-title {
  font-size: 28px;
  margin-bottom: 10px;
}

.feedback-title.correct {
  color: var(--accent-green);
}

.feedback-title.wrong {
  color: var(--accent-red);
}

.feedback-text {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.4;
}

.star-animation {
  animation: starPop 0.5s ease;
}

@keyframes starPop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== JOGO DA MEMÓRIA ===== */
.memory-grid {
  display: grid;
  gap: 12px;
  justify-content: center;
  margin: 20px auto;
  max-width: 600px;
}

.memory-grid.grid-2x2 { grid-template-columns: repeat(2, 120px); }
.memory-grid.grid-2x3 { grid-template-columns: repeat(3, 120px); }
.memory-grid.grid-3x4 { grid-template-columns: repeat(4, 100px); }

.memory-card {
  position: relative;
  width: 120px;
  height: 120px;
  cursor: pointer;
  perspective: 600px;
}

.memory-grid.grid-3x4 .memory-card {
  width: 100px;
  height: 100px;
}

.memory-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

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

.memory-card.matched .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-card.matched {
  animation: matchBounce 0.5s ease;
}

@keyframes matchBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.memory-card-front,
.memory-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--accent-purple);
}

.memory-card-back {
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
  font-size: 40px;
  box-shadow: var(--shadow);
}

.memory-card-front {
  transform: rotateY(180deg);
  overflow: hidden;
}

.memory-card-front img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.memory-info {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

/* ===== TELA DE PARABÉNS ===== */
.congrats-photo {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--accent-yellow);
  box-shadow: var(--shadow-lg);
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}

.congrats-title {
  font-size: 36px;
  color: var(--accent-yellow);
  margin-bottom: 10px;
}

.congrats-score {
  font-size: 24px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.congrats-message {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 25px;
  max-width: 400px;
  text-align: center;
  line-height: 1.4;
}

.congrats-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.achievement-unlock {
  background: var(--bg-card);
  border: 3px solid var(--accent-yellow);
  border-radius: var(--border-radius);
  padding: 15px 25px;
  margin-bottom: 20px;
  text-align: center;
  animation: achievePop 0.6s ease;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

@keyframes achievePop {
  0% { transform: scale(0) rotate(-10deg); opacity: 0; }
  60% { transform: scale(1.1) rotate(3deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.achievement-unlock-icon { font-size: 40px; }
.achievement-unlock-text {
  font-size: 18px;
  color: var(--accent-yellow);
  margin-top: 5px;
}

/* ===== ESTATÍSTICAS ===== */
.stats-container {
  max-width: 500px;
  width: 100%;
}

.stats-title {
  font-size: 30px;
  color: var(--accent-pink);
  text-align: center;
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 25px;
}

.stat-card {
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 32px;
  color: var(--accent-purple);
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 5px;
}

/* ===== CONQUISTAS ===== */
.achievements-title {
  font-size: 30px;
  color: var(--accent-yellow);
  text-align: center;
  margin-bottom: 20px;
}

.achievements-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 400px;
  width: 100%;
  margin-bottom: 20px;
}

.achievement-item {
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: 15px;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.achievement-item.locked {
  opacity: 0.5;
  filter: grayscale(0.8);
}

.achievement-item.unlocked {
  border-color: var(--accent-yellow);
}

.achievement-item.new {
  animation: achievePulse 1s ease infinite;
}

@keyframes achievePulse {
  0%, 100% { box-shadow: 0 0 5px rgba(251, 191, 36, 0.3); }
  50% { box-shadow: 0 0 20px rgba(251, 191, 36, 0.6); }
}

.achievement-icon { font-size: 35px; }
.achievement-info { flex: 1; }
.achievement-name {
  font-size: 16px;
  color: var(--text-primary);
}
.achievement-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== CONFETTI ===== */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 300;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 12px;
  height: 12px;
  top: -20px;
  animation: confettiFall linear forwards;
}

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

/* ===== RESPONSIVO ===== */
@media (max-width: 600px) {
  .welcome-title { font-size: 32px; }
  .welcome-subtitle { font-size: 18px; }
  .welcome-photo { width: 150px; height: 150px; }
  .name-input { font-size: 20px; width: 260px; }

  .game-card { width: 90%; max-width: 360px; padding: 20px 15px; }
  .game-cards { flex-direction: column; align-items: center; }

  .quiz-photo { width: 220px; height: 220px; }
  .quiz-question { font-size: 22px; }
  .btn { font-size: 20px; padding: 12px 30px; }
  .btn-large { font-size: 24px; padding: 15px 35px; }

  .memory-card { width: 90px; height: 90px; }
  .memory-grid.grid-3x4 .memory-card { width: 75px; height: 75px; }
  .memory-card-back { font-size: 30px; }

  .congrats-photo { width: 180px; height: 180px; }
  .congrats-title { font-size: 28px; }

  .stats-grid { grid-template-columns: 1fr; }

  .difficulty-selector { flex-wrap: wrap; justify-content: center; }
  .difficulty-label { width: 100%; text-align: center; }

  .score-bar { font-size: 16px; padding: 6px 15px; }

  .miniplayer-nome { font-size: 13px; }
}

/* ===== MINIPLAYER ===== */
.miniplayer {
  position: fixed;
  bottom: -80px;
  left: 0;
  right: 0;
  z-index: 95;
  background: var(--bg-card);
  border-top: var(--card-border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
  padding: 10px 16px 6px;
  transition: bottom 0.35s cubic-bezier(.32,1.25,.55,1);
}

.miniplayer.visible {
  bottom: 0;
}

.miniplayer-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.miniplayer-note {
  font-size: 16px;
  flex-shrink: 0;
}

.miniplayer-nome {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.miniplayer-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.miniplayer-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--text-primary);
  transition: background 0.15s, transform 0.15s;
  line-height: 1;
}

.miniplayer-btn:hover {
  background: var(--bg-secondary);
  transform: scale(1.15);
}

.miniplayer-pp {
  font-size: 22px;
  color: var(--accent-pink);
}

/* Barra de progresso */
.miniplayer-progress {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: var(--bg-secondary);
  outline: none;
  cursor: pointer;
  accent-color: var(--accent-purple);
}

.miniplayer-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-purple);
  cursor: pointer;
  transition: transform 0.15s;
}

.miniplayer-progress::-webkit-slider-thumb:hover {
  transform: scale(1.4);
}

.miniplayer-progress::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-purple);
  border: none;
  cursor: pointer;
}

.miniplayer-vol-wrap {
  position: relative;
}

.miniplayer-vol-popup {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  padding: 14px 10px;
  flex-direction: column;
  align-items: center;
  z-index: 200;
}

.miniplayer-vol-popup.open {
  display: flex;
}

.miniplayer-volume {
  -webkit-appearance: slider-vertical;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 4px;
  height: 80px;
  cursor: pointer;
  accent-color: var(--accent-pink);
  outline: none;
}

/* ===== NÍVEL BADGE (MENU) ===== */
.nivel-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: 20px;
  padding: 10px 18px;
  margin: 0 auto 12px;
  max-width: 340px;
  box-shadow: var(--shadow);
}

.nivel-badge > :first-child {
  font-size: 26px;
  flex-shrink: 0;
}

.nivel-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#nivel-nome {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-primary);
  font-family: "Bubblegum Sans", cursive;
}

.nivel-xp-bar {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
}

.nivel-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-pink), var(--accent-purple));
  border-radius: 3px;
  transition: width 0.6s ease;
}

.nivel-numero {
  font-size: 13px;
  font-weight: bold;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* ===== LEVEL-UP BANNER (CONGRATS) ===== */
.levelup-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-radius: 16px;
  padding: 14px 20px;
  margin: 14px auto;
  max-width: 340px;
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.4);
  animation: levelup-pop 0.5s ease;
}

.levelup-icon {
  font-size: 36px;
  flex-shrink: 0;
}

.levelup-text {
  color: #1c1c1c;
  font-size: 14px;
  line-height: 1.5;
  font-family: "Bubblegum Sans", cursive;
}

.levelup-fotos {
  font-size: 12px;
  opacity: 0.8;
}

@keyframes levelup-pop {
  0%   { transform: scale(0.7); opacity: 0; }
  70%  { transform: scale(1.05); }
  100% { transform: scale(1);   opacity: 1; }
}

/* ===== GALERIA ===== */
.galeria-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

.galeria-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
  padding: 0 8px;
}

.galeria-card {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
  position: relative;
  box-shadow: var(--shadow);
}

.galeria-card.desbloqueada img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.galeria-card.desbloqueada:hover img {
  transform: scale(1.05);
}

.galeria-card-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 10px;
  padding: 4px 6px;
  text-align: center;
  line-height: 1.2;
}

.galeria-card.bloqueada {
  background: var(--bg-secondary);
  border: var(--card-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.galeria-card-lock {
  font-size: 28px;
  opacity: 0.4;
}

.galeria-card.bloqueada .galeria-card-label {
  position: static;
  background: none;
  color: var(--text-secondary);
  font-size: 10px;
  padding: 0 6px;
}

.screen-title {
  text-align: center;
  font-family: "Bubblegum Sans", cursive;
  color: var(--text-primary);
  margin-bottom: 6px;
}

/* ===== PLACAR ===== */
.placar-subtitulo {
  font-family: "Bubblegum Sans", cursive;
  color: var(--text-primary);
  text-align: center;
  margin: 20px 0 8px;
  font-size: 17px;
}

.placar-lista {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  width: 100%;
  max-width: 420px;
}

.placar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: 12px;
  margin-bottom: 6px;
  font-size: 13px;
}

.placar-primeiro {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #f59e0b;
}

[data-theme="dark"] .placar-primeiro {
  background: linear-gradient(135deg, #451a03, #78350f);
}

.placar-pos { font-size: 18px; flex-shrink: 0; }
.placar-nome { flex: 1; font-weight: bold; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.placar-estrelas { color: #f59e0b; flex-shrink: 0; }
.placar-precisao { color: var(--text-secondary); flex-shrink: 0; font-size: 11px; }
.placar-data { color: var(--text-secondary); flex-shrink: 0; font-size: 11px; }

/* ===== DESAFIO DIÁRIO ===== */
.desafio-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 16px;
  padding: 10px 18px;
  margin: 0 auto 10px;
  max-width: 340px;
  cursor: pointer;
  transition: transform 0.2s ease;
  font-family: "Bubblegum Sans", cursive;
  font-size: 15px;
}

.desafio-badge:hover { transform: scale(1.02); }

.desafio-badge.disponivel {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #1c1c1c;
  box-shadow: 0 4px 14px rgba(251, 191, 36, 0.4);
  animation: pulseGlow 2s ease-in-out infinite;
}

.desafio-badge.feito {
  background: var(--bg-card);
  border: var(--card-border);
  color: var(--text-secondary);
  box-shadow: var(--shadow);
}

.desafio-icone { font-size: 22px; }

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 4px 14px rgba(251, 191, 36, 0.4); }
  50%       { box-shadow: 0 4px 22px rgba(251, 191, 36, 0.7); }
}

/* ===== RELÂMPAGO ===== */
.relampago-timer-bar {
  width: 100%;
  max-width: 360px;
  height: 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 6px;
}

.relampago-timer-fill {
  height: 100%;
  width: 100%;
  border-radius: 6px;
  background: #4ade80;
  transition: width 0.9s linear, background 0.3s ease;
}

.relampago-tempo {
  font-family: "Bubblegum Sans", cursive;
  font-size: 22px;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.relampago-flash {
  font-family: "Bubblegum Sans", cursive;
  font-size: 32px;
  text-align: center;
  padding: 8px;
  border-radius: 12px;
  margin-bottom: 10px;
  animation: fadeIn 0.2s ease;
}

.relampago-flash.correto { color: var(--accent-green); }
.relampago-flash.errado  { color: var(--accent-red); }

/* ===== CAÇA-PALAVRAS ===== */
.cp-palavras-lista {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 14px;
  max-width: 360px;
}

.cp-palavra {
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 13px;
  font-family: "Bubblegum Sans", cursive;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.cp-palavra.encontrada {
  background: var(--accent-green);
  color: white;
  text-decoration: line-through;
  border-color: var(--accent-green);
}

.cp-grade {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 3px;
  max-width: 360px;
  width: 100%;
  user-select: none;
  touch-action: none;
}

.cp-celula {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Bubblegum Sans", cursive;
  font-size: 15px;
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  color: var(--text-primary);
}

.cp-celula.selecionada {
  background: var(--accent-purple);
  color: white;
  border-color: var(--accent-purple);
}

.cp-celula.encontrada-cel {
  background: var(--accent-green);
  color: white;
  border-color: var(--accent-green);
}

/* ===== O MUNDO DO FLOYD ===== */

.moedas-global {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.95rem;
  font-weight: bold;
  z-index: 100;
  display: none;
}

#screen-floyd .moedas-global,
body.screen-floyd-active .moedas-global { display: flex; align-items: center; gap: 4px; }

.floyd-sala {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px;
  max-width: 420px;
  margin: 0 auto;
}

.floyd-sala-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.floyd-streak-badge {
  background: var(--accent-orange);
  color: white;
  border-radius: 20px;
  padding: 4px 14px;
  font-weight: bold;
  font-size: 0.95rem;
}

.floyd-moedas-display {
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: 20px;
  padding: 4px 14px;
  font-weight: bold;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.floyd-sala-img {
  width: min(280px, 80vw);
  height: min(280px, 80vw);
  object-fit: contain;
  border-radius: 16px;
}

.floyd-humor-label {
  font-size: 1.2rem;
  font-weight: bold;
}

.floyd-saudacao {
  font-size: 1rem;
  text-align: center;
  color: var(--text-secondary);
  margin: 0;
}

.floyd-interacoes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.btn-interacao {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 16px;
  font-size: 0.95rem;
  flex: 1;
  min-width: 90px;
}

.btn-interacao .custo {
  font-size: 0.78rem;
  opacity: 0.85;
}

.btn-interacao:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.floyd-conteudo-diario {
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: 14px;
  padding: 14px 18px;
  width: 100%;
  box-sizing: border-box;
}

.floyd-conteudo-titulo {
  font-weight: bold;
  margin-bottom: 6px;
  font-size: 1rem;
}

.floyd-conteudo-texto {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.btn-congelar {
  width: 100%;
  justify-content: center;
}

.btn-floyd-menu {
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
  color: white;
  font-weight: bold;
}

.congrats-moedas {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--accent-orange);
  margin: 4px 0;
}

/* ===== PHASE 1: TOAST ===== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  color: var(--text-primary);
  border: var(--card-border);
  box-shadow: var(--shadow-lg);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  max-width: 320px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
  pointer-events: none;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== LOGIN BANNER ===== */
.login-banner {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(135deg, var(--accent-teal), #1a7a70);
  border-radius: var(--border-radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-md);
}

.login-banner-text {
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
}

.login-banner-text strong {
  display: block;
  font-size: 16px;
}

.login-banner-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.login-banner-actions .btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

.login-banner-dismiss {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 18px;
  cursor: pointer;
  margin-left: auto;
  padding: 4px 8px;
  line-height: 1;
}

.login-banner-dismiss:hover {
  color: #fff;
}

/* ===== PHASE 1: LOCK BADGE ===== */
.game-card {
  position: relative;
}
.lock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1.1rem;
  background: rgba(0,0,0,0.15);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
}
.game-card.locked {
  opacity: 0.75;
}
.game-card.locked .lock-badge {
  display: inline;
}

/* ===== PHASE 1: LOGIN BANNER ===== */
.login-banner {
  background: var(--accent-primary);
  color: #fff;
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.9rem;
  text-align: center;
  margin-top: var(--space-md);
  cursor: pointer;
}

/* ===== PHASE 1: FULLSCREEN OVERLAYS ===== */
.overlay-fullscreen {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-md);
}
.overlay-fullscreen[hidden] { display: none; }

.upgrade-card,
.nudge-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  max-width: 360px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  box-shadow: var(--shadow-lg);
}
.overlay-floyd-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0 auto;
}
.upgrade-title { font-size: 1.3rem; font-weight: bold; }
.upgrade-game-name {
  font-size: 1.1rem;
  color: var(--accent-primary);
  font-weight: bold;
}
.upgrade-plans {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.btn-plan-annual { background: var(--accent-secondary); color: #fff; }
.btn-text {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  padding: var(--space-sm);
}

/* ===== PHASE 1: MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  padding: var(--space-md);
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  max-width: 320px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  box-shadow: var(--shadow-lg);
}

/* ===== PHASE 1: SHOP ===== */
.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}
.coins-display {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--accent-secondary);
}
.shop-tabs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.tab {
  flex: 1;
  padding: var(--space-sm);
  border: var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}
.tab.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}
@media (min-width: 480px) {
  .shop-grid { grid-template-columns: repeat(3, 1fr); }
}
.shop-card {
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-align: center;
  box-shadow: var(--shadow);
}
.shop-card--premium {
  border-color: var(--accent-secondary);
  background: linear-gradient(135deg, var(--bg-card), rgba(232,145,58,0.05));
}
.shop-card-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
}
.shop-card-name { font-weight: bold; font-size: 0.9rem; }
.shop-card-desc { font-size: 0.78rem; color: var(--text-secondary); }
.btn-owned { background: var(--accent-success); color: #fff; opacity: 0.7; }
.btn-premium-locked { background: var(--accent-secondary); color: #fff; }

/* ===== PHASE 1: ADMIN ===== */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
@media (max-width: 480px) {
  .admin-grid { grid-template-columns: 1fr; }
}
.admin-panel {
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow);
}
.admin-panel h2 { font-size: 1rem; margin-bottom: var(--space-sm); }
.admin-panel ul { list-style: none; padding: 0; font-size: 0.85rem; }
.admin-panel li { padding: 2px 0; color: var(--text-secondary); }
