/* ============================================
   EGGLISH – JUEGOS  |  juegos.css
   ============================================ */

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

:root {
  --blue:    #1cb0f6;
  --blue-d:  #0090d9;
  --yellow:  #f5a623;
  --yellow-d:#d48800;
  --green:   #58cc02;
  --green-d: #3ea800;
  --purple:  #8549ba;
  --purple-d:#6a3a96;
  --orange:  #ff9600;
  --orange-d:#e07800;
  --teal:    #00c5a1;
  --teal-d:  #009e82;
  --red:     #ff4b4b;
  --white:   #ffffff;
  --bg:      #f0f4f8;
  --card:    #ffffff;
  --text:    #1a1a2e;
  --mid:     #4b5563;
  --light:   #9ca3af;
  --border:  #e5e7eb;
  --radius:  20px;
  --shadow:  0 4px 24px rgba(0,0,0,0.10);
  --font:    'Nunito', sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a {
    text-decoration: none;
    color: inherit;
}

/* ══════════ NAVBAR ══════════ */

.navbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--white); padding: 0 32px; height: 68px;
  border-bottom: 2px solid var(--border);
  position: sticky; top: 0; z-index: 200;
}
.navbar-logo { display: flex; align-items: center; gap: 10px; }
.logo-img { width: 40px; height: 40px; object-fit: contain; }
.logo-text { font-size: 1.4rem; font-weight: 900; color: var(--text); }

/* Quita los puntos/bullets de listas en el navbar */
.navbar-links,
.navbar-links ul,
.navbar-links li { list-style: none; margin: 0; padding: 0; }

.navbar-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 24px; text-decoration: none;
  font-size: 0.9rem; font-weight: 700; color: var(--mid);
  transition: background .2s, color .2s; white-space: nowrap; line-height: 1;
}
.navbar-links a:hover { background: var(--bg); color: var(--text); }
.navbar-links a.active { background: #dbeafe; color: var(--blue); }
.navbar-auth { display: flex; align-items: center; gap: 12px; }
.btn-entrar { font-family: var(--font); font-weight: 700; font-size: .9rem; color: var(--mid); text-decoration: none; padding: 8px 14px; border-radius: 12px; }
.btn-registrarse {
  font-family: var(--font); font-weight: 800; font-size: .95rem;
  color: var(--white); background: var(--yellow); text-decoration: none;
  padding: 10px 22px; border-radius: 12px;
  box-shadow: 0 4px 0 var(--yellow-d); transition: transform .1s, box-shadow .1s;
}
.btn-registrarse:hover { transform: translateY(1px); box-shadow: 0 3px 0 var(--yellow-d); }

/* --- DISEÑO ESCRITORIO --- */
@media (min-width: 769px) {
  .hamburger { display: none; }

  .nav-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    margin-left: 20px;
  }

  /* Links centrados, auth empujado a la derecha */
  .navbar-links {
    display: flex;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    order: 1;
  }

  .navbar-auth {
    order: 2;
    margin-left: auto;
  }
}

/* --- DISEÑO MÓVIL (MAX 768PX) --- */
@media (max-width: 768px) {

  .hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100;
  }

  .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1100;
  }

  .navbar-logo {
    z-index: 1200;
    position: relative;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background: white;
    display: flex !important;
    flex-direction: column;
    padding: 100px 30px 40px;
    transition: left 0.4s ease-in-out;
    z-index: 1050;
    overflow-y: auto;
  }

  .nav-menu.active {
    left: 0;
  }

  .navbar-links {
    flex-direction: column;
    width: 100%;
    gap: 10px;
    display: flex !important;
  }

  .navbar-links a {
    font-size: 1.2rem;
    padding: 15px;
    border-radius: 12px;
    width: 100%;
    display: block;
    text-align: left;
  }

  .navbar-auth {
    flex-direction: column;
    width: 100%;
    gap: 15px;
    margin-top: 30px;
    border-top: 2px solid var(--border);
    padding-top: 30px;
    display: flex !important;
  }

  .btn-registrarse {
    text-transform: none !important;
    width: 100%;
    text-align: center;
    padding: 16px;
    font-size: 1.1rem;
  }
}

/* ══════════ SCREENS ══════════ */
.screen { display: none; flex: 1; flex-direction: column; }
.screen.active { display: flex; }

