/* ============================================================
   GLOBAL CSS - Shared across all pages
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #080c14;
  --bg2:        #0d1420;
  --surface:    #141e2e;
  --surface2:   #1a2640;
  --cyan:       #00e5cc;
  --cyan2:      #00b8a3;
  --cyan-dim:   rgba(0,229,204,0.12);
  --cyan-glow:  rgba(0,229,204,0.25);
  --text:       #e8f4f8;
  --text2:      #8ba5b8;
  --text3:      #4a6278;
  --border:     rgba(0,229,204,0.15);
  --border2:    rgba(0,229,204,0.3);
  --mono:       'Space Mono', monospace;
  --sans:       'Sora', sans-serif;
}

html {
  scrollbar-gutter: stable;
}
html, body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* SHARED LABEL */
.section-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--cyan);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* NAVIGATION */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 64px;
  background: rgba(8, 12, 20, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
}
.nav-logo {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
  text-decoration: none;
}
.nav-logo span { color: var(--cyan); }
.nav-links { display: flex; gap: 32px; }
.nav-link {
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  position: relative;
  padding: 8px 0;
}
.nav-link:hover, .nav-link.active { color: var(--cyan); }
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--cyan);
  transition: width 0.3s ease;
  box-shadow: 0 0 10px var(--cyan-glow);
}
.nav-link.active::after { width: 100%; }

/* TOAST */
.toast-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.toast-overlay.show { opacity: 1; visibility: visible; }
.toast-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 24px 40px;
  text-align: center;
  box-shadow: 0 0 50px var(--cyan-glow), 0 10px 40px rgba(0,0,0,0.6);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.toast-box.error { border-color: #dc3c3c; box-shadow: 0 0 50px rgba(220,60,60,0.3), 0 10px 40px rgba(0,0,0,0.6); }
.toast-icon { font-size: 32px; }
.toast-msg { font-size: 16px; font-weight: 600; }

/* RESPONSIVE GLOBAL */
@media (max-width: 900px) {
  .main-nav { padding: 0 20px; }
  .nav-links { gap: 16px; }
  .nav-link { font-size: 11px; }
}

/* HAMBURGER TOGGLE STYLE */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.nav-toggle .bar {
  width: 100%;
  height: 2px;
  background-color: var(--text);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.3, 1);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
  
  .nav-toggle.open .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  
  .nav-toggle.open .bar:nth-child(2) {
    opacity: 0;
  }
  
  .nav-toggle.open .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 15, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 24px;
    gap: 20px;
    box-sizing: border-box;
    z-index: 999;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
  }
  
  .nav-links.show {
    display: flex;
  }
  
  .nav-link {
    width: 100%;
    padding: 10px 0;
    font-size: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
  }
  .nav-link:last-child {
    border-bottom: none;
  }
}

/* GLOBAL PAGE ENTRANCE ANIMATIONS */
main, .game-viewport {
  animation: pageFadeUp 1.2s cubic-bezier(0.25, 1, 0.3, 1) forwards;
}

@keyframes pageFadeUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
