/* gallery.css — GameCard-accurate card faces: thick coloured border, dark art,
   coloured text panel. Matches CARD_BORDER_RADIUS=14, CARD_BORDER_WIDTH=6. */

.gallery__head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 40px;
}

/* 4 rows container */
.gallery__rows {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.gallery__row-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}
.gallery__row-label {
  font-family: var(--font-app);
  font-weight: 800;
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.gallery__row-sub {
  font-size: .88rem;
  color: var(--text-muted);
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: stretch;
  /* prevent glow bleed from one card overlapping neighbours */
  isolation: isolate;
}

/* ── GameCard face — gcf-* ─────────────────────────────────────────────────── */
.gcf {
  border-radius: 14px;
  border: 6px solid;       /* colour set inline by card-face-html.js */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;            /* fill grid cell so all cards match the tallest */
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease;
}
.gcf:hover { transform: translateY(-4px); box-shadow: 0 20px 48px rgba(0,0,0,.22); }

/* Category header bar */
.gcf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 9px;
  height: 22px;
  flex-shrink: 0;
}
.gcf-cat {
  font-family: var(--font-app);
  font-weight: 800;
  font-size: .6rem;
  letter-spacing: .14em;
  color: #fff;
}
.gcf-pill {
  font-size: .52rem;
  font-weight: 800;
  letter-spacing: .12em;
  color: #fff;
  background: rgba(0,0,0,.35);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Art panel — dark bg, cover image or centred category icon */
.gcf-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 0.85;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Generated art — full bleed */
.gcf-art:not(.gcf-art--icon) > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}
/* Category icon fallback — centred in the art band (matches the app) */
.gcf-art--icon {
  display: grid;
  place-items: center;
}
.gcf-art--icon > img,
img.gcf-art--icon {
  width: 44%;
  height: auto;
  max-height: 44%;
  object-fit: contain;
  object-position: center center;
  display: block;
}

/* Type notch — Dynamic-Island pill merged into the top border (category colour) */
.gcf-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
}
.gcf-notch-shape { display: block; position: absolute; top: 0; left: 0; }
.gcf-notch-row {
  position: absolute;
  top: 7px;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.gcf-notch-row span {
  font-family: var(--font-app);
  color: #fff;
  font-weight: 800;
  font-size: .62rem;
  letter-spacing: .14em;
}

/* Text panel — cream, dark title, category name + icon in the divider */
.gcf-body {
  background: #FBF8F2;
  padding: 11px 12px 13px;
  flex: 1;
  display: flex;
  flex-direction: column;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}
.gcf-title {
  font-family: var(--font-app);
  font-weight: 700;
  font-size: .86rem;
  line-height: 1.3;
  color: #262420;
  /* uniform height: clamp to 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gcf-divider-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 9px 0;
  flex-shrink: 0;
}
.gcf-divider-line { flex: 1; height: .5px; background: rgba(0,0,0,.14); }
.gcf-divider-label {
  font-family: var(--font-app);
  font-weight: 800;
  font-size: .56rem;
  letter-spacing: .12em;
}
.gcf-divider-row svg { flex-shrink: 0; }
.gcf-flavour {
  font-style: italic;
  font-size: .74rem;
  line-height: 1.45;
}

/* ── Legacy result__card aliases (kept for quiz.js legacy path) ─────────────── */
/* The app-quiz path already uses renderWebCardFaceHtml so gcf-* above applies. */
.result__card--app .gcf { /* already .gcf — no alias needed */ }

@media (max-width: 960px) {
  .gallery__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .gallery__grid { grid-template-columns: 1fr; }
}
