/* css/main.css */

:root {
  /* --- Palette: Cyber-Midnight --- */
  --bg-deep: #020617;       
  --bg-surface: #0f172a;    
  --bg-glass: rgba(30, 41, 59, 0.7); 
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  
  --accent-primary: #FFD700; 
  --accent-glow: #38bdf8;    
  --danger: #ef4444;
  --success: #10b981;

  /* --- Dimensions & Spacing --- */
  --header-height: 80px;
  --max-width: 1200px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  
  /* --- Effects --- */
  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.15);
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Base Reset --- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  
  /* Modern Mesh Gradient Background */
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.08), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(255, 215, 0, 0.03), transparent 25%);
}

/* --- Typography --- */
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
a { text-decoration: none; color: inherit; transition: all 0.2s ease; }
p { color: var(--text-secondary); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -120px;
  z-index: 2000;
  background: #ffffff;
  color: #020617;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 2px solid #0ea5e9;
  font-weight: 700;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 1rem;
}

a:focus-visible,
button:focus-visible,
.btn-action:focus-visible,
.nav-link:focus-visible,
.mobile-toggle:focus-visible {
  outline: 3px solid #38bdf8;
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main { flex: 1; padding: 3rem 0; }

/* --- 1. The Header --- */
.site-header {
  height: var(--header-height);
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: block;
  width: 180px;
  height: auto;
}
.brand-logo img { width: 100%; display: block; }

.nav-desktop { display: flex; gap: 2rem; }

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
  position: relative;
  padding: 0.5rem 0;
}

.nav-link:hover, .nav-link.active { color: var(--text-primary); }

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent-primary);
  transition: width 0.3s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.mobile-toggle { display: none; background: none; border: none; color: white; cursor: pointer; }

/* --- 2. The Game Grid (Dashboard Style) --- */
.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

/* --- 3. The Glass Card --- */
.game-card {
  background: var(--bg-glass);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow);
  border-color: rgba(56, 189, 248, 0.3);
}

.card-media {
  aspect-ratio: 16/9;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* WIDTH 60% ensures the ship is large and centered */
.card-media img {
  width: 60%;
  height: auto;
  transition: transform 0.5s ease;
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.4));
}
.game-card:hover .card-media img { transform: scale(1.05); }

.card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title { font-size: 1.25rem; margin-bottom: 0.5rem; color: var(--text-primary); }
.card-desc { font-size: 0.9rem; margin-bottom: 1.5rem; line-height: 1.5; }

.card-meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
  /* Removed display: inline-block to fix vertical alignment shift */
}

/* UPDATED: Slower pulse (4s) */
.badge.live { 
  background: rgba(16, 185, 129, 0.15); color: #34d399; 
  border: 1px solid rgba(16, 185, 129, 0.3);
  animation: pulse-green-glow 4s infinite ease-in-out; /* Changed from 3s to 4s */
}
.badge.soon { background: rgba(255, 255, 255, 0.05); color: #94a3b8; border: 1px solid rgba(255, 255, 255, 0.1); }

.btn-action {
  background: var(--accent-primary);
  color: #000;
  font-weight: 700;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.btn-action:hover {
  background: #fff;
  box-shadow: 0 0 15px var(--accent-primary);
}

.content-wrapper {
  background: var(--bg-glass);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  max-width: 800px;
  margin: 0 auto;
}
.page-header { margin-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 1rem; }
.text-block p { margin-bottom: 1.5rem; }
.text-block ul { color: var(--text-secondary); margin-bottom: 1.5rem; padding-left: 1.5rem; }

/* --- 5. The Footer --- */
.site-footer {
  background: var(--bg-surface);
  border-top: var(--glass-border);
  padding: 1.25rem 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}
.footer-brand p { margin: 0; }

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--success);
  font-size: 0.85rem;
  font-weight: 600;
}
.status-dot {
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }

