/* ==========================================================================
 * GHZYLAB ARCADE — hub page.
 * Relies on the --arc-* tokens defined in arcade.css (loaded first), so the
 * hub and the in-game switcher share one palette in both themes.
 * ====================================================================== */

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

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

body {
  background:
    radial-gradient(1100px 620px at 50% -18%, var(--arc-cell-hi) 0%, transparent 62%),
    var(--arc-bg);
  color: var(--arc-ink);
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding: calc(22px + var(--arc-sat)) 18px calc(22px + var(--arc-sab));
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Centre a short page instead of stranding it at the top of a tall window.
     `justify-content: center` alone would clip the top on short viewports, so
     the min-height uses dvh and `margin: auto` on the child does the centring
     safely — an overflowing child still keeps its top padding. */
  min-height: 100vh;
  min-height: 100dvh;
}

.wrap { margin: auto; }

.wrap { width: min(760px, 100%); }

/* ------------------------------------------------------------------- header */

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 34px;
}

.eyebrow {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .3em;
  color: var(--arc-dim);
  margin-bottom: 9px;
}

h1 {
  font-size: clamp(1.9rem, 7.4vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: .92;
}
h1 span { color: var(--arc-gold); }

.blurb {
  margin-top: 11px;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--arc-dim);
  max-width: 42ch;
}

.tools { display: flex; gap: 7px; flex: none; }
.tool-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--arc-line);
  border-radius: 11px;
  background: var(--arc-cell);
  color: var(--arc-ink);
  font-family: inherit;
  font-size: .84rem;
  cursor: pointer;
  transition: background .14s, transform .14s;
}
.tool-btn:hover { background: var(--arc-cell-hi); transform: translateY(-1px); }
.tool-btn:active { transform: scale(.93); }

/* -------------------------------------------------------------------- cards */

.games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 15px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 21px 20px 18px;
  border: 1px solid var(--arc-line);
  border-radius: 21px;
  background: var(--arc-panel);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--card-accent, var(--arc-gold));
  box-shadow: 0 18px 42px rgba(0, 0, 0, .26);
}
.card:active { transform: translateY(-1px); }

/* Accent wash, tinted per game via the --card-accent custom property. */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 118px;
  background: radial-gradient(120% 100% at 12% 0%,
              var(--card-accent, var(--arc-gold)) 0%, transparent 68%);
  opacity: .17;
  pointer-events: none;
}

.card-emoji { font-size: 2.1rem; line-height: 1; margin-bottom: 12px; }
.card-name {
  font-size: 1.16rem;
  font-weight: 800;
  letter-spacing: -.01em;
  margin-bottom: 4px;
}
.card-tag {
  font-size: .74rem;
  line-height: 1.5;
  color: var(--arc-dim);
  margin-bottom: 16px;
  min-height: 2.2em;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 17px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 11px;
  border: 1px solid var(--arc-line);
  border-radius: 11px;
  background: var(--arc-cell);
}
.stat-k {
  font-size: .52rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--arc-dim);
}
.stat-v {
  font-size: .95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stat-empty {
  font-size: .7rem;
  color: var(--arc-dim);
  letter-spacing: .02em;
  padding: 4px 0;
}

.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding: 12px 15px;
  border-radius: 13px;
  background: var(--card-accent, var(--arc-gold));
  color: #0c1020;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .1em;
}
html[data-theme="light"] .cta { color: #fff; }
.cta .arrow { transition: transform .18s; }
.card:hover .cta .arrow { transform: translateX(4px); }

.badge-new {
  position: absolute;
  top: 15px; right: 15px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--arc-gold);
  color: #2a1a02;
  font-size: .53rem;
  font-weight: 800;
  letter-spacing: .16em;
}

/* ------------------------------------------------------------------- footer */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 30px;
  padding-top: 17px;
  border-top: 1px solid var(--arc-line);
}
.foot-note { font-size: .66rem; color: var(--arc-dim); letter-spacing: .04em; }
.foot-link {
  padding: 7px 12px;
  border-radius: 10px;
  color: var(--arc-dim);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-decoration: none;
  transition: color .14s, background .14s;
}
.foot-link:hover { color: var(--arc-ink); background: var(--arc-cell); }

@media (max-width: 520px) {
  body { padding-left: 14px; padding-right: 14px; }
  .top { margin-bottom: 24px; }
  .card { padding: 17px 16px 15px; }
  .card-tag { min-height: 0; }
  .games { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .card:hover { transform: none; }
  .card:hover .cta .arrow { transform: none; }
}
