/* =========================================================
   STONEHILL AUTH & USER UI STYLES
   ========================================================= */

.auth-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Кнопка открытия модалки входа */
.btn--login {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #030712 !important;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn--login:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px var(--glow);
  color: #030712 !important;
}

/* Профиль авторизованного игрока в шапке */
.auth-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(14, 26, 48, 0.85);
  border: 1px solid var(--border);
  padding: 4px 12px 4px 6px;
  border-radius: 999px;
  transition: border-color 0.2s;
}
.auth-user-badge:hover {
  border-color: var(--border-hover);
}

.auth-avatar-wrap {
  position: relative;
  cursor: pointer;
  display: inline-flex;
}
.auth-avatar-wrap:hover .auth-avatar {
  border-color: #60a5fa;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}
.auth-avatar-edit-icon {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: var(--accent);
  color: #050b16;
  font-size: 9px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #050b16;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
}
.auth-avatar-wrap:hover .auth-avatar-edit-icon {
  opacity: 1;
  transform: scale(1.15);
}

.auth-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--accent);
  background: var(--bg-2);
}

/* Загрузка своей аватарки в модалке */
.avatar-upload-preview-wrap {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  margin: 0 auto;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.25);
  background: #060e1d;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-upload-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-drop-zone {
  border: 2px dashed rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.04);
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
  font-size: 13px;
}
.avatar-drop-zone:hover, .avatar-drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.1);
}

.avatar-security-notice {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #a7f3d0;
  font-size: 11px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 10px;
  margin-top: 14px;
  text-align: left;
}

.btn-avatar-reset {
  background: transparent;
  border: 1px solid rgba(139, 163, 196, 0.2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-avatar-reset:hover {
  border-color: #f87171;
  color: #f87171;
  background: rgba(248, 113, 113, 0.08);
}

.auth-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}

.auth-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-mcnick {
  font-size: 11px;
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: color 0.2s;
}
.auth-mcnick:hover {
  text-decoration: underline;
}
.auth-mcnick--warning {
  color: #fbbf24 !important;
  font-weight: 600;
  animation: pulseNickWarning 2s infinite ease-in-out;
}
@keyframes pulseNickWarning {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(1.02); }
}

.admin-badge-mini {
  background: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%);
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: inline-block;
  line-height: 1.2;
}

.btn-admin-nav {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fb7185 !important;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-admin-nav:hover {
  background: rgba(244, 63, 94, 0.3);
  border-color: #f43f5e;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.4);
  transform: translateY(-1px);
}

.auth-balance-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text);
}
.auth-balance-pill b {
  color: var(--accent);
}

.btn-topup-mini {
  background: var(--accent);
  color: #050b16;
  border: none;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-topup-mini:hover {
  opacity: 0.85;
}

.btn-logout-mini {
  background: transparent;
  color: var(--muted);
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.btn-logout-mini:hover {
  color: #f87171;
}

/* =========================================================
   МОДАЛЬНЫЕ ОКНА
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 16px;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #0b1528;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  position: relative;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.25s ease;
}
.modal-overlay.open .modal-box {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
}

.modal-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.modal-desc {
  margin: 0 0 22px;
  font-size: 14px;
  color: var(--muted);
}

/* Кнопки провайдеров OAuth */
.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  border: none;
}
.btn-oauth:hover {
  transform: translateY(-1px);
}

.btn-discord {
  background: #5865F2;
  color: #ffffff !important;
}
.btn-discord:hover {
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
  color: #ffffff !important;
}

.btn-google {
  background: #ffffff;
  color: #1f2937 !important;
}
.btn-google:hover {
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.25);
  color: #1f2937 !important;
}

.oauth-icon {
  width: 22px;
  height: 22px;
}

.dev-login-hint {
  margin-top: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.dev-login-hint a {
  color: var(--accent);
  text-decoration: underline;
  margin: 0 6px;
}

/* Форма ввода ника */
.input-field {
  width: 100%;
  padding: 12px 14px;
  background: rgba(14, 26, 48, 0.8);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}
.input-field:focus {
  border-color: var(--accent);
}

/* Пресеты пополнения */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.preset-btn {
  background: rgba(14, 26, 48, 0.7);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}
.preset-btn:hover, .preset-btn.active {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
}


/* Адаптив для мобильных устройств */
@media (max-width: 820px) {
  #auth-container {
    margin-top: 12px;
    width: 100%;
  }
  .auth-wrapper {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }
  .btn--login {
    width: 100%;
    justify-content: center;
    padding: 10px;
  }
  .auth-user-badge {
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
  }
  .auth-balance-pill {
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
  }
}


/* =========================================================
   ТАБЫ И ФОРМЫ АВТОРИЗАЦИИ ПО EMAIL / ПАРОЛЮ
   ========================================================= */

.auth-tabs {
  display: flex;
  background: rgba(5, 11, 22, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.auth-tab-btn:hover {
  color: var(--text);
}
.auth-tab-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

.auth-form {
  display: flex;
  flex-direction: column;
}

.input-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-password-wrap {
  position: relative;
  width: 100%;
}
.input-password-wrap .input-field {
  padding-right: 44px;
}
.btn-toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -8px;
}
.btn-toggle-pass:hover {
  color: var(--text);
}

.auth-msg {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 16px;
  display: none;
}
.auth-msg--error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.auth-msg--success {
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 18px 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}
.auth-divider span {
  padding: 0 10px;
}

.auth-link {
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  transition: opacity 0.2s;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}
.auth-link:hover {
  opacity: 0.8;
}

.verify-code-input {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 10px;
  text-align: center;
  padding: 12px;
  color: var(--accent);
  background: rgba(14, 26, 48, 0.95);
  border: 2px solid rgba(56, 189, 248, 0.4);
  border-radius: 12px;
  margin-bottom: 14px;
  width: 100%;
  box-sizing: border-box;
}
.verify-code-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
  outline: none;
}

.verify-dev-box {
  background: rgba(245, 158, 11, 0.1);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  color: #fde68a;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 14px;
  text-align: center;
  cursor: pointer;
}

/* =========================================================
   МОДАЛКА УПРАВЛЕНИЯ ПРОФИЛЕМ (PROFILE SETTINGS MODAL)
   ========================================================= */

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.profile-avatar-big-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}

.profile-modal-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
  background: #081120;
}

.profile-avatar-badge-btn {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: var(--accent);
  color: #030712;
  border-radius: 50%;
  font-size: 11px;
  padding: 2px 4px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.profile-header-info {
  flex: 1;
  min-width: 0;
}

.profile-modal-username {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-modal-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.profile-meta-pill {
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-tabs-nav {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.profile-tab-btn {
  flex: 1;
  padding: 8px 6px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
}

.profile-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.profile-tab-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.profile-section-card {
  background: rgba(14, 26, 48, 0.55);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.social-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  gap: 12px;
}

.social-link-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.social-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.social-icon--discord {
  background: #5865F2;
}

.social-icon--google {
  background: #ffffff;
}

.btn-social-action {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s;
}

.btn-social--link {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-social--link:hover {
  background: var(--accent);
  color: #030712;
  box-shadow: 0 0 12px var(--glow);
}

.btn-social--unlink {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.btn-social--unlink:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
}

.btn-profile-gear {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  margin-left: 2px;
  transition: all 0.2s;
  color: var(--muted);
}

.btn-profile-gear:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: rotate(45deg);
  background: rgba(56, 189, 248, 0.15);
}

.code-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 8px;
}

.code-digit {
  width: 44px;
  height: 52px;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  background: rgba(14, 26, 48, 0.95);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--accent);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.code-digit:focus {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}
