/* ==============================
   🌍 BASE GLOBAL
============================== */
/*html, body {
  touch-action: manipulation;
}*/

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #fefcfb;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-size: 1.5rem;
  line-height: 2;
}

.hidden {
  display: none !important;
}

/* ==============================
   🔝 TOPBAR (barra superior)
============================== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffe0e9;
  padding: 20px;
  font-size: 1.8em;
}
.logo {
  font-weight: bold;
}
.topbar-right span {
  margin-left: 15px;
  cursor: pointer;
}

/* 🖥️ Pantallas grandes */
@media (min-width: 1024px) {
  .topbar {
    padding: 5px 20px;
    font-size: 1em;
  }
}

/* ==============================
   🔻 FOOTER
============================== */
.bottombar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #ffe0e9;
  text-align: center;
  padding: 8px;
  font-size: 0.9em;
  z-index: 1000;
}

/* ==============================
   📋 MAIN & BOTONES MENÚ
============================== */
main {
  flex: 1;
  padding: 20px;
  text-align: center;
}

.menu-btn {
  display: block;
  width: 100%;
  max-width: 800px;
  margin: 40px auto;
  padding: 50px;
  background: #cce5ff;
  border: none;
  border-radius: 12px;
  font-size: 2em;
  cursor: pointer;
  transition: transform 0.2s;
}
.menu-btn:hover {
  transform: scale(1.05);
}

/* 🖥️ Pantallas grandes */
@media (max-height: 1300px) {
  .menu-btn {
    max-width: 700px;
    font-size: 1em;
    padding: 16px;
    margin: 6px auto;
  }
}

/* ==============================
   📚 VOCLISTS
============================== */
/* 📚 Botones Voclist - móviles */
#voclistScreen button {
  width: 95%;            
  text-align: left;      
  margin: 10px auto;      
  padding: 10px 14px;
  font-size: 2em;        
  line-height: 1.4;      /* 🔥 más aire vertical */
  border-radius: 6px;
}

/* 🖥️ Pantallas grandes */
@media (min-width: 1024px) {
  #voclistScreen button {
    width: 80%;              /* relativo al contenedor */
    min-width: 600px;        /* ✅ nunca menos de 600px */
    max-width: 900px;
    text-align: center;
    font-size: 1.2em;
    margin: 10px auto;
    padding: 14px 20px;
    line-height: normal; /* comportamiento estándar */
  }
}

/* Label listado */
.current-list-label {
  font-size: 1.5em;    /* FUENTE LISTADO */  
  font-weight: bold;
  text-align: center;
  margin-bottom: 15px;
  min-height: 1.5em;
  color: #555;
}

/* ==============================
   📖 REVIEW
============================== */
#reviewScreen {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
  text-align: left;
  line-height: 1.6em;
  font-size: 1em;
}
#reviewScreen b { color: #333; }

#reviewContent {
  text-align: left;
  padding: 0 10px;
}
#reviewContent div {
  margin-bottom: 12px;
  font-size: 1.7em;   /* 📱 móviles: más grande */
   line-height: 1.4em; /* 📱 móviles: menos espaciado */
}
@media (min-width: 1024px) {
  #reviewContent div {
    font-size: 1em;   /* 📱 móviles: más grande */ 
    margin-bottom: 6px;
    line-height: 1.3em;
  }
}

/* ==============================
   🎮 GAME
============================== */
#questionWord {
  font-size: clamp(1em, 5vw, 2.5em);
  margin: 35px 0;
}
@media (min-width: 1200px) {
  #questionWord {
    font-size: 1.7em; /* más pequeño en pantallas grandes */
    margin: 10px 0;
  }
}

/* ==============================
  🔘  BOTONES DE JUEGO 
============================== */
/* 📱 Móviles → 2 columnas */
#optionsContainer {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* siempre 2 columnas */
  row-gap: 45px;      /* espacio vertical mayor */
  column-gap: 30px;   /* espacio horizontal igual */
  justify-items: stretch;
}

#optionsContainer button {
  padding: 35px;
  background: #d4f0f0;
  border: none;
  border-radius: 12px;
  font-size: 1.7em;
  cursor: pointer;
  width: 100%;
  min-height: 100px; 
  box-sizing: border-box;
}

#optionsContainer button.correct { background: #b5e48c; }
#optionsContainer button.wrong { background: #f28b82; }

/* Base escritorio */
@media (min-width: 1024px) {
  #optionsContainer {
    display: grid;
    gap: 25px 20px;
    justify-content: center;
    justify-items: stretch;
    max-width: 900px; /* evita que las columnas se vayan a la izquierda */
    margin: 0 auto;   /* centra el bloque dentro del padre */
  }

  /* 4 opciones → 2 columnas */
  #optionsContainer.cols-2 {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    grid-template-rows: repeat(2, auto);
    /*justify-content: center; /* centrado del bloque */
  }

  /* 6 opciones → 3 columnas */
  #optionsContainer.cols-3 {
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    grid-template-rows: repeat(2, auto);
  }

  #optionsContainer button {
    font-size: 1.3em;
    padding: 18px;
    min-width: 280px;
    max-width: 400px;
    width: 100%;
  }
}

/* Barra de tiempo */
.progress-container {
  width: 85%;
  max-width: 800px;
  height: 32px;
  background: #eee;
  border-radius: 16px;
  margin: 3px auto 30px;
  overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.08);
}
/* Solo en pantallas alargadas 1300px */
@media (min-height: 1300px) {
  .progress-container {
    margin: 10px auto 80px; /* más espacio abajo en móviles */
  }
}
#timeBar {
  height: 100%;
  width: 100%;
  background: #4caf50;
  transition: width 1s linear, background-color 0.2s linear;
}

