/* ============================================================
   სელფი — Games Home
   Minimalist cover grid · dark (#0b0b14) · brand ambient blobs
   ============================================================ */

:root {
  --purple:  #7c3aed;
  --magenta: #e6007e;
  --orange:  #f26822;

  --bg:      #0b0b14;
  --text:    #f4f3fb;
  --text-soft: rgba(244, 243, 251, 0.55);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius-card: 18px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Outfit', 'Noto Sans Georgian', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ----------------------------------------------------------------
   Ambient background
   ---------------------------------------------------------------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  will-change: transform;
}
.blob-1 { background: radial-gradient(circle, var(--purple),  transparent 60%); top: -22vmax; left: -16vmax;  animation: drift1 22s var(--ease) infinite alternate; }
.blob-2 { background: radial-gradient(circle, var(--magenta), transparent 60%); bottom: -26vmax; right: -18vmax; animation: drift2 26s var(--ease) infinite alternate; }
.blob-3 { background: radial-gradient(circle, var(--orange),  transparent 62%); top: 30%; left: 35%; opacity: 0.25; animation: drift3 30s var(--ease) infinite alternate; }

@keyframes drift1 { to { transform: translate(12vmax, 10vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-12vmax, -8vmax) scale(1.1);  } }
@keyframes drift3 { to { transform: translate(-8vmax, 12vmax)  scale(0.85); } }

.grain {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, transparent 40%, rgba(0,0,0,0.55) 100%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 3px);
  opacity: 0.6;
}

/* ----------------------------------------------------------------
   Page layout
   ---------------------------------------------------------------- */
.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top, 0px) + 3rem)
    1.25rem
    calc(env(safe-area-inset-bottom, 0px) + 2.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.25rem;
}

/* ----------------------------------------------------------------
   Hero — logo + title only
   ---------------------------------------------------------------- */
.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  animation: rise 0.55s var(--ease) both;
}

.hero-logo {
  height: 52px;
  width: auto;
  filter: drop-shadow(0 8px 24px rgba(230, 0, 126, 0.35));
}

.hero-title {
  font-size: clamp(1.35rem, 5.5vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.1;
  background: linear-gradient(110deg, #fff 25%, #f0a8d8 58%, #f7b48a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ----------------------------------------------------------------
   Games grid
   ---------------------------------------------------------------- */
.games {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (min-width: 560px) {
  .games { grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
}

/* ----------------------------------------------------------------
   Card — cover image + title
   ---------------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
  animation: rise 0.55s var(--ease) both;
}
.card:nth-child(1) { animation-delay: 0.04s; }
.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.12s; }
.card:nth-child(4) { animation-delay: 0.16s; }
.card:nth-child(5) { animation-delay: 0.20s; }
.card:nth-child(6) { animation-delay: 0.24s; }

.card-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  /* prevent layout shift while image loads */
  isolation: isolate;
}

.card-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.38s var(--ease);
}

.card:hover .card-cover img {
  transform: scale(1.06);
}

.card:active .card-cover img {
  transform: scale(1.02);
  transition-duration: 0.1s;
}

.card:focus-visible .card-cover {
  outline: 2px solid var(--magenta);
  outline-offset: 3px;
}

.card-title {
  font-size: clamp(0.82rem, 2.8vw, 0.95rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text);
  padding: 0 0.1rem;
  /* truncate very long titles on small screens */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ----------------------------------------------------------------
   Footer
   ---------------------------------------------------------------- */
.foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 500;
}
.foot-dot { opacity: 0.4; }

/* ----------------------------------------------------------------
   Keyframes
   ---------------------------------------------------------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

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