
  :root {
    --sky: #4FC3F7;
    --sky-dark: #0288D1;
    --sun: #FFD54F;
    --sun-dark: #FF8F00;
    --grass: #66BB6A;
    --grass-dark: #388E3C;
    --purple: #CE93D8;
    --purple-dark: #7B1FA2;
    --coral: #FF8A65;
    --coral-dark: #E64A19;
    --mint: #80CBC4;
    --bg: #EEF9FF;
    --card: #FFFFFF;
    --text: #263238;
    --text-muted: #546E7A;
    --xp-color: #FFB300;
    --radius: 20px;
    --shadow: 0 8px 32px rgba(0,0,0,0.10);
    --shadow-sm: 0 4px 16px rgba(0,0,0,0.08);
    /* Cor do perfil (personalizável) */
    --profile-color: #7B1FA2;
    --profile-color-light: #F3E5F5;
  }

  /* ══ TEMA ESCURO ══ */
  body.tema-escuro {
    --bg: #0F1923;
    --card: #1A2535;
    --text: #E8F0FE;
    --text-muted: #8FA3BF;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-sm: 0 4px 16px rgba(0,0,0,0.3);
    --sky: #4FC3F7;
    --sky-dark: #29B6F6;
  }
  body.tema-escuro .topnav { background: #1A2535; border-bottom: 1px solid #263545; }
  body.tema-escuro .auth-card,
  body.tema-escuro .module-card,
  body.tema-escuro .stat-card,
  body.tema-escuro .game-topbar,
  body.tema-escuro .lesson-topbar,
  body.tema-escuro .lesson-card,
  body.tema-escuro .profile-section,
  body.tema-escuro .challenge-card,
  body.tema-escuro .badge-item,
  body.tema-escuro .ranking-item { background: #1A2535; color: var(--text); }
  body.tema-escuro .form-input { background: #263545; border-color: #37475A; color: var(--text); }
  body.tema-escuro .form-input:focus { border-color: var(--sky); }
  body.tema-escuro .auth-tabs { background: #263545; }
  body.tema-escuro .auth-tab.active { background: #1A2535; }
  body.tema-escuro .quiz-opt { background: #1A2535; border-color: #37475A; color: var(--text); }
  body.tema-escuro .quiz-opt:hover { background: #263545; border-color: var(--sky); }
  body.tema-escuro #screen-landing { background: linear-gradient(160deg,#0F1923 0%,#1A2535 60%,#0F2030 100%); }
  body.tema-escuro #screen-auth,
  body.tema-escuro #screen-reset { background: linear-gradient(160deg,#0F1923 0%,#1A2535 100%); }
  body.tema-escuro .hero-bar { background: linear-gradient(120deg,#1565C0,#0D47A1); }
  body.tema-escuro .mod-prog-bar,
  body.tema-escuro .challenge-prog-bar,
  body.tema-escuro .xp-bar-bg { background: #263545; }
  body.tema-escuro .drop-zone { background: #1A2535; border-color: #37475A; color: var(--text-muted); }
  body.tema-escuro #mouse-arena { background: #1A2535; border-color: #37475A; }
  body.tema-escuro .land-char { background: #1A2535; }
  body.tema-escuro .btn-xs[style*="F5F5F5"] { background: #263545 !important; color: var(--text-muted) !important; }
  body.tema-escuro .profile-hero { background: linear-gradient(135deg, var(--profile-color), color-mix(in srgb, var(--profile-color) 60%, #000)); }
  body.tema-escuro #cert-card { background: linear-gradient(160deg,#1A2535,#263545); border-color: var(--sky); }
  body.tema-escuro .overlay-card { background: #1A2535; }
  body.tema-escuro #levelup-overlay .overlay-card { background: linear-gradient(160deg,#1A2535,#0F2030); }
  body.tema-escuro .tour-modal { background: #1A2535; }
  body.tema-escuro .tour-close { background: #263545; color: var(--text); }
  body.tema-escuro .tour-dot { background: #37475A; }

  /* ══ CORES DE PERFIL ══ */
  .profile-hero { background: linear-gradient(135deg, var(--profile-color), color-mix(in srgb, var(--profile-color) 70%, #000 30%)); }
  /* ══ MODAL DE EDIÇÃO DE PERFIL ══ */
  #edit-profile-overlay { z-index: 600; }
  #edit-profile-card {
    background: white; border-radius: 28px; padding: 32px 28px;
    max-width: 420px; width: 100%; box-shadow: 0 24px 64px rgba(0,0,0,0.3);
    animation: popIn 0.3s;
  }
  body.tema-escuro #edit-profile-card { background: #1A2535; }
  .edit-profile-title { font-family:'Fredoka One',cursive; font-size: 24px; color: var(--sky-dark); margin-bottom: 20px; text-align: center; }
  .edit-avatar-preview { font-size: 72px; text-align: center; margin-bottom: 16px; cursor: pointer; transition: transform 0.2s; }
  .edit-avatar-preview:hover { transform: scale(1.1); }
  .edit-avatar-grid { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 12px 0 20px; }
  .edit-avatar-opt {
    width: 52px; height: 52px; border-radius: 50%; font-size: 28px;
    border: 3px solid transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: #F5F5F5; transition: all 0.2s;
  }
  .edit-avatar-opt.unlocked:hover { transform: scale(1.1); background: #E3F2FD; }
  .edit-avatar-opt.selected { border-color: var(--sky-dark); background: #E3F2FD; transform: scale(1.1); }
  .edit-avatar-opt.locked-av { opacity: 0.35; filter: grayscale(1); cursor: not-allowed; position: relative; }
  body.tema-escuro .edit-avatar-opt { background: #263545; }
  body.tema-escuro .edit-avatar-opt.selected { background: #1A2535; border-color: var(--sky); }

  /* Botão editar no hero do perfil */
  .btn-edit-perfil {
    position: absolute; top: 14px; right: 14px;
    background: rgba(255,255,255,0.25); border: 2px solid rgba(255,255,255,0.5);
    border-radius: 50px; padding: 6px 14px; color: white;
    font-weight: 800; font-size: 13px; cursor: pointer;
    display: flex; align-items: center; gap: 6px; transition: background 0.2s;
  }
  .btn-edit-perfil:hover { background: rgba(255,255,255,0.4); }

  .color-picker-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
  .color-opt {
    width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
    border: 3px solid transparent; transition: all 0.2s;
    box-shadow: var(--shadow-sm);
  }
  .color-opt.selected { border-color: white; transform: scale(1.2); box-shadow: 0 0 0 3px var(--text-muted); }
  .color-opt:hover { transform: scale(1.15); }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
  }

  h1, h2, h3, .logo-text, .level-title { font-family: 'Fredoka One', cursive; }

  /* ============================
     SCREENS (SPA routing)
     ============================ */
  .screen { display: none; min-height: 100vh; }
  .screen.active { display: block; }

  /* ============================
     LANDING / WELCOME
     ============================ */
  #screen-landing {
    background: linear-gradient(160deg, #B3E5FC 0%, #E1F5FE 40%, #F1F8E9 100%);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 16px;
    min-height: 100vh;
    position: relative;
  }
  #screen-landing.active { display: flex !important; }

  .land-deco {
    position: absolute;
    border-radius: 50%;
    opacity: 0.18;
    pointer-events: none;
  }
  .land-deco-1 { width: 340px; height: 340px; background: var(--sun); top: -80px; left: -80px; }
  .land-deco-2 { width: 220px; height: 220px; background: var(--grass); bottom: -60px; right: -40px; }
  .land-deco-3 { width: 160px; height: 160px; background: var(--purple); top: 30%; right: -30px; }

  .logo-wrap { margin-bottom: 20px; }
  .logo-wrap:hover { animation: bounce 0.8s ease-in-out; }
  .logo-emoji { font-size: 72px; line-height: 1; }
  .logo-text { font-size: 42px; color: var(--sky-dark); letter-spacing: 1px; }
  .logo-sub { font-size: 18px; color: var(--text-muted); font-weight: 700; margin-top: 4px; }

  .land-desc {
    font-size: 20px;
    color: var(--text);
    max-width: 520px;
    line-height: 1.6;
    margin: 20px auto 36px;
    font-weight: 600;
  }

  .land-btn-group { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
  .btn { 
    padding: 16px 36px; border: none; border-radius: 50px; font-family: 'Nunito', sans-serif;
    font-size: 18px; font-weight: 800; cursor: pointer; transition: all 0.2s;
    box-shadow: 0 6px 0 rgba(0,0,0,0.15); position: relative; top: 0;
    display: inline-flex; align-items: center; gap: 8px;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  }
  .btn:hover { top: 3px; box-shadow: 0 3px 0 rgba(0,0,0,0.15); }
  .btn:active { top: 5px; box-shadow: 0 1px 0 rgba(0,0,0,0.15); }
  .btn-primary { background: var(--sky); color: #fff; }
  .btn-primary:hover { background: var(--sky-dark); }
  .btn-secondary { background: var(--sun); color: var(--text); }
  .btn-secondary:hover { background: var(--sun-dark); color: #fff; }
  .btn-green { background: var(--grass); color: #fff; }
  .btn-green:hover { background: var(--grass-dark); }
  .btn-purple { background: var(--purple); color: #fff; }
  .btn-coral { background: var(--coral); color: #fff; }
  .btn-sm { padding: 10px 22px; font-size: 15px; }
  .btn-xs { padding: 7px 16px; font-size: 13px; }

  .land-chars {
    display: flex; gap: 32px; margin-top: 40px; flex-wrap: wrap; justify-content: center;
  }
  .land-char {
    background: white; border-radius: var(--radius); padding: 20px 24px;
    box-shadow: var(--shadow-sm); display: flex; flex-direction: column; align-items: center; gap: 8px;
    font-weight: 700; font-size: 15px; color: var(--text-muted); min-width: 130px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  .land-char:hover {
    animation: floatUp 1.2s ease-in-out infinite;
    box-shadow: var(--shadow);
  }
  .land-char .char-emoji { font-size: 40px; }
  .land-char .char-label { font-size: 13px; }

  /* ============================
     AUTH SCREEN
     ============================ */
  #screen-auth {
    background: linear-gradient(160deg, #E8F5E9 0%, #E3F2FD 100%);
    align-items: center; justify-content: center;
    padding: 32px 16px;
  }
  #screen-auth.active { display: flex !important; }

  #screen-reset {
    background: linear-gradient(160deg, #E8F5E9 0%, #E3F2FD 100%);
    align-items: center; justify-content: center;
    padding: 32px 16px;
  }
  #screen-reset.active { display: flex !important; }

  .auth-card {
    background: white; border-radius: 28px; padding: 40px 36px;
    box-shadow: var(--shadow); width: 100%; max-width: 420px; text-align: center;
  }
  .auth-emoji { font-size: 56px; margin-bottom: 10px; }
  .auth-title { font-size: 28px; color: var(--sky-dark); margin-bottom: 6px; }
  .auth-sub { font-size: 15px; color: var(--text-muted); margin-bottom: 28px; font-weight: 600; }

  .auth-tabs { display: flex; gap: 8px; margin-bottom: 28px; background: #F0F4F8; border-radius: 50px; padding: 4px; }
  .auth-tab {
    flex: 1; padding: 10px; border: none; border-radius: 50px; font-family: 'Nunito', sans-serif;
    font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.2s;
    background: transparent; color: var(--text-muted);
  }
  .auth-tab.active { background: white; color: var(--sky-dark); box-shadow: var(--shadow-sm); }

  .form-group { margin-bottom: 16px; text-align: left; }
  .form-label { font-size: 14px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; display: block; }
  .form-input {
    width: 100%; padding: 14px 18px; border: 2px solid #E0E0E0; border-radius: 14px;
    font-family: 'Nunito', sans-serif; font-size: 16px; transition: border 0.2s; outline: none;
  }
  .form-input:focus { border-color: var(--sky); }

  .avatar-picker { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
  .avatar-opt {
    width: 48px; height: 48px; border-radius: 50%; font-size: 26px; border: 3px solid transparent;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    background: #F5F5F5; transition: all 0.2s;
  }
  .avatar-opt.selected { border-color: var(--sky); background: #E3F2FD; }

  /* ============================
     DASHBOARD
     ============================ */
  #screen-dashboard { background: var(--bg); }
  #screen-dashboard.active { display: block; }

  /* TOP NAV */
  .topnav {
    background: white; box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 0 24px; height: 72px; display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 100; overflow: visible;
  }
  .nav-logo { font-family: 'Fredoka One', cursive; font-size: 22px; color: var(--sky-dark); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  @media (max-width: 480px) {
    .nav-logo { font-size: 16px; }
    .nav-xp-pill { font-size: 12px; padding: 5px 10px; }
    .streak-badge { font-size: 12px; padding: 5px 10px; }
    .topnav { height: 60px; padding: 0 12px; gap: 8px; }
    .nav-avatar { width: 36px; height: 36px; font-size: 18px; }
    .nav-config-dropdown { top: 60px; right: 8px; min-width: 190px; }
  }

  @media (max-width: 600px) {
    .badges-row {
      grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
      gap: 8px;
    }
    .badge-item {
      padding: 10px 6px;
      border-radius: 12px;
      font-size: 10px;
      min-height: 80px;
    }
    .badge-emoji { font-size: 24px; }
  }

  @media (max-width: 380px) {
    .badges-row {
      grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
      gap: 6px;
    }
    .badge-item { min-height: 72px; padding: 8px 4px; font-size: 9px; }
    .badge-emoji { font-size: 22px; }
  }
  .nav-avatar {
    width: 42px; height: 42px; border-radius: 50%; background: #E3F2FD;
    display: flex; align-items: center; justify-content: center; font-size: 22px;
    border: 3px solid var(--sky); cursor: pointer; flex-shrink: 0;
  }
  .nav-xp-pill {
    background: linear-gradient(90deg, var(--sun), var(--sun-dark));
    color: white; border-radius: 50px; padding: 6px 14px; font-weight: 800; font-size: 14px;
    display: flex; align-items: center; gap: 5px; flex-shrink: 0;
  }
  .nav-logout { background: none; border: none; cursor: pointer; font-size: 20px; color: var(--text-muted); flex-shrink: 0; }

  /* Menu de configurações dropdown */
  .nav-config-wrap { position: relative; flex-shrink: 0; }
  .nav-config-btn {
    background: #F5F5F5; border: none; border-radius: 50px; cursor: pointer;
    width: 38px; height: 38px; font-size: 18px; display: flex; align-items: center;
    justify-content: center; transition: background 0.2s; color: var(--text-muted);
  }
  .nav-config-btn:hover { background: #E0E0E0; }
  .nav-config-dropdown {
    position: fixed; top: 72px; right: 12px; background: white; border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22); padding: 8px; min-width: 210px;
    z-index: 9999; display: none; flex-direction: column; gap: 4px;
    animation: fadeInUp 0.2s;
  }
  .nav-config-dropdown.open { display: flex; }
  .nav-config-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 14px;
    color: var(--text); border: none; background: none; width: 100%; text-align: left;
    transition: background 0.15s;
  }
  .nav-config-item:hover { background: #F5F5F5; }
  .nav-config-item.active { background: #E3F2FD; color: var(--sky-dark); }
  .nav-config-icon { font-size: 20px; width: 28px; text-align: center; }
  .nav-config-divider { height: 1px; background: #F0F0F0; margin: 4px 0; }
  body.tema-escuro .nav-config-dropdown { background: #1A2535; }
  body.tema-escuro .nav-config-item:hover { background: #263545; }
  body.tema-escuro .nav-config-item.active { background: #263545; color: var(--sky); }
  body.tema-escuro .nav-config-btn { background: #263545; color: var(--text); }

  /* DASHBOARD MAIN */
  .dash-main { max-width: 960px; margin: 0 auto; padding: 28px 16px 60px; }

  /* HERO BAR */
  .hero-bar {
    background: linear-gradient(120deg, var(--sky) 0%, var(--sky-dark) 100%);
    border-radius: 24px; padding: 28px 32px; color: white; margin-bottom: 28px;
    display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
    box-shadow: 0 8px 28px rgba(2,136,209,0.30);
  }
  .hero-avatar-big { font-size: 64px; }
  .hero-text { flex: 1; min-width: 200px; }
  .hero-greeting { font-size: 15px; opacity: 0.85; font-weight: 600; }
  .hero-name { font-family: 'Fredoka One', cursive; font-size: 30px; line-height: 1; }
  .hero-level { font-size: 16px; opacity: 0.9; font-weight: 700; margin-top: 4px; }

  .xp-bar-wrap { flex: 1; min-width: 220px; }
  .xp-bar-labels { display: flex; justify-content: space-between; font-size: 13px; opacity: 0.9; font-weight: 700; margin-bottom: 6px; }
  .xp-bar-bg { background: rgba(255,255,255,0.25); border-radius: 50px; height: 18px; overflow: hidden; }
  .xp-bar-fill {
    height: 100%; border-radius: 50px;
    background: linear-gradient(90deg, var(--sun), #FFF176);
    transition: width 1s cubic-bezier(.22,.61,.36,1);
    box-shadow: 0 2px 8px rgba(255,213,79,0.5);
  }
  .xp-bar-xp { text-align: center; font-size: 13px; opacity: 0.85; font-weight: 700; margin-top: 4px; }

  /* STATS ROW */
  .stats-row { display: flex; gap: 14px; margin-bottom: 28px; flex-wrap: wrap; }
  .stat-card {
    flex: 1; min-width: 130px; background: white; border-radius: 18px;
    padding: 18px 20px; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 14px;
  }
  .stat-icon { font-size: 32px; }
  .stat-val { font-family: 'Fredoka One', cursive; font-size: 26px; line-height: 1; }
  .stat-lbl { font-size: 12px; color: var(--text-muted); font-weight: 700; }

  /* SECTION TITLE */
  .sec-title { font-size: 22px; color: var(--text); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

  /* MODULE CARDS */
  .modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 32px; }
  .module-card {
    background: white; border-radius: 22px; padding: 24px;
    box-shadow: var(--shadow-sm); cursor: pointer; transition: all 0.2s;
    border: 3px solid transparent; position: relative; overflow: hidden;
  }
  .module-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
  .module-card.locked { opacity: 0.55; cursor: not-allowed; }
  .module-card.completed { border-color: var(--grass); }
  .module-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px;
    background: var(--card-accent, var(--sky));
  }
  .module-card[data-mod="1"] { --card-accent: var(--sky); }
  .module-card[data-mod="2"] { --card-accent: var(--sun-dark); }
  .module-card[data-mod="3"] { --card-accent: var(--grass); }
  .module-card[data-mod="4"] { --card-accent: var(--purple-dark); }
  .module-card[data-mod="5"] { --card-accent: var(--coral); }
  .module-card[data-mod="6"] { --card-accent: #00897B; }
  .module-card[data-mod="7"] { --card-accent: #5E35B1; }

  .module-emoji { font-size: 42px; margin-bottom: 10px; }
  .module-num { font-size: 11px; font-weight: 800; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; }
  .module-title { font-family: 'Fredoka One', cursive; font-size: 20px; margin: 4px 0; }
  .module-desc { font-size: 13px; color: var(--text-muted); font-weight: 600; line-height: 1.5; }
  .module-progress { margin-top: 14px; }
  .mod-prog-bar { background: #F0F4F8; border-radius: 50px; height: 10px; overflow: hidden; }
  .mod-prog-fill { height: 100%; border-radius: 50px; background: var(--card-accent, var(--sky)); transition: width 0.8s; }
  .mod-prog-lbl { font-size: 12px; color: var(--text-muted); font-weight: 700; margin-top: 4px; text-align: right; }
  .module-lock { position: absolute; top: 16px; right: 16px; font-size: 20px; }
  .module-badge { position: absolute; top: 16px; right: 16px; background: var(--grass); color: white; border-radius: 50px; font-size: 12px; font-weight: 800; padding: 3px 10px; }

  /* MINI GAMES */
  .games-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 32px; }
  .game-card {
    flex: 1; min-width: 155px; border-radius: 22px; padding: 20px 16px;
    cursor: pointer; transition: all 0.2s; color: white; box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; gap: 8px;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  }
  .game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
  .game-card-1 { background: linear-gradient(135deg, #42A5F5, #1565C0); }
  .game-card-2 { background: linear-gradient(135deg, #66BB6A, #2E7D32); }
  .game-card-3 { background: linear-gradient(135deg, #FFA726, #E65100); }
  .game-emoji { font-size: 36px; }
  .game-title { font-family: 'Fredoka One', cursive; font-size: 19px; }
  .game-desc { font-size: 13px; opacity: 0.85; font-weight: 600; }
  .game-xp-badge { background: rgba(255,255,255,0.2); border-radius: 50px; padding: 4px 12px; font-size: 12px; font-weight: 800; width: fit-content; }

  /* ACHIEVEMENTS */
  .badges-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 10px;
  }
  .badge-item {
    background: white; border-radius: 14px; padding: 12px 8px; box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; font-size: 11px; font-weight: 700; color: var(--text-muted);
    text-align: center; min-height: 90px; width: 100%; position: relative;
    transition: transform 0.15s; cursor: default; word-break: break-word; line-height: 1.3;
  }
  .badge-item:hover { transform: translateY(-2px); }
  .badge-item.earned { color: var(--text); }
  .badge-item.locked-badge { opacity: 0.35; filter: grayscale(1); }
  .badge-item .badge-tooltip {
    display: none; position: absolute; bottom: calc(100% + 6px); left: 50%;
    transform: translateX(-50%); background: rgba(0,0,0,0.82); color: white;
    font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 8px;
    white-space: nowrap; z-index: 200; pointer-events: none;
    max-width: 180px; white-space: normal; text-align: center;
  }
  .badge-item:hover .badge-tooltip { display: block; }
  .badge-emoji { font-size: 28px; line-height: 1; }

  /* ============================
     LESSON SCREEN
     ============================ */
  #screen-lesson { background: var(--bg); }
  #screen-lesson.active { display: block; }

  .lesson-topbar {
    background: white; padding: 16px 24px; display: flex; align-items: center; gap: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06); position: sticky; top: 0; z-index: 50;
  }
  .lesson-back { background: none; border: none; font-size: 24px; cursor: pointer; }
  .lesson-topbar-title { font-family: 'Fredoka One', cursive; font-size: 22px; flex: 1; }
  .lesson-prog-mini { display: flex; gap: 6px; }
  .lesson-dot { width: 12px; height: 12px; border-radius: 50%; background: #E0E0E0; transition: background 0.3s; }
  .lesson-dot.done { background: var(--grass); }
  .lesson-dot.active { background: var(--sky); }

  .lesson-body { max-width: 700px; margin: 0 auto; padding: 32px 16px 80px; }

  .lesson-card {
    background: white; border-radius: 24px; padding: 32px; box-shadow: var(--shadow-sm);
    margin-bottom: 24px; animation: fadeInUp 0.4s;
  }
  .lesson-step-label { font-size: 12px; font-weight: 800; color: var(--sky-dark); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
  .lesson-card h2 { font-size: 26px; margin-bottom: 12px; color: var(--text); }
  .lesson-card p { font-size: 17px; color: var(--text-muted); line-height: 1.7; font-weight: 600; }
  .lesson-image { font-size: 80px; text-align: center; margin: 20px 0; }

  .lesson-quiz { margin-top: 24px; }
  .quiz-question { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 16px; }
  .quiz-options { display: flex; flex-direction: column; gap: 10px; }
  .quiz-opt {
    padding: 16px 20px; border: 3px solid #E0E0E0; border-radius: 16px;
    font-family: 'Nunito', sans-serif; font-size: 16px; font-weight: 700;
    cursor: pointer; transition: all 0.2s; background: white; text-align: left;
    display: flex; align-items: center; gap: 12px;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    min-height: 56px; /* maior área de toque */
  }
  .quiz-opt:hover { border-color: var(--sky); background: #E3F2FD; }
  .quiz-opt.correct { border-color: var(--grass); background: #E8F5E9; color: var(--grass-dark); }
  .quiz-opt.wrong { border-color: var(--coral); background: #FBE9E7; color: var(--coral-dark); }
  .quiz-opt-icon {
    width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
    background: #E3F2FD; color: #0288D1;
    font-family: 'Fredoka One', cursive; font-size: 16px; font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #B3E5FC; transition: all 0.2s;
  }
  .quiz-opt:hover .quiz-opt-icon { background: #B3E5FC; border-color: #0288D1; }
  .quiz-opt.correct .quiz-opt-icon { background: var(--grass); color: white; border-color: var(--grass-dark); }
  .quiz-opt.wrong   .quiz-opt-icon { background: var(--coral); color: white; border-color: var(--coral-dark); }

  .quiz-feedback {
    margin-top: 16px; padding: 16px 20px; border-radius: 16px; font-weight: 700; font-size: 16px;
    display: none; align-items: center; gap: 10px;
  }
  .quiz-feedback.show { display: flex; }
  .quiz-feedback.success { background: #E8F5E9; color: var(--grass-dark); }
  .quiz-feedback.error { background: #FBE9E7; color: var(--coral-dark); }

  .lesson-nav { display: flex; justify-content: space-between; align-items: center; }

  /* ============================
     MINIGAME: MOUSE TRAINER
     ============================ */
  #screen-game-mouse { background: linear-gradient(160deg, #E3F2FD 0%, #E8F5E9 100%); }
  #screen-game-mouse.active { display: flex !important; flex-direction: column; }

  /* ============================
     MINIGAME: DRAG AND DROP
     ============================ */
  #screen-game-drag { background: linear-gradient(160deg, #F1F8E9 0%, #FFF8E1 100%); }
  #screen-game-drag.active { display: flex !important; flex-direction: column; }

  /* ============================
     MINIGAME: TYPING
     ============================ */
  #screen-game-typing { background: linear-gradient(160deg, #FFF8E1 0%, #FCE4EC 100%); }
  #screen-game-typing.active { display: flex !important; flex-direction: column; }

  /* GAME COMMON */
  .game-topbar {
    background: white; padding: 14px 24px; display: flex; align-items: center; gap: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  }
  .game-topbar-title { font-family: 'Fredoka One', cursive; font-size: 22px; flex: 1; }
  .game-score-pill {
    background: linear-gradient(90deg, var(--sun), var(--sun-dark));
    color: white; border-radius: 50px; padding: 7px 16px; font-weight: 800; font-size: 15px;
  }
  .game-timer-pill {
    background: linear-gradient(90deg, var(--coral), var(--coral-dark));
    color: white; border-radius: 50px; padding: 7px 16px; font-weight: 800; font-size: 15px;
  }
  .game-body {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 24px 16px; width: 100%;
  }
  /* Responsivo nos jogos */
  @media (max-width: 600px) {
    .game-body { padding: 16px 12px; }
    #mouse-arena, #mouse2-arena { height: 280px !important; }
    .target-star { font-size: 52px !important; }
    /* Verdade ou Mito */
    #tf-card { padding: 20px 16px !important; min-height: 100px !important; }
    #tf-statement { font-size: 17px !important; }
    /* Conectar Pares */
    #conn-area { gap: 6px !important; }
    /* Speed Click */
    #sc-target-btn { width: 160px !important; height: 160px !important; font-size: 60px !important; }
    .memory-grid { grid-template-columns: repeat(4,1fr); gap:6px; max-width:320px; }
    .memory-card { font-size: 24px; }
    .drop-zone { width: 110px; height: 100px; }
    #typing-word-display { font-size: 36px !important; }
    .typing-chars { gap: 5px; }
    .typing-char { width: 36px; height: 44px; font-size: 22px; }
    #math-question { font-size: 40px !important; }
    #word-scrambled { font-size: 32px !important; letter-spacing: 4px !important; }
    .weekly-chart { height: 80px; }
  }

  /* MOUSE TRAINER */
  #mouse-arena {
    width: 100%; max-width: 600px; height: 360px; background: white; border-radius: 24px;
    box-shadow: var(--shadow); position: relative; overflow: hidden;
    border: 3px solid #E3F2FD; cursor: crosshair;
  }
  .target-star {
    position: absolute; font-size: 42px; cursor: pointer; transition: transform 0.1s;
    animation: popIn 0.3s; transform-origin: center; user-select: none;
    /* Área mínima de toque 48x48 para acessibilidade mobile */
    min-width: 48px; min-height: 48px;
    display: flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  }
  .target-star:hover { transform: scale(1.2); }
  #mouse-score-msg { font-family: 'Fredoka One', cursive; font-size: 22px; color: var(--grass-dark); margin-top: 16px; height: 28px; }

  /* DRAG DROP */
  #drag-arena {
    width: 100%; max-width: 680px; display: flex; flex-direction: column; gap: 24px;
  }
  .drag-items-row { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
  .drag-item {
    background: white; border-radius: 16px; padding: 14px 22px; box-shadow: var(--shadow-sm);
    font-size: 28px; cursor: grab; user-select: none; display: flex; align-items: center; gap: 8px;
    font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 16px;
    border: 3px solid #E0E0E0; transition: all 0.2s;
  }
  .drag-item:hover { border-color: var(--sky); transform: translateY(-2px); }
  .drag-item.dragging { opacity: 0.5; }
  .drag-zones { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
  .drop-zone {
    width: 140px; height: 120px; border: 3px dashed #B0BEC5; border-radius: 18px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 30px; gap: 6px; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 14px;
    color: var(--text-muted); transition: all 0.2s; background: white;
  }
  .drop-zone.over { border-color: var(--sky); background: #E3F2FD; transform: scale(1.05); }
  .drop-zone.success { border-color: var(--grass); background: #E8F5E9; border-style: solid; }
  .drop-zone.error { border-color: var(--coral); background: #FBE9E7; border-style: solid; }
  #drag-msg { font-family: 'Fredoka One', cursive; font-size: 22px; color: var(--text); height: 28px; }

  /* TYPING GAME */
  .typing-arena { width: 100%; max-width: 560px; text-align: center; }
  #typing-word-display {
    font-family: 'Fredoka One', cursive; font-size: 52px; color: var(--sky-dark);
    margin-bottom: 12px; letter-spacing: 4px; min-height: 72px;
  }
  #typing-input {
    width: 100%; padding: 18px 24px; border: 4px solid #E0E0E0; border-radius: 18px;
    font-family: 'Nunito', sans-serif; font-size: 28px; font-weight: 800; text-align: center;
    outline: none; transition: border 0.2s; letter-spacing: 4px;
  }
  #typing-input:focus { border-color: var(--sky); }
  #typing-input.correct-flash { border-color: var(--grass); background: #E8F5E9; }
  #typing-input.wrong-flash { border-color: var(--coral); background: #FBE9E7; }
  .typing-hint { font-size: 15px; color: var(--text-muted); font-weight: 600; margin-top: 12px; }
  .typing-chars { display: flex; justify-content: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
  .typing-char {
    width: 44px; height: 52px; border: 3px solid #E0E0E0; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Fredoka One', cursive; font-size: 26px; transition: all 0.2s;
  }
  .typing-char.typed-correct { border-color: var(--grass); background: #E8F5E9; color: var(--grass-dark); }
  .typing-char.typed-wrong { border-color: var(--coral); background: #FBE9E7; color: var(--coral-dark); }

  /* ============================
     GAME OVER / LEVEL UP
     ============================ */
  .overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000;
    display: none; align-items: center; justify-content: center; padding: 16px;
  }
  .overlay.show { display: flex; }
  .overlay-card {
    background: white; border-radius: 28px; padding: 36px 32px; max-width: 400px; width: 100%;
    text-align: center; box-shadow: 0 24px 64px rgba(0,0,0,0.25); animation: popIn 0.4s;
  }
  .overlay-emoji { font-size: 72px; margin-bottom: 12px; }
  .overlay-title { font-size: 32px; color: var(--sky-dark); margin-bottom: 8px; }
  .overlay-body { font-size: 17px; color: var(--text-muted); font-weight: 600; margin-bottom: 24px; }
  .overlay-xp { font-family: 'Fredoka One', cursive; font-size: 28px; color: var(--xp-color); margin-bottom: 20px; }

  /* LEVEL UP MODAL */
  #levelup-overlay .overlay-card { background: linear-gradient(160deg, #E3F2FD, #E8F5E9); }
  .levelup-stars { font-size: 40px; margin: 10px 0; animation: spin 2s linear infinite; display: inline-block; }

  /* XP TOAST */
  #xp-toast {
    position: fixed; bottom: 76px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(90deg, var(--sun), var(--sun-dark));
    color: white; border-radius: 50px; padding: 11px 24px;
    font-family: 'Fredoka One', cursive; font-size: 17px;
    box-shadow: 0 8px 24px rgba(255,179,0,0.4);
    z-index: 300; display: none;
    white-space: normal;          /* permite quebrar linha */
    max-width: 88vw;              /* nunca ultrapassa a tela */
    width: max-content;           /* encolhe se couber */
    text-align: center;
    line-height: 1.35;
    word-break: break-word;
    animation: slideUp 0.4s, fadeOut 0.5s 1.8s forwards;
  }
  #xp-toast.show { display: block; }

  /* ============================
     PROFILE SCREEN
     ============================ */
  #screen-profile { background: var(--bg); }
  #screen-profile.active { display: block; }
  .profile-main { max-width: 700px; margin: 0 auto; padding: 28px 16px 60px; }
  .profile-hero {
    background: linear-gradient(135deg, var(--purple), var(--purple-dark));
    border-radius: 24px; padding: 32px; color: white; text-align: center; margin-bottom: 24px;
  }
  .profile-avatar-big { font-size: 80px; margin-bottom: 10px; }
  .profile-uname { font-family: 'Fredoka One', cursive; font-size: 28px; }
  .profile-level-badge { background: rgba(255,255,255,0.2); border-radius: 50px; display: inline-block; padding: 6px 20px; font-weight: 800; font-size: 15px; margin-top: 8px; }

  .profile-section { background: white; border-radius: 20px; padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
  .profile-section-title { font-family: 'Fredoka One', cursive; font-size: 20px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
  .history-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #F5F5F5; }
  .history-item:last-child { border-bottom: none; }
  .history-icon { font-size: 28px; }
  .history-text { flex: 1; font-weight: 700; font-size: 15px; }
  .history-xp { font-weight: 800; font-size: 14px; color: var(--xp-color); }

  /* ============================
     ANIMATIONS
     ============================ */
  @keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
  }
  @keyframes floatUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
  }
  @keyframes popIn {
    0% { transform: scale(0.7); opacity: 0; }
    80% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
  }
  @keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes slideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(30px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
  }
  @keyframes fadeOut {
    to { opacity: 0; }
  }
  @keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }
  @keyframes starBurst {
    0% { transform: scale(1); }
    50% { transform: scale(1.4) rotate(20deg); }
    100% { transform: scale(0); opacity: 0; }
  }

  /* ============================
     RESPONSIVE
     ============================ */
  /* ============================
     TOUR VISUAL
     ============================ */
  #tour-overlay {
    position: fixed; inset: 0; z-index: 400;
    background: rgba(10,20,40,0.82);
    display: none; align-items: center; justify-content: center; padding: 16px;
  }
  #tour-overlay.show { display: flex; }

  .tour-modal {
    background: white; border-radius: 28px; width: 100%; max-width: 560px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.4); overflow: hidden;
    animation: popIn 0.4s;
  }

  .tour-header {
    padding: 28px 28px 0;
    display: flex; align-items: center; justify-content: space-between;
  }
  .tour-dots {
    display: flex; gap: 8px;
  }
  .tour-dot {
    width: 10px; height: 10px; border-radius: 50%; background: #E0E0E0;
    transition: all 0.3s; cursor: pointer;
  }
  .tour-dot.active { background: var(--sky); transform: scale(1.3); }
  .tour-dot.done   { background: var(--grass); }
  .tour-close {
    background: #F5F5F5; border: none; border-radius: 50%;
    width: 36px; height: 36px; font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
  }
  .tour-close:hover { background: #EEEEEE; }

  .tour-slide { display: none; padding: 20px 28px 28px; animation: fadeInUp 0.35s; }
  .tour-slide.active { display: block; }

  .tour-visual {
    border-radius: 18px; margin-bottom: 20px; padding: 28px 20px;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    min-height: 180px; justify-content: center;
  }
  .tour-big-emoji  { font-size: 64px; line-height: 1; }
  .tour-mini-cards {
    display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: 100%;
  }
  .tour-mini-card {
    background: rgba(255,255,255,0.7); border-radius: 14px; padding: 10px 14px;
    font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }
  .tour-xp-bar-demo {
    width: 100%; background: rgba(255,255,255,0.3); border-radius: 50px; height: 14px; overflow: hidden;
  }
  .tour-xp-fill {
    height: 100%; border-radius: 50px; background: linear-gradient(90deg,#FFD54F,#FFB300);
    animation: growBar 1.5s ease-out forwards;
  }
  @keyframes growBar { from { width: 0% } to { width: 65% } }

  .tour-slide-title {
    font-family: 'Fredoka One', cursive; font-size: 24px; color: var(--text); margin-bottom: 8px;
  }
  .tour-slide-body {
    font-size: 16px; color: var(--text-muted); font-weight: 600; line-height: 1.6; margin-bottom: 20px;
  }
  .tour-nav {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
  }
  .tour-step-label {
    font-size: 12px; font-weight: 800; color: var(--text-muted);
    letter-spacing: 1px; text-transform: uppercase;
  }

  /* MODO LEITURA */
  .modo-leitura body, .modo-leitura { font-size: 120% !important; }
  .modo-leitura p, .modo-leitura .lesson-card p { font-size: 20px !important; line-height: 1.9 !important; }
  .modo-leitura h2, .modo-leitura .module-title { font-size: 28px !important; }
  .modo-leitura .quiz-opt { font-size: 18px !important; padding: 20px !important; }
  .modo-leitura .btn { font-size: 20px !important; padding: 18px 40px !important; }
  .modo-leitura .form-input { font-size: 18px !important; padding: 16px !important; }

  /* STREAK BADGE */
  .streak-badge {
    background: linear-gradient(90deg,#FF6F00,#FF8F00);
    color: white; border-radius: 50px; padding: 6px 14px;
    font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 5px;
  }

  /* CERTIFICADO */
  /* ── RANKING ── */
  #screen-ranking { background: var(--bg); }
  #screen-ranking.active { display: block; }
  .ranking-main { max-width: 700px; margin: 0 auto; padding: 28px 16px 60px; }
  .ranking-item {
    background: white; border-radius: 18px; padding: 16px 20px;
    box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 16px;
    margin-bottom: 12px; transition: transform 0.2s;
  }
  .ranking-item:hover { transform: translateY(-2px); }
  .ranking-item.me { border: 3px solid var(--sky); background: #E3F2FD; }
  .ranking-pos { font-family:'Fredoka One',cursive; font-size: 24px; min-width: 40px; text-align: center; }
  .ranking-pos.gold   { color: #FFB300; }
  .ranking-pos.silver { color: #90A4AE; }
  .ranking-pos.bronze { color: #A1887F; }
  .ranking-avatar { font-size: 36px; }
  .ranking-info { flex: 1; }
  .ranking-name { font-weight: 800; font-size: 16px; }
  .ranking-level { font-size: 13px; color: var(--text-muted); font-weight: 600; }
  .ranking-xp { font-family:'Fredoka One',cursive; font-size: 20px; color: var(--xp-color); }

  /* ── DESAFIOS SEMANAIS ── */
  .challenge-card {
    background: white; border-radius: 20px; padding: 20px 24px;
    box-shadow: var(--shadow-sm); margin-bottom: 14px;
    border-left: 6px solid var(--sky); display: flex; align-items: center; gap: 16px;
  }
  .challenge-card.done { border-left-color: var(--grass); background: #F1F8E9; }
  .challenge-card.done .challenge-title { text-decoration: line-through; color: var(--text-muted); }
  .challenge-emoji { font-size: 36px; }
  .challenge-info { flex: 1; }
  .challenge-title { font-weight: 800; font-size: 16px; margin-bottom: 4px; }
  .challenge-desc { font-size: 13px; color: var(--text-muted); font-weight: 600; }
  .challenge-xp { font-family:'Fredoka One',cursive; font-size: 18px; color: var(--xp-color); white-space: nowrap; }
  .challenge-prog-bar { background: #F0F4F8; border-radius: 50px; height: 8px; overflow: hidden; margin-top: 8px; }
  .challenge-prog-fill { height: 100%; border-radius: 50px; background: var(--sky); transition: width 0.8s; }

  /* ── AVATARES DESBLOQUEÁVEIS ── */
  .avatar-unlock-grid { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
  .avatar-unlock-item {
    width: 64px; height: 64px; border-radius: 50%; font-size: 32px;
    border: 3px solid transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: #F5F5F5; transition: all 0.2s; position: relative;
    flex-direction: column; gap: 2px;
  }
  .avatar-unlock-item.unlocked { background: #E3F2FD; border-color: var(--sky); cursor: pointer; }
  .avatar-unlock-item.selected { background: #E3F2FD; border-color: var(--sky-dark); box-shadow: 0 0 0 3px rgba(2,136,209,0.3); }
  .avatar-unlock-item.locked-av { opacity: 0.45; filter: grayscale(1); cursor: not-allowed; }
  .avatar-unlock-item .av-lock { font-size: 12px; position: absolute; bottom: -2px; right: -2px; background: white; border-radius: 50%; padding: 1px; }

  /* ══ CERTIFICADO REDESENHADO ══ */
  /* ══ TELA LENDA ══ */
  #lenda-overlay { z-index: 600; background: rgba(0,0,0,0.85); }
  #lenda-card {
    background: linear-gradient(160deg, #1a1a2e, #16213e, #0f3460);
    border-radius: 28px; padding: 0; max-width: 520px; width: 100%;
    box-shadow: 0 0 60px rgba(255,215,0,0.4), 0 24px 80px rgba(0,0,0,0.6);
    animation: popIn 0.5s; overflow: hidden; text-align: center;
    border: 2px solid rgba(255,215,0,0.4);
  }
  .lenda-top {
    background: linear-gradient(135deg, #B8860B, #FFD700, #FFA500, #FFD700, #B8860B);
    background-size: 200% auto; animation: goldShine 3s linear infinite;
    height: 8px;
  }
  @keyframes goldShine {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
  }
  .lenda-stars {
    font-size: 28px; letter-spacing: 8px; margin: 24px 0 8px;
    animation: pulse 2s ease-in-out infinite;
  }
  @keyframes pulse {
    0%,100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
  }
  .lenda-trophy { font-size: 90px; margin: 8px 0; display: block;
    filter: drop-shadow(0 0 20px rgba(255,215,0,0.8));
    animation: floatUp 2s ease-in-out infinite;
  }
  .lenda-title {
    font-family: 'Fredoka One', cursive; font-size: 36px;
    background: linear-gradient(135deg, #FFD700, #FFA500, #FFD700);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; margin: 8px 0 4px; letter-spacing: 2px;
  }
  .lenda-sub {
    font-family: 'Fredoka One', cursive; font-size: 20px; color: #E0E0E0;
    margin-bottom: 4px;
  }
  .lenda-nome {
    font-family: 'Fredoka One', cursive; font-size: 28px; color: #FFD700;
    margin: 12px 0; text-shadow: 0 0 20px rgba(255,215,0,0.5);
  }
  .lenda-desc {
    font-size: 15px; color: #B0BEC5; font-weight: 600; line-height: 1.7;
    padding: 0 24px; margin-bottom: 20px;
  }
  .lenda-stats {
    display: flex; justify-content: center; gap: 20px; flex-wrap: wrap;
    background: rgba(255,255,255,0.06); padding: 16px; margin: 0 20px 20px;
    border-radius: 16px; border: 1px solid rgba(255,215,0,0.2);
  }
  .lenda-stat { text-align: center; }
  .lenda-stat-val { font-family:'Fredoka One',cursive; font-size: 28px; color: #FFD700; }
  .lenda-stat-lbl { font-size: 11px; color: #90A4AE; font-weight: 700; text-transform: uppercase; }
  .lenda-badge {
    display: inline-block; background: linear-gradient(135deg,#B8860B,#FFD700);
    color: #1a1a2e; font-weight: 800; font-size: 13px; border-radius: 50px;
    padding: 6px 18px; margin-bottom: 20px; letter-spacing: 1px;
  }
  .lenda-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 20px; background: rgba(0,0,0,0.2); }

  /* ══ Hero dourado para lenda ══ */
  .hero-bar.lenda-mode {
    background: linear-gradient(120deg, #B8860B 0%, #FFD700 40%, #FFA500 70%, #B8860B 100%) !important;
    background-size: 200% auto !important;
    animation: goldShine 4s linear infinite !important;
  }
  .hero-bar.lenda-mode .hero-name,
  .hero-bar.lenda-mode .hero-level,
  .hero-bar.lenda-mode .hero-greeting { color: #1a1a2e !important; }
  .hero-bar.lenda-mode .xp-bar-bg { background: rgba(0,0,0,0.2) !important; }

  /* Título Lenda no perfil */
  .lenda-title-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, #B8860B, #FFD700);
    color: #1a1a2e; border-radius: 50px; padding: 4px 14px;
    font-size: 13px; font-weight: 800; margin-top: 8px;
    box-shadow: 0 2px 12px rgba(255,215,0,0.4);
  }

  #cert-overlay { z-index: 1003; overflow-y: auto; }

  /* Card de progresso (quando não atingiu 70%) */
  .cert-progresso-card {
    background: white; border-radius: 24px; padding: 32px 28px;
    max-width: 440px; width: 100%; box-shadow: 0 24px 64px rgba(0,0,0,0.25);
    animation: popIn 0.3s; text-align: center;
  }
  body.tema-escuro .cert-progresso-card { background: #1A2535; }
  .cert-prog-emoji { font-size: 64px; margin-bottom: 12px; }
  .cert-prog-title { font-family:'Fredoka One',cursive; font-size: 24px; color: var(--sky-dark); margin-bottom: 8px; }
  .cert-prog-sub { font-size: 15px; color: var(--text-muted); font-weight: 600; line-height: 1.6; margin-bottom: 20px; }
  .cert-req-list { background: #F8F9FA; border-radius: 16px; padding: 16px 20px; margin-bottom: 20px; text-align: left; }
  body.tema-escuro .cert-req-list { background: #263545; }
  .cert-req-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-weight: 700; font-size: 15px; }
  .cert-req-item:not(:last-child) { border-bottom: 1px solid #F0F0F0; }
  body.tema-escuro .cert-req-item:not(:last-child) { border-bottom-color: #37475A; }
  .cert-req-icon { font-size: 22px; width: 30px; text-align: center; }
  .cert-req-info { flex: 1; }
  .cert-req-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
  .cert-req-val { font-size: 15px; color: var(--text); }
  .cert-req-status { font-size: 20px; }
  .cert-prog-bar-wrap { margin: 8px 0 4px; }
  .cert-prog-bar-bg { background: #E0E0E0; border-radius: 50px; height: 12px; overflow: hidden; }
  .cert-prog-bar-fill { height: 100%; border-radius: 50px; transition: width 1s; }
  .cert-prog-bar-fill.ok { background: linear-gradient(90deg, var(--grass), var(--grass-dark)); }
  .cert-prog-bar-fill.pending { background: linear-gradient(90deg, var(--sky), var(--sky-dark)); }
  .cert-prog-pct { font-size: 13px; font-weight: 800; margin-top: 4px; text-align: right; }
  #cert-overlay .overlay { align-items: flex-start; padding: 24px 16px; }

  #cert-card {
    position: relative;
    background: #FFFEF7;
    border-radius: 16px;
    padding: 0;
    max-width: 640px; width: 100%;
    box-shadow: 0 24px 80px rgba(0,0,0,0.35);
    animation: popIn 0.4s;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
  }

  /* Topo dourado */
  .cert-top-bar {
    background: linear-gradient(135deg, #B8860B, #FFD700, #B8860B);
    height: 12px; width: 100%;
  }

  /* Borda ornamental interna */
  .cert-inner {
    margin: 18px; padding: 32px 36px 28px;
    border: 3px solid #D4AF37;
    border-radius: 8px;
    background: linear-gradient(170deg, #FFFEF7 0%, #FFF9E6 50%, #FFFEF7 100%);
    text-align: center;
    position: relative;
  }

  /* Cantos decorativos */
  .cert-inner::before, .cert-inner::after {
    content: '❖'; position: absolute; font-size: 22px; color: #D4AF37; line-height: 1;
  }
  .cert-inner::before { top: 8px; left: 12px; }
  .cert-inner::after  { bottom: 8px; right: 12px; }

  /* Cabeçalho */
  .cert-header { margin-bottom: 20px; }
  .cert-logo-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 6px; }
  .cert-logo { font-size: 42px; }
  .cert-app-name { font-family:'Fredoka One',cursive; font-size: 28px; color: #B8860B; letter-spacing: 1px; }
  .cert-tipo {
    display: inline-block;
    font-family:'Fredoka One',cursive; font-size: 22px; color: #5D4037;
    letter-spacing: 3px; text-transform: uppercase;
    border-top: 2px solid #D4AF37; border-bottom: 2px solid #D4AF37;
    padding: 6px 24px; margin: 8px 0;
  }

  /* Medalha central */
  .cert-medal-wrap {
    margin: 16px auto;
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(135deg, #FFD700, #FFA500, #FFD700);
    display: flex; align-items: center; justify-content: center;
    font-size: 42px; box-shadow: 0 4px 20px rgba(212,175,55,0.5);
    border: 4px solid #B8860B;
  }

  /* Nome do aluno */
  .cert-concedido { font-size: 14px; color: #8D6E63; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
  .cert-nome { font-family:'Fredoka One',cursive; font-size: 38px; color: #3E2723; margin: 4px 0 8px; line-height: 1.1; }
  .cert-descricao { font-size: 15px; color: #5D4037; font-weight: 600; line-height: 1.6; margin: 8px 0 16px; }

  /* Divisor */
  .cert-divider {
    display: flex; align-items: center; gap: 12px; margin: 14px 0;
  }
  .cert-divider::before, .cert-divider::after {
    content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #D4AF37, transparent);
  }
  .cert-divider-icon { font-size: 18px; color: #D4AF37; }

  /* Stats do aluno */
  .cert-stats {
    display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; margin: 12px 0;
  }
  .cert-stat-item { text-align: center; }
  .cert-stat-val { font-family:'Fredoka One',cursive; font-size: 26px; color: #B8860B; }
  .cert-stat-lbl { font-size: 12px; color: #8D6E63; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

  /* Rodapé */
  .cert-footer-row {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-top: 20px; padding-top: 14px;
    border-top: 1px solid #E8D5A3;
    flex-wrap: wrap; gap: 8px;
  }
  .cert-assinatura { text-align: center; }
  .cert-assin-linha { width: 140px; height: 1px; background: #5D4037; margin: 0 auto 4px; }
  .cert-assin-nome { font-size: 12px; font-weight: 800; color: #5D4037; }
  .cert-assin-cargo { font-size: 11px; color: #8D6E63; font-weight: 600; }
  .cert-data-wrap { text-align: center; }
  .cert-data-label { font-size: 11px; color: #8D6E63; font-weight: 600; text-transform: uppercase; }
  .cert-data-val { font-family:'Fredoka One',cursive; font-size: 15px; color: #5D4037; }

  /* Rodapé da plataforma */
  .cert-bottom-bar {
    background: linear-gradient(135deg, #B8860B, #FFD700, #B8860B);
    height: 8px; width: 100%;
  }

  /* Botões do certificado */
  .cert-btns {
    display: flex; gap: 10px; justify-content: center;
    padding: 16px; background: #F5F0E8; flex-wrap: wrap;
  }

  /* JOGO DA MEMÓRIA */
  #screen-game-quiz { background: linear-gradient(160deg,#E0F2F1 0%,#E8F5E9 100%); }
  #screen-game-quiz.active { display: flex !important; flex-direction: column; }
  #screen-game-word { background: linear-gradient(160deg,#FCE4EC 0%,#F8BBD0 100%); }
  #screen-game-word.active { display: flex !important; flex-direction: column; }
  #screen-game-mouse2 { background: linear-gradient(160deg,#FFF3E0 0%,#FFE0B2 100%); }
  #screen-game-mouse2.active { display: flex !important; flex-direction: column; }
  #screen-game-typing2 { background: linear-gradient(160deg,#E0F7FA 0%,#B2EBF2 100%); }
  #screen-game-typing2.active { display: flex !important; flex-direction: column; }
  #screen-game-math { background: linear-gradient(160deg,#F1F8E9 0%,#DCEDC8 100%); }
  #screen-game-math.active { display: flex !important; flex-direction: column; }
  #screen-game-memory { background: linear-gradient(160deg,#F3E5F5 0%,#E8EAF6 100%); }
  #screen-game-memory.active { display: flex !important; flex-direction: column; }
  .memory-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 12px; max-width: 480px; width: 100%;
  }
  .memory-card {
    aspect-ratio: 1; border-radius: 16px; border: 3px solid #E0E0E0;
    background: white; cursor: pointer; transition: all 0.3s;
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; box-shadow: var(--shadow-sm);
    transform-style: preserve-3d; position: relative;
  }
  .memory-card .card-front, .memory-card .card-back {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    border-radius: 13px; backface-visibility: hidden;
  }
  .memory-card .card-front { background: linear-gradient(135deg,#7C4DFF,#651FFF); font-size: 28px; }
  .memory-card .card-back { background: white; font-size: 36px; transform: rotateY(180deg); }
  .memory-card.flipped { transform: rotateY(180deg); border-color: var(--sky); }
  .memory-card.matched { border-color: var(--grass); background: #E8F5E9; transform: rotateY(180deg); }
  .memory-card.matched .card-back { background: #E8F5E9; }

  /* ══ CONFETES ══ */
  #confetti-container {
    position: fixed; inset: 0; pointer-events: none; z-index: 9999; overflow: hidden;
  }
  .confetti-piece {
    position: absolute; width: 10px; height: 10px; border-radius: 2px;
    animation: confetti-fall linear forwards;
  }
  @keyframes confetti-fall {
    0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
  }

  /* ══ MENSAGENS PERSONALIZADAS ══ */
  #personal-msg-toast {
    position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
    background: white; border-radius: 20px; padding: 14px 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18); z-index: 1000;
    font-size: 15px; font-weight: 800; color: var(--text);
    display: none;
    white-space: normal;
    word-break: break-word;
    max-width: 88vw;
    width: max-content;
    text-align: center;
    line-height: 1.4;
    animation: slideDown 0.4s, fadeOut 0.5s 2.5s forwards;
  }
  #personal-msg-toast.show { display: block; }
  @keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
  }

  /* ══ META DIÁRIA ══ */
  .meta-card {
    background: white; border-radius: 20px; padding: 20px 24px;
    box-shadow: var(--shadow-sm); margin-bottom: 20px;
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  }
  .meta-emoji { font-size: 36px; }
  .meta-info { flex: 1; min-width: 160px; }
  .meta-title { font-family: 'Fredoka One', cursive; font-size: 18px; margin-bottom: 4px; }
  .meta-sub { font-size: 13px; color: var(--text-muted); font-weight: 600; }
  .meta-bar-bg { background: #F0F4F8; border-radius: 50px; height: 12px; overflow: hidden; margin-top: 8px; }
  .meta-bar-fill { height: 100%; border-radius: 50px; background: linear-gradient(90deg,var(--grass),var(--grass-dark)); transition: width 1s; }
  .meta-pct { font-family: 'Fredoka One', cursive; font-size: 22px; color: var(--grass-dark); }
  .meta-input-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
  .meta-input { width: 80px; padding: 8px 12px; border: 2px solid #E0E0E0; border-radius: 12px;
    font-family: 'Nunito', sans-serif; font-size: 16px; font-weight: 700; text-align: center; outline: none; }
  .meta-input:focus { border-color: var(--grass); }

  /* ══ GRÁFICO SEMANAL ══ */
  .weekly-chart { display: flex; align-items: flex-end; gap: 8px; height: 100px; margin-top: 12px; }
  .week-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
  .week-bar { width: 100%; border-radius: 8px 8px 0 0; background: var(--sky);
    transition: height 0.8s cubic-bezier(.22,.61,.36,1); min-height: 4px; }
  .week-bar.today { background: linear-gradient(180deg,var(--sun-dark),var(--sun)); }
  .week-day { font-size: 11px; font-weight: 800; color: var(--text-muted); }
  .week-xp  { font-size: 11px; font-weight: 700; color: var(--text-muted); }

  @media (max-width: 600px) {
    .logo-text { font-size: 30px; }
    .logo-emoji { font-size: 56px; }
    .hero-bar { flex-direction: column; text-align: center; }
    .topnav { padding: 0 14px; }
    .lesson-card { padding: 22px; }
    #typing-word-display { font-size: 36px; }
    .overlay-card { padding: 28px 20px; }
    .memory-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 340px; }
    .memory-card { font-size: 26px; }
  }

  /* ══════════════════════════════════════
     JOGO: ADIVINHE A TELA (13)
  ══════════════════════════════════════ */
  #screen-game-screenshot { background: linear-gradient(160deg, #E0F2F1 0%, #E8F5E9 100%); }
  #screen-game-screenshot.active { display: flex !important; flex-direction: column; }
  .screenshot-display { background: white; border-radius: 20px; padding: 28px 24px; box-shadow: var(--shadow); text-align: center; border: 3px solid #B2DFDB; }
  .screenshot-icon { font-size: 72px; margin-bottom: 12px; }
  .screenshot-clue { font-size: 16px; font-weight: 700; color: var(--text-muted); background: #F5F5F5; border-radius: 12px; padding: 12px 16px; margin: 12px 0; line-height: 1.6; }
  .screenshot-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px; }
  .screenshot-opt { background: white; border: 3px solid #E0E0E0; border-radius: 16px; padding: 14px 10px; font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 800; cursor: pointer; text-align: center; transition: all 0.2s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; min-height: 56px; }
  .screenshot-opt:hover { border-color: #00796B; background: #E0F2F1; }
  .screenshot-opt.correct { background: #E8F5E9; border-color: var(--grass); color: var(--grass-dark); }
  .screenshot-opt.wrong   { background: #FBE9E7; border-color: var(--coral); color: var(--coral-dark); }

  /* ══════════════════════════════════════
     JOGO: TECLAS MÁGICAS (14)
  ══════════════════════════════════════ */
  #screen-game-shortcut { background: linear-gradient(160deg, #FFEBEE 0%, #FCE4EC 100%); }
  #screen-game-shortcut.active { display: flex !important; flex-direction: column; }
  .shortcut-action-card { background: white; border-radius: 20px; padding: 24px; box-shadow: var(--shadow); text-align: center; border: 3px solid #FFCDD2; }
  .shortcut-action-icon { font-size: 52px; margin-bottom: 10px; }
  .shortcut-action-text { font-family: 'Fredoka One', cursive; font-size: 22px; color: var(--text); margin-bottom: 8px; }
  .shortcut-action-hint { font-size: 14px; color: var(--text-muted); font-weight: 600; }
  .shortcut-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px; }
  .shortcut-opt { background: white; border: 3px solid #E0E0E0; border-radius: 16px; padding: 14px 8px; cursor: pointer; text-align: center; font-family: 'Nunito', sans-serif; font-weight: 800; transition: all 0.2s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; min-height: 56px; }
  .shortcut-key { display: inline-block; background: #F5F5F5; border: 2px solid #BDBDBD; border-radius: 8px; padding: 2px 10px; font-size: 15px; font-family: monospace; font-weight: 900; color: #333; box-shadow: 0 2px 0 #9E9E9E; letter-spacing: 1px; }
  .shortcut-opt:hover { border-color: #C62828; background: #FFEBEE; }
  .shortcut-opt.correct { background: #E8F5E9; border-color: var(--grass); }
  .shortcut-opt.wrong   { background: #FBE9E7; border-color: var(--coral); }

  /* ══════════════════════════════════════
     JOGO: COMPLETE A FRASE (15)
  ══════════════════════════════════════ */
  #screen-game-fillblank { background: linear-gradient(160deg, #EDE7F6 0%, #E8EAF6 100%); }
  #screen-game-fillblank.active { display: flex !important; flex-direction: column; }
  .fillblank-sentence { background: white; border-radius: 20px; padding: 24px; box-shadow: var(--shadow); text-align: center; border: 3px solid #D1C4E9; font-size: 18px; font-weight: 700; line-height: 1.7; color: var(--text); }
  .fillblank-blank { display: inline-block; border-bottom: 4px solid #7B1FA2; min-width: 100px; padding: 0 8px; color: #7B1FA2; font-family: 'Fredoka One', cursive; font-size: 20px; vertical-align: bottom; margin: 0 4px; }
  .fillblank-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px; }
  .fillblank-opt { background: white; border: 3px solid #E0E0E0; border-radius: 16px; padding: 14px 10px; cursor: pointer; text-align: center; font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 800; transition: all 0.2s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; min-height: 56px; }
  .fillblank-opt:hover { border-color: #7B1FA2; background: #EDE7F6; }
  .fillblank-opt.correct { background: #E8F5E9; border-color: var(--grass); }
  .fillblank-opt.wrong   { background: #FBE9E7; border-color: var(--coral); }

  /* ══════════════════════════════════════
     JOGO: SEQUÊNCIA CERTA (16)
  ══════════════════════════════════════ */
  #screen-game-sequence { background: linear-gradient(160deg, #FBE9E7 0%, #FFF3E0 100%); }
  #screen-game-sequence.active { display: flex !important; flex-direction: column; }
  .sequence-task { background: white; border-radius: 20px; padding: 20px; box-shadow: var(--shadow); text-align: center; border: 3px solid #FFCCBC; }
  .sequence-task-emoji { font-size: 42px; margin-bottom: 8px; }
  .sequence-task-text { font-family: 'Fredoka One', cursive; font-size: 19px; }
  .sequence-items { margin: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
  .sequence-item { background: white; border: 3px solid #E0E0E0; border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; cursor: grab; user-select: none; touch-action: none; -webkit-tap-highlight-color: transparent; font-weight: 700; font-size: 15px; transition: all 0.2s; box-shadow: var(--shadow-sm); min-height: 56px; }
  .sequence-item.dragging { opacity: 0.4; }
  .sequence-item.correct-pos { border-color: var(--grass); background: #E8F5E9; }
  .sequence-item.wrong-pos   { border-color: var(--coral); background: #FBE9E7; }
  .seq-num { width: 32px; height: 32px; border-radius: 50%; background: #F5F5F5; border: 2px solid #E0E0E0; display: flex; align-items: center; justify-content: center; font-family: 'Fredoka One', cursive; font-size: 16px; flex-shrink: 0; }
  .seq-drag-handle { color: #BDBDBD; font-size: 20px; flex-shrink: 0; }

  /* ══════════════════════════════════════
     JOGO: ADIVINHE O EMOJI (17)
  ══════════════════════════════════════ */
  #screen-game-emoji { background: linear-gradient(160deg,#FCE4EC 0%,#F8BBD0 100%); }
  #screen-game-emoji.active { display:flex !important; flex-direction:column; }
  .emoji-display { font-size: 96px; text-align:center; margin:8px 0; animation: popIn 0.4s; line-height:1.1; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15)); }
  .emoji-opts { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:12px 16px; }
  .emoji-opt { background:white; border:3px solid #F8BBD0; border-radius:18px; padding:16px 10px; font-family:'Nunito',sans-serif; font-size:15px; font-weight:800; cursor:pointer; text-align:center; transition:all 0.2s; touch-action:manipulation; -webkit-tap-highlight-color:transparent; min-height:60px; display:flex; align-items:center; justify-content:center; gap:8px; }
  .emoji-opt:hover { border-color:#AD1457; background:#FCE4EC; transform:translateY(-2px); }
  .emoji-opt.correct { background:#E8F5E9; border-color:var(--grass); color:var(--grass-dark); }
  .emoji-opt.wrong   { background:#FBE9E7; border-color:var(--coral); color:var(--coral-dark); }
  .emoji-opt-icon { font-size:22px; }

  /* ══════════════════════════════════════
     JOGO: ESTOURA BALÕES (18)
  ══════════════════════════════════════ */
  #screen-game-balloon { background:linear-gradient(160deg,#E0F7FA 0%,#B2EBF2 100%); }
  #screen-game-balloon.active { display:flex !important; flex-direction:column; }
  .balloon-question { background:white; border-radius:20px; padding:18px 20px; margin:0 16px 8px; text-align:center; box-shadow:var(--shadow); font-size:17px; font-weight:800; color:var(--text); border:3px solid #B2EBF2; line-height:1.5; }
  .balloon-arena { flex:1; position:relative; margin:0 8px; min-height:260px; overflow:hidden; }
  .balloon { position:absolute; display:flex; flex-direction:column; align-items:center; cursor:pointer; animation:balloonRise linear forwards; touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
  .balloon-body { width:72px; height:88px; border-radius:50% 50% 50% 50% / 60% 60% 40% 40%; display:flex; align-items:center; justify-content:center; font-size:15px; font-weight:900; color:white; text-shadow:0 1px 4px rgba(0,0,0,0.3); box-shadow:inset -8px -8px 20px rgba(0,0,0,0.15); padding:8px; text-align:center; line-height:1.3; pointer-events:none; }
  .balloon-string { width:2px; height:24px; background:#888; border-radius:2px; }
  .balloon.pop { animation:balloonPop 0.3s forwards !important; }
  .balloon.wrong-pop { animation:balloonWrongPop 0.3s forwards !important; }
  @keyframes balloonRise { 0% { bottom:-120px; opacity:1; } 100% { bottom:110%; opacity:0.9; } }
  @keyframes balloonPop { 0% { transform:scale(1); opacity:1; } 50% { transform:scale(1.4); opacity:0.8; } 100% { transform:scale(0); opacity:0; } }
  @keyframes balloonWrongPop { 0%,100% { transform:translateX(0); } 25% { transform:translateX(-8px); } 75% { transform:translateX(8px); } }

  /* ══════════════════════════════════════
     JOGO: MONTE A PALAVRA (19)
  ══════════════════════════════════════ */
  #screen-game-puzzle { background:linear-gradient(160deg,#F1F8E9 0%,#DCEDC8 100%); }
  #screen-game-puzzle.active { display:flex !important; flex-direction:column; }
  .puzzle-hint { background:white; border-radius:20px; padding:16px 20px; margin:0 16px 10px; text-align:center; box-shadow:var(--shadow-sm); border:3px solid #C5E1A5; }
  .puzzle-hint-icon { font-size:52px; margin-bottom:4px; }
  .puzzle-hint-text { font-size:15px; font-weight:700; color:var(--text-muted); }
  .puzzle-slots { display:flex; justify-content:center; gap:8px; flex-wrap:wrap; margin:10px 16px; }
  .puzzle-slot { width:44px; height:52px; border-radius:12px; border:3px solid #C5E1A5; background:white; display:flex; align-items:center; justify-content:center; font-family:'Fredoka One',cursive; font-size:24px; color:var(--grass-dark); transition:all 0.2s; box-shadow:var(--shadow-sm); }
  .puzzle-slot.filled { background:#E8F5E9; border-color:var(--grass); }
  .puzzle-slot.wrong  { background:#FBE9E7; border-color:var(--coral); animation:shake 0.4s; }
  @keyframes shake { 0%,100% { transform:translateX(0); } 25% { transform:translateX(-6px); } 75% { transform:translateX(6px); } }
  .puzzle-letters { display:flex; justify-content:center; gap:8px; flex-wrap:wrap; margin:10px 16px; }
  .puzzle-letter { width:48px; height:56px; border-radius:14px; background:linear-gradient(135deg,#9CCC65,#558B2F); color:white; font-family:'Fredoka One',cursive; font-size:26px; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:all 0.2s; box-shadow:0 4px 0 #33691E; touch-action:manipulation; -webkit-tap-highlight-color:transparent; user-select:none; }
  .puzzle-letter:active { transform:translateY(3px); box-shadow:0 1px 0 #33691E; }
  .puzzle-letter.used { opacity:0.3; pointer-events:none; }
  .puzzle-backspace { background:linear-gradient(135deg,#EF9A9A,#E53935); box-shadow:0 4px 0 #B71C1C; touch-action:manipulation; -webkit-tap-highlight-color:transparent; }

  /* ══════════════════════════════════════
     JOGO: ACERTA O TATU (20)
  ══════════════════════════════════════ */
  #screen-game-whack { background:linear-gradient(160deg,#FFF9C4 0%,#FFF3E0 100%); }
  #screen-game-whack.active { display:flex !important; flex-direction:column; }
  .whack-question { background:white; border-radius:20px; padding:14px 20px; margin:0 16px 8px; text-align:center; box-shadow:var(--shadow-sm); font-size:16px; font-weight:800; color:var(--text); border:3px solid #FFE082; line-height:1.5; }
  .whack-category { font-size:13px; color:var(--text-muted); font-weight:700; margin-top:3px; }
  .whack-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:8px 16px; max-width:400px; width:100%; }
  .whack-hole { aspect-ratio:1; border-radius:20px; background:#E8D5A3; display:flex; align-items:center; justify-content:center; position:relative; overflow:hidden; box-shadow:inset 0 4px 12px rgba(0,0,0,0.15); cursor:pointer; touch-action:manipulation; -webkit-tap-highlight-color:transparent; border:3px solid #C8A96E; }
  .whack-item { font-size:clamp(20px,6vw,36px); font-weight:800; font-family:'Nunito',sans-serif; color:var(--text); text-align:center; padding:4px; transition:transform 0.15s; line-height:1.2; pointer-events:none; user-select:none; }
  .whack-hole.hit-correct { background:#E8F5E9; animation:whackHit 0.3s; }
  .whack-hole.hit-wrong   { background:#FBE9E7; animation:whackShake 0.3s; }
  @keyframes whackHit   { 0%{transform:scale(1)} 50%{transform:scale(0.85)} 100%{transform:scale(1)} }
  @keyframes whackShake { 0%,100%{transform:translateX(0)} 33%{transform:translateX(-5px)} 66%{transform:translateX(5px)} }

  /* ══════════════════════════════════════
     JOGO: QUAL CATEGORIA? (21)
  ══════════════════════════════════════ */
  #screen-game-category { background:linear-gradient(160deg,#EDE7F6 0%,#D1C4E9 100%); }
  #screen-game-category.active { display:flex !important; flex-direction:column; }
  .cat-item-card { background:white; border-radius:20px; padding:20px; margin:0 16px 8px; text-align:center; box-shadow:var(--shadow); border:3px solid #D1C4E9; }
  .cat-item-icon { font-size:64px; margin-bottom:8px; }
  .cat-item-name { font-family:'Fredoka One',cursive; font-size:22px; color:var(--text); }
  .cat-item-hint { font-size:13px; color:var(--text-muted); font-weight:700; margin-top:4px; }
  .cat-opts { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:8px 16px; }
  .cat-opt { background:white; border:3px solid #D1C4E9; border-radius:18px; padding:14px 10px; font-family:'Nunito',sans-serif; font-size:14px; font-weight:800; cursor:pointer; text-align:center; transition:all 0.2s; touch-action:manipulation; -webkit-tap-highlight-color:transparent; min-height:60px; display:flex; flex-direction:column; align-items:center; gap:4px; }
  .cat-opt-icon { font-size:24px; }
  .cat-opt:hover { border-color:#7E57C2; background:#EDE7F6; transform:translateY(-2px); }
  .cat-opt.correct { background:#E8F5E9; border-color:var(--grass); }
  .cat-opt.wrong   { background:#FBE9E7; border-color:var(--coral); }

  /* ══ Mobile breakpoints novos jogos ══ */
  @media (max-width: 600px) {
    .emoji-display { font-size:72px !important; }
    .emoji-opts, .screenshot-opts, .shortcut-opts, .fillblank-opts, .cat-opts { gap:8px; margin:8px 12px; }
    .emoji-opt, .screenshot-opt, .shortcut-opt, .fillblank-opt, .cat-opt { font-size:13px !important; padding:12px 8px !important; min-height:52px !important; }
    .balloon-body { width:60px !important; height:74px !important; font-size:12px !important; }
    .puzzle-letter { width:40px !important; height:48px !important; font-size:22px !important; }
    .puzzle-slot  { width:36px !important; height:44px !important; font-size:20px !important; }
    .whack-question { font-size:14px !important; padding:10px 12px !important; }
    .whack-grid { gap:7px !important; }
    .sequence-item { padding:12px !important; font-size:13px !important; }
    .game-card { min-width:140px; padding:16px 12px; border-radius:18px; }
    .game-emoji { font-size:32px !important; }
    .game-title { font-size:14px !important; }
    .game-desc  { font-size:12px !important; }
  
    /* ── Digitação Relâmpago ── */
    .t3-arena    { height:240px !important; }
    .t3-letter   { font-size:24px !important; width:36px !important; height:36px !important; }
    .t3-input    { font-size:22px !important; padding:12px 14px !important; letter-spacing:4px !important; }

    /* ── Forca Digital ── */
    .hm-key        { width:34px !important; height:34px !important; font-size:14px !important; }
    .hm-letter-slot{ width:30px !important; font-size:18px !important; }
    .hm-drawing    { font-size:48px !important; min-height:60px !important; }
    .hm-keyboard   { gap:4px !important; }

    /* ── Caminho do Dado ── */
    .pf-board      { max-width:270px !important; gap:3px !important; }
    .pf-cell       { border-radius:7px !important; font-size:12px !important; }
    .pf-question-card { font-size:14px !important; padding:12px 14px !important; }
    .pf-opts       { gap:7px; margin:6px 12px; }
    .pf-opt        { font-size:13px !important; padding:10px 8px !important; min-height:46px !important; }

    /* ── Charadas Tech ── */
    .riddle-card   { padding:16px 14px !important; }
    .riddle-icon   { font-size:40px !important; }
    .riddle-text   { font-size:15px !important; }
    .riddle-opts   { gap:7px; margin:8px 12px; }
    .riddle-opt    { font-size:13px !important; padding:12px 8px !important; min-height:52px !important; }
}

  /* ══ DIGITAÇÃO RELÂMPAGO ══ */
  #screen-game-typing3 { background: linear-gradient(160deg,#E3F2FD 0%,#BBDEFB 100%); }
  #screen-game-typing3.active { display:flex !important; flex-direction:column; }
  .t3-arena {
    position:relative; width:100%; max-width:560px; height:320px;
    background:white; border-radius:20px; box-shadow:var(--shadow);
    overflow:hidden; border:3px solid #90CAF9;
  }
  .t3-letter {
    position:absolute; font-family:'Fredoka One',cursive; font-size:32px;
    font-weight:900; cursor:default; user-select:none; transition:top 0.1s linear;
    width:44px; height:44px; display:flex; align-items:center; justify-content:center;
    border-radius:10px; color:white;
  }
  .t3-input {
    width:100%; max-width:560px; padding:16px 20px; border:4px solid #90CAF9;
    border-radius:16px; font-family:'Fredoka One',cursive; font-size:28px;
    font-weight:900; text-align:center; outline:none; letter-spacing:6px;
    text-transform:uppercase; background:white;
    touch-action:manipulation; -webkit-tap-highlight-color:transparent;
  }
  .t3-input:focus { border-color:#0288D1; }
  .t3-ground { position:absolute; bottom:0; left:0; right:0; height:6px; background:#EF5350; border-radius:0 0 17px 17px; }

  /* ══ FORCA DIGITAL ══ */
  #screen-game-hangman { background: linear-gradient(160deg,#E8F5E9 0%,#C8E6C9 100%); }
  #screen-game-hangman.active { display:flex !important; flex-direction:column; }
  .hm-word { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; margin:16px 0; }
  .hm-letter-slot {
    width:40px; height:48px; border-bottom:4px solid #2E7D32;
    display:flex; align-items:center; justify-content:center;
    font-family:'Fredoka One',cursive; font-size:26px; color:#1B5E20;
  }
  .hm-letter-slot.revealed { animation: popIn 0.3s; }
  .hm-keyboard {
    display:flex; flex-wrap:wrap; gap:6px; justify-content:center;
    max-width:480px; margin:12px auto;
  }
  .hm-key {
    width:44px; height:44px; border-radius:10px; border:2px solid #A5D6A7;
    background:white; font-family:'Fredoka One',cursive; font-size:18px;
    cursor:pointer; transition:all 0.15s; touch-action:manipulation;
    -webkit-tap-highlight-color:transparent; display:flex; align-items:center; justify-content:center;
  }
  .hm-key:hover { background:#E8F5E9; border-color:#2E7D32; }
  .hm-key.used-correct { background:#E8F5E9; border-color:var(--grass); color:var(--grass-dark); }
  .hm-key.used-wrong   { background:#FBE9E7; border-color:var(--coral); color:var(--coral-dark); opacity:0.5; }
  .hm-drawing { font-size:64px; text-align:center; min-height:80px; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:4px; }
  .hm-lives-bar { display:flex; gap:6px; justify-content:center; margin:4px 0; }
  .hm-life { font-size:22px; transition:all 0.3s; }
  .hm-life.lost { opacity:0.2; transform:scale(0.7); }

  /* ══ CAMINHO DO DADO ══ */
  #screen-game-pathfind { background: linear-gradient(160deg,#FFF8E1 0%,#FFECB3 100%); }
  #screen-game-pathfind.active { display:flex !important; flex-direction:column; }
  .pf-board {
    display:grid; gap:4px; margin:0 auto;
    max-width:340px; width:100%;
  }
  .pf-cell {
    aspect-ratio:1; border-radius:10px; display:flex; align-items:center;
    justify-content:center; font-size:clamp(14px,4vw,22px); font-weight:800;
    border:2px solid rgba(0,0,0,0.1);
  }
  .pf-cell.path    { background:#FFF9C4; color:#F57F17; }
  .pf-cell.wall    { background:#BCAAA4; color:#5D4037; }
  .pf-cell.player  { background:#FF8F00; color:white; font-size:clamp(18px,5vw,28px); }
  .pf-cell.goal    { background:#43A047; color:white; }
  .pf-cell.visited { background:#FFE082; }
  .pf-question-card {
    background:white; border-radius:18px; padding:16px 18px; margin:8px 16px;
    font-size:16px; font-weight:800; text-align:center; box-shadow:var(--shadow-sm);
    border:3px solid #FFE082;
  }
  .pf-opts { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:8px 16px; }
  .pf-opt {
    background:white; border:3px solid #FFE082; border-radius:14px; padding:12px 8px;
    font-family:'Nunito',sans-serif; font-size:14px; font-weight:800; cursor:pointer;
    text-align:center; transition:all 0.2s; touch-action:manipulation;
    -webkit-tap-highlight-color:transparent; min-height:50px;
  }
  .pf-opt:hover { border-color:#F57F17; background:#FFF8E1; }
  .pf-opt.correct { background:#E8F5E9; border-color:var(--grass); }
  .pf-opt.wrong   { background:#FBE9E7; border-color:var(--coral); }

  /* ══ CHARADAS TECH ══ */
  #screen-game-riddle { background: linear-gradient(160deg,#F3E5F5 0%,#E1BEE7 100%); }
  #screen-game-riddle.active { display:flex !important; flex-direction:column; }
  .riddle-card {
    background:white; border-radius:22px; padding:24px 20px; margin:0 16px;
    box-shadow:var(--shadow); border:3px solid #CE93D8; text-align:center;
  }
  .riddle-icon { font-size:52px; margin-bottom:10px; }
  .riddle-text {
    font-size:17px; font-weight:700; color:var(--text); line-height:1.6;
    font-style:italic; margin-bottom:8px;
  }
  .riddle-hint { font-size:13px; color:var(--text-muted); font-weight:600; }
  .riddle-opts { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:12px 16px; }
  .riddle-opt {
    background:white; border:3px solid #CE93D8; border-radius:16px; padding:14px 10px;
    font-family:'Nunito',sans-serif; font-size:14px; font-weight:800; cursor:pointer;
    text-align:center; transition:all 0.2s; touch-action:manipulation;
    -webkit-tap-highlight-color:transparent; min-height:56px;
  }
  .riddle-opt:hover { border-color:#880E4F; background:#F3E5F5; transform:translateY(-2px); }
  .riddle-opt.correct { background:#E8F5E9; border-color:var(--grass); }
  .riddle-opt.wrong   { background:#FBE9E7; border-color:var(--coral); }

  /* ══ Mobile ══ */
  @media (max-width:600px) {
    .t3-arena { height:240px !important; }
    .t3-letter { font-size:24px !important; width:36px !important; height:36px !important; }
    .hm-key { width:36px !important; height:36px !important; font-size:15px !important; }
    .hm-letter-slot { width:32px !important; font-size:20px !important; }
    .pf-board { max-width:280px !important; }
    .riddle-opts, .pf-opts { gap:7px; margin:8px 12px; }
  }

  /* ══ MODAL: O QUE HÁ DE NOVO ══ */
  #news-overlay { z-index: 9997; }
  .news-modal {
    background: white; border-radius: 26px; width: 100%; max-width: 480px;
    max-height: 88vh; overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,0.25); animation: fadeInUp 0.35s;
  }
  .news-header {
    background: linear-gradient(135deg, #7B1FA2, #0288D1);
    padding: 24px 24px 20px; color: white; flex-shrink: 0; position: relative;
  }
  .news-version-badge {
    display: inline-block; background: rgba(255,255,255,0.25);
    border-radius: 50px; padding: 3px 12px; font-size: 12px; font-weight: 800;
    letter-spacing: 1px; margin-bottom: 8px;
  }
  .news-header-title {
    font-family: 'Fredoka One', cursive; font-size: 28px; line-height: 1.1;
    margin-bottom: 4px;
  }
  .news-header-sub { font-size: 13px; opacity: 0.85; font-weight: 600; }
  .news-header-emoji {
    position: absolute; right: 20px; top: 16px; font-size: 52px;
    opacity: 0.9; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
  }
  .news-body {
    overflow-y: auto; padding: 20px 24px; flex: 1;
    scrollbar-width: thin; scrollbar-color: #E0E0E0 transparent;
  }
  .news-section { margin-bottom: 20px; }
  .news-section:last-child { margin-bottom: 0; }
  .news-section-title {
    font-size: 12px; font-weight: 900; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
  }
  .news-section-title::after {
    content: ''; flex: 1; height: 1px; background: #F0F0F0;
  }
  .news-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 10px 14px; border-radius: 14px; margin-bottom: 6px;
    transition: background 0.15s;
  }
  .news-item:hover { background: #F8F8F8; }
  .news-item-icon {
    width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 20px;
  }
  .news-item-icon.purple { background: #EDE7F6; }
  .news-item-icon.blue   { background: #E3F2FD; }
  .news-item-icon.green  { background: #E8F5E9; }
  .news-item-icon.orange { background: #FFF3E0; }
  .news-item-icon.red    { background: #FBE9E7; }
  .news-item-icon.pink   { background: #FCE4EC; }
  .news-item-icon.teal   { background: #E0F2F1; }
  .news-item-text { flex: 1; }
  .news-item-label {
    font-size: 14px; font-weight: 800; color: var(--text); line-height: 1.3;
  }
  .news-item-desc {
    font-size: 12px; color: var(--text-muted); font-weight: 600;
    margin-top: 2px; line-height: 1.4;
  }
  .news-item-badge {
    display: inline-block; padding: 1px 8px; border-radius: 50px;
    font-size: 10px; font-weight: 800; letter-spacing: 0.5px; flex-shrink: 0;
    margin-top: 2px;
  }
  .news-item-badge.new    { background: #E8F5E9; color: #2E7D32; }
  .news-item-badge.fix    { background: #E3F2FD; color: #1565C0; }
  .news-item-badge.melhoria { background: #FFF8E1; color: #E65100; }
  .news-item-badge.segurança { background: #FCE4EC; color: #880E4F; }
  .news-footer {
    padding: 16px 24px; border-top: 1px solid #F0F0F0; flex-shrink: 0;
    display: flex; gap: 10px; align-items: center;
  }
  .news-footer-tip {
    flex: 1; font-size: 12px; color: var(--text-muted); font-weight: 600;
  }
  @media (max-width: 520px) {
    .news-modal { max-height: 92vh; border-radius: 20px 20px 0 0; }
    .news-header { padding: 20px 18px 16px; }
    .news-header-title { font-size: 22px; }
    .news-header-emoji { font-size: 40px; right: 14px; top: 14px; }
    .news-body { padding: 16px 18px; }
    .news-footer { padding: 14px 18px; }
  }

/* ══ CLICK MASTER ══════════════════════════════════════════ */
#cm-arena {
  position: relative; width: 100%; flex: 1;
  min-height: 280px; overflow: hidden;
  background: radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f1a 100%);
  border-radius: 20px; margin: 12px 0; cursor: crosshair;
  border: 2px solid rgba(255,255,255,0.06);
}
.cm-target {
  position: absolute; width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
  border: 2px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transform: scale(0); opacity: 0;
  transition: transform 0.18s cubic-bezier(.34,1.56,.64,1), opacity 0.15s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  user-select: none; will-change: transform; box-shadow: 0 4px 18px rgba(0,0,0,0.4);
  padding: 0; border: none; outline: none;
}
.cm-target-bad {
  background: linear-gradient(135deg, rgba(220,50,50,0.25), rgba(180,20,20,0.1));
  border: 2px solid rgba(255,80,80,0.4);
  box-shadow: 0 0 16px rgba(255,60,60,0.3);
  animation: cm-pulse-bad 0.7s infinite alternate;
}
@keyframes cm-pulse-bad {
  from { box-shadow: 0 0 8px rgba(255,60,60,0.2); }
  to   { box-shadow: 0 0 22px rgba(255,60,60,0.6); }
}
.cm-target-in { transform: scale(1); opacity: 1; }
.cm-target-hit {
  transform: scale(1.4) !important; opacity: 0 !important;
  transition: transform 0.2s ease-out, opacity 0.2s ease-out !important;
}
.cm-target-miss {
  transform: scale(0.3) !important; opacity: 0 !important;
  transition: transform 0.25s ease-in, opacity 0.25s !important;
}
.cm-t-emoji { font-size: 32px; line-height: 1; pointer-events: none; }
.cm-float {
  position: absolute; font-size: 14px; font-weight: 900;
  pointer-events: none; animation: cm-float-up 0.9s ease-out forwards;
  transform: translateX(-50%); white-space: nowrap; z-index: 10;
}
.cm-float-good { color: #69F0AE; text-shadow: 0 1px 6px rgba(0,0,0,0.7); }
.cm-float-bad  { color: #FF6B6B; text-shadow: 0 1px 6px rgba(0,0,0,0.7); }
@keyframes cm-float-up {
  0%   { transform: translateX(-50%) translateY(0); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-52px); opacity: 0; }
}
#cm-lives { font-size: 18px; letter-spacing: 2px; }
#cm-combo {
  font-family: 'Fredoka One', cursive; font-size: 18px;
  color: #FFD600; min-height: 28px; text-align: center;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.cm-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 4px; margin-bottom: 6px;
}
#cm-level { font-size: 12px; font-weight: 800; color: var(--text-muted); }
@media (max-width: 480px) {
  #cm-arena { min-height: 240px; }
  .cm-target { width: 60px; height: 60px; }
  .cm-t-emoji { font-size: 28px; }
}

/* ══ PRESTÍGIO ══════════════════════════════════════════════ */
@keyframes pg-pulse {
  0%,100% { box-shadow: 0 0 40px rgba(255,214,0,0.6), 0 0 80px rgba(123,31,162,0.4); }
  50%      { box-shadow: 0 0 60px rgba(255,214,0,0.9), 0 0 120px rgba(123,31,162,0.7); }
}
#pg-core:active { transform: scale(0.93) !important; }
.pg-upgrade-btn {
  width:100%; display:flex; align-items:center; gap:10px;
  background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.12);
  border-radius:12px; padding:10px 12px; cursor:pointer; margin-bottom:6px;
  color:rgba(255,255,255,0.5); transition: all 0.15s; text-align:left;
  font-family: inherit;
}
.pg-upgrade-btn.pg-can-buy {
  background:rgba(255,214,0,0.12); border-color:rgba(255,214,0,0.4); color:white;
}
.pg-upgrade-btn.pg-can-buy:hover { background:rgba(255,214,0,0.2); transform:translateX(2px); }
.pg-upgrade-btn:disabled { opacity:0.35; cursor:not-allowed; }
.pg-upg-icon { font-size:22px; flex-shrink:0; }
.pg-upg-info { flex:1; }
.pg-upg-label { font-size:13px; font-weight:800; }
.pg-upg-desc  { font-size:11px; opacity:0.7; margin-top:1px; }
.pg-upg-cost  { font-size:12px; font-weight:800; color:#FFD600; white-space:nowrap; }

/* ══ ASCENSÃO ══════════════════════════════════════════════ */
#screen-game-ascensao { background: #08060f; }

#as-arena {
  position: relative;
  width: 100%; flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  overflow: hidden; min-height: 0;
  padding: 20px 0 10px;
}

#as-canvas {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 1;
}

/* ── Orb ─────────────────────────────── */
#as-orb {
  width: 190px; height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #b060ff, #7b1fa2 60%, #4a0080);
  box-shadow: 0 0 40px rgba(160,60,255,0.5), 0 0 80px rgba(160,60,255,0.25);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 3; position: relative;
  transition: transform 0.12s cubic-bezier(.34,1.56,.64,1),
              box-shadow 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; user-select: none;
  border: none; outline: none;
  animation: as-idle 4s ease-in-out infinite;
  will-change: transform, box-shadow;
}

#as-orb:active { transform: scale(0.88) !important; }

.as-orb-welcome {
  animation: as-orb-welcome 0.8s cubic-bezier(.34,1.56,.64,1) !important;
}

@keyframes as-orb-welcome {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes as-idle {
  0%, 100% { transform: scale(1) translateY(0); }
  50%       { transform: scale(1.03) translateY(-6px); }
}

.as-turbo #as-orb {
  animation: as-turbo-pulse 0.3s ease-in-out infinite alternate !important;
}

@keyframes as-turbo-pulse {
  from { transform: scale(1); }
  to   { transform: scale(1.08); filter: brightness(1.3); }
}

/* ── Level up flash ──────────────────── */
@keyframes as-levelup-flash-anim {
  0%   { background: rgba(255,255,255,0) }
  15%  { background: rgba(255,255,255,0.12) }
  100% { background: rgba(255,255,255,0) }
}

.as-levelup-flash {
  animation: as-levelup-flash-anim 0.6s ease-out !important;
}

/* ── HUD ─────────────────────────────── */
#as-hud {
  width: 100%; max-width: 360px;
  padding: 0 20px;
  z-index: 4; position: relative;
  display: flex; flex-direction: column; gap: 10px;
}

.as-level-row {
  display: flex; align-items: baseline;
  justify-content: space-between;
}

#as-level-num {
  font-family: 'Fredoka One', cursive;
  font-size: 52px; line-height: 1;
  color: white; letter-spacing: -1px;
  text-shadow: 0 0 30px rgba(160,60,255,0.8);
  transition: color 0.5s;
}

#as-phase {
  font-size: 13px; font-weight: 800;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase; letter-spacing: 2px;
}

#as-combo {
  font-family: 'Fredoka One', cursive;
  font-size: 22px; color: #FFD600;
  text-shadow: 0 0 20px rgba(255,214,0,0.8);
  min-width: 40px; text-align: right;
  transition: all 0.1s;
}

#as-mult {
  font-size: 13px; font-weight: 900;
  color: #FF6B00; background: rgba(255,107,0,0.15);
  border-radius: 50px; padding: 2px 10px;
  display: none;
}
#as-mult:not(:empty) { display: inline-block; }

/* ── Barras ──────────────────────────── */
.as-bar-wrap {
  display: flex; flex-direction: column; gap: 3px;
}

.as-bar-label {
  font-size: 10px; font-weight: 800;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase; letter-spacing: 1.5px;
  display: flex; justify-content: space-between;
}

.as-bar-track {
  height: 8px; border-radius: 50px;
  background: rgba(255,255,255,0.08);
  overflow: hidden; position: relative;
}

.as-bar-fill {
  height: 100%; border-radius: 50px;
  transition: width 0.15s cubic-bezier(.4,0,.2,1);
  position: relative;
}

.as-bar-fill::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 20px;
  background: rgba(255,255,255,0.4);
  border-radius: 50px;
  filter: blur(4px);
}

#as-energy-fill { transition: width 0.1s linear; }

.as-turbo #as-energy-track {
  box-shadow: 0 0 12px rgba(255,214,0,0.5);
}

/* ── Botão e badges ──────────────────── */
#as-start-btn {
  margin-top: 8px;
  background: linear-gradient(135deg, #7b1fa2, #4a0080);
  border: none; border-radius: 16px;
  padding: 14px 32px;
  font-family: 'Fredoka One', cursive;
  font-size: 18px; color: white;
  cursor: pointer; width: 100%;
  box-shadow: 0 4px 24px rgba(123,31,162,0.5);
  transition: transform 0.1s, box-shadow 0.1s;
  touch-action: manipulation;
}

#as-start-btn:active { transform: scale(0.96); }

.as-badge-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  justify-content: center; margin-top: 4px;
}

.as-badge {
  font-size: 11px; font-weight: 800;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50px; padding: 3px 10px;
}

#as-prestige-badge {
  color: #FFD600;
  background: rgba(255,214,0,0.1);
  border-color: rgba(255,214,0,0.3);
}

/* ── Topbar customizada ───────────────── */
#as-topbar {
  background: rgba(8,6,15,0.95);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

@media (max-width: 480px) {
  #as-orb { width: 160px; height: 160px; }
  #as-level-num { font-size: 42px; }
  #as-hud { padding: 0 16px; gap: 8px; }
  .as-bar-track { height: 7px; }
}

/* ── Ascensão shake + urgent ─────────────────────── */
@keyframes as-shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px) rotate(-1deg); }
  40%      { transform: translateX(6px)  rotate(1deg); }
  60%      { transform: translateX(-4px) rotate(-0.5deg); }
  80%      { transform: translateX(4px)  rotate(0.5deg); }
}

/* Prestige urgent pulse nos últimos 15s */
@keyframes pg-urgent {
  from { box-shadow: 0 0 40px rgba(255,60,60,0.5), 0 0 80px rgba(255,60,60,0.25); }
  to   { box-shadow: 0 0 70px rgba(255,60,60,0.9), 0 0 140px rgba(255,60,60,0.5); }
}

/* ══════════════════════════════════════════════════════════
   UI/UX IMPROVEMENTS
   ══════════════════════════════════════════════════════════ */

/* ── Screen transitions ─────────────────────────────────── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

.screen-exit {
  animation: screenFadeOut 0.2s ease-out forwards;
  pointer-events: none;
}
.screen-enter {
  animation: screenFadeIn 0.22s ease-out forwards;
}
@keyframes screenFadeOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.98); }
}
@keyframes screenFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Bottom Navigation Bar ──────────────────────────────── */
#bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 60px; background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0,0,0,0.08);
  display: none;  /* shown by JS after login */
  justify-content: space-around; align-items: center;
  z-index: 800; padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.06);
}
.bnav-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 6px 20px; border: none; background: none;
  cursor: pointer; transition: all 0.18s; border-radius: 14px;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  color: var(--text-muted); font-family: inherit;
}
.bnav-btn:active { transform: scale(0.9); }
.bnav-icon { font-size: 22px; line-height: 1; transition: transform 0.18s cubic-bezier(.34,1.56,.64,1); }
.bnav-label { font-size: 10px; font-weight: 800; letter-spacing: 0.5px; }
.bnav-btn.bnav-active { color: var(--sky-dark); }
.bnav-btn.bnav-active .bnav-icon { transform: scale(1.18) translateY(-2px); }

/* Padding bottom das screens para nav bar não sobrepor */
.screen.active { padding-bottom: 68px; }
#screen-landing.active,
#screen-auth.active,
#screen-reset.active { padding-bottom: 0; }

/* Dark mode support for bottom nav */
body.dark #bottom-nav { background: rgba(30,30,40,0.97); border-color: rgba(255,255,255,0.08); }
body.dark .bnav-btn { color: rgba(255,255,255,0.4); }
body.dark .bnav-btn.bnav-active { color: var(--sky); }

/* ── Focus visível acessível ────────────────────────────── */
.form-input:focus {
  outline: 3px solid var(--sky-dark);
  outline-offset: 2px;
  border-color: var(--sky-dark);
}
button:focus-visible {
  outline: 3px solid var(--sky-dark);
  outline-offset: 3px;
}

/* ── Skeleton loader ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.4s ease-in-out infinite;
  border-radius: 12px;
}
body.dark .skeleton {
  background: linear-gradient(90deg,#2a2a3a 25%,#353548 50%,#2a2a3a 75%);
  background-size: 200% 100%;
}
@keyframes skeleton-wave {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Game cards: pointerdown visual feedback ────────────── */
.game-card { touch-action: manipulation; }
.game-card:active {
  transform: scale(0.96) !important;
  transition: transform 0.08s ease-in !important;
}

/* ── Empty state ────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 48px 24px; text-align: center;
  color: var(--text-muted);
}
.empty-state-emoji { font-size: 56px; margin-bottom: 12px; opacity: 0.6; }
.empty-state-title { font-family: 'Fredoka One',cursive; font-size: 20px; margin-bottom: 6px; }
.empty-state-desc  { font-size: 14px; line-height: 1.6; opacity: 0.7; }

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

/* ── PWA theme & safe areas ─────────────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #bottom-nav { padding-bottom: env(safe-area-inset-bottom); height: calc(60px + env(safe-area-inset-bottom)); }
}

/* ══════════════════════════════════════════════════════════
   MOBILE UI/UX FIXES — Touch, Popups, Conquistas
   ══════════════════════════════════════════════════════════ */

/* ── Overlay: scroll vertical em telas pequenas ─────────── */
.overlay {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  align-items: flex-start;          /* não centraliza, deixa scrollar */
  padding: 20px 14px;
}
/* Mas manter centralizado quando há espaço */
@media (min-height: 600px) {
  .overlay { align-items: center; }
}

/* ── overlay-card: sem padding excessivo no mobile ──────── */
@media (max-width: 480px) {
  .overlay-card {
    padding: 28px 18px !important;
    border-radius: 22px !important;
    max-width: 100% !important;
    margin: 0 auto;
  }
  .overlay-title { font-size: 24px !important; margin-bottom: 6px !important; }
  .overlay-body  { font-size: 15px !important; margin-bottom: 16px !important; }
  .overlay-emoji { font-size: 56px !important; margin-bottom: 8px !important; }
  .overlay-xp    { font-size: 22px !important; margin-bottom: 16px !important; }
}
@media (max-width: 380px) {
  .overlay-card  { padding: 22px 14px !important; border-radius: 18px !important; }
  .overlay-title { font-size: 21px !important; }
  .overlay-body  { font-size: 14px !important; }
  .overlay-emoji { font-size: 48px !important; }
}
/* Botões do gameover: empilha em telas pequenas */
@media (max-width: 380px) {
  #gameover-overlay .btn, #levelup-overlay .btn {
    width: 100%; justify-content: center;
  }
}

/* ── Conquistas (badges): legível em qualquer tamanho ───── */
.badge-item {
  background: white;
  border-radius: 14px;
  padding: 12px 6px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;          /* base legível */
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  min-height: 84px;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  word-break: break-word;   /* evita overflow de texto longo */
  overflow: hidden;
  line-height: 1.3;
}
.badge-item:active { transform: scale(0.94); }
.badge-item.earned { background: linear-gradient(135deg,#E8F5E9,#F1F8E9); color: var(--grass-dark); }
.badge-item.locked-badge { opacity: 0.55; filter: grayscale(0.6); }
.badge-emoji { font-size: 26px; line-height: 1; flex-shrink: 0; }

/* Label da conquista — elipse com hover para ver completo */
.badge-label {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
  max-height: 2.6em;
}

@media (max-width: 480px) {
  .badge-item  { font-size: 10px; min-height: 76px; padding: 10px 5px; gap: 4px; }
  .badge-emoji { font-size: 24px; }
  .badge-label { font-size: 10px; }
}
@media (max-width: 380px) {
  .badge-item  { font-size: 9px; min-height: 68px; padding: 8px 4px; gap: 3px; }
  .badge-emoji { font-size: 22px; }
  .badge-label { font-size: 9px; }
}

/* ── Badge tooltip: funciona no mobile com tap ───────────── */
.badge-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%; transform: translateX(-50%);
  background: rgba(20,20,32,0.92);
  color: white;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 8px;
  pointer-events: none;
  z-index: 10;
  max-width: 200px;
  white-space: normal;
  text-align: center;
  line-height: 1.4;
}
.badge-item:hover .badge-tooltip,
.badge-item.tooltip-open .badge-tooltip { display: block; }

/* ── News modal: scroll interno no mobile ────────────────── */
.news-modal {
  max-height: 90vh;
  overflow: hidden;
}
.news-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
@media (max-width: 480px) {
  .news-modal {
    max-height: 94vh;
    border-radius: 20px 20px 0 0 !important;
    position: fixed !important;
    bottom: 0; left: 0; right: 0;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0;
  }
  #news-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .news-header { padding: 18px 16px 14px !important; }
  .news-header-title { font-size: 20px !important; }
  .news-item-label { font-size: 13px !important; }
  .news-item-desc  { font-size: 12px !important; }
}

/* ── Touch: feedback imediato em todos os botões ─────────── */
.btn, .auth-tab, .lesson-back, .btn-edit-perfil,
.pg-upgrade-btn, .bnav-btn, .module-card, .lesson-card {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active        { transform: scale(0.96); transition: transform 0.08s; }
.module-card:active { transform: scale(0.97); }
.lesson-card:active { transform: scale(0.97); }

/* ── Conquistas: grid mais flexível ─────────────────────── */
.badges-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 10px;
}
@media (max-width: 480px) {
  .badges-row {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
  }
}
@media (max-width: 380px) {
  .badges-row {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 6px;
  }
}

/* ── Profile hero: evitar overflow em nomes longos ─────── */
.profile-uname {
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}
.profile-level-badge {
  word-break: break-word;
  text-align: center;
  padding: 0 12px;
}

/* ── Bottom nav: sempre acima de tudo ───────────────────── */
#bottom-nav { z-index: 900; }

/* ── Scroll suave em todas as telas ─────────────────────── */
.screen { scroll-behavior: smooth; }
.profile-main, .dashboard-scroll, .ranking-main { 
  -webkit-overflow-scrolling: touch;
}
