/* === BASE MODAL SYSTEM === */

.modal {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 25;
  cursor: pointer;
  
}

.modal.is-open {
  display: flex;
}

.modalOverlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.9);
}

body.dark-mode .modalOverlay {
  background: rgba(0,0,0,0.85);
}

.modalContent {
  position: relative;
  max-width: 260px;
  width: 90%;
  padding: 16px;
  text-align: center;
  pointer-events: auto;
  cursor: default;
  background: #fff;
  color: #003366;
  border: 2px solid #003366;
}

body.dark-mode .modalContent {
  background: #000;
  color: #33ff33;
  border-color: #33ff33;
}

.modalTitle {
  font-size: 1.3em;
  margin-bottom: 10px;
}

.modalHint {
  margin-top: 10px;
  font-size: 0.8em;
  opacity: 0.7;
}

/* === LEADERBOARD MODAL === */

#leaderboardList {
  list-style: none;
  padding: 0;
  margin: 0 auto 10px;
  width: 220px;
}

#leaderboardList li {
  display: flex;
  justify-content: space-between;
  font-size: 1.1em;
  padding: 2px 0;
  border-bottom: 1px dotted rgba(0,0,0,0.2);
}

body.dark-mode #leaderboardList li {
  border-bottom: 1px dotted rgba(51,255,51,0.4);
}

.modalTitle .subtitle {
  font-size: 0.9em;
  opacity: 0.8;
}


/* === LEVEL SELECT MODAL === */

#levelList {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 240px;
  overflow-y: auto;
}

#levelList li {
  padding: 10px;
  margin-bottom: 6px;
  font-size: 1.1em;
  cursor: pointer;
  border: 1px solid currentColor;
}

@media (hover: hover) and (pointer: fine) {
  #levelList li:hover {
    background: rgba(0,0,0,0.08);
  }

  body.dark-mode #levelList li:hover {
    background: rgba(255,255,255,0.1);
  }
}

/* === PLAYER NAME MODAL === */
#playerName {
  width: 10ch;
  font-size: 16px;
  letter-spacing: 0.15em;
  margin: 10px 0;
  text-align: center;
  pointer-events: auto;
}

/* === SETTINGS MODAL === */

.settings-section {
  display: flex;
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

.settings-hint {
  font-size: 0.85em;
  opacity: 0.85;
  text-align: center;
  line-height: 1.4;
}

.settings-subsection {
  font-size: 1em;
  opacity: 1;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  
}

.teamOptions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* Optional: iOS share icon styling */
.ios-share {
  font-weight: bold;
}

#qrCode {margin:auto;}

#teamNameInput {
  text-align: center;
  font-family: inherit;
  font-size: 1em;
  letter-spacing: 0.05em; /* optional: arcade feel */
}

.button.is-loading {
  opacity: 0.6;
  pointer-events: none;
  cursor: default;
}

.button.is-loading::after {
  content: ' ⏳';
}

