@import url("https://fonts.googleapis.com/css2?family=SF+Pro+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap");

:root {
  --primary-color: #1f2937;
  --secondary-color: #6366f1;
  --accent-color: #ec4899;
  --gamming-accent: #a78bfa;
  --text-primary: #ffffff;
  --text-secondary: #d1d5db;
  --bg-dark: #0f172a;
  --bg-card: rgba(31, 41, 55, 0.8);
  --border-color: rgba(255, 255, 255, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

.bg-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  z-index: -1;
  background: linear-gradient(135deg, #0f172a 0%, #1f2937 50%, #1a1f35 100%);
  background-attachment: fixed;
}

.bg-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(
      circle 200px at 20% 30%,
      rgba(99, 102, 241, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle 250px at 80% 60%,
      rgba(236, 72, 153, 0.12) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle 150px at 50% 80%,
      rgba(167, 139, 250, 0.1) 0%,
      transparent 50%
    );
  animation: ambientShift 8s ease-in-out infinite;
}

@keyframes ambientShift {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(20px, -20px);
  }
}

.header {
  display: flex;
  align-items: center;
  gap: 15px;
  height: 90px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* HEADER - Modern Apple Style */
.container-title {
  font-size: 42px;
  font-weight: 700;
  font-family:
    "SF Pro Display",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  letter-spacing: -1.2px;
  width: 100%;
  display: flex;
  align-items: center;
  vertical-align: middle;
  justify-content: flex-start;
  color: white;
  padding-left: 10px;
}

#title {
  text-align: left;
  opacity: 0;
  transform: translateY(-25px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  background: linear-gradient(135deg, #ffffff, #d1d5db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#title.show {
  opacity: 1;
  transform: translateY(-8px);
}

#title::before {
  content: "";
  margin-right: 15px;
  display: inline-block;
  animation: gameIcon 2s ease-in-out infinite;
}

@keyframes gameIcon {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* LOGO */
.logo {
  width: 70px;
  height: auto;
  margin-left: 30px;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  animation: logoAppear 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

@keyframes logoAppear {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 0.5;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* LAYOUT */
.layout {
  padding-top: 70px;
  width: 100%;
  display: flex;
  min-height: calc(100vh - 90px);
}

/* NAVBAR - Modern Sidebar */
.container-nav {
  opacity: 0;
  transform: translateX(-40px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  width: 200px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 40px 0;
  position: sticky;
  top: 90px;
  height: calc(100vh - 90px);
  overflow-y: auto;
}

.container-nav.show {
  opacity: 1;
  transform: translateX(0);
}

.container-nav ul {
  list-style: none;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.container-nav li {
  font-size: 14px;
  font-weight: 500;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* LINK NAVBAR - Interactive */
.container-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text-secondary);
  background-color: transparent;
  border-radius: 8px;
  border-left: 3px solid transparent;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.container-nav a::before {
  content: "";
  position: absolute;
  left: -3px;
  width: 3px;
  height: 0;
  background: linear-gradient(
    135deg,
    var(--secondary-color),
    var(--accent-color)
  );
  border-radius: 2px;
  transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.container-nav a:hover {
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
  transform: translateX(6px);
  padding-left: 22px;
}

.container-nav a:hover::before {
  height: 100%;
}

.container-nav a.active {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.2),
    rgba(236, 72, 153, 0.15)
  );
  color: var(--text-primary);
  border-left: 3px solid var(--secondary-color);
  font-weight: 600;
}

.container-nav a.active::before {
  display: none;
}

/* HEADER TITLE LINK */
.container-title a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.container-title a:visited {
  color: inherit;
}

.container-title a:hover {
  opacity: 0.8;
}

#title a.active {
  opacity: 0.7;
}

/* MAIN CONTENT */
.content {
  flex: 1;
  padding: 60px 80px;
  overflow-y: auto;
  animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.content h1 {
  font-family:
    "SF Pro Display",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-size: 64px;
  font-weight: 700;
  margin-bottom: 30px;
  letter-spacing: -1.5px;
  background: linear-gradient(135deg, #ffffff, #d1d5db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.content p {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 600px;
  margin-bottom: 40px;
  transition: color 0.3s ease;
}

/* SCROLLBAR STYLING */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.5);
  border-radius: 4px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.8);
}

/* ==========================================
   MOBILE RESPONSIVE STYLES
   ========================================== */

/* Hamburger Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 28px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 200;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.mobile-menu-btn span {
  width: 28px;
  height: 3px;
  background: var(--text-primary);
  border-radius: 3px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 8px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -8px);
}

/* Overlay for mobile menu */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-overlay.active {
  display: block;
  opacity: 1;
}

/* Tablet styles */
@media (max-width: 1024px) {
  .header {
    height: 70px;
  }

  .container-title {
    font-size: 32px;
  }

  .logo {
    width: 50px;
    margin-left: 20px;
  }

  .layout {
    min-height: calc(100vh - 70px);
  }

  .container-nav {
    width: 180px;
    top: 70px;
    height: calc(100vh - 70px);
  }

  .content {
    padding: 40px 50px;
  }

  .content h1 {
    font-size: 48px;
  }

  .content p {
    font-size: 16px;
  }
}

/* Mobile styles */
@media (max-width: 768px) {
  /* Header Mobile */
  .header {
    height: 60px;
    padding: 0 15px;
  }

  .logo {
    width: 40px;
    margin-left: 15px;
  }

  .container-title {
    font-size: 22px;
    padding-left: 8px;
  }

  #title {
    font-size: 20px;
    letter-spacing: -0.5px;
  }

  /* Show hamburger menu */
  .mobile-menu-btn {
    display: flex;
  }

  /* Mobile Navigation */
  .container-nav {
    position: fixed;
    top: 60px;
    left: -280px;
    width: 260px;
    height: calc(100vh - 60px);
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    padding: 20px 0;
    opacity: 1;
    transform: none;
  }

  .container-nav.mobile-open {
    left: 0;
  }

  .container-nav ul {
    padding: 15px;
    gap: 8px;
  }

  .container-nav li {
    font-size: 14px;
  }

  .container-nav a {
    padding: 14px 16px;
  }

  /* Content Mobile */
  .content {
    padding: 30px 20px;
  }

  .content h1 {
    font-size: 32px;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
  }

  .content p {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 25px;
  }

  /* Layout Mobile */
  .layout {
    min-height: calc(100vh - 60px);
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .header {
    height: 55px;
    padding: 0 12px;
  }

  .logo {
    width: 35px;
    margin-left: 10px;
  }

  .container-title {
    font-size: 18px;
  }

  #title {
    font-size: 16px;
  }

  .container-nav {
    top: 55px;
    height: calc(100vh - 55px);
    width: 240px;
    left: -260px;
  }

  .content {
    padding: 25px 15px;
  }

  .content h1 {
    font-size: 26px;
  }

  .content p {
    font-size: 14px;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .container-nav a {
    min-height: 48px;
    padding: 14px 18px;
  }

  .btn,
  .play-btn {
    min-height: 48px;
  }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .container-nav {
    padding-top: 10px;
    overflow-y: auto;
  }

  .container-nav ul {
    gap: 4px;
  }

  .container-nav a {
    padding: 10px 16px;
  }
}


/* ══════════════════════════════════════════════════════
   AUTH BUTTON + MODAL  —  globale per tutte le pagine
   ══════════════════════════════════════════════════════ */

/* Bottone header */
.auth-btn {
  margin-left: auto;
  margin-right: 50px;
  padding: 9px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(99,102,241,0.45);
  background: rgba(99,102,241,0.1);
  color: #c7d2fe;
  font-family: "Inter", -apple-system, sans-serif;
  transition: all 0.25s ease;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-btn:hover { background:rgba(99,102,241,0.22); border-color:#6366f1; color:#fff; }
.auth-btn.logged-in {
  background: rgba(16,185,129,0.1);
  border-color: rgba(16,185,129,0.4);
  color: #6ee7b7;
}
.auth-btn.logged-in:hover { background:rgba(16,185,129,0.2); }

/* Modal overlay */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(5px);
}
.modal-overlay.active { display: flex; align-items: flex-start; justify-content: flex-end; padding: 80px 24px 0 0; }

.modal-box {
  background: #0d1526;
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 20px;
  width: 360px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(99,102,241,0.08);
  animation: modalSlide 0.32s cubic-bezier(0.16,1,0.3,1);
  position: relative;
}
@keyframes modalSlide {
  from { opacity:0; transform:translateY(-16px) scale(0.97); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}

.modal-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid rgba(99,102,241,0.12);
}
.modal-tab {
  padding: 15px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: "Inter", sans-serif;
  letter-spacing: 0.3px;
}
.modal-tab.active { color: #c7d2fe; background: rgba(99,102,241,0.07); border-bottom-color: #6366f1; }
.modal-tab:hover:not(.active) { color: #94a3b8; background:rgba(255,255,255,0.03); }

.modal-body { padding: 24px 26px 22px; }

.modal-form { display:none; flex-direction:column; gap:14px; }
.modal-form.active { display:flex; }

.form-group { display:flex; flex-direction:column; gap:5px; }
.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}
.form-group input {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: 9px;
  padding: 10px 13px;
  color: #e2e8f0;
  font-size: 14px;
  font-family: "Inter", sans-serif;
  outline: none;
  transition: all 0.2s ease;
}
.form-group input:focus {
  border-color: #6366f1;
  background: rgba(99,102,241,0.06);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.form-group input::placeholder { color: #2d3748; }

.modal-submit {
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: white;
  font-size: 14px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(99,102,241,0.28);
  margin-top: 2px;
}
.modal-submit:hover { transform:translateY(-2px); box-shadow:0 8px 22px rgba(99,102,241,0.42); }
.modal-submit:active { transform:translateY(0); }
.modal-submit:disabled { opacity:0.55; cursor:not-allowed; transform:none; }

.modal-msg {
  font-size: 12px;
  text-align: center;
  padding: 7px 10px;
  border-radius: 8px;
  display: none;
}
.modal-msg.success { display:block; background:rgba(16,185,129,0.1); color:#6ee7b7; border:1px solid rgba(16,185,129,0.2); }
.modal-msg.error   { display:block; background:rgba(239,68,68,0.1);  color:#fca5a5; border:1px solid rgba(239,68,68,0.2); }

.modal-user-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 26px;
  text-align: center;
}
.modal-user-panel.active { display:flex; }
.user-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: white;
  box-shadow: 0 4px 15px rgba(99,102,241,0.35);
}
.user-greeting { font-size: 15px; font-weight: 600; color: #e2e8f0; }
.user-sub      { font-size: 12px; color: #475569; margin-top: 2px; }
.logout-btn {
  padding: 8px 22px;
  border-radius: 9px;
  border: 1px solid rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.07);
  color: #fca5a5;
  font-size: 13px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
}
.logout-btn:hover { background:rgba(239,68,68,0.16); border-color:rgba(239,68,68,0.55); }

.modal-close {
  position: absolute;
  top: 11px; right: 13px;
  background: none;
  border: none;
  color: #334155;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.2s;
}
.modal-close:hover { color:#94a3b8; background:rgba(255,255,255,0.05); }

@media (max-width: 768px) {
  .auth-btn { font-size:12px; padding:7px 12px; margin-right:44px; max-width:110px; }
  .modal-overlay.active { padding: 58px 12px 0; justify-content:center; }
  .modal-box { width:100%; max-width:360px; }
}


/* ── LINK ADMIN NAVBAR ── */
.nav-admin-link {
  color: #f43f5e !important;
}
.nav-admin-link:hover {
  background-color: rgba(244, 63, 94, 0.1) !important;
}
.nav-admin-link.active {
  background: rgba(244, 63, 94, 0.15) !important;
  border-left-color: #f43f5e !important;
}
