:root {
    --primary-color: #20c997;
    --accent-color: #20c997;
    --bg-dark: #0b1e2d;
    --text-light: #e3f2fd;
    --card-bg: #1c2f45;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --correct-bg: #20c997;
  }
  
  * { box-sizing: border-box; margin: 0; padding: 0; }
  
  body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    display: flex;
    justify-content: center;
    padding: 2rem;
    flex-direction: column;
    align-items: center;
  }
  
  #app { width: 100%; max-width: 800px; }
  
  header {
    text-align: center;
    margin-bottom: 2rem;
}
  
  header h1 { font-size: 2.5rem; }
  #controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem; 
}
  
  #lives-container {
    font-size: 1.5rem;
    font-weight: 700;
    background-color: var(--card-bg);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px var(--shadow-color);
    display: flex;
    gap: 0.5rem;
  }
  
  #give-up-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: background-color 0.2s ease;
  }
  #give-up-btn:hover { background-color: #c82333; }
  
  #grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 8px;
    aspect-ratio: 1 / 1;
}
  
.header-cell {
    padding: 0.5rem;
    background-color: transparent;
    border: none;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    align-content: center;
}
  
  .grid-cell {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
  }
  
  .header-cell { padding: 0.5rem; }
  .header-cell img { width: 80%; height: 80%; object-fit: contain; }
  
  .grid-cell input {
    width: 100%;
    height: 100%;
    border: none;
    background-color: transparent;
    text-align: center;
    font-size: 2.5rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-light);
    outline: none;
  }
  .grid-cell input:focus { box-shadow: inset 0 0 0 2px var(--primary-color); border-radius: 6px; }
  
  .grid-cell.correct { background-color: var(--correct-bg); padding: 10px; }
  .player-image { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
  
  @keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
  }
  .incorrect-shake { animation: shake 0.3s ease-in-out; border-color: #dc3545; }
  
  .player-name-cell {
    font-weight: bold;
    font-size: 1.1rem;
    padding: 0.5rem;
    text-align: center;
}

  .autocomplete-container, #search-container { position: relative; }
  
  .modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: opacity 0.2s ease-in-out;
}
  
  
  #search-container {
    width: 90%;
    max-width: 600px; 
    background-color: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: 0 5px 15px var(--shadow-color);
  }
  
  #search-input {
    width: 100%;
    padding: 0.75rem;
    padding-right: 45px;
    font-size: 1.2rem;
    background-color: var(--bg-dark);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
}
  
  #close-modal-btn {
    position: absolute;
    top: 10px; right: 15px;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
  }
  
  #search-results {
    list-style-type: none;
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
  }
  #search-results li { padding: 0.75rem 1rem; cursor: pointer; border-bottom: 1px solid var(--border-color); }
  #search-results li:last-child { border-bottom: none; }
  #search-results li:hover { background-color: var(--primary-color); }
  #search-results li.used { text-decoration: line-through; opacity: 0.5; pointer-events: none; }

  
.grid-cell.game-over {
    cursor: pointer;
}


#country-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.nav-link:hover {
    background-color: var(--card-bg);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white !important;
}

.header-cell.corner {
    background-color: transparent;
    border: none;
}



#give-up-container {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 15px var(--shadow-color);
  }
  
  #give-up-container h3 {
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
  }
  
  #give-up-container p {
    margin-bottom: 1.5rem;
    opacity: 0.8;
  }
  
  .modal-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
  }
  
  .modal-buttons button {
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: opacity 0.2s ease;
  }
  
  .modal-buttons button:hover {
    opacity: 0.85;
  }
  
  .btn-danger {
    background-color: #dc3545;
    color: white;
  }
  
  .btn-secondary {
    background-color: #6c757d;
    color: white;
  }
  
  
  
  .game-over-cell {
      cursor: pointer;
      transition: background-color 0.2s ease;
  }
  
  .game-over-cell:hover {
      background-color: #34495E;
  }
  
  .answer-reveal-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
}

.player-count {
    font-size: 2.5rem;
}

.see-players-btn {
    font-size: 0.9rem;
    background-color: var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    color: white;
}

  .modal-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
}


@media (max-width: 768px) {

  body {
      padding: 1rem;
  }

  header h1 {
      font-size: 2rem;
  }

  #grid-container {
    
      grid-template-columns: repeat(4, 1fr);
      grid-template-rows: repeat(4, 1fr);
      gap: 5px;
  }

  .header-cell {
      font-size: 0.8rem; 
      padding: 0.25rem;
  }

  #controls {
      margin-top: 1.5rem;
  }

  #give-up-btn, .modal-buttons button {
      padding: 0.6rem 1rem;
      font-size: 0.9rem;
  }

  #lives-container {
      font-size: 1.2rem;
      padding: 0.4rem 0.8rem;
  }

  #search-container {
      width: 95%;
      padding: 1rem;
  }
}


@media (max-width: 480px) {
  header {
      flex-direction: column;
      gap: 1rem;
  }

  .header-cell {
      font-size: 0.6rem;
  }

  .player-name-cell {
      font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  
  .answer-reveal-container {
      gap: 0.25rem; 
  }

  .player-count {
      font-size: 1.2rem;
  }

  .see-players-btn {
      font-size: 0.55rem;
      padding: 0.3rem 0.5rem; 
  }
}
/* --- Footer Styles --- */
#page-footer {
  width: 100%;
  max-width: 800px;
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.9rem;
  color: #8899a6; /* A lighter, less prominent color */
}

#page-footer p {
  margin-bottom: 0.5rem;
}

#page-footer a {
  color: #aab8c2;
  text-decoration: none;
  transition: color 0.2s ease;
}

#page-footer a:hover {
  color: var(--primary-color);
}
.nav-link.create-link {
  background-color: var(--accent-color);
  color: var(--bg-dark);
}
.nav-link.create-link:hover {
  background-color: var(--accent-color);
  opacity: 0.85;
}

/* --- Creator Page Styles --- */
#creator-container {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.instructions {
  text-align: center;
  margin-bottom: 2rem;
  opacity: 0.8;
}

.grid-selectors {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.selector-group h3 {
  margin-bottom: 0.75rem;
}

.selector-group select {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  background-color: var(--bg-dark);
  color: var(--text-light);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

#create-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.1rem;
  width: 100%;
  transition: background-color 0.2s ease;
}

#create-btn:hover {
  opacity: 0.9;
}

#result-container {
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px dashed var(--accent-color);
  border-radius: 8px;
  text-align: center;
}

.share-box {
  display: flex;
  margin-top: 1rem;
}

#share-link {
  width: 100%;
  flex-grow: 1;
  padding: 0.75rem;
  font-size: 1rem;
  background-color: var(--bg-dark);
  color: var(--text-light);
  border: 1px solid var(--border-color);
  border-radius: 6px 0 0 6px;
  border-right: none;
}

#copy-btn {
  background-color: var(--accent-color);
  color: var(--bg-dark);
  border: none;
  padding: 0 1.5rem;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  font-weight: 700;
}