/* --- LOBBY (VÁRÓTEREM) --- */
#lobby-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-in-out;
}

.lobby-box {
  background:
    radial-gradient(circle at top left, rgba(60, 60, 80, 0.3), transparent), rgba(10, 10, 20, 0.4); /* Átlátszóbb háttér */
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 2px solid rgba(197, 160, 89, 0.6); /* Aranyozott díszítés */
  border-left: 2px solid rgba(197, 160, 89, 0.4);
  border-radius: 20px;
  padding: 30px;
  width: 100%;
  max-width: 650px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-sizing: border-box;
  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.9),
    inset 0 0 30px rgba(57, 162, 219, 0.05);
  text-align: center;
  position: relative;
  animation: pulse-red-border 2s infinite;
}

/* Custom scrollbar for lobby-box */
.lobby-box::-webkit-scrollbar {
  width: 6px;
}
.lobby-box::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}
.lobby-box::-webkit-scrollbar-thumb {
  background: rgba(197, 160, 89, 0.4);
  border-radius: 10px;
}
.lobby-box::-webkit-scrollbar-thumb:hover {
  background: rgba(197, 160, 89, 0.7);
}
.lobby-box h2 {
  margin-top: 0;
  margin-bottom: 30px;
  color: #e94560;
  font-size: 1.1rem;
  border-bottom: none;
  padding-bottom: 0;
  white-space: pre;
  font-family: 'Courier New', Courier, monospace;
  line-height: 1.2;
  text-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
  display: inline-block;
}

.lobby-section {
  margin: 10px 0;
}
.lobby-section p {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  color: #ccc;
}
.hint {
  font-size: 0.75rem !important;
  color: #888 !important;
  margin-top: 5px !important;
}
.divider {
  margin: 25px 0;
  font-size: 0.8rem;
  color: #555;
  font-weight: bold;
  position: relative;
}

/* --- REAL-TIME LOBBY ONLINE PLAYERS --- */
.online-players-container {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 10px;
  min-height: 80px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 5px;
  transition: background 0.2s;
}
.player-row:hover {
  background: rgba(255, 255, 255, 0.1);
}

.player-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.player-name-text {
  font-weight: bold;
  color: #fff;
}

.player-status {
  font-size: 0.75rem;
  color: #4cd137;
  background: rgba(76, 209, 55, 0.1);
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid rgba(76, 209, 55, 0.3);
}

.challenge-btn {
  background: linear-gradient(135deg, #e94560, #c0392b);
  border: none;
  color: white;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  text-transform: uppercase;
}
.challenge-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
}
.challenge-btn:disabled {
  background: #555;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* --- CHALLENGE MODAL --- */
#challenge-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s;
}

.challenge-box {
  background: #1a1a24;
  border: 2px solid #e94560;
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 0 30px rgba(233, 69, 96, 0.4);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.challenge-box h2 {
  color: #e94560;
  margin-top: 0;
}

.challenge-box p {
  font-size: 1.1rem;
  margin-bottom: 25px;
}

.challenge-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}
.challenge-buttons button {
  flex: 1;
  padding: 10px;
  font-size: 1rem;
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #4cd137;
  border-radius: 50%;
  margin-right: 5px;
  box-shadow: 0 0 8px #4cd137;
  animation: pulse-dot-anim 1.5s infinite;
}

@keyframes pulse-dot-anim {
  0% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 8px #4cd137;
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
    box-shadow: 0 0 15px #4cd137;
  }
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 8px #4cd137;
  }
}

/* --- NICKNAME MODAL GLASSMORPHISM --- */
#nickname-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.3s;
}

