:root {
  --ink: #111827;
  --ink-soft: #263244;
  --paper: #fffaf1;
  --panel: #fff6e6;
  --panel-strong: #f7dfb4;
  --gold: #e0a524;
  --gold-dark: #9d680b;
  --green: #37d67a;
  --red: #c0392b;
  --muted: #6b7280;
  --line: rgba(17, 24, 39, 0.14);
  --shadow: 0 20px 50px rgba(17, 24, 39, 0.18);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
}

a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(17, 24, 39, 0.96);
  color: white;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.09);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.brand.center { justify-content: center; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), #f7d36d);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(224,165,36,0.32);
}
.brand-text { font-size: 1.2rem; }

.site-nav {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 0.94rem;
}
.site-nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
}
.site-nav a:hover { color: white; }
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  border-radius: 10px;
  padding: 7px 10px;
}

.section-pad {
  padding: clamp(56px, 8vw, 96px) clamp(20px, 5vw, 72px);
}
.section-pad.compact { padding-top: 34px; padding-bottom: 34px; }

.hero {
  min-height: 78vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(30px, 5vw, 70px);
  align-items: center;
  background:
    radial-gradient(circle at 85% 10%, rgba(224,165,36,0.24), transparent 35%),
    linear-gradient(145deg, var(--ink), #1f2937 55%, #3a270d);
  color: white;
}
.hero h1 {
  font-size: clamp(2.7rem, 7vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
  margin: 0 0 26px;
  max-width: 860px;
}
.hero-subtitle {
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  max-width: 710px;
  color: rgba(255,255,255,0.82);
}
.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 900;
  color: var(--gold);
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin: 30px 0 14px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  border: 0;
  cursor: pointer;
  font-size: 0.98rem;
}
.button-primary { background: var(--gold); color: var(--ink); box-shadow: 0 12px 30px rgba(224,165,36,0.25); }
.button-primary:hover { background: #f0bb3d; }
.button-secondary { background: rgba(255,255,255,0.1); color: white; border: 1px solid rgba(255,255,255,0.22); }
.button.full { width: 100%; }
.tiny-note { color: var(--muted); font-size: 0.9rem; margin-top: 10px; }
.hero .tiny-note { color: rgba(255,255,255,0.62); }

.hero-card { display: flex; justify-content: center; }
.terminal-window {
  width: min(560px, 100%);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0b1220;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.13);
}
.terminal-top {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: rgba(255,255,255,0.07);
}
.terminal-top span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.9;
}
.terminal-body {
  padding: 24px;
  font-family: "Cascadia Mono", "Courier New", monospace;
  font-size: 0.95rem;
  color: #dbeafe;
}
.terminal-body p { margin: 0 0 14px; }
.terminal-body .green { color: var(--green); }

.notice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  background: #f3e5c8;
}
.notice-card, .action-panel, .submission-box, .recipe-list, .signup-form, .bug-form, .game-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(17,24,39,0.08);
}
.notice-card { padding: 26px; }
.notice-card h2 { margin: 0 0 12px; color: var(--gold); font-size: 1.45rem; font-weight: 900; }
ul { margin: 0; padding-left: 20px; }

.section-heading { max-width: 780px; margin: 0 auto 34px; text-align: center; }
.section-heading.narrow { max-width: 640px; }
.section-heading h2, .split-section h2 { font-size: clamp(2rem, 4vw, 3.6rem); line-height: 1; letter-spacing: -0.05em; margin: 0 0 16px; }

