/* The home page: three big choices (Party Night, Make a game, Play & challenge).
   body.home-mode is on while they show; picking a game turns it off (js/home.js). */

/* ---------- Which pieces show ---------- */
.hub,
.back-home { display: none; }
body.home-mode .hub { display: grid; }
body:not(.home-mode) .back-home { display: inline-block; }
body.home-mode .stage,
body.home-mode .remix { display: none; }

/* ---------- Layout while the choices show ---------- */
.hub { grid-column: 1 / -1; }
body.home-mode .layout {
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  grid-template-rows: auto auto;
  grid-template-areas:
    "hub  hub"
    "make feed";
}
body.home-mode .hub { grid-area: hub; }
body.home-mode .feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---------- The three cards ---------- */
.hub {
  gap: var(--gap-lg);
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
}
.hub-card {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
  padding: var(--gap-lg);
  border-radius: var(--radius-lg);
  background: var(--color-panel);
  border: 1px solid var(--color-line);
}
.hub-card h2 { font-size: calc(var(--text-xl) * 1.2); }
.hub-card p { margin: 0; color: var(--color-text-muted); font-weight: 600; }
.hub-card > button { margin-top: auto; }

.hub-party { border-color: var(--color-accent); box-shadow: var(--glow-accent); }
.hub-make { border-color: color-mix(in srgb, var(--color-accent-2) 50%, transparent); }
.hub-play { border-color: color-mix(in srgb, var(--color-gold) 50%, transparent); }

/* Party games inside the Party Night card */
.hub-games { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--gap-md); }
.hub-game {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--gap-md);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-well);
  border: 1px solid var(--color-line-strong);
}
.hub-game:hover { border-color: var(--color-accent); box-shadow: var(--glow-accent); }
.hub-game b { font-size: var(--text-lg); }
.hub-game span { color: var(--color-text-muted); font-size: var(--text-sm); font-weight: 600; }
.hub-game .facts { color: var(--color-gold); font-size: var(--text-xs); }
.hub-game .go {
  align-self: flex-start;
  margin-top: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  color: var(--color-on-accent);
  background: var(--color-accent);
}

.hub-join { display: flex; gap: var(--gap-sm); }
.hub-join input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .2em; font-weight: 700; }
.hub-join input::placeholder { letter-spacing: normal; text-transform: none; }

/* Game of the day inside the Play & challenge card */
.hub-featured { display: flex; flex-direction: column; gap: 6px; }
.hub-featured .label { color: var(--color-gold); font-weight: 700; font-size: var(--text-sm); }
.hub-featured .card .text { flex: 1; }
.hub-featured .card .go { color: var(--color-accent-2); font-weight: 700; }

/* "← Home" above the game */
.back-home { color: var(--color-text-muted); font-weight: 700; text-decoration: none; }
.back-home:hover { color: var(--color-accent-2); }

/* ---------- Tablets ---------- */
@media (max-width: 1100px) {
  .hub { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hub-party { grid-column: 1 / -1; }
}

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  .hub { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  body.home-mode .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "hub" "make" "feed";
  }
  body.home-mode .feed { grid-template-columns: minmax(0, 1fr); }
}
