/* ==========================================================================
   ClassBoard Games Creator Portal — v3.1
   Design language inherited from the classboardgames.com landing page, but
   BRIGHTER: the portal opens in a rich mid-navy (clearly lighter than the
   landing page's near-black) and keeps lightening into a warm royal blue
   further down. Glass panels, faint grid, ambient glows, landing accents.

   v3.1 brightness step: every page-background stop was lifted, and the
   muted/faint text colours were lifted with it so contrast stays AA.
   ========================================================================== */

:root {
  /* landing-page palette, brightened one step for the portal */
  --navy-950: #0c2547;
  --navy-900: #12325c;
  --navy-800: #1c477e;
  --navy-700: #21528d;
  --navy-650: #265c9c;
  --blue: #2d7cff;
  --blue-soft: rgba(45, 124, 255, 0.16);
  --cyan: #16c7d9;
  --gold: #ffae27;
  --violet: #9a55f7;
  --green: #3ecf8e;
  --red: #ff6b6b;

  --white: #ffffff;
  --text: #eef5ff;
  /* Lifted with the background so body text clears WCAG AA (4.5:1) even
     against the brightest stop at the very bottom of the page. */
  --muted: #c8d8ec;
  --faint: #a6bad2;

  --line: rgba(200, 224, 255, 0.20);
  --line-strong: rgba(200, 224, 255, 0.34);
  --glass: rgba(12, 38, 72, 0.62);
  --glass-raised: rgba(20, 50, 90, 0.66);
  --glass-input: rgba(8, 28, 56, 0.52);

  --shadow: 0 28px 80px rgba(0, 8, 24, 0.42);
  --shadow-sm: 0 10px 30px rgba(0, 8, 24, 0.32);
  --glow-blue: 0 8px 30px rgba(45, 124, 255, 0.35);

  --radius: 1.1rem;
  --radius-sm: 0.65rem;

  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;
  --mono: "SF Mono", SFMono-Regular, ui-monospace, Menlo, Consolas,
    "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

/* The page opens in a rich mid-navy — deliberately brighter than the
   landing page's near-black — and keeps lightening toward a royal blue as
   the visitor moves down. Still deep enough for white type to sing. */
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -8%, rgba(60, 130, 220, 0.26), transparent 38rem),
    linear-gradient(180deg,
      var(--navy-950) 0%,
      var(--navy-900) 22%,
      #173d6d 50%,
      var(--navy-800) 75%,
      var(--navy-650) 100%);
  background-attachment: fixed;
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* faint blueprint grid, exactly like the landing page */
body::before {
  position: fixed;
  inset: 0;
  z-index: -4;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black, transparent 82%);
  -webkit-mask-image: radial-gradient(circle at center, black, transparent 82%);
}

/* ambient glows */
.ambient {
  position: fixed;
  z-index: -3;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(70px);
  opacity: 0.5;
}
.ambient-one {
  top: -12rem; left: -10rem;
  width: 34rem; height: 34rem;
  background: radial-gradient(circle, rgba(45, 124, 255, 0.30), transparent 65%);
}
.ambient-two {
  top: 30%; right: -12rem;
  width: 30rem; height: 30rem;
  background: radial-gradient(circle, rgba(22, 199, 217, 0.16), transparent 65%);
}
.ambient-three {
  bottom: -14rem; left: 22%;
  width: 36rem; height: 36rem;
  background: radial-gradient(circle, rgba(154, 85, 247, 0.14), transparent 65%);
}

a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  margin: 0 0 0.6rem;
  color: var(--white);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.18;
}
h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); }
h3 { font-size: 1.13rem; }
p { margin: 0 0 0.9rem; }

.skip-link {
  position: fixed;
  top: 0.75rem; left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  color: var(--navy-950);
  background: white;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}