/* ══════════ HERO BANNER ══════════ */
.hero-banner {
  background: var(--blue);
  padding: 48px 32px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-content { position: relative; z-index: 1; }
.hero-chick {
  width: 96px; height: 96px; object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.2));
  animation: chick-bounce 2s ease-in-out infinite;
}
@keyframes chick-bounce {
  0%,100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-12px) rotate(3deg); }
}
.hero-title { font-size: 2.2rem; font-weight: 900; color: var(--white); margin: 12px 0 6px; text-shadow: 0 2px 8px rgba(0,0,0,.15); }
.hero-sub   { font-size: 1.05rem; font-weight: 700; color: rgba(255,255,255,.85); }

/* ══════════ LEVELS SECTION ══════════ */
.levels-section { padding: 32px 40px 40px; flex: 1; }
.level-tabs { display: flex; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.level-tab {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 12px 24px; border-radius: 14px; border: 2.5px solid var(--border);
  background: var(--white); font-family: var(--font);
  font-size: 1rem; font-weight: 900; color: var(--mid);
  cursor: pointer; transition: all .2s;
}
.level-tab span { font-size: 0.75rem; font-weight: 600; color: var(--light); margin-top: 2px; }
.level-tab:hover { border-color: var(--blue); color: var(--blue); }
.level-tab.active { background: var(--blue); border-color: var(--blue); color: var(--white); box-shadow: 0 4px 0 var(--blue-d); }
.level-tab.active span { color: rgba(255,255,255,.8); }

/* GAMES GRID */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.game-card-sel {
  background: var(--white); border-radius: var(--radius);
  padding: 24px; cursor: pointer;
  border: 2.5px solid var(--border);
  transition: transform .18s, box-shadow .18s, border-color .18s;
  display: flex; flex-direction: column; gap: 12px;
}
.game-card-sel:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--blue); }
.game-card-icon { font-size: 2.4rem; line-height: 1; }
.game-card-title { font-size: 1.1rem; font-weight: 900; color: var(--text); }
.game-card-desc  { font-size: 0.85rem; font-weight: 600; color: var(--mid); line-height: 1.4; }
.game-card-badge {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-size: 0.75rem; font-weight: 800; color: var(--white);
  align-self: flex-start;
}
.badge-A1 { background: var(--green); }
.badge-A2 { background: var(--blue); }
.badge-B1 { background: var(--purple); }
.game-card-sel .btn-play {
  margin-top: 4px; padding: 10px 0; border-radius: 12px; border: none;
  font-family: var(--font); font-size: .9rem; font-weight: 800;
  color: var(--white); cursor: pointer; transition: opacity .2s;
}
.btn-play:hover { opacity: .88; }
.btn-A1 { background: var(--green); box-shadow: 0 4px 0 var(--green-d); }
.btn-A2 { background: var(--blue);  box-shadow: 0 4px 0 var(--blue-d); }
.btn-B1 { background: var(--purple);box-shadow: 0 4px 0 var(--purple-d); }

/* ══════════ GAME SCREENS ══════════ */
.game-screen { flex: 1; }
.game-bg {
  min-height: calc(100vh - 68px); background: var(--blue);
  display: flex; flex-direction: column; padding: 24px 24px 40px;
}
.game-bg--green  { background: var(--green); }
.game-bg--purple { background: var(--purple); }
.game-bg--orange { background: var(--orange); }
.game-bg--teal   { background: var(--teal); }

/* GAME HEADER */
.game-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.btn-back {
  font-family: var(--font); font-weight: 800; font-size: .9rem;
  color: var(--white); background: rgba(255,255,255,.2); border: none;
  padding: 8px 16px; border-radius: 12px; cursor: pointer;
  transition: background .2s;
}
.btn-back:hover { background: rgba(255,255,255,.35); }
.game-title-row { display: flex; align-items: center; gap: 8px; }
.game-tag { font-size: .75rem; font-weight: 900; color: var(--white); background: rgba(0,0,0,.2); padding: 3px 10px; border-radius: 99px; }
.game-name { font-size: 1rem; font-weight: 900; color: var(--white); }
.stars-row { display: flex; align-items: center; gap: 4px; font-size: 1rem; font-weight: 900; color: var(--white); }
.star-icon { font-size: 1.2rem; }

/* GAME CARD */
.game-card {
  background: var(--white); border-radius: 24px;
  padding: 28px 28px 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  flex: 1; display: flex; flex-direction: column; gap: 20px;
  max-width: 740px; margin: 0 auto; width: 100%;
}

