/* ==========================================================================
   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: 1.2rem;
  max-width: 1240px;
  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;
}
.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;
  gap: 0.25rem;
  margin-left: auto;
}
.nav-main a {
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
  transition: color 140ms ease, background 140ms ease;
}
.nav-main a:hover,
.nav-main a:focus-visible { color: var(--white); background: rgba(45, 124, 255, 0.14); }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* mobile drawer */
.nav-drawer { display: none; position: relative; margin-left: auto; }
.nav-drawer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 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);
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(14, 40, 74, 0.97);
  box-shadow: var(--shadow);
}
.nav-drawer-links { display: grid; gap: 0.15rem; margin-bottom: 0.9rem; }
.nav-drawer-links a {
  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; gap: 0.5rem; }

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

/* ==========================================================================
   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(3, 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.fs iframe { height: 100vh; 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-top: 1px solid var(--line);
  background: rgba(10, 31, 59, 0.93);
}
.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;
  }
}
