/* ── USER SYSTEM: DRAWER BACKDROP ────────────────────────────────────── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 990;
  opacity: 1;
  transition: opacity 0.3s ease;
}
.drawer-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── USER SYSTEM: SLIDING DRAWER ─────────────────────────────────────── */
.user-drawer.hidden {
  display: none !important;
}
.user-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(340px, 100vw);
  background: rgba(11, 11, 18, 0.98);
  border-right: 1px solid var(--border, #1c1c2a);
  box-shadow: 20px 0 50px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.user-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  position: relative;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border, #1c1c2a);
}
.drawer-logo {
  font-family: "Bebas Neue", sans-serif;
  font-size: 26px;
  letter-spacing: 2px;
  color: var(--text, #e2e2ee);
  text-decoration: none;
}
.drawer-logo span {
  color: var(--accent, #4f7cff);
}
.drawer-close {
  position: absolute;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--muted, #4a4a6a);
  font-size: 18px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius, 5px);
  transition: all 0.15s ease;
}
.drawer-close:hover {
  color: var(--text, #e2e2ee);
  background: rgba(255, 255, 255, 0.05);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.drawer-section {
  animation: drawerFadeIn 0.25s ease;
}
.drawer-section.hidden {
  display: none;
}

@keyframes drawerFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.drawer-section-kicker {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent, #4f7cff);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}
.drawer-section-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: 24px;
  color: var(--text, #e2e2ee);
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.drawer-section-text {
  font-size: 12.5px;
  color: var(--muted, #4a4a6a);
  margin-bottom: 20px;
  line-height: 1.45;
}

/* ── Auth Mode Tabs ──────────────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border, #1c1c2a);
  border-radius: var(--radius, 5px);
  padding: 3px;
  gap: 3px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: calc(var(--radius, 5px) - 2px);
  color: var(--muted, #4a4a6a);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 8px 0;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
  text-transform: uppercase;
}
.auth-tab.active {
  background: var(--accent, #4f7cff);
  color: #000;
}
.auth-tab:not(.active):hover {
  color: var(--text, #e2e2ee);
  background: rgba(255, 255, 255, 0.05);
}

/* ── Labeled field wrapper ────────────────────────────────────────────────── */
.drawer-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 2px;
}
.drawer-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted, #4a4a6a);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Input wrapper (for status icon inside input row) */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrapper input {
  padding-right: 34px;
}
.input-status-icon {
  position: absolute;
  right: 10px;
  font-size: 14px;
  pointer-events: none;
  display: flex;
  align-items: center;
}

/* Password wrapper */
.pw-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.pw-wrapper input {
  padding-right: 38px;
}
.pw-toggle-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  background: transparent;
  border: none;
  color: var(--muted, #4a4a6a);
  font-size: 14px;
  cursor: pointer;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}
.pw-toggle-btn:hover {
  color: var(--text, #e2e2ee);
}

/* Field-level error text */
.drawer-field-error {
  font-size: 10px;
  color: var(--danger, #ff4560);
  min-height: 14px;
  line-height: 1.3;
}

/* Auth mode switch row */
.auth-mode-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted, #4a4a6a);
  margin-top: 16px;
  text-align: center;
}
.auth-switch-link {
  background: transparent;
  border: none;
  color: var(--accent, #4f7cff);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.15s ease;
}
.auth-switch-link:hover {
  opacity: 0.8;
}

/* Spin animation for loading indicator */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Form & Buttons inside drawer */
.auth-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.drawer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius, 5px);
  border: 1px solid var(--border, #1c1c2a);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.drawer-btn.oauth-google {
  background: #ffffff;
  color: #1a1a24;
  border-color: #ffffff;
}
.drawer-btn.oauth-google:hover {
  background: rgba(255, 255, 255, 0.9);
}
.drawer-btn.primary {
  background: var(--accent, #4f7cff);
  border-color: var(--accent, #4f7cff);
  color: #000000;
}
.drawer-btn.primary:hover {
  background: transparent;
  color: var(--accent, #4f7cff);
}
.drawer-btn.secondary {
  background: transparent;
  border-color: var(--border, #1c1c2a);
  color: var(--text, #e2e2ee);
}
.drawer-btn.secondary:hover {
  border-color: var(--muted, #4a4a6a);
  background: rgba(255, 255, 255, 0.02);
}

.auth-divider {
  text-align: center;
  position: relative;
  margin: 8px 0;
}
.auth-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border, #1c1c2a);
  z-index: 1;
}
.auth-divider span {
  background: #0b0b12;
  position: relative;
  z-index: 2;
  padding: 0 10px;
  font-size: 10px;
  color: var(--muted, #4a4a6a);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

#drawer-email-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#drawer-email-form input {
  background: rgba(8, 8, 13, 0.5);
  border: 1px solid var(--border, #1c1c2a);
  border-radius: var(--radius, 5px);
  color: var(--text, #e2e2ee);
  padding: 10px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}
#drawer-email-form input:focus {
  border-color: var(--accent, #4f7cff);
  background: rgba(8, 8, 13, 0.8);
}
#drawer-email-form input::placeholder {
  color: var(--muted, #4a4a6a);
  font-size: 12px;
}

.drawer-error {
  color: var(--danger, #ff4560);
  background: rgba(255, 69, 96, 0.08);
  border: 1px solid rgba(255, 69, 96, 0.2);
  border-radius: var(--radius, 5px);
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.4;
}

/* Profile Card & Stats List */
.profile-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border, #1c1c2a);
  border-radius: var(--radius, 5px);
  padding: 14px;
}
.profile-avatar {
  font-size: 32px;
  color: var(--accent, #4f7cff);
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.profile-username {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #e2e2ee);
}
.profile-email {
  font-size: 11px;
  color: var(--muted, #4a4a6a);
}

/* Modal styles for Set Custom Username overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 8, 13, 0.85);
  backdrop-filter: blur(4px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}
.modal-overlay.hidden {
  display: none !important;
}
.lobby-modal-content {
  background: var(--surface, #0f0f17);
  border: 1.5px solid var(--accent, #4f7cff);
  border-radius: 8px;
  padding: 24px 30px;
  width: min(440px, 92%);
  text-align: left;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  animation: modalSlideIn 0.3s ease;
  box-sizing: border-box;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.lobby-modal-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.2rem;
  color: #fff;
  letter-spacing: 1.5px;
  margin: 0 0 10px;
  text-align: center;
  border-bottom: 1px solid var(--border, #1c1c2a);
  padding-bottom: 10px;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--muted, #4a4a6a);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s ease;
}
.modal-close:hover {
  color: var(--text, #e2e2ee);
}
.lobby-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lobby-field-group label {
  font-size: 12px;
  color: var(--muted, #4a4a6a);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.modal-lobby-input {
  background: var(--bg, #08080d);
  border: 1px solid var(--border, #1c1c2a);
  border-radius: 4px;
  padding: 10px 14px;
  color: var(--text, #e2e2ee);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}
.modal-lobby-input:focus {
  border-color: var(--accent, #4f7cff);
}
.modal-lobby-input.invalid {
  border-color: #ff4a4a !important;
}

.btn-lobby-primary {
  background: var(--accent, #4f7cff);
  color: #000;
  border: none;
  border-radius: 4px;
  padding: 10px 0;
  font-family: "Bebas Neue", sans-serif;
  font-size: 20px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  width: 100%;
}
.btn-lobby-primary:hover {
  background: #fff;
}
.btn-lobby-primary:disabled {
  background: var(--muted, #4a4a6a);
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
}

.lobby-error-msg {
  color: var(--danger, #ff4560);
  font-size: 11px;
  font-weight: 600;
}
.lobby-error-msg.hidden {
  display: none !important;
}

.hidden {
  display: none !important;
}

/* ── SUB-VIEWS Y STICKY FOOTER ── */

.drawer-sub-view {
  display: none;
  animation: drawerFadeIn 0.2s ease;
  flex: 1;
  flex-direction: column;
}
.drawer-sub-view.active {
  display: flex !important;
}

/* Menú de navegación principal */
.drawer-nav-menu {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border, #1c1c2a);
  border-radius: var(--radius, 5px);
  overflow: hidden;
  margin-top: 10px;
}
.drawer-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #e2e2ee);
  text-decoration: none;
  border-bottom: 1px solid var(--border, #1c1c2a);
  transition: background 0.15s ease, color 0.15s ease;
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.drawer-nav-item:last-child {
  border-bottom: none;
}
.drawer-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent, #4f7cff);
}
.drawer-nav-item i {
  font-size: 16px;
  color: var(--muted, #4a4a6a);
  transition: color 0.15s ease;
}
.drawer-nav-item:hover i {
  color: var(--accent, #4f7cff);
}
.drawer-nav-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Envoltorio del botón Settings (separado del bloque principal) */
.settings-wrapper {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
}
.settings-wrapper .drawer-nav-item {
  border: 1px solid var(--border, #1c1c2a);
  border-radius: var(--radius, 5px);
}

/* Sticky Footer */
.drawer-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border, #1c1c2a);
  background: rgba(11, 11, 18, 0.98);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Badge de Notificaciones */
.drawer-notification-badge {
  background: var(--danger, #ff4560);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 10px;
  text-align: center;
  display: inline-block;
  line-height: 1;
}