/* ==============================
   📊 ESTADÍSTICAS
============================== */
#statsScreen {
  font-size: 1.2em;
  line-height: 1.6;
  padding: 8px;
}
#statsScreen h2 {
  font-size: 1.5em;
  margin-bottom: 20px;
}
#statsContent > * {
  display: flex;
  flex-direction: column;
  gap: 18px; /* margen entre elementos */
}
.stats-line {
  margin-bottom: 20px; /* espacio extra debajo de las estadísticas para grandes y pequeños */
}
/* 📱 Móviles */
@media (max-width: 1023px) {
  #statsScreen button {
    font-size: 1.5em;
    padding: 20px 30px;
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 12px auto;
    border-radius: 10px;
  }
}
/* 🖥️ Grandes */
@media (min-width: 1024px) {
  #statsScreen button {
    font-size: 1.1em;
    padding: 20px 30px;
    display: inline-block;
    width: auto;
    margin: 0 12px 20px 0;
    border-radius: 10px;
    vertical-align: middle;
  }
}

/* ==============================
   ⚙️ SETTINGS MODAL
============================== */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.settings-list label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-list select,
.settings-list input[type="range"] {
  flex: 1;
}

/* 🎚️ Sliders */
.settings-list input[type="range"] {
  -webkit-appearance: none;
  height: 8px;
  background: linear-gradient(90deg, #4cafef, #2196f3);
  border-radius: 5px;
  outline: none;
  transition: background 0.3s;
}

.settings-list input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #2196f3;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: transform 0.2s;
}

.settings-list input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
/* 🖥️ Pantallas grandes */
@media (min-width: 1024px) {
  .settings-list select {
    font-size: 1.3em;   /* 🔥 un poco más grande en escritorio */
  }
}
/* 📱 Móviles */
@media (max-width: 768px) {
  .settings-list select {
    font-size: 1.2em;   /* texto un poco más grande en móviles */
    padding: 10px;      /* opcional: más aire para tocarlo mejor */
  }
}

/* Switch estilo iOS */
.switch {
  position: relative;
  display: inline-block;
  width: 90px;
  height: 34px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}
.switch input:checked + .slider { background-color: #2196f3; }
.switch input:checked + .slider:before { transform: translateX(56px); }

/* 📱 Ajustes móviles */
@media (max-width: 1023px) {
  #settingsModal { font-size: 1.4em; }
  #settingsModal h2 { font-size: 1.8em; }
  .settings-list { gap: 25px; }
  .settings-list label {
    font-size: 1.5em;
    margin-bottom: 18px;
  }
  .settings-list select { font-size: 1.2em; padding: 8px; }
  .settings-list input[type="range"] { height: 15px; }
  .settings-list input[type="range"]::-webkit-slider-thumb {
    width: 48px; height: 48px;
  }
  .switch { transform: scale(1.8); }
  .modal-actions button { font-size: 1.7em; padding: 16px; }
}

/* Modal base */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}
.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 30px;
  width: 80%;
  max-width: 800px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-box h2 {
  margin: 0 0 15px 0;
  font-size: 1.4em;
  text-align: center;
  color: #333;
}

/* Botones modal */
.modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}
.modal-actions button {
  flex: 1;
  margin: 0 15px;
  padding: 15px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.2em;
  transition: background 0.3s;
}
button.cancel { background: #eee; color: #333; }
button.cancel:hover { background: #ddd; }
button.reset { background: #f44336; color: #fff; }
button.reset:hover { background: #d32f2f; }
button.save { background: #2196f3; color: #fff; }
button.save:hover { background: #1976d2; }

/* Dificultad*/
.lives-setting {
  display: flex;
  align-items: center;
  gap: 15px; /* espacio entre emoji, número y slider */
  font-size: 1.4em;
}

#livesEmoji {
  /*font-size: 1em;*/
}

#livesValue {
  min-width: 2ch;  /* reserva espacio para números de 1 a 10 */
  text-align: center;
}

/* Ajustes extra */
#difficultyEmoji { margin-right: 40px; }
/* 📱 Móviles */
@media (max-width: 768px) {
  #difficultyEmoji {
    font-size: 1.4em;     /* un poquito más grande */
    margin-right: 50px;  /* más espacio a la derecha */
  }
}
.settings-list select option { font-size: 0.8em; }

/* 📦 TOASTS */
#toast-container {
  position: fixed;
  top: 120px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px; /* separación entre toasts */
  z-index: 9999;
}

/* 📝 Estilo base */
.toast {
  background: #000;
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 1.1em;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.4s ease;
  max-width: 450px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* 🚀 Animación de entrada */
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ✅ Toast éxito */
.toast-success {
  background: #2ecc71; /* verde */
}

/* ❌ Toast fallo */
.toast-fail {
  background: #e74c3c; /* rojo */
}

.game-over {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  text-align: center;
}

.game-over h1 {
  font-size: 2.5rem;
  color: #e53935;
  margin-bottom: 20px;
}

.game-over p {
  font-size: 1.2rem;
  margin: 5px 0;
}

.game-over .buttons {
  margin-top: 20px;
}

.game-over button {
  padding: 10px 20px;
  margin: 5px;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
}

.hidden {
  display: none !important;
}
