/* =====================================================
 * Quadra — Style
 * Version : v0.2.4-ui-modal-popup
 * ===================================================== */

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  font-family: system-ui, sans-serif;
  background: #fafafa;
}

/* ===== ATLAS ===== */
.atlas-header {
  padding: 8px 16px 4px;
}

#app {
  flex: 1;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.atlas-footer {
  border-top: 1px solid #ddd;
  background: #f6f7f9;
  padding: 8px 12px;
}

/* ===== JOUEURS ===== */
.quadra-players {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: #ffffff;
  padding: 6px;
  border-radius: 14px;
  gap: 6px;
}

.quadra-player {
  padding: 4px 10px;
  border-radius: 18px;
  background: #ddd;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.quadra-player.active {
  background: #4caf50;
  color: white;
}

/* Bouton Options (⚙️) */
.quadra-options-btn {
  margin-left: auto;
  width: 40px;
  height: 36px;
  border-radius: 10px;
  border: 2px solid rgba(0,0,0,0.25);
  background: #f3f4f6;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 0 rgba(0,0,0,0.15);
}

.quadra-options-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}

/* ===== TABLE ===== */
.quadra-table {
  background: #2e7d32;
  color: white;
  border-radius: 18px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.quadra-table-cards {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 12px;
  justify-content: center;
}

/* ===== BOUTONS TABLE ===== */
.quadra-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
}

.quadra-btn {
  padding: 12px 28px;
  font-size: 20px;
  font-weight: 700;
  border: none;
  border-radius: 30px;
  background: #4caf50;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 0 #1b5e20;
}

.quadra-btn.secondary {
  background: #81c784;
  box-shadow: 0 4px 0 #4caf50;
}

.quadra-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.3);
}

/* Bouton danger (Quitter la room) */
.quadra-btn.danger {
  background: #e53935;
  box-shadow: 0 4px 0 #b71c1c;
}

/* ===== MAIN JOUEUR ===== */
.quadra-hand {
  background: #ffffff;
  border-radius: 18px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 12px;
  justify-content: center;
}

/* ===== CARTES (BASE — INTOUCHABLE) ===== */
.quadra-card {
  position: relative;
  width: 90px;
  height: 130px;
  background: #fff;
  border-radius: 14px;
  border: 3px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  font-weight: bold;
  user-select: none;
}

.quadra-card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 10px;
  border: 2px solid rgba(0, 0, 0, 0.2);
}

.quadra-num {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 18px;
}

.red    { color: #e53935; }
.blue   { color: #1e88e5; }
.green  { color: #43a047; }
.yellow { color: #fbc02d; }

/* ===== MODAL OPTIONS (POPUP) ===== */
.quadra-modal.hidden {
  display: none;
}

.quadra-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.quadra-modal-content {
  width: min(520px, 100%);
  background: #ffffff;
  color: #111;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  border: 1px solid rgba(0,0,0,0.12);
}

.quadra-modal-content h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.quadra-modal-content label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 650;
  margin: 10px 0;
}

.quadra-modal-content input,
.quadra-modal-content select {
  height: 40px;
  border-radius: 12px;
  border: 2px solid rgba(0,0,0,0.18);
  padding: 0 12px;
  font-size: 16px;
  outline: none;
  background: #fff;
}

.quadra-modal-content input:focus,
.quadra-modal-content select:focus {
  border-color: rgba(76,175,80,0.85);
  box-shadow: 0 0 0 3px rgba(76,175,80,0.18);
}

.quadra-modal-actions,
.quadra-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* ===== ADAPTATION PETITS ÉCRANS (20%) ===== */
@media (max-height: 720px) {
  .quadra-card {
    width: 72px;
    height: 104px;
    font-size: 36px;
  }

  .quadra-num {
    font-size: 14px;
  }

  .quadra-btn {
    font-size: 18px;
    padding: 10px 22px;
  }

  .quadra-modal-content {
    padding: 12px;
  }

  .quadra-modal-content input,
  .quadra-modal-content select {
    height: 38px;
    font-size: 15px;
  }
}

/* ===== DESKTOP ===== */
@media (min-width: 768px) {
  #app {
    max-width: 900px;
    margin: 0 auto;
  }
}
