/* Game Hub — modular arcade homepage */

:root {
  --bg-deep: #080b14;
  --bg-panel: #12182a;
  --bg-elevated: #1a2238;
  --text: #e8eefc;
  --muted: #8b9bb8;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #7c9cff;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  --radius: 18px;
  --font-display: "Press Start 2P", system-ui, sans-serif;
  --font-ui: "Outfit", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--font-ui);
  background:
    radial-gradient(ellipse 90% 50% at 50% -15%, rgba(124, 156, 255, 0.16), transparent),
    radial-gradient(ellipse 40% 35% at 0% 100%, rgba(255, 107, 53, 0.08), transparent),
    radial-gradient(ellipse 40% 35% at 100% 80%, rgba(93, 255, 90, 0.06), transparent),
    var(--bg-deep);
}

body {
  overflow-x: hidden;
}

#app {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Header */
.hub-header {
  text-align: center;
  animation: fadeUp 0.45s ease both;
}

.hub-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.hub-logo {
  font-size: 2.4rem;
  filter: drop-shadow(0 0 18px rgba(124, 156, 255, 0.45));
}

.hub-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 3.5vw, 1.55rem);
  letter-spacing: 0.04em;
  line-height: 1.4;
  background: linear-gradient(120deg, #fff 20%, #7c9cff 55%, #ffd166 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hub-subtitle {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

/* Game grid */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  animation: fadeUp 0.5s ease 0.05s both;
}

.game-card {
  --accent: #7c9cff;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, var(--bg-panel), var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent),
    0 0 40px color-mix(in srgb, var(--accent) 12%, transparent);
}

.game-card.featured {
  grid-column: span 1;
}

@media (min-width: 900px) {
  .game-card.featured {
    /* keep equal cards; featured only affects badge */
  }
}

.game-media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 120px;
  background:
    radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
  border-bottom: 1px solid var(--border);
}

.game-icon {
  font-size: 3.25rem;
  line-height: 1;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
  user-select: none;
}

.badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.badge-featured {
  background: color-mix(in srgb, var(--accent) 22%, #12182a);
  color: #fff;
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.badge-soon {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.game-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.15rem 1.2rem 1.25rem;
  flex: 1;
}

.game-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.game-tagline {
  margin: 0;
  color: color-mix(in srgb, var(--accent) 70%, var(--muted));
  font-size: 0.92rem;
  font-weight: 600;
}

.game-desc {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  flex: 1;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
}

.game-tag {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
}

.game-actions {
  margin-top: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-play {
  color: #0b0f1a;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent) 90%, #fff),
    var(--accent)
  );
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 30%, transparent);
}

.btn-play:hover {
  filter: brightness(1.08);
}

.btn-disabled {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  cursor: not-allowed;
  opacity: 0.75;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

/* Footer */
.hub-footer {
  margin-top: auto;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  animation: fadeUp 0.55s ease 0.1s both;
}

.hub-footer p {
  margin: 0 0 0.75rem;
}

.how-to-add {
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 1rem;
}

.how-to-add summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  user-select: none;
}

.how-to-add ol {
  margin: 0.6rem 0 0.25rem;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.55;
}

.how-to-add li + li {
  margin-top: 0.3rem;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 520px) {
  #app {
    padding: 1.5rem 1rem 2rem;
    gap: 1.5rem;
  }

  .game-icon {
    font-size: 2.75rem;
  }

  .game-media {
    min-height: 100px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
