/* =============================================
   RESET Y VARIABLES
============================================= */
:root {
  --primary-color: rgba(1, 1, 1, 0.9);
  --secondary-color: #ff8c42;
  --white: #ffffff;
  --black: #000000;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

/* =============================================
   HEADER STYLES - MENÚ HAMBURGUESA
============================================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--primary-color);
  padding: 0 10%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-bottom: 2px solid var(--secondary-color);
  transition: all 0.3s ease;
  height: 80px;
}

.header:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.logo {
  font-size: 28px;
  font-weight: 700;
  color: var(--white);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  letter-spacing: 1px;
}

.navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.header .navigation ul li {
  float: left;
  position: relative;
}

.header .navigation ul li a {
  font-size: 16px;
  font-weight: 500;
  color: var(--white);
  text-decoration: none;
  padding: 22px 20px;
  display: block;
  transition: all 0.3s ease;
}

.header .navigation ul li a:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  color: var(--black);
}

#toggle,
.header label {
  display: none;
  cursor: pointer;
}

.menu {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1);
}

/* Animación para el menú desplegable */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Media Queries para Header */
@media (max-width: 950px) {
  .header label {
    display: initial;
  }

  .header {
    padding: 15px 10%;
  }

  .header .navigation {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-color);
    display: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .header .navigation ul li {
    width: 100%;
  }

  .header .navigation ul li a {
    padding: 12px 20px;
    font-size: 18px;
  }

  #toggle:checked ~ .navigation {
    display: block;
    animation: slideDown 0.4s ease-out;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 22px;
  }

  .header {
    padding: 12px 5%;
  }
}

/* =============================================
   BODY Y CONTENEDOR PRINCIPAL
   (Estilos para el juego - SEPARADO del header)
============================================= */
body {
    font-family: 'Segoe UI', 'Arial', sans-serif;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 100px 20px 40px; /* Aumentado padding-top para header fijo */
    color: #333;
}

.container {
    max-width: 900px;
    width: 100%;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    margin-top: 20px; /* Separación del header */
}

/* =============================================
   HEADER DEL JUEGO (no confundir con el header del menú)
============================================= */
.game-header-section {
    background: linear-gradient(135deg, #4a6ee0, #6a11cb);
    color: white;
    padding: 25px 30px;
    text-align: center;
}

.game-header-section h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* =============================================
   PANTALLA DE SELECCIÓN DE MODO
============================================= */
.selection-screen {
    padding: 40px 30px;
    text-align: center;
}

.selection-screen h2 {
    color: #4a6ee0;
    margin-bottom: 40px;
    font-size: 1.8rem;
}

.mode-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .mode-options {
        grid-template-columns: 1fr;
    }
}

.mode-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
    text-align: center;
}

.mode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: #4a6ee0;
}

.mode-icon {
    font-size: 3rem;
    color: #4a6ee0;
    margin-bottom: 15px;
}

.mode-card h3 {
    color: #4a6ee0;
    margin-bottom: 10px;
    font-size: 1.6rem;
}

.mode-card > p {
    color: #666;
    margin-bottom: 15px;
    font-size: 1rem;
}

.mode-examples {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.mode-examples p {
    margin-bottom: 5px;
    color: #555;
}

.mode-examples strong {
    color: #4a6ee0;
}

.select-mode-btn {
    background: #4a6ee0;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.select-mode-btn:hover {
    background: #3a5ecf;
    transform: translateY(-2px);
}

/* =============================================
   PANTALLA DE JUEGO
============================================= */
.game-screen {
    padding: 30px;
}

.game-info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .game-info-section {
        grid-template-columns: 1fr;
    }
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.info-label {
    color: #666;
    font-weight: 600;
}

.info-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #4a6ee0;
}

.game-instructions {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.game-instructions h3 {
    color: #4a6ee0;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-instructions p {
    color: #666;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

/* =============================================
   CONTENIDO DEL JUEGO
============================================= */
.game-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.hangman-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

@media (max-width: 768px) {
    .hangman-section {
        grid-template-columns: 1fr;
    }
}

.hangman-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hangman-drawing {
    width: 200px;
    height: 250px;
    position: relative;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: white;
}

.hangman-part {
    position: absolute;
    background: #4a6ee0;
    border-radius: 3px;
    display: none;
}

#gallows {
    width: 150px;
    height: 8px;
    background: #8b4513;
    bottom: 0;
    left: 25px;
    display: block;
}

#head {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 5px solid #4a6ee0;
    top: 40px;
    left: 75px;
}

#body {
    width: 10px;
    height: 80px;
    top: 95px;
    left: 95px;
}

#left-arm {
    width: 50px;
    height: 8px;
    top: 110px;
    left: 50px;
    transform: rotate(45deg);
}

#right-arm {
    width: 50px;
    height: 8px;
    top: 110px;
    left: 95px;
    transform: rotate(-45deg);
}

#left-leg {
    width: 50px;
    height: 8px;
    top: 170px;
    left: 55px;
    transform: rotate(45deg);
}

#right-leg {
    width: 50px;
    height: 8px;
    top: 170px;
    left: 90px;
    transform: rotate(-45deg);
}

.word-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.word-display {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.letter {
    width: 40px;
    height: 50px;
    border-bottom: 3px solid #4a6ee0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: #4a6ee0;
    text-transform: uppercase;
}

.space {
    width: 20px;
}

.hint {
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1rem;
}

.message {
    color: #4a6ee0;
    font-weight: bold;
    text-align: center;
    font-size: 1.1rem;
    min-height: 30px;
}

/* =============================================
   TECLADO
============================================= */
.keyboard-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.keyboard-section h3 {
    color: #4a6ee0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}

.keyboard {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 8px;
}

@media (max-width: 768px) {
    .keyboard {
        grid-template-columns: repeat(7, 1fr);
    }
}

@media (max-width: 480px) {
    .keyboard {
        grid-template-columns: repeat(5, 1fr);
    }
}

.key {
    background: white;
    border: 2px solid #e0e0e0;
    color: #4a6ee0;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 12px 5px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-transform: uppercase;
    user-select: none;
}

.key:hover {
    background: #e8f0fe;
    border-color: #4a6ee0;
}

.key.used {
    background: #f0f0f0;
    color: #aaa;
    cursor: not-allowed;
    border-color: #ddd;
}

.key.used.correct {
    background: #e8f6ef;
    color: #27ae60;
    border-color: #27ae60;
}

.key.used.wrong {
    background: #fdeaea;
    color: #e74c3c;
    border-color: #e74c3c;
}

/* =============================================
   CONTROLES DEL JUEGO
============================================= */
.game-controls {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.control-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 200px;
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.control-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.next-btn {
    background: #4a6ee0;
    color: white;
}

/* =============================================
   PANTALLA DE RESULTADOS
============================================= */
.results-screen {
    padding: 40px 30px;
}

.results-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #4a6ee0;
}

.results-icon {
    font-size: 4rem;
    color: #4a6ee0;
    margin-bottom: 20px;
}

.results-card h2 {
    color: #4a6ee0;
    margin-bottom: 30px;
    font-size: 2rem;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

@media (max-width: 600px) {
    .results-stats {
        grid-template-columns: 1fr;
    }
}

.result-stat {
    text-align: center;
}

.result-label {
    display: block;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.result-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: #4a6ee0;
}

#result-percentage {
    color: #27ae60;
}

.results-message {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.results-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 160px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.menu-btn {
    background: #666;
    color: white;
}

.play-again-btn {
    background: #4a6ee0;
    color: white;
}