* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  min-height: 100dvh;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #0f0f1a;
  color: #f5f5f7;
  overflow-x: hidden;
}

.hub-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.35), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(236, 72, 153, 0.2), transparent),
    linear-gradient(180deg, #12121f 0%, #0a0a12 100%);
}

.hub-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.hub-wrap {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 72px;
  padding-top: max(24px, env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
  max-width: min(100%, calc((100dvh - 140px) * 1.6 + 24px));
  margin: 0 auto;
}

.game-tile {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #1a1a2e;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.game-tile:hover,
.game-tile:focus-visible {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.55);
}

.game-tile:focus-visible {
  outline: 3px solid #818cf8;
  outline-offset: 4px;
}

.game-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.tile-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 48px 20px 20px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.75) 100%);
}

.tile-label h2 {
  font-size: 1.5rem;
  font-weight: 800;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.tile-label p {
  margin-top: 4px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

.hub-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(16px, env(safe-area-inset-bottom));
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
}

.hub-footer a {
  color: rgba(165, 180, 252, 0.9);
  text-decoration: none;
}

.hub-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .hub-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    max-width: 420px;
  }

  .game-tile {
    aspect-ratio: 16 / 10;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-tile {
    transition: none;
  }
}
