/* ============================================================
   Freedom35 Studios — the catalogue layer.

   base.css and theme.css come from the F35 WebKit unchanged and
   still do all the work: type scale, buttons, containers,
   sections, header, footer, forms. Nothing in this file
   redefines any of that.

   What a games site needs on top is only ever about ARTWORK:
   somewhere for a cover to be big, somewhere for screenshots to
   run in a row, and a shelf that keeps its shape whether it
   holds one game or thirty. That is all this file is.
   ============================================================ */

/* ---------- The shelf ---------- */

.game-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.game-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .18s ease, border-color .18s ease;
}
.game-card:hover,
.game-card:focus-visible { transform: translateY(-3px); border-color: var(--brand); }

/* A fixed 16:9 window, so a shelf of covers lines up even when the
   creators uploaded whatever their screenshot key produced. */
.game-card__art {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
}
.game-card__art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-card__blank {
  display: block; width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--surface-2), var(--dark));
}

.game-card__body { display: block; padding: 16px 18px 20px; }
.game-card__body strong { display: block; font-family: var(--font-display, inherit); font-size: 1.05rem; }
.game-card__tag { display: block; margin-top: 6px; color: var(--muted); font-size: .92rem; }
.game-card__by { display: block; margin-top: 10px; color: var(--brand-dark); font-size: .84rem; }

/* ---------- One game ---------- */

.game-hero { padding: 44px 0 28px; border-bottom: 1px solid var(--line-soft); }
.game-hero__grid {
  display: grid; gap: 34px; align-items: center;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}
.game-hero__art img {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface-2);
}
.game-hero__text h1 { margin: 8px 0 10px; }
.byline { color: var(--muted); margin: 0 0 20px; }
.byline a { color: var(--brand-dark); }

.rel-row { flex-wrap: wrap; align-items: center; gap: 12px; }
.rel-meta { color: var(--muted); font-size: .84rem; }
.tag-row { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-row .pill { text-decoration: none; }

.game-body {
  display: grid; gap: 40px;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: start;
}
.game-about h2 { margin-top: 0; }

.spec { margin: 26px 0 0; display: grid; gap: 10px; }
.spec > div { display: flex; gap: 12px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.spec dt { color: var(--muted); min-width: 110px; margin: 0; }
.spec dd { margin: 0; }

/* ---------- Screenshots ----------
   A horizontal strip that scrolls rather than wrapping. Wrapping
   would let two screenshots decide the height of the whole page
   on a phone. */
.shot-strip {
  display: flex; gap: 14px; overflow-x: auto;
  padding-bottom: 10px; scroll-snap-type: x mandatory;
}
.shot { margin: 0; flex: 0 0 auto; scroll-snap-align: start; }
.shot img {
  height: 260px; width: auto; display: block;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
}

/* ---------- The wall ---------- */

.paywall {
  border: 1px solid var(--brand);
  background: var(--brand-soft);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.paywall h3 { margin: 0 0 8px; }
.paywall p { margin: 0 0 14px; color: var(--body); }
.paywall p:last-child { margin-bottom: 0; }

.lib-card { padding: 16px 18px; margin-top: 18px; }

/* ---------- Save files ----------
   The rows carry four buttons on a narrow column, so they wrap rather than
   squeezing the name into nothing. `.row-list` already wraps; this only stops
   the buttons stretching to fill a line of their own. */
.saves-card { padding: 18px 20px; margin-top: 18px; }
.saves-card h3 { margin: 0 0 12px; }
.saves-card .row-list li { gap: 8px; }
.saves-card .row-list .grow { flex-basis: 100%; }
.saves-card .btn { flex: 0 0 auto; }

/* ---------- A creator ---------- */

.creator-hero {
  padding: 40px 0 30px;
  border-bottom: 1px solid var(--line-soft);
  background-image: linear-gradient(to bottom, rgba(12,15,20,.55), var(--canvas)), var(--banner, none);
  background-size: cover;
  background-position: center;
}
.creator-hero__inner { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.creator-hero__cta { margin-left: auto; }
.creator-hero h1 { margin: 0 0 4px; }
.handle { color: var(--muted); margin: 0; }
.link-row { margin: 10px 0 0; }
.link-row a { color: var(--brand-dark); }

.creator-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--line);
  background: var(--surface-2);
}
.creator-avatar--blank {
  display: grid; place-items: center;
  font-size: 2.2rem; font-weight: 600; color: var(--muted);
}

/* ---------- Comments ---------- */

.cmt { border-top: 1px solid var(--line-soft); padding: 16px 0; }
.cmt:first-child { border-top: 0; }
.cmt__who { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.cmt__who strong { font-size: .95rem; }
.cmt__when { color: var(--muted); font-size: .8rem; }
.cmt__body { margin: 0; white-space: pre-wrap; }

/* ---------- Dashboards (account, studio, admin) ---------- */

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 22px 24px;
  margin-bottom: 22px;
}
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }

.row-list { list-style: none; margin: 0; padding: 0; }
.row-list li {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  border-top: 1px solid var(--line-soft); padding: 14px 0;
}
.row-list li:first-child { border-top: 0; }
.row-list .grow { flex: 1 1 240px; min-width: 0; }
.row-list .muted { color: var(--muted); font-size: .86rem; }

.status {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: .76rem; letter-spacing: .02em; text-transform: uppercase;
  border: 1px solid var(--line); color: var(--muted);
}
.status--published { border-color: var(--ok); color: var(--ok); }
.status--in_review { border-color: var(--warn); color: var(--warn); }
.status--rejected  { border-color: var(--danger); color: var(--danger); }
.status--unlisted  { border-color: var(--accent); color: var(--accent); }

.stat-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stat-box {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 18px; background: var(--surface-2);
}
.stat-box b { display: block; font-size: 1.7rem; font-family: var(--font-display, inherit); }
.stat-box span { color: var(--muted); font-size: .84rem; }

/* Repeating editor rows (releases, screenshots, links). */
.repeat { display: grid; gap: 12px; }
.repeat__row {
  display: grid; gap: 10px; align-items: end;
  grid-template-columns: 150px minmax(0, 1fr) 130px 160px auto;
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  padding: 12px; background: var(--surface-2);
}
.repeat__row .field { margin: 0; }

.toast {
  position: fixed; inset-inline: 0; bottom: 24px; margin-inline: auto;
  width: max-content; max-width: 90vw; z-index: 60;
  padding: 12px 20px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--brand);
  color: var(--ink); box-shadow: var(--shadow);
}
.toast--bad { border-color: var(--danger); }

/* ---------- Narrow screens ---------- */

@media (max-width: 900px) {
  .game-hero__grid,
  .game-body { grid-template-columns: minmax(0, 1fr); }
  .repeat__row { grid-template-columns: minmax(0, 1fr); }
  .creator-hero__cta { margin-left: 0; }
  .shot img { height: 190px; }
}