.skip-link:focus { transform: translateY(0); }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 33, 62, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.65rem clamp(1rem, 3vw, 2rem);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  min-width: 0;
  flex-shrink: 0;
}
.brand-logo { width: auto; height: 46px; }
.brand-tag {
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  background: rgba(45, 124, 255, 0.10);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nav-main {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.15rem;
  margin-left: auto;
}
.nav-main a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition: color 140ms ease, background 140ms ease;
}
.nav-main a:hover,
.nav-main a:focus-visible,
.nav-main a[aria-current="page"] { color: var(--white); background: rgba(110, 164, 244, 0.14); }
.nav-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.5rem;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}
.site-header .header-button {
  min-width: 0;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  gap: 0.55rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.header-icon { flex: 0 0 18px; }
.site-header .header-create {
  color: #fff;
  border-color: rgba(142, 188, 255, 0.45);
  background: linear-gradient(145deg, #2b71e5, #2059c9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 4px 12px rgba(0, 13, 44, 0.2);
}
.site-header .header-create:hover {
  background: linear-gradient(145deg, #2d73e2, #2764d6);
  border-color: #94bdff;
  box-shadow: 0 5px 16px rgba(26, 87, 189, 0.3);
}
.site-header .header-account,
.site-header .header-auth {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(188, 215, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.site-header .header-account { padding: 0.4rem 0.65rem; }
.header-account .avatar { width: 28px; height: 28px; flex-shrink: 0; border-radius: 0.5rem; }
.header-username { min-width: 0; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; }
.header-signout { display: flex; margin: 0; }
.site-header .header-auth .header-icon { color: #abcaff; }
.site-header .header-account:hover,
.site-header .header-auth:hover { color: #fff; border-color: #88acd9; background: rgba(188, 215, 255, 0.12); }
.site-header :is(a, button, summary):focus-visible { outline: 2px solid #a6d7ff; outline-offset: 3px; }

/* mobile drawer */
.nav-drawer { display: none; position: relative; margin-left: auto; }
.nav-drawer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--glass);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  list-style: none;
}
.nav-drawer-toggle::-webkit-details-marker { display: none; }
.nav-drawer-bars,
.nav-drawer-bars::before,
.nav-drawer-bars::after {
  display: block;
  width: 16px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  content: "";
}
.nav-drawer-bars { position: relative; }
.nav-drawer-bars::before { position: absolute; top: -5px; }
.nav-drawer-bars::after { position: absolute; top: 5px; }
.nav-drawer-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  z-index: 60;
  width: min(78vw, 300px);
  max-height: calc(100vh - 100px);
  max-height: calc(100dvh - 100px);
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #102b4b;
  box-shadow: var(--shadow);
}
.nav-drawer-links { display: grid; gap: 0.15rem; margin-bottom: 0.9rem; }
.nav-drawer-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}
.nav-drawer-links a:hover { background: rgba(45, 124, 255, 0.14); }
.nav-drawer-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.nav-drawer-actions .header-button { width: 100%; }
.nav-drawer-actions .header-username { max-width: 100%; }

@media (max-width: 1399px) { .brand-tag { display: none; } }

/* Give navigation its own row before the account controls become cramped. */
@media (min-width: 901px) and (max-width: 1199px) {
  .header-inner { display: grid; grid-template-columns: auto 1fr; gap: 0.45rem 1rem; }
  .brand { grid-column: 1; grid-row: 1; }
  .nav-actions { grid-column: 2; grid-row: 1; justify-self: end; padding: 0; border: 0; }
  .nav-main { grid-column: 1 / -1; grid-row: 2; justify-content: center; margin: 0; padding-top: 0.35rem; border-top: 1px solid var(--line); }
}

@media (max-width: 900px) {
  .nav-main, .nav-actions { display: none; }
  .nav-drawer { display: block; }
  .brand-logo { height: 38px; }
  .brand-tag { display: none; }
}

@media (min-width: 1600px) {
  .site-header .header-button, .nav-main a { min-height: 48px; font-size: 0.95rem; }
}

/* ==========================================================================
   Buttons, badges, pills
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.68rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 0.8rem;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease,
    border-color 140ms ease, color 140ms ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  color: #fff;
  background: linear-gradient(145deg, #3d89ff, #2465e0);
  box-shadow: var(--glow-blue);
}
.btn-primary:hover { background: linear-gradient(145deg, #4f95ff, #2d70ef); box-shadow: 0 10px 36px rgba(45, 124, 255, 0.5); }
.btn-secondary {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(45, 124, 255, 0.10);
}
.btn-secondary:hover { background: rgba(45, 124, 255, 0.20); border-color: rgba(190, 218, 255, 0.45); }
.btn-ghost { color: var(--muted); background: transparent; }
.btn-ghost:hover { color: var(--white); background: rgba(255, 255, 255, 0.07); }
.btn-danger {
  color: #ffd7d7;
  border-color: rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.12);
}
.btn-danger:hover { background: rgba(255, 107, 107, 0.22); }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.85rem; border-radius: 0.65rem; }
.btn-lg { padding: 0.9rem 1.7rem; font-size: 1.05rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.btn:focus-visible,
button:focus-visible,
summary:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(143, 233, 242, 0.95);
  outline-offset: 3px;
}

.pill-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  background: rgba(45, 124, 255, 0.08);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  white-space: nowrap;
}
a.badge:hover { color: var(--white); border-color: var(--line-strong); }
.badge-gold { color: #ffd489; border-color: rgba(255, 174, 39, 0.45); background: rgba(255, 174, 39, 0.12); }
.badge-cyan { color: #8fe9f2; border-color: rgba(22, 199, 217, 0.45); background: rgba(22, 199, 217, 0.10); }
.badge-violet { color: #cfb2ff; border-color: rgba(154, 85, 247, 0.45); background: rgba(154, 85, 247, 0.12); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.7rem;
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-published, .status-active { color: #7ce4b5; background: rgba(62, 207, 142, 0.14); }
.status-draft, .status-pending { color: #ffd489; background: rgba(255, 174, 39, 0.14); }
.status-pending_review, .status-reviewing, .status-open { color: #8fe9f2; background: rgba(22, 199, 217, 0.14); }
.status-unpublished, .status-archived, .status-resolved, .status-dismissed { color: var(--faint); background: rgba(126, 147, 179, 0.16); }
.status-quarantined, .status-suspended { color: #ff9d9d; background: rgba(255, 107, 107, 0.16); }

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(1.4rem, 3.5vw, 2.6rem) clamp(1rem, 3vw, 2rem) 4rem;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.4rem;
}
.section-head .lede { margin: 0; }
.lede { max-width: 60ch; color: var(--muted); font-size: 1.05rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow-line { width: 2rem; height: 1px; background: rgba(22, 199, 217, 0.5); }

.panel {
  padding: clamp(1.2rem, 3vw, 1.8rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 1.2rem; }
.panel h2 { font-size: 1.15rem; margin-bottom: 1rem; }

/* ==========================================================================
   Hero (portal home)
   ========================================================================== */

.hero {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  padding: clamp(1.6rem, 4vw, 3.2rem) 0 clamp(1.8rem, 4vw, 3rem);
}
.hero-copy h1 { margin-bottom: 1rem; }
.hero-copy .lede { font-size: 1.12rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.5rem; }
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  margin-top: 1.9rem;
}
.hero-stat strong {
  display: block;
  color: var(--white);
  font-size: 1.55rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}
.hero-stat span { color: var(--faint); font-size: 0.85rem; font-weight: 650; }

.hero-visual { position: relative; display: grid; place-items: center; }
.hero-logo-halo {
  position: absolute;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 124, 255, 0.30), transparent 68%);
  filter: blur(30px);
}
.hero-logo { position: relative; width: min(100%, 430px); filter: drop-shadow(0 22px 50px rgba(0, 5, 18, 0.55)); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-logo { width: min(72vw, 330px); }
}

/* the three-step strip */
.steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.step {
  position: relative;
  padding: 1.4rem 1.3rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 2.1rem; height: 2.1rem;
  margin-bottom: 0.8rem;
  border-radius: 0.7rem;
  color: #fff;
  background: linear-gradient(145deg, rgba(45, 124, 255, 0.9), rgba(22, 199, 217, 0.55));
  font-weight: 850;
}
.step p { margin: 0; color: var(--muted); font-size: 0.93rem; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ==========================================================================
   Game cards
   ========================================================================== */

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.1rem;
}
.game-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(45, 124, 255, 0.55);
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(45, 124, 255, 0.25);
}
.game-thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.game-thumb img { width: 100%; height: 100%; object-fit: cover; }
.game-thumb-fallback {
  width: 100%; height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-shadow: 0 4px 18px rgba(0, 5, 18, 0.45);
}
/* deterministic fallback palettes (template picks f0–f5 from the slug) */
.f0 { background: linear-gradient(135deg, #2d7cff, #123a68); }
.f1 { background: linear-gradient(135deg, #16c7d9, #0b2a52); }
.f2 { background: linear-gradient(135deg, #9a55f7, #1b1f52); }
.f3 { background: linear-gradient(135deg, #ffae27, #703e0e); }
.f4 { background: linear-gradient(135deg, #3ecf8e, #0e3d33); }
.f5 { background: linear-gradient(135deg, #ff6b9d, #4d1330); }

.game-thumb .play-glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 22, 46, 0.38);
  opacity: 0;
  transition: opacity 150ms ease;
}
.game-card:hover .play-glyph { opacity: 1; }
.play-glyph span {
  display: grid;
  place-items: center;
  width: 3.2rem; height: 3.2rem;
  border-radius: 50%;
  color: #fff;
  background: rgba(45, 124, 255, 0.92);
  box-shadow: var(--glow-blue);
  font-size: 1.2rem;
}
.game-card-body { display: grid; gap: 0.35rem; padding: 0.95rem 1.05rem 1.1rem; }
.game-card-title {
  color: var(--white);
  font-size: 1.02rem;
  font-weight: 780;
  line-height: 1.3;
}
.game-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  color: var(--faint);
  font-size: 0.8rem;
  font-weight: 600;
}
.game-card-meta .by { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-card-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* category chips row */
.cat-row { display: flex; flex-wrap: wrap; gap: 0.55rem; }

/* ==========================================================================
   Filter bar, pagination
   ========================================================================== */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  padding: 0.9rem 1rem;
  margin-bottom: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
}
.filter-bar input[type="search"],
.filter-bar select {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--glass-input);
  font-family: var(--font);
  font-size: 0.92rem;
}
.filter-bar input[type="search"] { flex: 1 1 200px; min-width: 0; }
.filter-bar input::placeholder { color: var(--faint); }

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 1.8rem;
}
.pagination a,
.pagination span {
  display: inline-grid;
  place-items: center;
  min-width: 2.4rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--glass);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}
.pagination a:hover { color: var(--white); border-color: var(--line-strong); }
.pagination .current { color: #fff; background: linear-gradient(145deg, #3d89ff, #2465e0); border-color: transparent; }

/* ==========================================================================
   Forms
   ========================================================================== */

.form-grid { display: grid; gap: 1.2rem; }
.form-row { display: grid; gap: 0.4rem; margin-bottom: 0.9rem; }
.form-row.two {
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-row.two .form-row { margin-bottom: 0; }
@media (max-width: 680px) { .form-row.two { grid-template-columns: 1fr; } }

label { color: var(--text); font-size: 0.9rem; font-weight: 700; }
.label-hint { color: var(--faint); font-weight: 500; font-size: 0.82rem; }

/* Match every text-style input by EXCLUDING the control types, rather than
   listing types. `<input name="x">` with no type attribute is valid HTML and
   behaves as text, but never matches input[type="text"] — listing types left
   those fields with the browser's grey default. Exclusion covers both. */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
textarea, select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--glass-input);
  font-family: var(--font);
  font-size: 0.97rem;
  transition: border-color 130ms ease, box-shadow 130ms ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(45, 124, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(45, 124, 255, 0.22);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
/* keep Chrome/Safari autofill from painting inputs beige */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #123258 inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}
textarea { min-height: 7rem; resize: vertical; }
textarea.code {
  min-height: 20rem;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.5;
  white-space: pre;
  tab-size: 2;
}
select { appearance: auto; }
select option { color: #10233c; background: #eaf3ff; }

.hint { color: var(--faint); font-size: 0.82rem; }
.checkbox-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 0.9rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}
.checkbox-row input { width: auto; margin-top: 0.2rem; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.35rem 0.8rem;
}
.cat-grid label {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 550;
}
.cat-grid input { width: auto; }

.error-list, .warning-list {
  margin: 0 0 1.2rem;
  padding: 0.9rem 1.1rem 0.9rem 2.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
}
.error-list { color: #ffc9c9; border: 1px solid rgba(255, 107, 107, 0.4); background: rgba(255, 107, 107, 0.10); }
.warning-list { color: #ffe1ae; border: 1px solid rgba(255, 174, 39, 0.4); background: rgba(255, 174, 39, 0.08); }
.error-list li + li, .warning-list li + li { margin-top: 0.3rem; }

.flash-stack { display: grid; gap: 0.6rem; margin-bottom: 1.3rem; }
.flash {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 650;
  font-size: 0.94rem;
}
.flash.success { color: #b8f3d8; border: 1px solid rgba(62, 207, 142, 0.4); background: rgba(62, 207, 142, 0.10); }
.flash.warn { color: #ffe1ae; border: 1px solid rgba(255, 174, 39, 0.4); background: rgba(255, 174, 39, 0.10); }
.flash.error { color: #ffc9c9; border: 1px solid rgba(255, 107, 107, 0.4); background: rgba(255, 107, 107, 0.10); }

/* password strength */
.strength-meter {
  height: 6px;
  margin-top: 0.4rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}
.strength-meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #ff6b6b, #ffae27, #3ecf8e);
  transition: width 200ms ease;
}

/* auth panels */
.auth-wrap { display: grid; place-items: center; padding: clamp(1rem, 4vw, 3rem) 0; }
.auth-panel {
  width: min(100%, 460px);
  padding: clamp(1.5rem, 4vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: 1.3rem;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.auth-panel .brand-mini { display: grid; place-items: center; margin-bottom: 1.2rem; }
.auth-panel .brand-mini img { height: 56px; width: auto; }
.auth-alt { margin-top: 1.1rem; color: var(--faint); font-size: 0.9rem; text-align: center; }
.auth-alt a { color: #7fb4ff; font-weight: 700; }

.input-wrap { position: relative; }
.input-wrap .toggle-pw {
  position: absolute;
  right: 0.5rem; top: 50%;
  transform: translateY(-50%);
  padding: 0.3rem 0.6rem;
  border: none;
  border-radius: 0.45rem;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.input-wrap .toggle-pw:hover { color: var(--white); }

/* ==========================================================================
   Publish flow — ingest tabs
   ========================================================================== */

.ingest-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin-bottom: 1.2rem;
}
@media (max-width: 760px) { .ingest-tabs { grid-template-columns: 1fr; } }
.ingest-tab {
  position: relative;
  display: grid;
  gap: 0.25rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass-input);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.ingest-tab:hover { border-color: var(--line-strong); }
.ingest-tab input { position: absolute; opacity: 0; pointer-events: none; }
.ingest-tab .t { color: var(--white); font-weight: 780; font-size: 0.95rem; }
.ingest-tab .d { color: var(--faint); font-size: 0.8rem; font-weight: 550; }
.ingest-tab.active {
  border-color: rgba(45, 124, 255, 0.8);
  background: rgba(45, 124, 255, 0.13);
  box-shadow: 0 0 0 3px rgba(45, 124, 255, 0.18);
}
.ingest-tab .rec {
  position: absolute;
  top: -0.55rem; right: 0.8rem;
  padding: 0.12rem 0.55rem;
  border-radius: 99px;
  color: #052341;
  background: linear-gradient(145deg, #ffd489, #ffae27);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.code-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.code-size { color: var(--faint); font-size: 0.8rem; font-weight: 650; }

.drop-zone {
  display: grid;
  place-items: center;
  gap: 0.3rem;
  padding: 1.6rem 1rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--faint);
  background: rgba(45, 124, 255, 0.05);
  text-align: center;
  font-size: 0.9rem;
  transition: border-color 140ms ease, background 140ms ease;
}
.drop-zone.dragover { border-color: var(--blue); background: rgba(45, 124, 255, 0.14); color: var(--text); }

/* licence picker */
.licence-grid { display: grid; gap: 0.6rem; }
.licence-option {
  position: relative;
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--glass-input);
  cursor: pointer;
}
.licence-option input { position: absolute; opacity: 0; pointer-events: none; }
.licence-option .t { color: var(--white); font-weight: 750; font-size: 0.92rem; display: flex; gap: 0.5rem; align-items: center; }
.licence-option .d { color: var(--faint); font-size: 0.8rem; }
.licence-option.active {
  border-color: rgba(62, 207, 142, 0.7);
  background: rgba(62, 207, 142, 0.08);
}
.licence-option .open-badge {
  padding: 0.1rem 0.5rem;
  border-radius: 99px;
  background: rgba(62, 207, 142, 0.18);
  color: #7ce4b5;
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ==========================================================================
   Game detail + player
   ========================================================================== */

.detail-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.6rem;
  align-items: start;
  margin-bottom: 1.6rem;
}
@media (max-width: 900px) { .detail-hero { grid-template-columns: 1fr; } }
.detail-thumb {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  aspect-ratio: 16 / 10;
  display: grid;
}
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail-meta { display: grid; gap: 0.5rem; margin: 1rem 0; }
.detail-meta-row { display: flex; gap: 0.6rem; align-items: baseline; font-size: 0.92rem; }
.detail-meta-row .k { min-width: 8.5rem; color: var(--faint); font-weight: 700; }
.detail-meta-row .v { color: var(--text); }

.lineage {
  display: grid;
  gap: 0.4rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid rgba(154, 85, 247, 0.4);
  border-radius: var(--radius-sm);
  background: rgba(154, 85, 247, 0.08);
  font-size: 0.9rem;
}
.lineage a { color: #cfb2ff; font-weight: 700; }

.player-shell {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}
.player-shell iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 420px;
  border: 0;
  background: #fff;
}
.player-shell:fullscreen {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
}
.player-shell:fullscreen iframe { flex: 1; min-height: 0; height: 0; aspect-ratio: auto; }
.player-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 31, 59, 0.93);
  flex-shrink: 0;
}
.player-bar .title { color: var(--white); font-weight: 750; font-size: 0.95rem; }

/* source view */
.source-box {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #04101f;
  overflow: hidden;
}
.source-box pre {
  margin: 0;
  padding: 1.2rem 1.4rem;
  max-height: 34rem;
  overflow: auto;
  color: #c9e3ff;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.55;
  tab-size: 2;
}
.source-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 31, 59, 0.92);
  font-size: 0.85rem;
  color: var(--faint);
  font-weight: 650;
}

/* ==========================================================================
   Dashboard & admin tables
   ========================================================================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
}
.stat-card strong {
  display: block;
  color: var(--white);
  font-size: 1.7rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}
.stat-card span { color: var(--faint); font-size: 0.84rem; font-weight: 650; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 0.75rem 1rem; text-align: left; }
th {
  color: var(--faint);
  border-bottom: 1px solid var(--line-strong);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}
td { color: var(--muted); border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: none; }
td a { color: #7fb4ff; font-weight: 700; text-decoration: none; }
td a:hover { text-decoration: underline; }
.inline-admin-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.inline-admin-form select { min-width: 8.5rem; }
.report-details { max-width: 42rem; margin-top: 0.3rem; white-space: pre-wrap; color: var(--muted); }

.report-panel {
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 31, 62, 0.45);
}
.report-panel summary { color: var(--muted); font-weight: 750; cursor: pointer; }
.report-form { display: grid; gap: 0.9rem; max-width: 46rem; margin-top: 1rem; }

.policy-page { max-width: 880px; margin-inline: auto; }
.policy-page h2 { margin-top: 2rem; font-size: 1.25rem; }
.policy-page p, .policy-page li { color: var(--muted); line-height: 1.75; }
.policy-page li + li { margin-top: 0.4rem; }

.version-list { display: grid; gap: 0.5rem; }
.version-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--glass-input);
  font-size: 0.88rem;
  color: var(--muted);
}
.version-item .vnum { color: var(--white); font-weight: 800; }
.version-item.live { border-color: rgba(62, 207, 142, 0.55); }

.empty-state {
  display: grid;
  place-items: center;
  gap: 0.6rem;
  padding: 3rem 1.5rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--faint);
  text-align: center;
}
.empty-state img { height: 64px; width: auto; opacity: 0.9; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(8, 26, 51, 0.90);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  max-width: 1240px;
  margin: 0 auto;
  padding: 2.4rem clamp(1rem, 3vw, 2rem) 1.6rem;
}
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-brand { display: flex; gap: 1rem; align-items: flex-start; }
.footer-brand img { height: 52px; width: auto; }
.footer-brand strong { color: var(--white); font-size: 1.05rem; }
.footer-brand p { margin: 0.3rem 0 0; color: var(--faint); font-size: 0.88rem; }
.footer-col h4 {
  margin-bottom: 0.7rem;
  color: var(--faint);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.footer-col a {
  display: block;
  padding: 0.22rem 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  max-width: 1240px;
  margin: 0 auto;
  padding: 1rem clamp(1rem, 3vw, 2rem) 1.6rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.83rem;
}

/* utility */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.center { text-align: center; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}

/* Account identity: the same compact picture across every creator surface. */
.avatar { display:inline-block; flex-shrink:0; width:2rem; height:2rem; object-fit:cover; border-radius:28%; vertical-align:middle; background:#eaf3ff; border:1px solid var(--line-strong); }
.avatar-small { width:1.6rem; height:1.6rem; }
.avatar-large { width:8rem; height:8rem; }
.avatar-hero { width:10rem; height:10rem; box-shadow:var(--shadow-sm); }
.creator-byline { display:inline-flex; gap:.5rem; align-items:center; }
.profile-editor { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:1.5rem; max-width:1100px; margin-inline:auto; }
.profile-editor .panel { margin:0; }
.profile-editor h2 { margin-top:0; }
.profile-details .form-grid { margin-top:1.5rem; }
.profile-picture-current { display:flex; align-items:center; gap:1.25rem; margin-block:1.25rem; }
.picture-actions { padding:0; border:0; margin:0; display:grid; gap:1rem; min-width:0; }
.picture-actions legend { font-weight:700; margin-bottom:.75rem; }
.picture-option { display:flex; align-items:center; gap:.65rem; font-size:1rem; }
.picture-actions input[type=radio] { width:1.1rem; height:1.1rem; accent-color:var(--cyan); }
.profile-editor input[type=file] { width:100%; min-width:0; font-size:.9rem; }
.avatar-choices { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.5rem; }
.avatar-choice { display:flex; flex-direction:column; gap:.45rem; align-items:center; padding:.65rem .25rem; border:2px solid var(--line); border-radius:var(--radius-sm); cursor:pointer; text-align:center; font-size:.875rem; }
.avatar-choice:has(input:checked) { border-color:var(--cyan); background:rgba(22,199,217,.12); }
.avatar-choice:focus-within { outline:2px solid white; outline-offset:3px; }
.avatar-choice img { width:100%; max-width:88px; height:auto; border-radius:25%; }
.profile-save { grid-column:1/-1; display:flex; gap:1rem; align-items:center; margin-bottom:2rem; }
.field-error { color:#ffb4b4; }
.teacher-profile { display:grid; grid-template-columns:auto minmax(0,1fr); gap:1.5rem 2rem; align-items:center; margin-top:2rem; }
.teacher-identity h1 { overflow-wrap:anywhere; margin:.35rem 0; }
.teacher-bio { grid-column:1/-1; border-top:1px solid var(--line); padding-top:1.5rem; }
.teacher-bio h2 { font-size:1.15rem; margin:0 0 .5rem; }
.bio-text { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.7; max-width:75ch; margin:0; }
.teacher-stats { grid-column:1/-1; margin-top:0; }
@media (max-width:800px) { .profile-editor { grid-template-columns:1fr; } }
@media (max-width:500px) { .avatar-choices { grid-template-columns:repeat(2,minmax(0,1fr)); } .teacher-profile { gap:1rem; } .avatar-hero { width:6rem; height:6rem; } .teacher-identity h1 { font-size:1.6rem; } .profile-picture-current { align-items:flex-start; } .profile-save { align-items:flex-start; flex-direction:column; } }

/* Creator ecosystem: scoped variables leave the surrounding portal familiar. */
.creator-space {
  background: var(--profile-background, #101d35);
  color: var(--profile-text, #f2f6ff);
  padding: clamp(1rem, 3vw, 2.5rem);
  border-radius: 1.4rem;
  border-top: 5px solid var(--profile-accent, #67c9c2);
}
.creator-space .panel, .creator-space .game-card, .creator-space .empty-state {
  background: var(--profile-card, #182a46);
  color: var(--profile-text, #f2f6ff);
  border-color: var(--profile-accent, #67c9c2);
}
.creator-space :is(h1,h2,h3,h4,p,.muted,.eyebrow,.game-card-title,.game-card-summary,.game-card-meta,.by,.creation-kind,.hero-stat strong,.hero-stat span) { color: inherit; }
.creator-space .btn { background: var(--profile-button); color: var(--profile-button-text); border-color: var(--profile-button); }
.creator-space a:focus-visible, .creator-space .btn:focus-visible { outline: 3px solid var(--profile-text); outline-offset: 4px; }
.creator-space .game-card:hover { border-color: var(--profile-text); }
.creator-sections { margin: 1.5rem 0; }
.creation-section-count { font-size: .65em; font-weight: 400; margin-left: .35rem; }
.creator-space > section + section { margin-top: 2rem; }
.creation-kind { display: block; font-size: .75rem; letter-spacing: .045em; margin-bottom: .5rem; color: var(--muted); }
.external-launch { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.external-launch p { overflow-wrap: anywhere; }
.profile-theme-editor { grid-column: 1 / -1; }
.theme-workspace { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.theme-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; min-width: 0; }
.theme-control { border: 1px solid var(--line); border-radius: .8rem; padding: 1rem; min-width: 0; margin: 0; }
.theme-control legend { font-weight: 700; padding: 0 .35rem; }
.theme-presets { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }
.theme-swatch { background: var(--swatch); width: 28px; height: 28px; padding: 0; border: 2px solid #ffffff66; border-radius: 50%; cursor: pointer; }
.theme-swatch:focus-visible { outline: 3px solid white; outline-offset: 3px; }
.theme-inputs { display: flex; gap: .65rem; align-items: end; }
.theme-inputs label { min-width: 0; font-size: .8rem; }
.theme-inputs input[type=color] { display: block; width: 52px; height: 42px; padding: 3px; cursor: pointer; }
.theme-inputs input[data-theme-hex] { width: 100%; min-width: 80px; font-family: monospace; }
.theme-control output { display: block; margin-top: .5rem; }
.theme-preview h3 { font-size: 1.7rem; margin: .4rem 0; }
.theme-preview .panel { margin-top: 1.2rem; }
.theme-preview .avatar { margin-bottom: .75rem; }
.theme-preview .btn { pointer-events: none; }
.theme-contrast { margin: 1rem 0; font-size: .875rem; }
.theme-contrast.low-contrast { color: #ffd489; }
.ingest-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filter-bar { flex-wrap: wrap; }
@media(max-width: 900px) { .theme-workspace { grid-template-columns: 1fr; } }
@media(max-width: 600px) { .ingest-tabs { grid-template-columns: 1fr; } .theme-controls { grid-template-columns: 1fr; } .creator-space { border-radius: .8rem; } }

.version-url { display:block; font-size:.8rem; overflow-wrap:anywhere; color:var(--muted); margin-top:.4rem; }
.version-item > span { min-width:0; }

/* A creator space is the page, with a classroom cover and a compact byline. */
.creator-page { background:var(--profile-background); color:var(--profile-text); }
.creator-page::before, .creator-page > .ambient { display:none; }
.creator-page #main.container { width:100%; max-width:1440px; padding:0; margin-inline:auto; }
.creator-page .creator-space { padding:0; border:0; border-radius:0; background:transparent; }
.creator-cover { position:relative; isolation:isolate; overflow:hidden; }
.creator-cover-board { display:flex; align-items:center; justify-content:center; min-height:260px; padding:2rem clamp(1.5rem,5vw,5rem) 3.2rem; background:radial-gradient(ellipse at 25% 10%,#ffffff08,transparent 65%),#205447; border-bottom:8px solid #bdab82; }
.creator-space .board-message, .board-message { font-family:Arial,Helvetica,sans-serif; font-size:clamp(1.4rem,2.8vw,2.6rem); line-height:1.3; font-weight:400; letter-spacing:0; color:#fff; text-align:center; white-space:pre-wrap; overflow-wrap:anywhere; max-width:32ch; margin:0; }
.creator-page .creator-space .board-message { color:#fff; }
.board-chalk { position:absolute; height:5px; width:38px; background:#faf9ef; bottom:3px; right:12%; border-radius:1px; transform:rotate(-2deg); }
.creator-cover-photo img { width:100%; height:auto; aspect-ratio:40/13; object-fit:cover; }
.cover-edit { position:absolute; right:1.25rem; bottom:1rem; z-index:1; background:#10281ee6; color:#fff; border:1px solid #ffffff60; border-radius:.35rem; padding:.6rem .85rem; font-size:.8rem; font-weight:600; text-decoration:none; min-height:44px; display:flex; align-items:center; }
.cover-edit:focus-visible { outline:3px solid white; outline-offset:3px; }
.creator-content { padding:0 clamp(1rem,3vw,3rem) 3rem; }
.creator-page .teacher-profile { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:2.5rem; align-items:start; margin:0; padding:0 0 1.25rem; }
.creator-page .teacher-identity { display:flex; gap:1.1rem; align-items:flex-start; min-width:0; }
.creator-page .avatar-hero { position:relative; z-index:2; width:120px; height:120px; margin-top:-36px; border:5px solid var(--profile-background); border-radius:24%; box-shadow:none; }
.teacher-name-block { min-width:0; padding-top:1rem; }
.creator-page .teacher-identity h1 { font-size:clamp(1.5rem,2.4vw,2.15rem); line-height:1.15; margin:0 0 .3rem; }
.creator-page .teacher-handle { font-size:.75rem; line-height:1.5; margin:0 0 .5rem; overflow-wrap:anywhere; }
.teacher-joined { font-size:.65rem; white-space:nowrap; }
.creator-page .teacher-stats { display:flex; gap:1rem; flex-wrap:wrap; margin:0 0 .6rem; font-size:.8rem; }
.teacher-stats strong { font-size:1em; font-weight:700; }
.creator-page .teacher-bio { grid-column:auto; margin:0; padding:1.25rem 0 0; border:0; min-width:0; }
.creator-page .teacher-bio h2 { font-size:.85rem; margin:0 0 .4rem; }
.creator-page .bio-text { font-size:.9rem; line-height:1.6; max-width:65ch; }
.creator-page .teacher-identity .btn { font-size:.75rem; min-height:36px; padding:.45rem .7rem; }
.creator-sections { display:flex; flex-wrap:wrap; gap:.25rem 1.5rem; margin:0 0 1.5rem; padding:.5rem 0; border-block:1px solid color-mix(in srgb,var(--profile-text) 20%,transparent); }
.creator-sections a { display:inline-flex; align-items:center; gap:.5rem; min-height:44px; font-size:.85rem; font-weight:650; text-decoration:none; }
.creator-sections a:hover { text-decoration:underline; text-underline-offset:5px; }
.creator-sections span { font-size:.75rem; font-weight:400; }
.creator-collection { margin:0 0 2rem; }
.creator-collection h2 { scroll-margin-top:110px; font-size:1.3rem; }
.creator-collection .section-head { margin-bottom:1rem; }
.creator-page .game-grid { grid-template-columns:repeat(auto-fill,minmax(min(260px,100%),1fr)); }
.creator-page .game-card { max-width:440px; box-shadow:none; }
.profile-cover-editor { grid-column:1/-1; scroll-margin-top:110px; }
.cover-workspace { display:grid; grid-template-columns:1fr 1fr; gap:2rem; margin-top:1.5rem; align-items:start; }
.cover-workspace > div { min-width:0; }
.cover-preview-column { position:sticky; top:110px; }
.cover-preview-column .creator-cover-board { min-height:210px; padding:1.5rem 1.5rem 2rem; }
.cover-preview-column .board-message { font-size:clamp(1.15rem,2vw,1.5rem); }
.cover-introduction { margin-top:1.25rem; }
.creator-cover [hidden] { display:none; }
@media(max-width:900px) {
  .creator-page .teacher-profile { gap:1.5rem; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); }
  .creator-page .teacher-identity { gap:.75rem; }
  .creator-page .avatar-hero { width:92px; height:92px; margin-top:-28px; border-width:4px; }
  .creator-cover-board { min-height:220px; }
  .cover-workspace { grid-template-columns:1fr; }
  .cover-preview-column { position:static; }
}
@media(max-width:600px) {
  .creator-page .teacher-profile { grid-template-columns:1fr; gap:.75rem; padding-bottom:1rem; }
  .creator-page .teacher-bio { padding:0; }
  .creator-page .teacher-identity { gap:1rem; }
  .creator-page .teacher-joined { display:block; }
  .creator-page .teacher-handle { margin-bottom:.35rem; }
  .creator-page .teacher-name-block { padding-top:.65rem; }
  .creator-page .teacher-identity .btn { min-height:44px; }
  .creator-page .bio-text { font-size:.85rem; }
  .creator-cover-board { min-height:210px; padding:1.5rem 1.25rem 3.5rem; }
  .creator-cover-board .board-message { font-size:1.35rem; }
  .creator-cover-photo .cover-edit { bottom:.5rem; right:.5rem; }
  .cover-edit { font-size:.7rem; padding:.35rem .65rem; }
  .creator-sections { gap:0 1.1rem; margin-bottom:1rem; }
}
@media(min-width:1600px) {
  /* Large classroom displays: readable from a distance, generous touch targets. */
  .creator-page #main.container { max-width:1800px; }
  .creator-page .creator-cover-board { min-height:320px; }
  .creator-page .board-message { font-size:3rem; }
  .creator-page .teacher-identity h1 { font-size:2.5rem; }
  .creator-page .bio-text { font-size:1.15rem; }
  .creator-page .teacher-handle { font-size:.9rem; }
  .creator-page .teacher-joined { font-size:.75rem; }
  .creator-page .teacher-bio h2, .creator-page .teacher-stats { font-size:1rem; }
  .creator-page .teacher-identity .btn, .creator-page .creator-sections a, .creator-page .cover-edit { min-height:48px; font-size:1rem; }
  .creator-page .game-grid { grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); }
  .creator-page .game-card-title { font-size:1.3rem; }
  .creator-page .game-card-summary { font-size:1.1rem; }
}
@media(pointer:coarse) { .creator-page .teacher-identity .btn, .cover-edit { min-height:48px; } }

.screenshot-editor { margin-top:1.5rem; padding-top:1.5rem; border-top:1px solid var(--line); }
.screenshot-editor h3 { margin-bottom:.5rem; }
.screenshot-actions { margin-bottom:.75rem; }
.screenshot-preview { width:min(100%,400px); aspect-ratio:16/9; object-fit:cover; margin-top:.65rem; border:1px solid var(--line); border-radius:.5rem; }
.capture-review { margin:1rem 0; padding:1rem; border:1px solid var(--line-strong); border-radius:.6rem; }
.capture-review canvas { display:block; width:100%; max-width:640px; height:auto; background:#102235; margin:.75rem 0; }
.capture-review input[type=range] { width:min(100%,640px); min-height:44px; accent-color:var(--cyan); }
.screenshot-editor [hidden] { display:none; }
.screenshot-manual { margin-top:1rem; }
.screenshot-manual summary { cursor:pointer; font-weight:600; padding:.65rem 0; }
.screenshot-manual[open] summary { margin-bottom:.65rem; }

/* One slogan across the public site and creator experience. */
.brand-slogan {
  color: var(--white);
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 800;
  font-style: normal;
  letter-spacing: -.035em;
  line-height: 1.15;
  text-wrap: balance;
}
.brand-slogan > span { color: #7de3ff; white-space: nowrap; }
.hero-copy h1.brand-slogan-hero {
  max-width: 12ch;
  font-size: clamp(2.65rem, 5.8vw, 4.8rem);
  line-height: 1.04;
  letter-spacing: -.05em;
  margin-bottom: 1.25rem;
}
.brand-slogan-hero > span { display: block; }
.brand-slogan-kicker {
  margin: 0 0 1rem;
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
}
.brand-slogan-auth { margin: 0 0 1.6rem; text-align: center; font-size: 1.15rem; }
.footer-brand p.brand-slogan {
  margin-top: .55rem;
  color: var(--white);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}
@media (max-width: 900px) {
  .hero-copy:has(.brand-slogan-hero) { grid-row: 1; }
  .hero:has(.brand-slogan-hero) .hero-visual { order: 0; }
}

/* Straightforward project uploads and age ranges. */
.catalogue-search { margin:0 0 1.5rem; }
.catalogue-query label, .catalogue-filters label { display:grid; gap:.5rem; min-width:0; font-size:.85rem; font-weight:650; }
.catalogue-query>div { display:flex; gap:.7rem; margin-top:.65rem; }
.catalogue-query input { min-width:0; flex:1; }
.catalogue-filters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:1rem; margin-top:1.1rem; }
.catalogue-filters input, .catalogue-filters select { width:100%; min-width:0; font-weight:400; }
.catalogue-extra-filters { grid-template-columns:repeat(3,minmax(0,1fr)); }
.catalogue-more { margin-top:1rem; }
.catalogue-more summary { cursor:pointer; padding:.6rem 0; color:var(--muted); }
.catalogue-filter-actions, .catalogue-results { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:.8rem; }
.catalogue-filter-actions { margin-top:1.2rem; }
.catalogue-results { color:var(--muted); font-size:.9rem; margin-bottom:.75rem; }
.catalogue-results p { margin:0; }
.catalogue-active-filters { display:flex; flex-wrap:wrap; gap:.5rem; margin-bottom:1.2rem; }
.catalogue-active-filters span { padding:.35rem .7rem; border:1px solid var(--line); border-radius:.5rem; font-size:.8rem; overflow-wrap:anywhere; }
.catalogue-active-filters:empty { display:none; }
.publication-notice { border-left:3px solid var(--cyan); padding:1rem 1.2rem; background:var(--glass-input); margin-bottom:1.5rem; border-radius:0 .7rem .7rem 0; }
.publication-notice p { margin:.4rem 0; color:var(--muted); }
.publication-notice a { display:inline-block; margin-top:.4rem; font-weight:650; }
@media(max-width:900px) { .catalogue-filters { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:520px) { .catalogue-filters { grid-template-columns:1fr; } .catalogue-query>div { flex-wrap:wrap; } .catalogue-query input { flex-basis:100%; } .catalogue-query button { width:100%; } }
.ingest-tabs.project-methods { grid-template-columns:repeat(2,minmax(0,1fr)); }
.ingest-tab:focus-within { outline:3px solid var(--blue); outline-offset:3px; }
.title-and-tool { grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); }
.age-range, .category-options { margin:0 0 1.2rem; padding:0; border:0; min-width:0; }
.age-range legend, .category-options legend { color:var(--text); font-size:.9rem; font-weight:700; margin-bottom:.65rem; }
.age-selectors { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); gap:.8rem; max-width:38rem; }
.age-selectors .form-row { margin:0; }
.age-selectors label { font-weight:500; font-size:.85rem; }
.age-to { align-self:end; padding-bottom:.75rem; color:var(--faint); }
.project-dropzone { padding:1.2rem; border:1px dashed var(--line-strong); border-radius:var(--radius); background:var(--glass-input); }
.project-dropzone input[type=file] { display:block; width:100%; margin-top:.85rem; }
.creation-extra { margin-bottom:1.25rem; }
.creation-extra summary { cursor:pointer; font-weight:650; padding:.65rem 0; }
.creation-extra[open] summary { margin-bottom:.8rem; }
.screenshot-editor { margin-top:1.5rem; }
@media(max-width:680px) { .ingest-tabs.project-methods { grid-template-columns:1fr; } .title-and-tool { grid-template-columns:1fr; } }

/* Classboard-only language menu. No school styles or shared cookies. */
.language-selector { margin:0; flex-shrink:0; }

.language-menu { position:relative; flex-shrink:0; }
.language-menu summary { list-style:none; display:flex; align-items:center; justify-content:center; gap:9px; width:92px; height:44px; padding:0; color:#e5f1ff; background:#ffffff08; border:1px solid #ffffff38; border-radius:12px; cursor:pointer; user-select:none; }
.language-menu summary::-webkit-details-marker { display:none; }
.language-menu summary:hover, .language-menu[open] summary { background:#ffffff12; border-color:#8bbce1; }
.language-menu summary:focus-visible { outline:2px solid #9cdbfa; outline-offset:4px; }
.language-glyphs { display:flex; align-items:center; gap:4px; height:24px; font-family:Arial,"Noto Sans TC",sans-serif; font-size:18px; font-weight:700; line-height:1; }
.language-glyphs span:nth-child(1) { color:#f2f6ff; }
.language-glyphs span:nth-child(2) { color:#8fd9f3; }
.language-glyphs span:nth-child(3) { color:#f9d57b; }
.language-chevron { width:6px; height:6px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg) translateY(-2px); }
.language-options { position:absolute; right:0; top:calc(100% + 10px); z-index:100; min-width:230px; padding:7px; border:1px solid #577291; border-radius:14px; background:#0d223e; box-shadow:0 16px 42px #0006; }
.language-options > a, .language-options > button { position:relative; display:block; width:100%; box-sizing:border-box; padding:12px 40px 12px 14px; border:0; border-radius:8px; color:#e5effc; background:transparent; font:600 15px/1.3 system-ui,sans-serif; text-align:left; text-decoration:none; white-space:nowrap; cursor:pointer; }
.language-options > :hover, .language-options > :focus-visible { background:#ffffff12; outline:2px solid transparent; }
.language-options > [aria-current] { color:#ffda83; background:#ffffff08; }
.language-options > [aria-current]::after { content:"✓"; position:absolute; right:13px; }

.header-inner { flex-wrap:wrap; }
html[lang="zh-Hant-TW"] .brand-slogan { line-height:1.25; }
html[lang="ru"] .brand-slogan { overflow-wrap:anywhere; }
