/* The three landing pages: the game hub, /puzzles/ and /learn/ (see shared/hub.js). */
.hero {
  text-align: center;
  padding: 12px 16px 20px;
  background:
    radial-gradient(circle at 12% 30%, #ffe28a 0 60px, transparent 61px),
    radial-gradient(circle at 88% 20%, #c9f2dc 0 80px, transparent 81px),
    radial-gradient(circle at 75% 90%, #e2dcff 0 50px, transparent 51px);
}
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); letter-spacing: -.5px; }
.hero h1 span { color: var(--primary); }
.hero p { color: var(--muted); font-size: 1.15rem; margin: 10px auto 0; max-width: 560px; }

/* Top bar: studio link on the left, who is playing and sound on the right */
.hub-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 1180px; margin: 0 auto 20px; min-height: 52px; }
.studio-link {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--ink); text-decoration: none;
  padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, .7); white-space: nowrap;
}
.studio-link:hover { background: #f3e9d6; }
.hub-bar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hub-bar-right > .icon-btn, .player > .btn { flex: none; }
.player { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* Only the name shrinks when space is tight */
.player-chip { min-width: 0; }
.player-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14ch; min-width: 0; }
.player-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 16px 6px 8px;
  border-radius: 999px; background: var(--card); border: 2px solid var(--line); font-weight: 900; font-size: 1.1rem;
}
.player-chip .avatar { font-size: 1.8rem; line-height: 1; }
@media (max-width: 560px) {
  .studio-link .long, .player .label { display: none; }
  .player-chip { padding-right: 12px; }
  .player-chip span:last-child { max-width: 8ch; }
}
@media (max-width: 360px) {
  .hub-bar { gap: 6px; }
  .studio-link { padding: 8px; }
  .player-chip { padding: 4px 8px; gap: 4px; }
  .player-chip span:last-child { display: none; }   /* avatar only on very narrow phones */
  .player-chip .avatar { font-size: 1.5rem; }
}

/* Games · Puzzles · Learn a skill */
.sections { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.section-link {
  font-weight: 900; text-decoration: none; color: var(--ink); background: rgba(255, 255, 255, .75);
  border: 2px solid var(--line); border-radius: 999px; padding: 10px 18px; min-height: 44px;
  display: inline-flex; align-items: center;
}
.section-link:hover { background: #fff; }
.section-link[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: #fff; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 8px 16px 20px; }
.filter {
  font: inherit; font-weight: 800; cursor: pointer;
  padding: 10px 18px; min-height: 44px; border-radius: 999px;
  border: 2px solid var(--line); background: var(--card); color: var(--ink);
}
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  max-width: 1180px; margin: 0 auto; padding: 0 16px 48px;
}
.game {
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit; overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
a.game:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 8px 0 rgba(43, 35, 80, .12), 0 16px 32px rgba(43, 35, 80, .12); }
.game .art { height: 130px; display: grid; place-items: center; font-size: 64px; background: var(--tint); }
.game .info { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.game h2 { font-size: 1.3rem; }
.game p { margin: 0; color: var(--muted); line-height: 1.4; flex: 1; }
.game .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.game .progress { font-weight: 800; font-size: .9rem; color: var(--good-dark); min-height: 1.2em; }
.game.soon { opacity: .6; }
.game.soon .art { filter: grayscale(.6); }
.soon-label { font-size: .9rem; font-weight: 800; color: var(--muted); }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px; }

footer { text-align: center; color: var(--muted); padding: 0 16px 32px; font-size: .95rem; }
footer a { color: var(--muted); font-weight: 700; }
