/* Student gallery */
.gal-header { padding-bottom: 8px; }
.gal-actions { margin-top: 16px; }
.gal-section { padding: 24px 0 80px; }
.gal-status { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 16px; }
.gal-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.gal-card {
  display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--border); transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.gal-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.gal-thumb {
  position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #fff;
  border-bottom: 1px solid var(--border);
}
.gal-thumb-letter {
  position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-head); font-size: 3rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.gal-thumb.is-loaded .gal-thumb-letter { display: none; }
/* The page renders at twice the box size, then shrinks: a real "screenshot". */
.gal-thumb iframe {
  position: absolute; top: 0; left: 0; width: 200%; height: 200%; border: 0; background: #fff;
  transform: scale(0.5); transform-origin: 0 0; pointer-events: none;
}
.gal-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.gal-title { font-size: 1.05rem; margin: 0; line-height: 1.3; overflow-wrap: anywhere; }
.gal-title a { color: var(--text); text-decoration: none; }
.gal-title a:hover { text-decoration: underline; }
.gal-by { margin: 0; font-size: 0.86rem; color: var(--text-muted); }
.gal-row { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 10px; font-size: 0.85rem; color: var(--text-muted); }
.gal-like {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; color: var(--text);
  padding: 5px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer;
}
.gal-like svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.gal-like.is-liked { color: #f43f5e; border-color: color-mix(in srgb, #f43f5e 45%, transparent); }
.gal-like.is-liked svg { fill: #f43f5e; stroke: #f43f5e; }
.gal-like.pop svg { animation: galPop 0.4s ease; }
@keyframes galPop { 50% { transform: scale(1.35); } }
@media (prefers-reduced-motion: reduce) { .gal-like.pop svg { animation: none; } .gal-card:hover { transform: none; } }
.gal-remix { margin-left: auto; color: var(--accent-2); font-weight: 600; text-decoration: none; }
.gal-remix:hover { text-decoration: underline; }
.gal-empty { text-align: center; max-width: 560px; margin: 24px auto 0; padding: 32px 24px; border-radius: var(--radius-md); background: var(--surface); border: 1px dashed var(--border); }
.gal-empty[hidden] { display: none; }
.gal-empty h2 { font-size: 1.3rem; margin: 0 0 8px; }
.gal-empty p { color: var(--text-muted); margin: 0 0 18px; }
@media (max-width: 560px) { .gal-grid { grid-template-columns: minmax(0, 1fr); } }

/* "View the code" on each card, and the code viewer (founder request, 2026-10-04). */
.gal-date { margin: 6px 0 0; font-size: 0.78rem; color: var(--text-muted); }
.gal-codebtn { margin-top: 10px; width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--accent-2) 45%, transparent); background: color-mix(in srgb, var(--accent-2) 10%, transparent);
  color: var(--text); font: 600 0.88rem/1 var(--font-body, Inter, system-ui, sans-serif); cursor: pointer; }
.gal-codebtn:hover { background: color-mix(in srgb, var(--accent-2) 18%, transparent); }
.gal-code-dlg { width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-elevated, #0b1022); color: var(--text); overflow: hidden; }
.gal-code-dlg[open] { display: flex; flex-direction: column; }
.gal-code-dlg::backdrop { background: rgba(2, 6, 20, 0.7); }
.gcd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px 10px; }
.gcd-head h2 { margin: 0; font-size: 1.2rem; }
.gcd-by { margin: 4px 0 0; font-size: 0.86rem; color: var(--text-muted); }
.gcd-x { border: 0; background: none; color: var(--text-muted); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.gcd-tabs { display: flex; gap: 6px; align-items: center; padding: 0 18px 10px; flex-wrap: wrap; }
.gcd-tabs [data-t] { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); font: 600 0.84rem/1 var(--font-body, Inter, sans-serif); cursor: pointer; }
.gcd-tabs [data-t].is-on { background: var(--accent, #1f7bff); border-color: transparent; color: #fff; }
.gcd-copy { margin-left: auto; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 600 0.84rem/1 var(--font-body, Inter, sans-serif); cursor: pointer; }
.gcd-code { flex: 1 1 auto; margin: 0 18px; min-height: 220px; max-height: 52vh; overflow: auto; padding: 14px 16px; border-radius: 12px; background: #0a0f1f; color: #dbe4ff;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; tab-size: 2; border: 1px solid rgba(255, 255, 255, 0.06); }
.gcd-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 18px 16px; }
.gcd-note { flex: 1 1 100%; margin: 2px 0 0; font-size: 0.8rem; color: var(--text-muted); }