.nickname-box {
  background: rgba(26, 26, 36, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 35px;
  text-align: center;
  max-width: 450px;
  width: 90%;
  box-shadow:
    0 15px 35px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(233, 69, 96, 0.15);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nickname-box h2 {
  color: #e94560;
  margin-top: 0;
  font-size: 1.8rem;
  letter-spacing: 1px;
  margin-bottom: 15px;
}

.nickname-box p {
  color: #ccc;
  font-size: 0.95rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.nickname-input-wrapper {
  margin-bottom: 20px;
  position: relative;
}

.nickname-input-field {
  width: 100%;
  padding: 12px 15px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.4);
  color: white;
  font-size: 1.1rem;
  text-align: center;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}

.nickname-input-field:focus {
  border-color: #e94560;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.5),
    0 0 10px rgba(233, 69, 96, 0.4);
}

.nickname-error-msg {
  color: #ff3860;
  font-size: 0.85rem;
  margin-top: 8px;
  min-height: 18px;
}

.nickname-warning-box {
  background: rgba(241, 196, 15, 0.08);
  border: 1px solid rgba(241, 196, 15, 0.25);
  border-radius: 10px;
  padding: 12px 15px;
  margin-bottom: 25px;
  text-align: left;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.nickname-warning-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.nickname-warning-text {
  color: #f1c40f;
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.4;
}

.nickname-actions {
  display: flex;
  gap: 15px;
}

.nickname-actions button {
  flex: 1;
  padding: 12px;
  font-size: 1rem;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  transition:
    transform 0.2s,
    background-color 0.2s;
}

.nickname-actions button:active {
  transform: scale(0.98);
}

/* --- COLLAPSIBLE SPECTATOR BUTTON AND INPUT --- */
.spectate-container {
  display: flex;
  position: relative;
  width: 100%;
  gap: 0;
  transition: gap 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.spectate-container.active {
  gap: 12px;
}

.spectate-input {
  width: 0;
  opacity: 0;
  pointer-events: none;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.45);
  color: white;
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  text-align: center;
  box-sizing: border-box;
  transition:
    width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
    opacity 0.3s ease,
    padding 0.3s ease,
    border-color 0.3s ease;
  outline: none;
}

.spectate-container.active .spectate-input {
  width: 62%;
  opacity: 1;
  pointer-events: auto;
  padding: 15px;
}

.spectate-input:focus {
  border-color: rgba(155, 89, 182, 0.6) !important;
  box-shadow: 0 0 12px rgba(155, 89, 182, 0.4);
}

.spectate-button {
  flex: 1 1 100%;
  width: 100%;
  margin: 0 !important;
  white-space: nowrap;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.spectate-container.active .spectate-button {
  flex: 0 0 38%;
  width: 38%;
  padding: 15px 10px !important;
  font-size: 0.85rem !important;
}

.spectate-button .btn-icon {
  position: absolute !important;
  left: 20px;
  top: 50%;
  transform: translateY(-50%) !important;
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.spectate-container.active .spectate-button .btn-icon {
  position: static !important;
  transform: none !important;
  margin-right: 4px;
}
/* --- JÁTÉKMÓD VÁLASZTÓ --- */
.mode-tabs {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 25px;
}

.mode-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ccc;
  padding: 12px 25px;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  font-family: 'Outfit', sans-serif;
}

.mode-tab:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.mode-tab.active {
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.8), rgba(233, 69, 96, 0.8));
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 5px 15px rgba(233, 69, 96, 0.3);
  transform: translateY(-2px);
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.mode-btn {
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  font-family: 'Outfit', sans-serif;
  min-height: 62px;
  box-sizing: border-box;
}

.mode-btn:not(.disabled):hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(197, 160, 89, 0.6);
  transform: translateY(-3px);
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.4),
    inset 0 0 15px rgba(197, 160, 89, 0.2);
}

.mode-icon {
  font-size: 1.4rem;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  line-height: 1;
}

.mode-title {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

.mode-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.5);
  border-color: transparent;
}

.coming-soon-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(233, 69, 96, 0.8);
  color: white;
  font-size: 0.5rem;
  padding: 2px 4px;
  border-radius: 4px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Responsiveness on low-height viewports */
@media (max-height: 720px) {
  .lobby-box {
    padding: 18px 25px;
  }
  .lobby-box h2 {
    margin-bottom: 15px;
    font-size: 1rem;
  }
  .mode-tabs {
    margin-bottom: 15px;
  }
  .mode-tab {
    padding: 8px 18px;
    font-size: 0.95rem;
  }
  .mode-grid {
    gap: 10px;
    margin-bottom: 12px;
  }
  .lobby-section {
    margin: 5px 0;
  }
  .lobby-box hr {
    margin: 12px 0 !important;
  }
}