/* Keyframes: Pure Glow, No Movement */
@keyframes pulse-green-glow { 
  0%, 100% { 
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.2); 
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
  } 
  50% { 
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5); 
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.5);
  } 
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  .nav-desktop { display: none; }
  
  .header-inner { justify-content: center; }
  .mobile-toggle { position: absolute; left: 1.5rem; }
  
  .content-wrapper { padding: 1.5rem; }
  
  .footer-inner { flex-direction: column; text-align: center; gap: 0.75rem; }
  .footer-nav a { margin: 0 0.75rem; }

  /* Active State for Mobile Menu */
  .nav-desktop.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: rgba(2, 6, 23, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    gap: 1.5rem;
    z-index: 999;
  }
}

/* --- 6. Error 404 Experience --- */
.error-page-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.25;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03) 0,
    rgba(255, 255, 255, 0.03) 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 4px
  );
}

.error-page-wrap {
  position: relative;
  z-index: 3;
  max-width: 980px;
  margin: 0 auto;
  padding: 2.25rem;
  background: var(--bg-glass);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow);
}

.error-page-topline {
  display: inline-block;
  margin: 0;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
  color: #7dd3fc;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.error-page-title {
  margin: 0.85rem 0 0;
  position: relative;
  font-size: clamp(3rem, 13vw, 7rem);
  line-height: 0.9;
  color: var(--text-primary);
  text-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

.error-page-title::before,
.error-page-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.6;
}

.error-page-title::before {
  color: #7dd3fc;
  transform: translate(2px, -1px);
  animation: glitch-a 3.2s infinite steps(1);
}

.error-page-title::after {
  color: #facc15;
  transform: translate(-2px, 1px);
  animation: glitch-b 2.8s infinite steps(1);
}

.error-page-lead {
  max-width: 68ch;
  margin: 1rem 0 1.4rem;
}

.error-page-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin: 1.5rem 0 2rem;
}

.error-page-card {
  min-height: 108px;
  position: relative;
  overflow: hidden;
  padding: 0.9rem;
  border-radius: 12px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.error-page-card::after {
  content: "";
  position: absolute;
  inset: -50% auto auto -40%;
  width: 60%;
  height: 200%;
  opacity: 0.25;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: rotate(20deg);
  animation: sweep 5s linear infinite;
}

.error-page-label {
  margin: 0 0 0.45rem;
  color: #cbd5e1;
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.error-page-value {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 800;
}

.error-page-value--warn {
  color: var(--accent-primary);
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
}

.error-page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.error-page-btn {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  padding: 0.5rem 1.05rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.error-page-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.error-page-ticker {
  margin-top: 1.6rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 215, 0, 0.35);
  background: rgba(255, 215, 0, 0.08);
}

.error-page-ticker-track {
  display: flex;
  gap: 2rem;
  padding: 0.55rem 1rem;
  white-space: nowrap;
  color: #fde68a;
  font-size: 0.9rem;
  font-weight: 700;
  animation: scroll-ticker 22s linear infinite;
}

@keyframes sweep {
  from { transform: translateX(0) rotate(20deg); }
  to { transform: translateX(320%) rotate(20deg); }
}

@keyframes scroll-ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes glitch-a {
  0%, 86%, 100% { clip-path: inset(0 0 0 0); }
  87% { clip-path: inset(12% 0 70% 0); }
  89% { clip-path: inset(68% 0 10% 0); }
  91% { clip-path: inset(40% 0 35% 0); }
  93% { clip-path: inset(0 0 0 0); }
}

@keyframes glitch-b {
  0%, 82%, 100% { clip-path: inset(0 0 0 0); }
  83% { clip-path: inset(55% 0 16% 0); }
  85% { clip-path: inset(4% 0 80% 0); }
  87% { clip-path: inset(27% 0 53% 0); }
  89% { clip-path: inset(0 0 0 0); }
}

@media (max-width: 768px) {
  .error-page-wrap { padding: 1.5rem; }
  .error-page-actions .btn-action,
  .error-page-actions .error-page-btn {
    width: 100%;
    text-align: center;
  }
}

