/*
  Arcade Vista Portal Styles
  - Designed for the portal pages (home, docs, guides)
  - Internal games keep their own CSS
*/

:root {
  /* Core Palette - Deep, Premium, Modern */
  --bg-0: #050814;
  --bg-1: #0a0f25;
  --surface-0: rgba(255, 255, 255, 0.04);
  --surface-1: rgba(255, 255, 255, 0.08);
  --surface-2: rgba(255, 255, 255, 0.12);
  --border-0: rgba(255, 255, 255, 0.10);
  --border-1: rgba(255, 255, 255, 0.18);

  /* Legacy/Game Compatibility */
  --bg-main: var(--bg-0);
  --font-main: var(--font-primary);
  --accent-primary: var(--accent);
  --surface-hover: var(--surface-2);
  --border-2: var(--border-1);
  --shadow-glow-sm: 0 0 10px var(--accent-glow);
  --shadow-glow-md: 0 0 20px var(--accent-glow);

  --text-0: #ffffff;
  --text-1: rgba(255, 255, 255, 0.85);
  --text-2: rgba(255, 255, 255, 0.60);

  /* Brand Accents */
  --accent: #8b5cf6;
  /* Vivid Purple */
  --accent-2: #06b6d4;
  /* Electric Cyan */
  --accent-glow: rgba(139, 92, 246, 0.5);

  /* Semantic Colors */
  --good: #10b981;
  --warn: #fbbf24;
  --bad: #ef4444;

  /* Sizing & Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  /* Shadows & Glass */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5);
  --glass-blur: 16px;

  --maxw: 1200px;

  /* Global Variables for Games */
  --font-primary: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --accent-gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html,
body {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text-0);
  font-family: 'Outfit', 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  background-color: var(--bg-0);
  background-image:
    radial-gradient(circle at 15% -10%, rgba(139, 92, 246, 0.25), transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(6, 182, 212, 0.20), transparent 45%),
    radial-gradient(circle at 50% 110%, rgba(139, 92, 246, 0.12), transparent 50%);
  background-attachment: fixed;
  overflow-x: hidden;
  line-height: 1.5;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 2000;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  background: rgba(5, 8, 20, 0.6);
  border-bottom: 1px solid var(--border-0);
  transition: all 0.3s ease;
}

.top-nav.is-scrolled {
  background: rgba(5, 8, 20, 0.85);
  border-bottom-color: var(--border-1);
}

.nav-container {
  height: 80px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.nav-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 240px;
  justify-content: flex-end;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-radius: var(--radius-xl);
  background: var(--surface-1);
  border: 1px solid var(--border-0);
  transition: all 0.2s ease;
}

.logo:hover {
  background: var(--surface-2);
  transform: scale(1.02);
  border-color: var(--accent);
}

[data-brand-emoji] {
  font-size: 24px;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.logo-text {
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #fff 40%, var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.search {
  width: min(500px, 100%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: var(--radius-xl);
  background: var(--surface-0);
  border: 1px solid var(--border-0);
  transition: all 0.3s ease;
}

.search:focus-within {
  background: var(--surface-1);
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
  width: min(540px, 100%);
}

.search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
}

.search input::placeholder {
  color: var(--text-2);
}

/* ---------- Hero ---------- */
.hero {
  padding: 60px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 40px;
  align-items: center;
}

.hero-main {
  position: relative;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 24px;
}

.hero-title {
  margin: 0 0 20px;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.95;
  font-weight: 950;
  letter-spacing: -0.05em;
}

.hero-subtitle {
  margin: 0 0 32px;
  color: var(--text-1);
  font-size: 20px;
  max-width: 600px;
  line-height: 1.5;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
  border: 1px solid var(--border-1);
}

.btn-solid {
  background: #fff;
  color: var(--bg-0);
  border: none;
}

.btn-solid:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.15);
  background: var(--accent-2);
  color: #fff;
}

.btn-ghost {
  background: var(--surface-1);
  color: #fff;
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  transform: translateY(-4px);
}

.hero-stats {
  margin-top: 48px;
  display: flex;
  gap: 40px;
}

.stat-num {
  font-size: 32px;
  font-weight: 900;
  color: var(--accent-2);
  line-height: 1;
}

.stat-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

/* ---------- Featured Grid ---------- */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 380px;
}

.featured-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  overflow: hidden;
}

.featured-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.1));
  opacity: 0;
  transition: opacity 0.35s ease;
}

