/* solo.php — règles propres à cette page.
   L'habillage commun vient de fichiers-partages-des-jeux/css/jeu.css. */

/* Habillage commun (body, #app, top-bar, boutons, info-bar, overlay,
   classement) : fichiers-partages-des-jeux/css/jeu.css.
   Ici, uniquement ce qui est propre a ce jeu. */
#app {
  position: relative;
  z-index: 1;
  padding: 32px 24px 24px;
  max-width: 960px;
}

h1 {
  text-align: center;
  margin-bottom: 8px;
}

.status-bar {
  text-align: center;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--texte);
  font-weight: 600;
}

.info-bar {
  font-size: 0.82rem;
}

.info-item span {
  color: var(--color-light);
  font-weight: 700;
}

.grilles-container {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.grille-wrapper {
  text-align: center;
}

.grille-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--texte);
  margin-bottom: 8px;
}

.grille {
  display: inline-grid;
  grid-template-columns: 30px repeat(10, 1fr);
  grid-template-rows: 30px repeat(10, 1fr);
  gap: 1px;
  background: var(--surface-2);
  border: 2px solid var(--line-forte);
  border-radius: 8px;
  overflow: hidden;
}

.grille-header {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--texte-faible);
  background: var(--surface-2);
}

.cell {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  background: var(--surface-1);
  user-select: none;
  -webkit-user-select: none;
}

.cell:hover {
  background: var(--surface-2);
}

.cell.eau {
  background: #1e3550;
  color: #7fb0dd;
}

.cell.touche {
  background: #9c333c;
  color: #ffdcdc;
}

.cell.coule {
  background: #47141a;
  color: #ff9a9a;
  box-shadow: inset 0 0 0 2px #c4545e;
}

.cell.navire {
  background: rgba(99, 102, 241, 0.35);
  border: 1px solid var(--line-forte);
}

.cell.navire-touche {
  background: #9c333c;
  border: 1px solid #b8434d;
}

.cell.navire-coule {
  background: #47141a;
  border: 2px solid #c4545e;
}

.cell.preview {
  background: var(--surface-2);
  border: 2px dashed rgba(99, 102, 241, 0.6);
}

.cell.preview-invalid {
  background: var(--surface-2);
  border: 2px dashed rgba(239, 68, 68, 0.6);
}

.cell.disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.placement-info {
  text-align: center;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--texte-doux);
}

.placement-info strong {
  color: var(--color-light);
}

.placement-info .key {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  color: var(--texte);
}

.navires-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.navire-tag {
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--line-forte);
  color: var(--texte-doux);
}

.navire-tag.actif {
  background: rgba(99, 102, 241, 0.3);
  border-color: var(--line-forte);
  color: var(--texte);
}

.navire-tag.place {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* CTA inscription */
#cta-inscription {
  background: var(--surface-2);
  border: 1px solid var(--line-forte);
  border-radius: 8px;
  padding: 18px 20px;
  margin-top: 16px;
}

.cta-rang {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-light);
  margin-bottom: 6px;
}

.cta-rang .rang-nombre {
  color: #d2973a;
  font-size: 1.3rem;
}

.cta-score-msg {
  color: var(--texte) !important;
  font-size: 0.85rem !important;
  margin-bottom: 12px !important;
}

.cta-auth-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.cta-auth-btns .btn {
  font-size: 0.85rem;
  padding: 8px 18px;
}

/* Overlay victoire/défaite */
.overlay-card {
  background: var(--surface-1);
  border: 1px solid var(--line-forte);
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.overlay-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.overlay-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  font-family: var(--font-display);
  color: #f0f3f6;
}

.overlay-stats {
  font-size: 0.9rem;
  color: var(--texte-doux);
  margin-bottom: 20px;
  line-height: 1.6;
}

.overlay-stats span {
  color: var(--color-light);
  font-weight: 700;
}

.back-link {
  text-align: center;
}

@media (max-width: 780px) {

  .grilles-container {
    flex-direction: column;
    align-items: center;
  }

  .cell {
    width: 28px;
    height: 28px;
    font-size: 0.65rem;
  }

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

  #app {
    padding: 24px 12px 16px;
  }
}

@media (max-width: 400px) {

  .cell {
    width: 24px;
    height: 24px;
    font-size: 0.6rem;
  }
}
