/* Game Hub — dark, modern landing page to choose a game. */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #0b1020;
  --ink: #eef1ff;
  --ink-soft: #9aa3c7;
  --card: rgba(23, 30, 56, 0.72);
  --border: rgba(255, 255, 255, 0.09);
  --radius: 26px;
}

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

body {
  font-family: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- animated background ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: float 18s ease-in-out infinite;
}
.orb-1 { width: 420px; height: 420px; background: #2563eb; top: -140px; left: -120px; }
.orb-2 { width: 360px; height: 360px; background: #db2777; bottom: -120px; right: -80px; animation-delay: -6s; }
.orb-3 { width: 300px; height: 300px; background: #14b8a6; top: 40%; left: 52%; opacity: 0.35; animation-delay: -11s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(30px, -24px) scale(1.08); }
}
.bg .grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
}

/* ---------- layout ---------- */
main, header, footer { position: relative; z-index: 1; }
main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 22px 60px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 78px 22px 34px;
}
.logo {
  font-size: 62px;
  line-height: 1;
  display: inline-block;
  filter: drop-shadow(0 12px 26px rgba(59, 130, 246, 0.45));
  animation: bob 3.4s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-12px) rotate(6deg); } }

.hero-title {
  font-size: clamp(40px, 9vw, 72px);
  font-weight: 700;
  letter-spacing: -1.5px;
  margin-top: 10px;
  background: linear-gradient(100deg, #ffffff 10%, #93c5fd 45%, #f9a8d4 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { color: var(--ink-soft); font-size: clamp(1rem, 2.4vw, 1.2rem); margin-top: 8px; }

/* ---------- game grid ---------- */
.games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
  margin-top: 12px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 24px 22px;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1), border-color 0.22s, box-shadow 0.22s;
  animation: rise 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }

.card::before {
  content: '';
  position: absolute; inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--a1, #7c3aed), var(--a2, #22d3ee));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.55;
  transition: opacity 0.22s;
  z-index: 2;
  pointer-events: none;
}
.card-glow {
  position: absolute;
  top: -60px; right: -60px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--a1, #7c3aed), transparent 68%);
  opacity: 0.22;
  filter: blur(24px);
  transition: opacity 0.25s, transform 0.25s;
  z-index: 0;
}

.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-icon {
  font-size: 46px;
  line-height: 1;
  width: 76px; height: 76px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 20px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--a1) 32%, transparent), color-mix(in srgb, var(--a2) 32%, transparent));
  border: 1px solid var(--border);
  box-shadow: inset 0 -6px 14px rgba(0, 0, 0, 0.25);
}
.card-players {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 600; color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 999px;
}
.players-ico { font-size: 0.9rem; }

.card-title { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.4px; margin-top: 4px; }
.card-tagline {
  font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
  color: var(--a1, #7c3aed);
  filter: brightness(1.6);
}
.card-desc { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.5; flex: 1; }

.card-modes { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 0.78rem; font-weight: 600;
  padding: 5px 12px; border-radius: 999px;
  color: var(--ink);
  background: linear-gradient(135deg, color-mix(in srgb, var(--a1) 30%, transparent), color-mix(in srgb, var(--a2) 30%, transparent));
  border: 1px solid var(--border);
}

.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 6px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 0.72rem; color: var(--ink-soft); background: rgba(255, 255, 255, 0.05); padding: 4px 10px; border-radius: 8px; }
.play {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 700; font-size: 0.95rem; white-space: nowrap;
  background: linear-gradient(135deg, var(--a1, #7c3aed), var(--a2, #22d3ee));
  color: #fff;
  padding: 10px 18px; border-radius: 999px;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--a1) 35%, transparent);
  transition: transform 0.18s, filter 0.18s;
}
.arrow { transition: transform 0.18s; }

/* hover (mouse only) */
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-6px); border-color: transparent; box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5); }
  .card:hover::before { opacity: 1; }
  .card:hover .card-glow { opacity: 0.4; transform: scale(1.15); }
  .card:hover .play { transform: scale(1.05); filter: brightness(1.08); }
  .card:hover .arrow { transform: translateX(4px); }
}
.card:active { transform: scale(0.985); }

/* ---------- states & footer ---------- */
.loading, .empty { text-align: center; color: var(--ink-soft); padding: 40px 0; font-weight: 600; }
.hidden { display: none !important; }

.foot {
  position: relative; z-index: 1;
  text-align: center;
  padding: 26px 20px calc(30px + env(safe-area-inset-bottom));
  color: var(--ink-soft);
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22d3ee; box-shadow: 0 0 10px #22d3ee; animation: blink 2s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

@media (max-width: 520px) {
  .hero { padding: 52px 18px 26px; }
  .logo { font-size: 50px; }
  .card { padding: 22px 18px 18px; }
  .card-icon { width: 64px; height: 64px; font-size: 38px; }
}
