﻿:root {
  --bg-dark: #090b1a;
  --bg: #101329;
  --panel: #161b37;
  --light: #f6f7fc;
  --text: #f4f7ff;
  --text-dark: #13203f;
  --muted: #9aa4cc;
  --accent: #7c5cff;
  --accent-strong: #ffb24f;
  --shadow: 0 24px 48px rgba(9, 11, 30, 0.45);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

/* 
 * Header Default Behavior: Fixed Position
 * الهيدر ثابت فوق الصفحة كـ default لكل الصفحات
 * 
 * لتغيير الهيدر إلى sticky في صفحة معينة، أضف هذا الكود في CSS الصفحة:
 * 
 * body {
 *   padding-top: 0 !important;
 * }
 * 
 * header {
 *   position: sticky !important;
 *   left: auto !important;
 *   right: auto !important;
 *   width: auto !important;
 * }
 */

body {
  padding-top: 80px;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  backdrop-filter: blur(14px);
  background: rgba(9, 11, 24, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  z-index: 50;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  position: relative;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 10;
}

.logo {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}

.logo::before {
  content: "";
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 28px rgba(124, 92, 255, 0.45);
}

.start-game-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #080c1f;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(124, 92, 255, 0.3);
}

.start-game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(124, 92, 255, 0.45);
}

.start-game-btn i {
  font-size: 1rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.2rem;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  transition: all 0.25s ease;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: rgba(124, 92, 255, 0.16);
  color: #fff;
  transform: translateY(-1px);
}

.nav-link.active {
  background: rgba(124, 92, 255, 0.2);
  color: #fff;
  font-weight: 600;
}

.nav-link i {
  font-size: 0.9rem;
  width: 16px;
  text-align: center;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.guest-actions,
.auth-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
  transition: background 0.25s ease;
}

.user-profile:hover {
  background: rgba(124, 92, 255, 0.1);
}

.user-avatar {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem !important;
  font-weight: 700;
  color: #080c1f;
  flex-shrink: 0;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.btn-logout {
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #080c1f;
  box-shadow: 0 8px 20px rgba(124, 92, 255, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 12px 28px rgba(124, 92, 255, 0.45);
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn i {
  font-size: 0.9rem;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0.75rem;
  border-radius: 8px;
  transition: background-color 0.3s ease;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.mobile-menu-toggle:hover {
  background: rgba(124, 92, 255, 0.16);
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(9, 11, 24, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 1.5rem;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(9, 11, 30, 0.6);
}

.mobile-menu.active {
  display: block;
}

.mobile-menu-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  transition: background 0.25s ease, color 0.25s ease;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  width: 100%;
  text-align: right;
}

.mobile-menu-item:hover {
  background: rgba(124, 92, 255, 0.16);
  color: #fff;
}

.mobile-menu-item i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.mobile-start-game {
  background: rgba(124, 92, 255, 0.2) !important;
  color: #fff !important;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.mobile-start-game:hover {
  background: rgba(124, 92, 255, 0.3) !important;
}

@media (max-width: 760px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .main-nav {
    display: none;
  }

  .start-game-btn {
    display: none !important;
  }

  .nav {
    position: relative;
  }
}