.featured-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--accent);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(139, 92, 246, 0.15);
}

.featured-card:hover::before {
  opacity: 1;
}

.featured-icon {
  position: relative;
  font-size: 32px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
  z-index: 1;
}

.featured-card:hover .featured-icon {
  transform: scale(1.15) rotate(-5deg);
}

.featured-info {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.featured-name {
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  letter-spacing: -0.02em;
}

.featured-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
}

.featured-card-wide {
  grid-column: span 2;
}

/* ---------- Catalog ---------- */
.section-head {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 48px;
}

@media (min-width: 960px) {
  .section-head {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.section-title {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -0.04em;
  margin: 0;
}

.section-desc {
  font-size: 18px;
  color: var(--text-2);
  margin: 8px 0 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chip {
  padding: 12px 24px;
  border-radius: var(--radius-xl);
  background: var(--surface-0);
  border: 1px solid var(--border-0);
  color: var(--text-1);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  background: var(--surface-1);
  border-color: var(--accent);
}

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.game-card {
  position: relative;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface-0);
  border: 1px solid var(--border-0);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.game-card:hover {
  transform: translateY(-8px) scale(1.02);
  background: var(--surface-1);
  border-color: var(--border-1);
  box-shadow: var(--shadow-lg);
}

.game-card:hover::before {
  opacity: 1;
}

.game-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  display: grid;
  place-items: center;
  font-size: 32px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.game-card:hover .game-icon {
  transform: rotate(5deg) scale(1.1);
  background: var(--surface-2);
  border-color: var(--accent);
}

.game-title {
  font-size: 22px;
  font-weight: 900;
  margin: 0;
  letter-spacing: -0.02em;
}

.game-desc {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0;
}

.game-meta {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.pill {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Footer ---------- */
.footer {
  padding: 80px 0 40px;
  border-top: 1px solid var(--border-0);
  background: rgba(5, 8, 20, 0.5);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 60px;
}

.footer-brand {
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.05em;
  margin-bottom: 20px;
  display: block;
}

.footer-head {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-2);
  margin-bottom: 24px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: var(--text-2);
  transition: all 0.2s ease;
  font-size: 15px;
}

.footer-links a:hover {
  color: #fff;
  transform: translateX(4px);
}

.footer-bottom {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid var(--border-0);
  text-align: center;
  color: var(--text-2);
  font-size: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-subtitle {
    margin: 0 auto 32px;
  }

  .hero-actions,
  .hero-stats {
    justify-content: center;
  }

  .hero-side {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-center {
    display: none;
  }

  .nav-left,
  .nav-right {
    min-width: auto;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .hero-title {
    font-size: 48px;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }
}



/* Forms */
.form {
  display: grid;
  gap: 14px;
}

.grid-2 {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: grid;
  gap: 8px;
}

.label {
  font-size: 13px;
  color: rgba(255, 255, 255, .75);
  font-weight: 700;
  letter-spacing: -0.01em;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(0, 0, 0, .18);
  color: rgba(255, 255, 255, .92);
  padding: 12px 14px;
  outline: none;
  box-shadow: none;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, .5);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(155, 255, 235, .28);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, .14);
}

textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.6;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hint {
  margin: 0;
  color: rgba(255, 255, 255, .7);
  font-size: 13px;
}

.link {
  color: rgba(155, 255, 235, 0.92);
  text-decoration: none;
  border-bottom: 1px dotted rgba(155, 255, 235, .42);
}

.link:hover {
  color: rgba(255, 255, 255, .95);
  border-bottom-color: rgba(255, 255, 255, .6);
}

/* Back-compat for older markup that uses .primary */
.btn.primary {
  background: linear-gradient(135deg, rgba(124, 58, 237, 1), rgba(6, 182, 212, 1));
  border-color: rgba(255, 255, 255, .18);
}

/* Global Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 20, 0.85);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 3000;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  padding: 40px;
  border-radius: var(--radius-xl);
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
}

.modal-overlay.show .modal {
  transform: translateY(0);
}

.modal-title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-content {
  margin-bottom: 32px;
  color: var(--text-1);
  font-size: 1.1rem;
}

.modal-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.modal-btn {
  padding: 12px 32px;
  border-radius: var(--radius-full);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border-1);
  font-family: inherit;
}

.modal-btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.modal-btn.secondary {
  background: var(--surface-2);
  color: var(--text-0);
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}