/* PROGRESS */
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-row span { font-size: .82rem; font-weight: 800; color: var(--mid); white-space: nowrap; }
.progress-track { flex: 1; height: 12px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill  { height: 100%; background: var(--blue); border-radius: 99px; transition: width .5s ease; }

/* QUESTION AREA */
.question-area { display: flex; align-items: center; gap: 16px; }
.q-mascot-img  { width: 72px; height: 72px; object-fit: contain; flex-shrink: 0; }
.question-text { font-size: 1.4rem; font-weight: 900; color: var(--text); line-height: 1.3; }

/* OPTIONS GRID */
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.option-btn {
  padding: 16px 20px; border-radius: 14px;
  border: 2.5px solid var(--border); background: var(--white);
  font-family: var(--font); font-size: 1rem; font-weight: 800;
  color: var(--text); cursor: pointer; text-align: left;
  transition: all .15s; position: relative; overflow: hidden;
}
.option-btn:hover { border-color: var(--blue); background: #eff9ff; transform: translateY(-2px); }
.option-btn.correct { border-color: var(--green); background: #f0fff0; color: var(--green); }
.option-btn.wrong   { border-color: var(--red);   background: #fff0f0; color: var(--red); }
.option-btn.shake   { animation: shake .35s ease; }
@keyframes shake {
  0%,100%{ transform: translateX(0); }
  25%    { transform: translateX(-6px); }
  75%    { transform: translateX(6px); }
}

/* MATCH GAME */
.match-instruction { font-size: .9rem; font-weight: 700; color: var(--mid); text-align: center; }
.match-container { display: flex; gap: 20px; justify-content: center; }
.match-col { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.match-btn {
  padding: 14px 16px; border-radius: 14px;
  border: 2.5px solid var(--border); background: var(--white);
  font-family: var(--font); font-size: .95rem; font-weight: 800;
  color: var(--text); cursor: pointer; text-align: center;
  transition: all .15s;
}
.match-btn:hover   { border-color: var(--blue); background: #eff9ff; }
.match-btn.selected { border-color: var(--blue); background: #dbeafe; color: var(--blue); }
.match-btn.correct  { border-color: var(--green); background: #f0fff0; color: var(--green); pointer-events: none; }
.match-btn.wrong    { border-color: var(--red); background: #fff0f0; color: var(--red); animation: shake .35s ease; }
.match-feedback { text-align: center; font-size: 1.1rem; font-weight: 800; min-height: 32px; }

/* FILL BLANK */
.word-bank { display: flex; flex-wrap: wrap; gap: 8px; min-height: 44px; }
.word-chip {
  padding: 8px 16px; border-radius: 99px;
  border: 2.5px solid var(--blue); background: #eff9ff;
  font-family: var(--font); font-size: .9rem; font-weight: 800;
  color: var(--blue); cursor: pointer; transition: all .15s;
}
.word-chip:hover   { background: var(--blue); color: var(--white); }
.word-chip.used    { opacity: .35; pointer-events: none; }
.fill-answer-row {
  display: flex; flex-wrap: wrap; gap: 8px; min-height: 50px;
  padding: 10px 14px; border-radius: 14px;
  border: 2.5px dashed var(--border); background: #fafafa;
  align-items: center;
}
.answer-chip {
  padding: 8px 14px; border-radius: 99px; background: var(--blue);
  font-family: var(--font); font-size: .9rem; font-weight: 800;
  color: var(--white); cursor: pointer;
}
.answer-chip:hover { background: var(--red); }
.btn-check {
  padding: 14px; border-radius: 14px; border: none;
  background: var(--green); color: var(--white);
  font-family: var(--font); font-size: 1rem; font-weight: 900;
  cursor: pointer; box-shadow: 0 4px 0 var(--green-d); transition: transform .1s;
}
.btn-check:hover { transform: translateY(1px); box-shadow: 0 3px 0 var(--green-d); }
.btn-check:disabled { opacity: .5; pointer-events: none; }

/* LISTEN GAME */
.listen-area { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0; }
.btn-speak {
  width: 90px; height: 90px; border-radius: 50%; border: none;
  background: var(--orange); font-size: 2.2rem;
  cursor: pointer; transition: transform .15s, box-shadow .15s;
  box-shadow: 0 6px 0 var(--orange-d);
}
.btn-speak:hover   { transform: scale(1.08); }
.btn-speak.playing { animation: pulse-speak .7s ease-in-out infinite alternate; }
@keyframes pulse-speak {
  from { transform: scale(1);    box-shadow: 0 6px 0 var(--orange-d); }
  to   { transform: scale(1.12); box-shadow: 0 2px 0 var(--orange-d); }
}
.listen-hint { font-size: .85rem; font-weight: 700; color: var(--mid); }

/* TRANSLATE */
.translate-label { font-size: .85rem; font-weight: 700; color: var(--light); }

/* EXPLANATION BOX */
.explain-box {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #f7f9fc;
  border: 2.5px solid var(--border);
  animation: explain-in .25s ease;
}
.explain-box.show { display: flex; }
@keyframes explain-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.explain-result { font-size: 1.05rem; font-weight: 900; }
.explain-text   { font-size: .92rem; font-weight: 600; color: var(--mid); line-height: 1.4; }
.btn-next {
  align-self: flex-end;
  padding: 12px 24px; border-radius: 14px; border: none;
  background: var(--blue); color: var(--white);
  font-family: var(--font); font-size: .95rem; font-weight: 900;
  cursor: pointer; box-shadow: 0 4px 0 var(--blue-d); transition: transform .1s, box-shadow .1s;
}
.btn-next:hover { transform: translateY(1px); box-shadow: 0 3px 0 var(--blue-d); }

/* ══════════ RESULTS ══════════ */
.results-bg {
  min-height: calc(100vh - 68px); background: var(--blue);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.results-card {
  background: var(--white); border-radius: 28px;
  padding: 40px 36px; max-width: 440px; width: 100%;
  text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.18);
  position: relative; overflow: hidden;
}
.results-mascot-wrap { position: relative; display: inline-block; margin-bottom: 16px; }
.results-mascot { width: 100px; height: 100px; object-fit: contain; animation: chick-bounce 2s ease-in-out infinite; }
.confetti-container { position: absolute; inset: 0; pointer-events: none; }
.confetti-piece {
  position: absolute; width: 8px; height: 8px; border-radius: 2px;
  animation: confetti-fall 2s ease forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(140px) rotate(720deg); opacity: 0; }
}
#results-title { font-size: 1.9rem; font-weight: 900; color: var(--text); margin-bottom: 6px; }
#results-subtitle { font-size: .95rem; font-weight: 600; color: var(--mid); margin-bottom: 20px; }
.results-score-box {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #fffbe6; border-radius: 16px; padding: 16px 24px; margin-bottom: 20px;
}
.results-stars { font-size: 2rem; }
#results-score-val { font-size: 2.8rem; font-weight: 900; color: var(--yellow); }
.results-score-label { font-size: 1rem; font-weight: 700; color: var(--mid); align-self: flex-end; padding-bottom: 6px; }
.results-badges { display: flex; justify-content: center; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.result-badge {
  padding: 6px 14px; border-radius: 99px; font-size: .8rem; font-weight: 800;
  color: var(--white);
}
.results-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-play-again, .btn-go-levels {
  padding: 14px; border-radius: 14px; border: none; font-family: var(--font);
  font-size: .95rem; font-weight: 900; cursor: pointer; transition: transform .1s;
}
.btn-play-again { background: var(--green); color: var(--white); box-shadow: 0 4px 0 var(--green-d); }
.btn-go-levels  { background: var(--bg); color: var(--mid); border: 2px solid var(--border); }
.btn-play-again:hover { transform: translateY(1px); }

/* ══════════ FOOTER ══════════ */
.footer {
  background: var(--white); border-top: 2px solid var(--border);
  text-align: center; padding: 36px 24px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.footer-logo  { width: 44px; height: 44px; object-fit: contain; }
.footer-brand { font-size: 1.3rem; font-weight: 900; color: var(--text); }
.footer-tagline { font-size: .88rem; color: var(--mid); font-weight: 600; max-width: 380px; line-height: 1.5; }
.footer-copy    { font-size: .8rem; color: var(--blue); font-weight: 700; margin-top: 4px; }

/* ══════════ RESPONSIVE ══════════ */
@media (max-width: 700px) {
  .levels-section { padding: 20px 16px; }
  .options-grid   { grid-template-columns: 1fr; }
  .match-container { flex-direction: column; }
  .game-card      { padding: 20px 16px; }
  .navbar-links   { display: none; }
  .hero-title     { font-size: 1.6rem; }
}