.signup-section { background: var(--panel); }
.signup-form { max-width: 780px; margin: 0 auto; padding: 26px; }
label { display: block; font-weight: 800; margin-bottom: 8px; }
.form-row { display: flex; gap: 12px; }
.form-status { min-height: 24px; margin: 14px 0 0; font-weight: 800; letter-spacing: 0.01em; }
.form-status.success { color: #14351f; background: #dff8e6; border: 1px solid #6ecb83; border-radius: 12px; padding: 12px 14px; }
.form-status.error { color: #4a1717; background: #fde2e2; border: 1px solid #df7777; border-radius: 12px; padding: 12px 14px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  background: #fffdf9;
  color: var(--ink);
}
textarea { resize: vertical; }
.hidden-field { display: none; }

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  gap: clamp(26px, 5vw, 64px);
  align-items: center;
}
.action-panel { padding: 28px; }
.action-panel h3 { margin-top: 0; font-size: 1.6rem; }
.callout {
  margin-top: 24px;
  padding: 16px;
  border-left: 5px solid var(--gold);
  background: rgba(224,165,36,0.12);
  border-radius: 14px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.game-card { padding: 26px; min-height: 250px; display: flex; flex-direction: column; }
.game-card.muted { background: #fbf7ef; }
.game-tag {
  width: max-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(224,165,36,0.16);
  color: var(--gold-dark);
  font-weight: 900;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.game-card h3 { font-size: 1.45rem; line-height: 1.08; margin: 18px 0 8px; }
.text-link { margin-top: auto; font-weight: 900; color: var(--gold-dark); text-decoration: none; }
.submission-box { margin-top: 22px; padding: 24px; background: var(--panel); }

.cookbook { background: var(--ink); color: white; }
.cookbook p { color: rgba(255,255,255,0.78); }
.recipe-list { padding: 26px; background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.13); }
.recipe-list h3 { margin-top: 0; }
.recipe-list li { margin-bottom: 8px; }

.bug-form { max-width: 920px; margin: 0 auto; padding: 26px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}
.bug-form textarea { margin-bottom: 18px; }

.community { background: #f3e5c8; }
.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}
.social-links a {
  padding: 12px 18px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 900;
}
.community .tiny-note { text-align: center; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 26px clamp(20px, 5vw, 72px);
  background: var(--ink);
  color: rgba(255,255,255,0.76);
  flex-wrap: wrap;
}
.site-footer p { margin: 0; }
.site-footer a { color: white; }

.thank-you-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--ink), #3a270d);
}
.thank-you-card {
  width: min(560px, calc(100% - 32px));
  padding: 42px;
  text-align: center;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.thank-you-card h1 { font-size: 3rem; margin: 26px 0 8px; }

@media (max-width: 900px) {
  .hero, .split-section, .notice-grid, .game-grid { grid-template-columns: 1fr; }
  .site-nav {
    display: none;
    position: absolute;
    left: 16px;
    right: 16px;
    top: 64px;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    background: var(--ink);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px; }
  .nav-toggle { display: inline-flex; }
  .form-row { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .section-pad { padding-left: 16px; padding-right: 16px; }
  .hero h1 { font-size: 3rem; }
  .site-header { padding-left: 14px; padding-right: 14px; }
}


/* ── Auth overlay & modal ────────────────────────────────────────────────── */
.auth-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(17,24,39,0.74);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
[hidden] { display: none !important; }
.auth-overlay[hidden] { display: none !important; }
.auth-card {
  width: min(440px, 100%);
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px 28px;
}
.auth-card-header {
  display: flex; justify-content: flex-end; margin-bottom: 4px;
}
.auth-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.6rem; color: var(--muted); line-height: 1; padding: 0 4px;
}
.auth-close:hover { color: var(--ink); }
.auth-tabs {
  display: flex; border-bottom: 2px solid var(--line); margin-bottom: 22px;
}
.auth-tab {
  padding: 9px 18px; cursor: pointer; font-weight: 800; font-size: 0.95rem;
  border: none; background: none; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.auth-tab.active { color: var(--ink); border-bottom-color: var(--gold); }
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.auth-field { margin-bottom: 14px; }
.auth-field label { display: block; font-weight: 800; margin-bottom: 6px; font-size: 0.9rem; }
.auth-hint { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }
.auth-spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(17,24,39,0.3); border-top-color: var(--ink);
  border-radius: 50%; animation: spin 0.7s linear infinite; margin-right: 6px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Nav auth elements ───────────────────────────────────────────────────── */
.nav-auth-group {
  display: inline-flex; gap: 10px; align-items: center;
}
.nav-signout-btn {
  background: rgba(255,255,255,0.1); color: white;
  border: 1px solid rgba(255,255,255,0.22); border-radius: 999px;
  padding: 5px 14px; font-size: 0.86rem; font-weight: 800; cursor: pointer;
}
.nav-signout-btn:hover { background: rgba(255,255,255,0.18); }

/* ── Account page ────────────────────────────────────────────────────────── */
.account-page {
  min-height: calc(100vh - 64px);
  background: var(--panel);
  padding: clamp(32px, 5vw, 64px) clamp(20px, 5vw, 72px);
}
.account-card {
  max-width: 600px; margin: 0 auto;
  background: white; border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(17,24,39,0.08);
  padding: 32px;
}
.account-card h1 { margin: 0 0 6px; font-size: 1.9rem; }
.account-email { color: var(--muted); font-size: 0.9rem; margin: 0 0 28px; }
.account-section { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.account-section:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.account-section h2 { margin: 0 0 14px; font-size: 1.1rem; color: var(--ink-soft); }
.account-field { margin-bottom: 14px; }
.account-field label { display: block; font-weight: 800; margin-bottom: 6px; font-size: 0.9rem; }
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.toggle-row label { font-weight: 800; margin: 0; }
.toggle-row p { color: var(--muted); font-size: 0.85rem; margin: 4px 0 0; }
.toggle-switch {
  position: relative; width: 44px; height: 24px; flex-shrink: 0; margin-left: 16px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #d1d5db; border-radius: 999px; transition: background 0.2s;
}
.toggle-slider:before {
  content: ''; position: absolute;
  width: 18px; height: 18px; top: 3px; left: 3px;
  background: white; border-radius: 50%; transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--gold-dark); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }
.suspended-banner {
  background: #fde2e2; border: 1px solid #df7777; border-radius: 14px;
  padding: 16px 20px; margin-bottom: 24px;
}
.suspended-banner strong { display: block; margin-bottom: 4px; color: #4a1717; }
.suspended-banner p { margin: 0; font-size: 0.9rem; color: #7a2020; }
.loading-state {
  text-align: center; padding: 48px 0; color: var(--muted);
}

/* ── Phase 2A: Creator game management ──────────────────────────────────── */
.creator-page {
  min-height: calc(100vh - 64px);
  background: var(--panel);
  padding: clamp(28px, 4vw, 56px) clamp(20px, 5vw, 72px);
}

.creator-page-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px; margin-bottom: 28px;
}
.creator-page-header h1 { margin: 0; font-size: 2rem; }

.new-game-panel {
  background: white; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(17,24,39,0.07); padding: 28px;
  margin-bottom: 28px;
}
.new-game-panel h2 { margin: 0 0 20px; font-size: 1.4rem; }
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 800; margin-bottom: 6px; font-size: 0.9rem; }
.form-field .field-hint { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }
.form-field textarea { resize: vertical; min-height: 90px; }
.visibility-options { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.vis-radio { display: none; }
.vis-label {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border: 2px solid var(--line); border-radius: 14px;
  cursor: pointer; font-weight: 700; font-size: 0.9rem; transition: all 0.15s;
  background: white;
}
.vis-radio:checked + .vis-label {
  border-color: var(--gold); background: rgba(224,165,36,0.1);
}
.vis-label-icon { font-size: 1.1rem; }
.content-rules-notice {
  background: #fffbf0; border: 1px solid #f0d070; border-radius: 12px;
  padding: 14px 16px; font-size: 0.88rem; line-height: 1.6; margin-bottom: 18px;
}
.content-rules-notice strong { display: block; margin-bottom: 4px; }
.panel-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* ── Game cards ─────────────────────────────────────────────────────────── */
.games-list { display: flex; flex-direction: column; gap: 16px; }
.creator-game-card {
  background: white; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(17,24,39,0.06); overflow: hidden;
}
.game-card-header {
  padding: 20px 24px 16px; display: flex; align-items: flex-start;
  gap: 12px; flex-wrap: wrap;
}
.game-card-title { font-size: 1.2rem; font-weight: 900; margin: 0 0 6px; }
.game-card-dates { font-size: 0.8rem; color: var(--muted); margin: 0; }
.game-card-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Status badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em;
}
.badge-draft   { background: #f0f4ff; color: #3b4ab8; }
.badge-published { background: #d1fae5; color: #065f46; }
.badge-hidden  { background: #fef3c7; color: #92400e; }
.badge-removed { background: #fee2e2; color: #991b1b; }
.badge-public  { background: rgba(17,24,39,0.08); color: var(--ink); }
.badge-members { background: rgba(224,165,36,0.15); color: var(--gold-dark); }

.game-card-body { padding: 0 24px 20px; }
.game-card-divider { height: 1px; background: var(--line); margin: 0 24px 20px; }

/* File indicators */
.file-indicators { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.file-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
}
.file-pill-yes  { background: #d1fae5; color: #065f46; }
.file-pill-no   { background: #f3f4f6; color: var(--muted); }

/* Upload sections */
.upload-section {
  background: var(--panel); border: 1px dashed var(--gold);
  border-radius: 14px; padding: 16px 18px; margin-bottom: 16px;
}
.upload-section h4 { margin: 0 0 8px; font-size: 0.95rem; }
.upload-section .file-note { font-size: 0.82rem; color: var(--muted); margin: 8px 0 0; }
.upload-input-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.file-input-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px; font-size: 0.88rem; font-weight: 800;
  background: white; border: 1.5px solid var(--line); cursor: pointer;
}
.file-input-btn input[type="file"] { position: absolute; opacity: 0; width: 0; }
.file-input-btn { position: relative; }
.chosen-filename { font-size: 0.82rem; color: var(--muted); }

/* Progress bar */
.upload-progress { margin-top: 10px; }
.progress-bar-track {
  height: 6px; background: var(--line); border-radius: 999px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; background: var(--gold); border-radius: 999px;
  transition: width 0.2s;
}
.progress-label { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

/* Publish section */
.publish-section {
  border: 1.5px solid #c7d2fe; border-radius: 16px; padding: 18px 20px;
}
.publish-section h4 { margin: 0 0 14px; font-size: 0.95rem; font-weight: 900; }
.confirm-row {
  display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px;
  font-size: 0.88rem; line-height: 1.5;
}
.confirm-row input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  padding: 0;
  margin: 3px 0 0;
  flex: 0 0 18px;
  border-radius: 4px;
  accent-color: var(--gold-dark);
}
.publish-vis-row { margin-bottom: 14px; }
.publish-vis-row > label {
  font-weight: 800;
  font-size: 0.88rem;
  margin-bottom: 6px;
  display: block;
}
.publish-vis-row .vis-label {
  display: inline-flex;
  margin-bottom: 0;
}

/* Admin-moderated banner */
.admin-moderated {
  background: #fffbf0; border: 1px solid #f0d070; border-radius: 14px;
  padding: 14px 18px; font-size: 0.88rem;
}
.admin-moderated strong { display: block; margin-bottom: 4px; }

/* Empty state */
.empty-games {
  text-align: center; padding: 56px 24px;
  background: white; border: 1px solid var(--line); border-radius: var(--radius);
}
.empty-games p { color: var(--muted); margin-bottom: 20px; }

@media (max-width: 640px) {
  .creator-page { padding: 20px 14px; }
  .new-game-panel { padding: 20px 16px; }
  .game-card-header { padding: 16px 16px 12px; }
  .game-card-body { padding: 0 16px 16px; }
  .game-card-divider { margin: 0 16px 16px; }
  .publish-section { padding: 14px 14px; }
}

/* ── Phase 2B: Community library ──────────────────────────────────────────── */

.community-page {
  min-height: calc(100vh - 64px);
  background: var(--panel);
  padding: clamp(28px,4vw,52px) clamp(20px,5vw,72px);
}
.community-header {
  max-width: 720px; margin: 0 auto 32px; text-align: center;
}
.community-header h1 { margin: 0 0 8px; font-size: clamp(1.8rem,4vw,2.4rem); }
.community-header p  { color: var(--muted); margin: 0; }

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.filter-bar {
  max-width: 900px; margin: 0 auto 28px;
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.filter-bar input[type="text"] {
  flex: 1; min-width: 180px;
}
.filter-vis { display: flex; gap: 4px; }
.fv-btn {
  padding: 8px 14px; border-radius: 999px; font-size: 0.84rem; font-weight: 800;
  border: 1.5px solid var(--line); background: white; cursor: pointer;
}
.fv-btn.active { background: var(--ink); color: white; border-color: var(--ink); }

/* ── Member prompt / suspended notice ───────────────────────────────────── */
.member-prompt {
  max-width: 600px; margin: 0 auto 32px; text-align: center;
  background: white; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 32px;
}
.member-prompt h3 { margin: 0 0 8px; }
.member-prompt p  { color: var(--muted); margin: 0 0 18px; }
.members-section-suspended {
  max-width: 600px; margin: 0 auto 20px;
  background: #fffbf0; border: 1px solid #f0d070;
  border-radius: 14px; padding: 14px 18px; font-size: 0.88rem;
}
.members-section-suspended strong { display: block; margin-bottom: 2px; }

/* ── Gallery section ─────────────────────────────────────────────────────── */
.gallery-section { max-width: 1100px; margin: 0 auto 44px; }
.gallery-section-header {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px;
  padding-bottom: 10px; border-bottom: 2px solid var(--line);
}
.gallery-section-header h2 { margin: 0; font-size: 1.4rem; }
.game-count { font-size: 0.84rem; color: var(--muted); font-weight: 700; }

/* ── Game grid ───────────────────────────────────────────────────────────── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}

/* ── Game card (library view) ────────────────────────────────────────────── */
.game-card-lib {
  background: white; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 4px 16px rgba(17,24,39,0.06);
  display: flex; flex-direction: column; overflow: hidden;
}
.game-cover-wrap {
  position: relative;
  width: 100%; height: 170px; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, #f0e8d8, #e8d8b8);
}
.game-cover-placeholder {
  position: absolute; inset: 0;
  width: 100%; height: 100%; display: flex;
  align-items: center; justify-content: center;
  font-size: 2.6rem; color: rgba(17,24,39,0.18); font-weight: 900;
}
.game-cover-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  display: block; visibility: hidden;   /* visibility toggled on load */
}
.game-card-content {
  padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column;
}
.game-card-title {
  font-size: 1.05rem; font-weight: 900; margin: 0 0 5px;
  word-break: break-word;
}
.game-card-desc {
  font-size: 0.84rem; color: var(--muted); margin: 0 0 10px;
  flex: 1; line-height: 1.5;
  /* Clamp long descriptions */
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.game-card-tags {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px;
}
.game-tag {
  padding: 2px 9px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 800;
  background: rgba(17,24,39,0.07); color: var(--muted);
}
.game-card-meta {
  font-size: 0.78rem; color: var(--muted); margin-bottom: 12px;
  display: flex; flex-direction: column; gap: 3px;
}
.creator-name { font-weight: 700; color: var(--ink-soft); }
.creator-contact a {
  color: var(--gold-dark); font-weight: 700; text-decoration: none;
  font-size: 0.78rem;
}
.creator-contact a:hover { text-decoration: underline; }
.game-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-top: auto;
}

.game-play-note {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 800;
  color: #475569; background: #f1f5f9; border: 1px solid #cbd5e1;
}
.dl-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 800; cursor: pointer;
  background: var(--ink); color: white; border: none;
  transition: background 0.15s;
}
.dl-btn:hover { background: #1e293b; }
.dl-btn:disabled {
  background: #9ca3af; cursor: not-allowed;
}
.game-error { font-size: 0.78rem; color: var(--red); margin-top: 6px; }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.gallery-empty {
  text-align: center; padding: 48px 24px; grid-column: 1/-1;
  color: var(--muted);
}
.gallery-empty p { margin: 4px 0; }

@media (max-width: 600px) {
  .community-page { padding: 20px 14px; }
  .game-grid { grid-template-columns: 1fr; }
  .filter-bar { gap: 8px; }
}

/* ── Phase 2C-A: Admin Moderation ────────────────────────────────────────── */

.admin-filters {
  max-width: 1100px; margin: 0 auto 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.admin-filter-groups { display: flex; gap: 12px; flex-wrap: wrap; }
.admin-filter-group  { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.admin-filter-group label { font-size: 0.82rem; font-weight: 800; color: var(--muted); }

.admin-game-list { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }

.admin-game-row {
  background: white; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 3px 12px rgba(17,24,39,0.05);
  display: flex; gap: 14px; padding: 16px 18px; flex-wrap: wrap; align-items: flex-start;
}
.admin-cover-wrap {
  position: relative;
  width: 80px; height: 56px; flex-shrink: 0;
  border-radius: 10px; overflow: hidden;
  background: linear-gradient(135deg, #f0e8d8, #e0d0a8);
}
.admin-cover-ph {
  position: absolute; inset: 0;
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: rgba(17,24,39,0.2);
}
.admin-cover-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  display: block; visibility: hidden;
}
.admin-game-info { flex: 1; min-width: 180px; }
.admin-game-title { font-size: 1rem; font-weight: 900; margin-bottom: 4px; word-break: break-word; }
.admin-game-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.admin-game-meta { font-size: 0.8rem; color: var(--muted); }
.admin-mod-reason {
  margin-top: 6px; padding: 6px 10px;
  background: #fffbf0; border: 1px solid #f0d070; border-radius: 8px;
  font-size: 0.8rem; color: var(--ink); word-break: break-word;
}
.admin-game-actions {
  display: flex; flex-direction: column; gap: 6px; min-width: 160px; flex-shrink: 0;
}
.admin-action-btn {
  font-size: 0.82rem; min-height: 32px; padding: 5px 12px;
  white-space: nowrap; text-align: center;
}
.btn-warn   { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.btn-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.btn-good   { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.btn-warn:hover   { background: #fde68a; }
.btn-danger:hover { background: #fecaca; }
.btn-good:hover   { background: #a7f3d0; }

/* ── Enhanced moderation banners on creator pages ────────────────────────── */
.admin-moderated p { margin: 4px 0; }
.admin-moderated .mod-reason {
  font-style: italic; background: rgba(17,24,39,0.05);
  border-radius: 8px; padding: 8px 10px; margin: 8px 0;
}
.admin-moderated .mod-date { font-size: 0.8rem; color: var(--muted); }
.admin-moderated .mod-contact { margin-top: 10px; }
.admin-moderated .mod-contact a { color: var(--gold-dark); font-weight: 800; }

/* ── Suspension details in account/game pages ────────────────────────────── */
.suspension-details { margin-top: 8px; font-size: 0.88rem; }
.suspension-details .susp-reason {
  background: rgba(17,24,39,0.06); border-radius: 8px; padding: 8px 10px; margin: 6px 0;
  font-style: italic; word-break: break-word;
}
.suspension-details .susp-date { font-size: 0.8rem; color: #7a2020; }

@media (max-width: 640px) {
  .admin-game-row { flex-direction: column; }
  .admin-game-actions { flex-direction: row; flex-wrap: wrap; min-width: 0; }
  .admin-cover-wrap { width: 60px; height: 42px; }
}

/* ── Phase 2D: Creator Game Controls ─────────────────────────────────────── */

/* Control groups */
.ctrl-group {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 14px; background: white;
}
.ctrl-group-title {
  font-size: 0.82rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted); margin-bottom: 10px;
}
.danger-zone { border-color: #fca5a5; background: #fff5f5; }
.danger-zone .ctrl-group-title { color: #991b1b; }

/* Status badges for new state columns */
.badge-published { background: #d1fae5; color: #065f46; }
.badge-hidden    { background: #fef3c7; color: #92400e; }
.badge-removed   { background: #fee2e2; color: #991b1b; }
.badge-draft     { background: #f3f4f6; color: #374151; }
.badge-members   { background: #ede9fe; color: #5b21b6; }
.badge-public    { background: #dbeafe; color: #1e40af; }

/* Edit panel */
.edit-panel {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* File controls */
.file-label { font-size: 0.85rem; font-weight: 700; display: block; margin-bottom: 6px; }
.file-input {
  font-size: 0.85rem; width: 100%; border: 1px dashed var(--line);
  border-radius: 8px; padding: 8px 10px; cursor: pointer;
  background: var(--panel);
}

/* Danger zone buttons */
.btn-warn   { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.btn-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.btn-warn:hover   { background: #fde68a; }
.btn-danger:hover { background: #fecaca; }
.btn-danger:disabled { background: #f3f4f6; color: #9ca3af; border-color: #e5e7eb; cursor: not-allowed; }

/* Admin badges in creator view */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 800; }

/* ── Homepage clickable game cards ─────────────────────────────────────────── */

/* Clickable homepage game cards — all three use anchor styling */
a.game-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

/* Hover */
.game-card-link:hover {
  background: #fffdf6;
  border-color: var(--gold-dark, #b8860b);
  box-shadow: 0 4px 18px rgba(0,0,0,0.10);
  transform: translateY(-2px);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

/* Keyboard focus */
.game-card-link:focus-visible {
  outline: 3px solid var(--gold-dark, #b8860b);
  outline-offset: 3px;
  border-color: var(--gold-dark, #b8860b);
}

/* Empty submission ribbon — preserve height for future graphic */
#submit-game:empty { min-height: 150px; }

/* ── Creator download button — visible on white card backgrounds ─────────── */
/* The global .button-secondary uses white text for use on dark backgrounds.  */
/* This class overrides for the creator-page white-panel context.             */
.creator-download-button {
  background: #eef4ff;
  color: var(--ink);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
}

.creator-download-button:hover {
  background: #e2ebff;
}

.creator-download-button:focus-visible {
  outline: 3px solid rgba(224, 165, 36, 0.45);
  outline-offset: 2px;
}

/* ── Confirmation-status banners (top-level on account page) ───────────────── */
/* Placed outside #account-content so they remain visible regardless of         */
/* whether the signed-in or signed-out container is active.                     */
.confirmation-status {
  max-width: 600px;
  margin: 0 auto 18px;
}
\n\n/* ── Support TAGMaker / Stripe-hosted contribution pages ───────────────── */\n.support-teaser {\n  background:\n    radial-gradient(circle at 12% 20%, rgba(224,165,36,0.22), transparent 32%),\n    #f8edd9;\n}\n.support-teaser-card {\n  max-width: 1180px;\n  margin: 0 auto;\n  display: grid;\n  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);\n  gap: clamp(28px, 5vw, 64px);\n  align-items: center;\n  background: white;\n  border: 1px solid var(--line);\n  border-radius: 28px;\n  box-shadow: 0 18px 48px rgba(17,24,39,0.1);\n  padding: clamp(30px, 5vw, 58px);\n}\n.support-teaser-copy h2,\n.support-promise-card h2 {\n  font-size: clamp(2.2rem, 4.5vw, 4rem);\n  line-height: 0.98;\n  letter-spacing: -0.055em;\n  margin: 0 0 18px;\n}\n.support-teaser-copy > p:not(.eyebrow) {\n  max-width: 720px;\n  font-size: 1.06rem;\n  color: var(--ink-soft);\n}\n.support-teaser-action {\n  padding: 28px;\n  border-radius: 22px;\n  background: linear-gradient(145deg, var(--ink), #263244);\n  color: white;\n  box-shadow: var(--shadow);\n}\n.support-teaser-action h3 { margin: 10px 0 8px; font-size: 1.5rem; }\n.support-teaser-action > p:not(.tiny-note) { color: rgba(255,255,255,0.78); }\n.support-teaser-action .tiny-note { color: rgba(255,255,255,0.62); }\n.support-heart {\n  display: inline-grid;\n  place-items: center;\n  width: 52px;\n  height: 52px;\n  border-radius: 16px;\n  background: linear-gradient(135deg, var(--gold), #f7d36d);\n  color: var(--ink);\n  font-size: 1.65rem;\n  box-shadow: 0 10px 26px rgba(224,165,36,0.3);\n}\n.support-heart.large { width: 64px; height: 64px; border-radius: 20px; font-size: 2rem; margin-bottom: 18px; }\n.support-pill-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }\n.support-pill-row span {\n  display: inline-flex;\n  align-items: center;\n  min-height: 34px;\n  padding: 7px 12px;\n  border-radius: 999px;\n  border: 1px solid rgba(157,104,11,0.22);\n  background: rgba(224,165,36,0.12);\n  color: #6f4b0c;\n  font-size: 0.82rem;\n  font-weight: 900;\n}\n\n.support-hero {\n  min-height: 68vh;\n  display: grid;\n  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.72fr);\n  gap: clamp(32px, 6vw, 84px);\n  align-items: center;\n  background:\n    radial-gradient(circle at 82% 16%, rgba(224,165,36,0.28), transparent 34%),\n    linear-gradient(145deg, var(--ink), #1f2937 58%, #3a270d);\n  color: white;\n}\n.support-hero h1 {\n  font-size: clamp(3.2rem, 8vw, 7rem);\n  line-height: 0.9;\n  letter-spacing: -0.075em;\n  margin: 0 0 28px;\n}\n.support-lead {\n  max-width: 780px;\n  color: rgba(255,255,255,0.82);\n  font-size: clamp(1.05rem, 1.8vw, 1.3rem);\n}\n.support-pill-row-light span {\n  background: rgba(255,255,255,0.08);\n  color: rgba(255,255,255,0.88);\n  border-color: rgba(255,255,255,0.16);\n}\n.support-checkout-card {\n  padding: clamp(28px, 4vw, 40px);\n  background: var(--paper);\n  color: var(--ink);\n  border: 1px solid rgba(255,255,255,0.14);\n  border-radius: 26px;\n  box-shadow: var(--shadow);\n}\n.support-checkout-card h2 {\n  margin: 0 0 14px;\n  font-size: clamp(2rem, 3.5vw, 3rem);\n  line-height: 1;\n  letter-spacing: -0.04em;\n}\n.support-checkout-card .support-stripe-button { margin-top: 24px; }\n\n.support-values { background: var(--paper); }\n.support-value-grid {\n  max-width: 1180px;\n  margin: 0 auto;\n  display: grid;\n  grid-template-columns: repeat(4, minmax(0, 1fr));\n  gap: 18px;\n}\n.support-value-card {\n  padding: 26px;\n  background: white;\n  border: 1px solid var(--line);\n  border-radius: 20px;\n  box-shadow: 0 10px 28px rgba(17,24,39,0.07);\n}\n.support-value-icon {\n  display: inline-grid;\n  place-items: center;\n  width: 44px;\n  height: 44px;\n  border-radius: 13px;\n  background: rgba(224,165,36,0.15);\n  color: var(--gold-dark);\n  font-weight: 900;\n  font-size: 1.2rem;\n}\n.support-value-card h3 { margin: 18px 0 8px; line-height: 1.12; }\n.support-value-card p { color: var(--muted); margin-bottom: 0; }\n\n.support-promise { background: #f3e5c8; }\n.support-promise-card {\n  max-width: 1100px;\n  margin: 0 auto;\n  display: grid;\n  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);\n  gap: clamp(26px, 5vw, 64px);\n  padding: clamp(30px, 5vw, 54px);\n  background: white;\n  border: 1px solid var(--line);\n  border-radius: 26px;\n  box-shadow: 0 14px 38px rgba(17,24,39,0.08);\n}\n.support-promise-copy p { font-size: 1.04rem; color: var(--ink-soft); }\n.support-final-cta { background: var(--panel); text-align: center; }\n\n.support-thank-you-page {\n  min-height: 100vh;\n  display: grid;\n  place-items: center;\n  padding: 26px;\n  background:\n    radial-gradient(circle at 75% 15%, rgba(224,165,36,0.28), transparent 34%),\n    linear-gradient(145deg, var(--ink), #3a270d);\n}\n.support-thank-you-card {\n  width: min(720px, 100%);\n  padding: clamp(34px, 6vw, 58px);\n  text-align: center;\n  background: var(--paper);\n  border-radius: 28px;\n  box-shadow: var(--shadow);\n}\n.support-thank-you-heart {\n  width: 72px; height: 72px; margin: 30px auto 18px;\n  display: grid; place-items: center; border-radius: 22px;\n  background: linear-gradient(135deg, var(--gold), #f7d36d);\n  color: var(--ink); font-size: 2.2rem;\n  box-shadow: 0 12px 30px rgba(224,165,36,0.28);\n}\n.support-thank-you-card h1 {\n  margin: 0 0 18px;\n  font-size: clamp(2.4rem, 6vw, 4.2rem);\n  line-height: 0.98;\n  letter-spacing: -0.055em;\n}\n.support-thank-you-card > p:not(.eyebrow) { color: var(--ink-soft); }\n.support-thank-you-note {\n  margin: 22px 0; padding: 16px; border-radius: 14px;\n  background: rgba(224,165,36,0.11); border: 1px solid rgba(157,104,11,0.18);\n}\n.support-thank-you-actions {\n  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; margin-top: 28px;\n}\n.support-button-outline { background: transparent; border: 1px solid var(--line); color: var(--ink); }\n\n@media (max-width: 980px) {\n  .support-teaser-card, .support-hero, .support-promise-card { grid-template-columns: 1fr; }\n  .support-value-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n  .support-hero { min-height: auto; }\n}\n@media (max-width: 620px) {\n  .support-value-grid { grid-template-columns: 1fr; }\n  .support-teaser-card { padding: 24px; }\n  .support-checkout-card { padding: 24px; }\n  .support-thank-you-actions { flex-direction: column; }\n  .support-thank-you-actions .button, .support-thank-you-actions .text-link { width: 100%; }\n}\n