/* =========================================================
   PLAYFORGE — Global Stylesheet
   Design concept: premium gaming platform — deep midnight surfaces
   with electric purple and blue neon accents. "Your world. Your rules."
   ========================================================= */

:root {
  /* Color */
  --bg: #0B0B12;
  --bg-elevated: #11111B;
  --surface: #171326;
  --surface-hover: #211C35;
  --surface-raised: #201B31;
  --border: #302746;
  --border-soft: #211C30;

  --ink: #F5F3FF;
  --ink-muted: #AAA5BC;
  --ink-faint: #77718C;

  --ember: #8B5CF6;
  --ember-hot: #60A5FA;
  --ember-dim: #302052;
  --steel: #60A5FA;
  --steel-dim: #29234D;

  --gradient-ember: linear-gradient(135deg, #8B5CF6 0%, #3B82F6 100%);
  --gradient-steel: linear-gradient(135deg, #6D28D9 0%, #3B82F6 100%);
  --gradient-glow: radial-gradient(circle at 22% 18%, rgba(139,92,246,0.30), transparent 52%), radial-gradient(circle at 78% 28%, rgba(59,130,246,0.22), transparent 48%);

  /* Type */
  --font-display: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --max-width: 1280px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --nav-h: 68px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }

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

ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, button, select, textarea { font-family: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: -0.01em;
  font-weight: 700;
}

p { margin: 0; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 640px) {
  .container { padding: 0 18px; }
}

::selection { background: var(--ember); color: #ffffff; }

:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================
   Buttons
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gradient-ember);
  color: #ffffff;
  box-shadow: 0 8px 24px -8px rgba(139, 92, 246, 0.38);
}
.btn-primary:hover { box-shadow: 0 10px 30px -6px rgba(59, 130, 246, 0.42); transform: translateY(-1px); }

.btn-secondary {
  background: var(--surface-raised);
  color: var(--ink);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-hover); border-color: #3a3b43; }

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--ink); border-color: #3a3b43; }

.btn-sm { padding: 9px 18px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-muted);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn-icon:hover { background: var(--surface-hover); color: var(--ink); }
.btn-icon svg { width: 18px; height: 18px; }

/* =========================================================
   Navigation
   ========================================================= */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(14, 14, 17, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border-soft);
}

.nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  flex-shrink: 0;
}
.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--gradient-ember);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px -4px rgba(139,92,246,0.55), 0 0 24px -8px rgba(59,130,246,0.45);
}
.logo-mark svg { width: 17px; height: 17px; }
.logo-forge { background: linear-gradient(90deg, #60A5FA, #A78BFA); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-link:hover { color: var(--ink); background: var(--surface); }
.nav-link.active { color: var(--ink); background: var(--surface); }

.nav-link .tag-soon {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--steel-dim);
  color: #BFD0FF;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-search-input {
  width: 0;
  opacity: 0;
  padding: 0;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.88rem;
  transition: width 0.28s ease, opacity 0.2s ease, padding 0.28s ease;
  pointer-events: none;
}
.nav-search-wrap.open .nav-search-input {
  width: 200px;
  opacity: 1;
  padding: 0 16px;
  pointer-events: auto;
  margin-right: 4px;
}
@media (max-width: 760px) {
  .nav-search-wrap.open .nav-search-input { width: 140px; }
}

.nav-burger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  align-items: center;
  justify-content: center;
}
.nav-burger svg { width: 20px; height: 20px; color: var(--ink); }

.nav-auth { display: flex; gap: 8px; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-auth .btn-ghost { display: none; }
  .nav-burger { display: flex; }
}

.mobile-menu {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  background: var(--bg-elevated);
  z-index: 99;
  padding: 20px;
  display: none;
  overflow-y: auto;
}
.mobile-menu.open { display: block; }
.mobile-menu .nav-link {
  display: flex;
  padding: 14px 16px;
  font-size: 1.05rem;
  border-bottom: 1px solid var(--border-soft);
  border-radius: 0;
}
.mobile-menu .nav-auth {
  margin-top: 18px;
  flex-direction: column;
}

/* =========================================================
   Section scaffolding
   ========================================================= */

.section { padding: 64px 0; }
.section-tight { padding: 40px 0; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
}

.section-head p {
  color: var(--ink-muted);
  margin-top: 6px;
  font-size: 0.96rem;
}

.section-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--steel);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.section-link svg { width: 15px; height: 15px; }

/* =========================================================
   Chips / badges
   ========================================================= */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--surface-raised);
  color: var(--ink-muted);
  border: 1px solid var(--border);
}

.chip-live {
  color: #C9F4D6;
  background: #16301F;
  border-color: #23452D;
}
.chip-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 0 0 rgba(74,222,128,0.6);
  animation: pulse-dot 1.8s infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.5); }
  70% { box-shadow: 0 0 0 6px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

/* =========================================================
   Game card + thumbnail themes
   ========================================================= */

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

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}
.game-card:hover {
  border-color: #3b3c45;
  transform: translateY(-3px);
  box-shadow: 0 16px 34px -18px rgba(0,0,0,0.6);
}

