/* =====================================================================
   LIVECADE ARCADE — GAME HUB STYLESHEET
   ===================================================================== */

:root {
  --font-display: 'Segoe UI Rounded', 'SF Pro Rounded', 'Trebuchet MS', 'Arial Rounded MT Bold', system-ui, -apple-system, sans-serif;
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', Consolas, 'Courier New', monospace;
  --bg-panel: rgba(15, 23, 42, 0.88);
  --bg-card: rgba(2, 6, 23, 0.62);
  --bg-input: #0f172a;
  --border-subtle: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --emerald: #34d399;
  --cyan: #22d3ee;
  --rose: #fb7185;
  --amber: #fbbf24;
  --purple: #c084fc;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: radial-gradient(circle at 20% 20%, #111827 0%, #07090e 60%, #030508 100%);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 80% 10%, rgba(52, 211, 153, 0.10), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(34, 211, 238, 0.08), transparent 45%);
  z-index: 0;
}

.font-display { font-family: var(--font-display); letter-spacing: 0.01em; }
.font-mono { font-family: var(--font-mono); }

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.55); }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, 0.55); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.85); }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 8px; }

/* ---------------------------------------------------------------------
   APP SHELL
   --------------------------------------------------------------------- */
.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 20px 60px;
}

/* ---------------------------------------------------------------------
   TOPBAR
   --------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  margin-bottom: 22px;
  background: rgba(7, 9, 14, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.9);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark {
  width: 42px; height: 42px;
  flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
  box-shadow: 0 8px 22px -8px rgba(16, 185, 129, 0.9), inset 0 0 0 1px rgba(255,255,255,0.22);
}

.brand-text { min-width: 0; }
.brand-title { font-family: var(--font-display); font-size: 17px; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  color: #6ee7b7;
  background: rgba(6, 78, 59, 0.5);
  border: 1px solid rgba(52, 211, 153, 0.4);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,0.7); animation: livePulse 1.8s infinite; }
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(52,211,153,0.65); }
  70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}

.top-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  font-size: 12px; font-weight: 700;
  color: #e2e8f0;
  text-decoration: none;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-subtle);
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.top-link:hover { background: rgba(51, 65, 85, 0.85); border-color: var(--border-strong); transform: translateY(-1px); }
.top-link:active { transform: translateY(0) scale(0.98); }

/* ---------------------------------------------------------------------
   HERO / FEATURED
   --------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 18px;
  margin-bottom: 26px;
}
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }

.hero-copy {
  position: relative;
  overflow: hidden;
  padding: 26px 26px 24px;
  border-radius: 26px;
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(16, 185, 129, 0.16), transparent 55%),
    var(--bg-panel);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 25px 60px -30px rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  align-self: flex-start;
  padding: 5px 12px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  border-radius: 999px;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, #f8fafc 0%, #6ee7b7 55%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc { font-size: 13.5px; line-height: 1.6; color: #cbd5e1; max-width: 52ch; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px;
  font-family: var(--font-sans);
  font-size: 13px; font-weight: 800;
  color: #020617;
  text-decoration: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #34d399 0%, #22d3ee 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 14px 30px -12px rgba(52, 211, 153, 0.85);
  transition: transform 0.12s ease, filter 0.15s ease;
}
.btn-primary:hover { filter: brightness(1.07); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  font-size: 13px; font-weight: 700;
  color: #e2e8f0;
  text-decoration: none;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-subtle);
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn-ghost:hover { background: rgba(51, 65, 85, 0.85); transform: translateY(-2px); }

.hero-stats {
  display: flex; flex-wrap: wrap; gap: 20px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.stat-num { font-family: var(--font-display); font-size: 18px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 700; margin-top: 4px; }

/* Featured preview panel */
.hero-preview {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background:
    radial-gradient(circle at 50% 30%, rgba(52, 211, 153, 0.35), transparent 60%),
    linear-gradient(160deg, #0f2a20 0%, #071a14 60%, #040d0a 100%);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.95), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  min-height: 260px;
  isolation: isolate;
}
.hero-preview::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(52, 211, 153, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52, 211, 153, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 50%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 20%, transparent 78%);
  z-index: -1;
}
.preview-emoji {
  font-size: 92px;
  line-height: 1;
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 34px rgba(52, 211, 153, 0.4));
  animation: bob 3.4s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }

