/**
 * Kayıt sayfası – her zaman multiplayer.html ile aynı stil.
 * register.html için; style-multiplayer.css sonrasında yüklenir.
 * Üst bar + mobil menü butonu (hamburger). Breakpoint: 768px (mobil) / 769px+ (masaüstü)
 */

/* ========== Multiplayer ile aynı stil sistemi (tüm ekranlar) ========== */

/* Container: login ekranı .container + .login-form kart stili */
.register-container {
  box-sizing: border-box;
  background: var(--surface, rgba(255, 255, 255, 0.92));
  border: 2px solid rgba(74, 144, 226, 0.15);
  border-radius: clamp(8px, 2vw, 12px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: clamp(10px, 2.5vw, 16px) clamp(12px, 3vw, 20px);
}

/* Üst bar: login sayfası .login-top-bar ile aynı */
.register-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
  padding: clamp(10px, 2.5vw, 16px) clamp(12px, 3vw, 20px);
  margin: 0 0 clamp(10px, 2.5vw, 14px) 0;
  border-radius: clamp(8px, 2vw, 12px);
  border: 2px solid rgba(74, 144, 226, 0.15);
  background: var(--surface, rgba(255, 255, 255, 0.95));
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

.register-top-bar-title {
  margin: 0;
  font-size: clamp(1rem, 4vw, 1.35rem);
  font-weight: 600;
  color: var(--primary-2, #6d28d9);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.register-top-bar .back-home-btn {
  margin-bottom: 0;
  flex-shrink: 0;
}

.register-header {
  margin-bottom: clamp(12px, 3vw, 20px);
  text-align: center;
}

.register-header .game-title {
  margin: 0 0 clamp(6px, 1.5vw, 10px) 0;
  font-size: clamp(1.2rem, 5vw, 1.6rem);
  font-weight: 600;
  color: var(--primary-2, #6d28d9);
}

.register-header .game-subtitle {
  margin: 0;
  font-size: clamp(0.85rem, 2.5vw, 0.95rem);
  color: var(--muted, #6b7280);
}

/* Ana sayfaya dön: multiplayer .header-icon-btn ile aynı */
.back-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: clamp(12px, 3vw, 16px);
  padding: clamp(8px, 2vw, 10px) clamp(12px, 3vw, 14px);
  font-size: clamp(0.85rem, 2.2vw, 0.9rem);
  font-weight: 500;
  min-height: 44px;
  border: 2px solid var(--primary-2, #6d28d9);
  border-radius: clamp(8px, 2vw, 10px);
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary-2, #6d28d9);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  touch-action: manipulation;
}

.back-home-btn:hover {
  background: rgba(109, 40, 217, 0.08);
  border-color: var(--primary-1, #8b5cf6);
  color: var(--primary-1, #8b5cf6);
}

/* Hamburger: masaüstünde gizli, mobilde görünür */
#hamburgerBtnRegister {
  display: none;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary-2, #6d28d9);
  border-radius: clamp(8px, 2vw, 10px);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

#hamburgerBtnRegister .hamburger-line {
  background: var(--primary-2, #6d28d9);
}

#hamburgerBtnRegister:hover {
  background: rgba(109, 40, 217, 0.08);
  box-shadow: 0 2px 12px rgba(109, 40, 217, 0.15);
}

/* Form: multiplayer .input-group ile aynı */
.register-container .form-group {
  margin-bottom: clamp(14px, 3vw, 20px);
}

.register-container .form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
  font-size: clamp(0.85rem, 2.2vw, 0.9rem);
}

.register-container .form-group input {
  width: 100%;
  padding: clamp(10px, 2.5vw, 12px);
  border: 2px solid #e1e5e9;
  border-radius: clamp(8px, 2vw, 10px);
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  min-height: 44px;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.register-container .form-group input:focus {
  outline: none;
  border-color: var(--primary-1, #8b5cf6);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.14);
}

.password-strength {
  margin-top: 4px;
  font-size: clamp(0.78rem, 2vw, 0.85rem);
  height: 20px;
}

.strength-weak { color: var(--danger-1, #dc3545); }
.strength-medium { color: #ffc107; }
.strength-strong { color: var(--success-1, #28a745); }

.register-container .primary-btn {
  width: 100%;
  padding: clamp(12px, 3vw, 14px);
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  min-height: 44px;
}

#registerError {
  margin-top: clamp(10px, 2.5vw, 15px);
  font-size: clamp(0.82rem, 2.2vw, 0.9rem);
  text-align: center;
  color: var(--danger-1, #dc3545);
}

.login-link {
  text-align: center;
  margin-top: clamp(16px, 4vw, 20px);
  font-size: clamp(0.85rem, 2.2vw, 0.9rem);
  color: var(--muted, #6b7280);
}

.login-link a {
  color: var(--primary-2, #6d28d9);
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  min-height: 44px;
  line-height: 44px;
  padding: 0 clamp(8px, 2vw, 12px);
  margin: -4px 0;
  transition: color 0.2s;
}

.login-link a:hover {
  color: var(--primary-1, #8b5cf6);
}

/* Mobil menü butonu (menü içindeki button) */
.mobile-menu-item-btn {
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  font-family: 'Poppins', sans-serif;
}

/* Masaüstü: Ana sayfaya dön görünsün, hamburger ve mobil menü gizli */
@media (min-width: 769px) {
  .desktop-only-register {
    display: inline-flex !important;
  }
  #hamburgerBtnRegister {
    display: none !important;
  }
}

/* Mobil: Ana sayfaya dön gizli, hamburger görünsün */
@media (max-width: 768px) {
  .desktop-only-register {
    display: none !important;
  }
  #hamburgerBtnRegister {
    display: flex !important;
  }
}

/* ========== Masaüstü: multiplayer .container ile aynı ========== */
@media (min-width: 769px) {
  body.register-page {
    min-height: 100vh;
    padding: 20px 0;
  }

  .register-container {
    width: 100%;
    max-width: 600px;
    margin: 50px auto;
    padding: 30px;
    height: auto;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: var(--radius-lg, 20px);
    box-shadow: var(--shadow-lg, 0 20px 40px rgba(0, 0, 0, 0.12));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.25));
  }

  #mobileMenuRegister,
  #mobileMenuOverlayRegister {
    display: none !important;
  }
}

/* Mobil menü – login sayfası ile aynı modern stil (gradient yok) */
@media (max-width: 768px) {
  #mobileMenuRegister {
    background: var(--surface, rgba(255, 255, 255, 0.98)) !important;
    border-left: 2px solid rgba(74, 144, 226, 0.15);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  }
  #mobileMenuRegister .mobile-menu-header {
    padding: clamp(14px, 3vw, 20px);
    background: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 2px solid rgba(74, 144, 226, 0.15);
    color: #333;
  }
  #mobileMenuRegister .mobile-menu-header h3 {
    font-size: clamp(1.1rem, 4vw, 1.3rem);
    font-weight: 600;
    margin: 0;
  }
  #mobileMenuRegister .close-menu-btn {
    min-width: 44px;
    min-height: 44px;
    background: rgba(74, 144, 226, 0.1);
    color: var(--primary-2, #6d28d9);
    font-size: 1.5rem;
    border: 2px solid rgba(74, 144, 226, 0.2);
    border-radius: clamp(8px, 2vw, 10px);
  }
  #mobileMenuRegister .mobile-menu-item {
    min-height: 44px;
    padding: clamp(12px, 3vw, 14px) clamp(14px, 3vw, 16px);
    margin-bottom: clamp(6px, 2vw, 10px);
    border: 2px solid rgba(74, 144, 226, 0.15);
    border-radius: clamp(8px, 2vw, 12px);
    background: rgba(255, 255, 255, 0.95);
    font-size: clamp(0.9rem, 2.5vw, 1rem);
  }
  #mobileMenuRegister .mobile-menu-item:hover {
    background: rgba(74, 144, 226, 0.08);
    border-color: var(--primary-2, #6d28d9);
    color: var(--primary-2, #6d28d9);
  }
  #mobileMenuRegister .mobile-menu-divider {
    margin: clamp(12px, 3vw, 15px) 0;
    background: rgba(74, 144, 226, 0.15);
  }
}

/* ========== Mobil: multiplayer #loginScreen > .container ile aynı (tam ekran, tek scroll) ========== */
@media (max-width: 768px) {
  html.register-page-root {
    height: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    width: 100%;
    max-width: 100vw;
  }

  html.register-page-root,
  body.register-page {
    min-height: 100dvh;
    min-height: 100vh;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
  }

  body.register-page {
    width: 100%;
    max-width: 100vw;
    display: block !important;
    overflow: hidden !important;
    overflow-x: hidden !important;
    touch-action: manipulation;
  }

  .register-container {
    width: 100% !important;
    max-width: 100vw !important;
    min-height: 0 !important;
    height: 100% !important;
    margin: 0 !important;
    padding: clamp(10px, 2.5vw, 16px) !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: var(--surface, rgba(255, 255, 255, 0.95)) !important;
  }
}