.game-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.game-thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,0.55) 100%);
}
.game-thumb-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.game-thumb-icon svg {
  width: 46%;
  height: 46%;
  opacity: 0.92;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.35));
}

.fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(11,11,18,0.72);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background 0.18s ease, transform 0.18s ease;
}
.fav-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.fav-btn:hover { transform: scale(1.08); }
.fav-btn.active { color: #A78BFA; filter: drop-shadow(0 0 7px rgba(139,92,246,0.45)); }
.fav-btn.active svg { fill: currentColor; }

.game-info { padding: 14px 16px 16px; }
.game-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
}
.game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.game-category {
  font-size: 0.75rem;
  color: var(--ink-muted);
}
.game-players {
  font-size: 0.75rem;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Thumbnail theme backgrounds — procedural, no image assets */
.thumb-drift { background:
  radial-gradient(120% 90% at 15% 10%, rgba(255,255,255,0.18), transparent 40%),
  repeating-linear-gradient(115deg, rgba(255,255,255,0.08) 0 2px, transparent 2px 46px),
  linear-gradient(135deg, #7A1FE0 0%, #FF3D6E 100%); }

.thumb-islands { background:
  radial-gradient(60% 50% at 30% 30%, rgba(255,255,255,0.25), transparent 60%),
  radial-gradient(40% 40% at 75% 70%, rgba(255,255,255,0.14), transparent 60%),
  linear-gradient(160deg, #1FA2D9 0%, #37E59A 100%); }

.thumb-shadow { background:
  radial-gradient(70% 70% at 70% 30%, rgba(255,80,40,0.35), transparent 60%),
  linear-gradient(180deg, #16181E 0%, #000000 100%); }

.thumb-blocks { background:
  conic-gradient(from 45deg at 30% 40%, rgba(255,255,255,0.12), transparent 25%, rgba(255,255,255,0.12) 50%, transparent 75%),
  linear-gradient(135deg, #2C8C4E 0%, #0E4A2A 100%); }

.thumb-speed { background:
  repeating-linear-gradient(100deg, rgba(255,255,255,0.14) 0 3px, transparent 3px 24px),
  linear-gradient(135deg, #8B5CF6 0%, #3B82F6 100%); }

.thumb-mystery { background:
  radial-gradient(80% 70% at 50% 20%, rgba(130,90,255,0.4), transparent 60%),
  linear-gradient(160deg, #241B3A 0%, #0D0B16 100%); }

.thumb-arena { background:
  radial-gradient(60% 60% at 80% 20%, rgba(255,215,90,0.35), transparent 60%),
  linear-gradient(140deg, #3A2110 0%, #171008 100%); }

.thumb-forest { background:
  radial-gradient(70% 60% at 25% 75%, rgba(140,255,170,0.3), transparent 60%),
  linear-gradient(150deg, #0E3B2E 0%, #0B1F1C 100%); }

/* =========================================================
   Footer
   ========================================================= */

.footer {
  border-top: 1px solid var(--border-soft);
  background: var(--bg-elevated);
  padding: 56px 0 28px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 40px;
}

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

.footer-brand p {
  color: var(--ink-muted);
  font-size: 0.88rem;
  margin-top: 12px;
  max-width: 260px;
}

.footer-col h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
}

.footer-col li { margin-bottom: 10px; }
.footer-col a, .footer-col button {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.86rem;
  color: var(--ink-muted);
  transition: color 0.15s ease;
}
.footer-col a:hover, .footer-col button:hover { color: var(--ink); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.social-row { display: flex; gap: 8px; }

/* =========================================================
   Toast (lightweight "coming soon" / feedback messages)
   ========================================================= */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 13px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 14px 34px -14px rgba(0,0,0,0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 90vw;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast svg { width: 16px; height: 16px; color: var(--ember-hot); flex-shrink: 0; }

/* =========================================================
   Utility
   ========================================================= */

.text-muted { color: var(--ink-muted); }
.text-faint { color: var(--ink-faint); }
.hidden { display: none !important; }
.mt-0 { margin-top: 0; }
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ember); color: #ffffff; padding: 10px 16px; border-radius: 8px; z-index: 999;
}
.skip-link:focus { left: 12px; top: 12px; }


/* PLAYFORGE neon identity polish */
.nav { box-shadow: 0 8px 30px rgba(0,0,0,0.18); }
.nav-link.active { box-shadow: inset 0 0 0 1px rgba(139,92,246,0.16); }
.btn-primary { box-shadow: 0 8px 26px -10px rgba(139,92,246,0.72), 0 0 22px -14px rgba(59,130,246,0.8); }
.btn-primary:hover { box-shadow: 0 10px 30px -7px rgba(139,92,246,0.72), 0 0 26px -12px rgba(59,130,246,0.8); }
:focus-visible { outline-color: #8B5CF6; box-shadow: 0 0 0 4px rgba(139,92,246,0.14); }
