* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
  min-height: 100vh;
  min-height: 100dvh;
  color: #eef2ff;
  overflow-x: hidden;
}

.hub {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(12px, 3vw, 24px) clamp(10px, 2.5vw, 20px) clamp(24px, 4vw, 48px);
}

.hub-header { margin-bottom: clamp(16px, 3vw, 28px); }

.hub-brand h1 {
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hub-tagline {
  margin-top: 4px;
  color: #94a3b8;
  font-size: clamp(0.8rem, 2.5vw, 0.95rem);
}

.hub-subtitle {
  margin-top: 10px;
  color: #cbd5e1;
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  max-width: 640px;
}

.hub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.hub-filter {
  font-family: inherit;
  font-size: clamp(0.8rem, 2.5vw, 0.9rem);
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
}

.hub-filter:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
}

.hub-filter.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-color: transparent;
  color: white;
}

.hub-count {
  color: #94a3b8;
  font-size: clamp(0.8rem, 2.5vw, 0.9rem);
  margin-bottom: 14px;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(10px, 2vw, 16px);
}

.game-tile {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: clamp(14px, 2vw, 20px);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
}

.game-tile.coming-soon {
  cursor: default;
  opacity: 0.65;
  pointer-events: none;
}

.game-tile.coming-soon:hover {
  transform: none;
  box-shadow: none;
}

.soon-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(251, 191, 36, 0.9);
  color: #78350f;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  z-index: 2;
}

.game-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.35);
  border-color: rgba(102, 126, 234, 0.5);
}

.tile-thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 2vw, 14px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.tile-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(4px, 1.5vw, 8px);
  width: 100%;
  max-width: min(160px, 80%);
}

.tile-preview-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.1rem, 4vw, 1.6rem);
  background: rgba(255,255,255,0.08);
  border-radius: clamp(6px, 1.5vw, 10px);
  border: 1px solid rgba(255,255,255,0.1);
  transition: transform 0.2s ease;
}

.game-tile:hover .tile-preview-cell {
  transform: scale(1.05);
}

.tile-preview-fallback {
  font-size: clamp(2.5rem, 8vw, 3.5rem);
}

.tile-body {
  padding: clamp(10px, 2vw, 16px) clamp(12px, 2.5vw, 18px) clamp(12px, 2.5vw, 18px);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1vw, 6px);
}

.tile-title {
  font-size: clamp(0.95rem, 2.5vw, 1.2rem);
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.2;
}

.tile-subtitle {
  font-size: clamp(0.72rem, 2vw, 0.85rem);
  color: #a5b4fc;
  font-weight: 600;
}

.tile-desc {
  font-size: clamp(0.78rem, 2vw, 0.88rem);
  color: #94a3b8;
  line-height: 1.4;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.tile-chip {
  font-size: clamp(0.62rem, 1.8vw, 0.72rem);
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #cbd5e1;
  text-transform: lowercase;
}

.tile-chip.age { background: rgba(102, 126, 234, 0.25); color: #c7d2fe; }
.tile-chip.time { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.tile-chip.tag { background: rgba(244, 114, 182, 0.2); color: #f9a8d4; }
.tile-chip.diff.easy { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.tile-chip.diff.medium { background: rgba(251, 191, 36, 0.2); color: #fcd34d; }

.hub-footer {
  margin-top: clamp(24px, 4vw, 40px);
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: #64748b;
  font-size: clamp(0.8rem, 2.5vw, 0.9rem);
}

.hub-footer a {
  color: #a5b4fc;
  text-decoration: none;
}

.hub-footer a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .hub-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .hub { padding: 10px 8px 24px; }
  .hub-header { margin-bottom: 12px; }
  .hub-subtitle { display: none; }
  .hub-filter { padding: 8px 12px; font-size: 0.8rem; min-height: 40px; }
  .hub-count { margin-bottom: 10px; }

  .tile-desc { -webkit-line-clamp: 1; }
  .tile-thumb { aspect-ratio: 2 / 1; padding: 6px; }
  .tile-preview-grid { max-width: 90px; gap: 3px; }
  .tile-preview-cell { font-size: 1rem; border-radius: 6px; }
  .tile-body { padding: 8px 10px 10px; gap: 3px; }
}

@media (max-width: 480px) {
  .hub-grid { gap: 7px; }
  .tile-meta .tile-chip.tag { display: none; }
}

@media (max-width: 380px) {
  .hub-brand h1 { font-size: 1.35rem; }
  .tile-title { font-size: 0.88rem; }
  .tile-subtitle { font-size: 0.68rem; }
  .hub-filter { padding: 6px 10px; font-size: 0.75rem; }
}
