body {
  margin: 0;
  padding: 0;
  background-color: #f2f7f7;
  font-family: 'Fira Sans Condensed', 'Roboto', system-ui, sans-serif;
  padding-top: 70px;
}

.headline {
  background-color: rgb(3, 79, 70, 0.98);
  color: #fff;
  padding: 10px 20px;
  font-family: 'Fira Sans', sans-serif;
  font-weight: 600;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.headline-text {
  flex-grow: 1;
  text-align: left;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.menu-link {
  color: white;
  font-size: 12px;
  text-decoration: none;
  margin-left: 10px;
}

.menu-link:hover {
  color: #25d96a;
}

.game-container {
  max-width: 620px;
  margin: 0 auto;
  padding: 20px;
  text-align: center;
}

.title {
  font-size: 26px;
  font-weight: 700;
  color: #1e2937;
  margin-bottom: 6px;
}

.subtitle {
  color: #64748b;
  font-size: 14px;
  margin-bottom: 20px;
}

.mistakes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
  font-size: 15px;
  font-weight: 600;
  color: #334155;
}

.mistake-dot {
  font-size: 22px;
  transition: color 0.3s;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(4, 78px);
  grid-template-rows: repeat(4, 78px);
  gap: 10px;
  justify-content: center;
  background-color: #ffffff;
  border: 1.5px solid #d4d4d4;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin: 0 auto 30px;
}

.flag-tile {
  cursor: pointer;
  border: 2px solid #ccc;
  border-radius: 10px;
  width: 74px;
  height: 74px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #f8f8f8;
  transition: all 0.2s ease;
  overflow: hidden;
  position: relative;
}

.flag-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  border-color: #888;
}

.flag-tile.selected {
  border-color: #166534;
  background-color: #dcfce7;
  box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.3);
}

.flag-tile img {
  width: 58px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.flag-tile .country-name {
  font-size: 9px;
  font-weight: 600;
  color: #444;
  margin-top: 4px;
  text-align: center;
  line-height: 1.1;
  padding: 0 2px;
}

.coolButton {
  background-color: rgba(5, 44, 31, 0.85);
  border: none;
  color: white;
  padding: 10px 18px;
  font-family: 'Fira Sans Condensed', sans-serif;
  font-size: 13px;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  margin: 6px 4px;
  transition: background-color 0.3s ease;
}

.coolButton:hover {
  background-color: #034519;
}

.coolButton:disabled {
  background-color: #94a3b8;
  cursor: not-allowed;
}

.solved-groups {
  margin-top: 25px;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

.solved-group {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.solved-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 8px;
}

.solved-flag {
  width: 52px;
  height: 36px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.group-name {
  font-weight: 700;
  font-size: 13px;
  text-align: center;
}

.shake {
  animation: shakeAnim 0.5s ease;
}

@keyframes shakeAnim {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.end-screen {
  background: #f8fafc;
  border-radius: 10px;
  padding: 25px;
  margin-top: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}


/* Overlay del modal */
.h5-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    backdrop-filter: blur(5px); /* Esto es lo que causa el efecto borroso de fondo */
}

/* Contenedor del Modal */
.h5modal {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    max-height: 85vh;
    z-index: 10001;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3);
    overflow-y: auto; /* Permite scroll dentro del modal */
}

/* Botón de cierre */
.h5-close-button {
    position: absolute;
    top: 10px; right: 15px;
    background: none; border: none;
    font-size: 24px; cursor: pointer; color: #64748b;
}

/* Títulos y Cards */
.h5title { font-weight: 800; font-size: 1.2rem; color: #1e293b; }
.h5-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}
.h5-card-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Grid de Emojis */
.h5-flag-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    font-size: 1.5rem;
    justify-items: center;
}

/* Estilos de botones y inputs */
.h5-rate-submit {
    background: #3b82f6; color: white; border: none;
    padding: 10px; border-radius: 8px; cursor: pointer;
    width: 100%; font-weight: bold; margin-top: 10px;
}
.h5-rate-comment {
    width: 100%; box-sizing: border-box; padding: 10px;
    border: 1px solid #cbd5e1; border-radius: 8px; margin-top: 10px;
}

/* Ajustes adicionales para que no se vea 'bloqueado' */
.h5-stats-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.9rem;
}




/* Esto asegura que tanto las llenas como las medias se vean amarillas */
.h5-stars .bi-star-fill, 
.h5-stars .bi-star-half {
    color: #ffc107 !important;
}

.h5-stars .bi-star {
    color: #ccc;
}

.h5-rate-submit {
  font-family: inherit; /* Usa la misma fuente que el resto de tu web */
  font-weight: 600;
  font-size: 14px; /* Un poco más pequeño y sutil */
  color: #ffffff;
  background-color: #4b5563; /* Un gris azulado elegante (Tailwind gray-600) */
  border: 1px solid #374151; /* Borde un poco más oscuro */
  border-radius: 6px; /* Rectangular con bordes muy ligeramente suavizados */
  padding: 10px 20px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); /* Sombra casi invisible, solo para dar profundidad */
  transition: background-color 0.2s ease, border-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  margin: 10px auto;
}

.h5-rate-submit:hover:not(:disabled) {
  background-color: #374151; /* Se oscurece un poco al pasar el ratón (Tailwind gray-700) */
  border-color: #1f2937;
}

.h5-rate-submit:active:not(:disabled) {
  background-color: #1f2937; /* Aún más oscuro al hacer clic */
}

.h5-rate-submit:disabled {
  background-color: #e5e7eb; /* Gris claro neutro */
  color: #9ca3af; /* Texto gris oscuro */
  border-color: #d1d5db;
  box-shadow: none;
  cursor: not-allowed;
}

/* Overlay del modal */
.h5-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000; /* Capa inferior */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Contenedor del Modal */
.h5modal {
    display: none;
    position: fixed;

    /* 👇 Nuevo sistema de centrado (100% nítido) 👇 */
    inset: 0; 
    margin: auto; 
    height: fit-content; 
    /* 👆 -------------------------------------- 👆 */

    background: white;
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    max-height: 85vh;
    z-index: 10010; /* Capa superior (por encima del 10000 del overlay) */
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3);
    overflow-y: auto;
}



