/* ==========================================================================
   TAIXU — Lobby
   ========================================================================== */

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lobby-container {
  background: var(--panel-bg);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), inset 0 0 20px rgba(0, 240, 255, 0.1);
  backdrop-filter: blur(12px);
  width: 100%;
  max-width: 420px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 35px;
}

.logo-box h1 {
  font-size: clamp(1.7rem, 8vw, 2.2rem);
  letter-spacing: 3px;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.menu-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lobby-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: bold;
  font-family: inherit;
  text-decoration: none;
  letter-spacing: 1.5px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  cursor: pointer;
  width: 100%;
  min-height: 52px; /* Alvo de toque confortável no celular */
}

.btn-play {
  background: linear-gradient(45deg, #661199, #440066);
  color: #ffffff;
  border: 1px solid var(--accent-purple);
  box-shadow: 0 0 15px rgba(157, 0, 255, 0.4);
}

.btn-play:hover,
.btn-play:focus-visible {
  background: linear-gradient(45deg, #8811cc, #661199);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.6);
  transform: translateY(-2px);
}

.btn-rules {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-p1);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.btn-rules:hover,
.btn-rules:focus-visible {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--accent-p1);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
  transform: translateY(-2px);
}

.btn-icon {
  font-size: 1.2rem;
}

.footer-info {
  font-size: 0.75rem;
  color: #606b7a;
}

/* ---------- Modal de seleção de modo ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 10, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--panel-bg);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), inset 0 0 20px rgba(0, 240, 255, 0.1);
  backdrop-filter: blur(12px);
  width: 100%;
  max-width: 420px;
  padding: 30px 25px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s ease;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal h2 {
  font-size: 1.3rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.modal-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -10px;
}

.mode-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mode-option {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-color);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  min-height: 60px;
}

.mode-option:hover:not(.disabled),
.mode-option:focus-visible:not(.disabled) {
  transform: translateY(-2px);
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--accent-p1);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.mode-option .mode-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.mode-option .mode-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mode-option .mode-name {
  font-size: 1.05rem;
}

.mode-option .mode-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.mode-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mode-option .mode-badge {
  margin-left: auto;
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(255, 215, 0, 0.15);
  color: var(--gold);
  border: 1px solid rgba(255, 215, 0, 0.4);
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  padding: 6px;
  transition: color 0.2s ease;
}

.modal-close:hover,
.modal-close:focus-visible {
  color: var(--accent-p1);
}

/* ---------- Modo Online ---------- */
.online-field {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.online-field label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.online-field input,
.online-join-form input {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 240, 255, 0.3);
  background: rgba(10, 15, 30, 0.8);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.online-field input:focus,
.online-join-form input:focus {
  border-color: var(--accent-p1);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.online-error {
  color: var(--accent-p2);
  font-size: 0.85rem;
  margin-top: -10px;
}

.online-join-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.online-join-form input {
  text-align: center;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: bold;
}

.online-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
}

.online-status p {
  color: var(--text-color);
  font-size: 0.95rem;
}

.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(0, 240, 255, 0.2);
  border-top-color: var(--accent-p1);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

/* ---------- Modal de configuração da partida (Local PvP / vs IA) ---------- */
.config-field {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.config-field label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timer-select {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 240, 255, 0.3);
  background: rgba(10, 15, 30, 0.8);
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.timer-select:focus {
  border-color: var(--accent-p1);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.difficulty-options {
  display: flex;
  gap: 8px;
}

.difficulty-btn {
  flex: 1;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}

.difficulty-btn:hover,
.difficulty-btn:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent-p1);
}

.difficulty-btn.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-p1);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}