.preview-badge {
  position: absolute; top: 14px; left: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
  border-radius: 999px;
  color: #020617;
  background: linear-gradient(90deg, #34d399, #fbbf24);
}
.preview-caption {
  position: absolute; bottom: 14px; left: 0; right: 0;
  text-align: center;
  font-size: 10px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: #a7f3d0;
  opacity: 0.85;
}

/* ---------------------------------------------------------------------
   TOOLBAR (search + filters)
   --------------------------------------------------------------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.search-wrap {
  position: relative;
  flex: 1 1 260px;
  min-width: 200px;
}
.search-wrap svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; stroke: #64748b; pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: #fff;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-input::placeholder { color: #64748b; }
.search-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15); }

.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 10px 16px;
  font-family: var(--font-sans);
  font-size: 12px; font-weight: 700;
  color: #94a3b8;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover { color: #e2e8f0; border-color: var(--border-strong); }
.chip.active {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.6);
}

.continue-chip {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 12px; font-weight: 700;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.12);
  border: 1px dashed rgba(251, 191, 36, 0.5);
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.15s ease;
}
.continue-chip.visible { display: inline-flex; }
.continue-chip:hover { background: rgba(245, 158, 11, 0.22); }

.results-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 14px;
}
.results-count strong { color: #e2e8f0; font-weight: 800; }

/* ---------------------------------------------------------------------
   GAME GRID
   --------------------------------------------------------------------- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 20px 44px -30px rgba(0, 0, 0, 0.95);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s ease, box-shadow 0.18s ease;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(52, 211, 153, 0.5);
  box-shadow: 0 28px 55px -28px rgba(52, 211, 153, 0.35);
}
.game-card.is-soon { opacity: 0.78; }
.game-card.is-soon:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 20px 44px -30px rgba(0, 0, 0, 0.95);
}
.game-card[hidden] { display: none; }

.card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 25% 0%, var(--c1, #34d399), transparent 62%),
    linear-gradient(140deg, var(--c2, #0ea5e9), #0b1220 88%);
}
.card-thumb::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.14) 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: 0.55;
  mask-image: radial-gradient(circle at 70% 30%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 70% 30%, #000, transparent 75%);
}
.thumb-emoji {
  position: relative;
  font-size: 56px;
  line-height: 1;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
  transition: transform 0.25s ease;
}
.game-card:hover .thumb-emoji { transform: scale(1.08) rotate(-3deg); }

.status-badge {
  position: absolute;
  top: 10px; right: 10px;
  padding: 3px 9px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.status-badge.live {
  color: #020617;
  background: linear-gradient(90deg, #34d399, #a7f3d0);
  box-shadow: 0 6px 16px -6px rgba(52, 211, 153, 0.9);
}
.status-badge.soon {
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-strong);
}

.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.card-title {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 800; line-height: 1.2;
  letter-spacing: -0.01em;
}
.card-sub { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-top: -4px; }
.card-desc { font-size: 12px; line-height: 1.55; color: #cbd5e1; flex: 1; }

.card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.tag {
  padding: 3px 8px;
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.02em;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.13);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 999px;
}

.card-cta {
  display: inline-flex; align-items: center; justify-content: space-between;
  margin-top: 6px;
  padding: 9px 12px;
  font-size: 12px; font-weight: 800;
  border-radius: 12px;
  color: #020617;
  background: linear-gradient(135deg, #34d399, #22d3ee);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: filter 0.15s ease;
}
.game-card:hover .card-cta { filter: brightness(1.08); }
.card-cta.is-soon {
  color: #94a3b8;
  background: rgba(30, 41, 59, 0.8);
  border: 1px dashed var(--border-strong);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-subtle);
  border-radius: 22px;
  font-size: 13px;
}
.empty-state .big { font-size: 34px; display: block; margin-bottom: 10px; opacity: 0.6; }

/* ---------------------------------------------------------------------
   FOOTER
   --------------------------------------------------------------------- */
.site-footer {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.site-footer .links { display: flex; flex-wrap: wrap; gap: 16px; }
.site-footer a { color: #94a3b8; text-decoration: none; font-weight: 600; transition: color 0.15s ease; }
.site-footer a:hover { color: #6ee7b7; }

/* ---------------------------------------------------------------------
   TOAST
   --------------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  z-index: 999;
  padding: 12px 20px;
  font-size: 12.5px; font-weight: 700;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: 0 20px 44px -16px rgba(0, 0, 0, 0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------------------- */
@media (max-width: 640px) {
  .app { padding: 14px 14px 48px; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .topbar-right { width: 100%; justify-content: flex-end; }
  .hero-copy { padding: 22px 20px; }
  .hero-stats { gap: 16px; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
  .thumb-emoji { font-size: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}