/* DrawDump — monochrome theme: black / white / gray */

[hidden] { display: none !important; }

* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

:root, html[data-theme="dark"] {
  --radius: 12px;
  --bg: #0a0a0a;
  --bg-soft: #0f0f0f;
  --panel: #121212;
  --panel-2: #171717;
  --border: #2a2a2a;
  --border-soft: #1e1e1e;
  --text: #f4f4f4;
  --muted: #a8a8a8;
  --faint: #7d7d7d;
  --accent: #ffffff;
  --accent-contrast: #0a0a0a;
  --hover: #1f1f1f;
  --ring: rgba(255, 255, 255, .16);
  --grid: rgba(255, 255, 255, .035);
  --danger: #e5484d;
  --code-kw: #ffffff;
  --code-str: #bcbcbc;
  --code-com: #6f6f6f;
  --code-num: #d8d8d8;
  --code-fn: #ececec;
  --code-var: #a8a8a8;
}

html[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --panel: #ffffff;
  --panel-2: #f5f5f5;
  --border: #e2e2e2;
  --border-soft: #ededed;
  --text: #0a0a0a;
  --muted: #565656;
  --faint: #7a7a7a;
  --accent: #0a0a0a;
  --accent-contrast: #ffffff;
  --hover: #f0f0f0;
  --ring: rgba(0, 0, 0, .14);
  --grid: rgba(0, 0, 0, .045);
  --danger: #d93036;
  --code-kw: #000000;
  --code-str: #3f3f3f;
  --code-com: #8b8b8b;
  --code-num: #1f1f1f;
  --code-fn: #000000;
  --code-var: #555555;
}

* { box-sizing: border-box; }
html { color-scheme: light dark; }
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--muted); }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

::selection { background: var(--text); color: var(--bg); }
::selection { background: var(--ring); }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 60px; }
.logo { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; font-size: 17px; }
.logo:hover { color: var(--text); }
.logo-mark {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 3px 7px; color: var(--text);
}
.logo-text span { color: var(--faint); }
.nav-main { display: flex; gap: 18px; font-size: 14px; }
.nav-main a { color: var(--muted); }
.nav-main a:hover { color: var(--text); }
.nav-auth { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-user { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.nav-user:hover { color: var(--text); }

/* account dropdown (avatar click) */
.user-menu-wrap { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 0; cursor: pointer; font-family: inherit;
  color: var(--text); font-size: 14px; font-weight: 600;
  padding: 5px 8px; border-radius: 9px;
}
.user-btn:hover { background: var(--hover); color: var(--text); }
.user-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.user-btn .chev { color: var(--muted); transition: transform .15s ease; }
.user-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  min-width: 210px; padding: 6px;
  display: flex; flex-direction: column; gap: 1px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 18px 44px -20px rgba(0, 0, 0, .7);
}
html[data-theme="light"] .user-menu { box-shadow: 0 18px 44px -24px rgba(0, 0, 0, .3); }
.user-menu-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px 9px; margin-bottom: 3px;
  border-bottom: 1px solid var(--border-soft);
}
.umh-text { display: flex; flex-direction: column; min-width: 0; }
.user-menu-head .un { font-size: 14px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-head .ue { font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu a, .user-menu button {
  display: flex; align-items: center; width: 100%;
  padding: 9px 11px; border-radius: 8px; font-family: inherit;
  font-size: 13.5px; font-weight: 600; color: var(--text);
  text-align: left; background: none; border: 0; cursor: pointer;
}
.user-menu a:hover, .user-menu button:hover { background: var(--hover); color: var(--text); }
.user-menu a:focus-visible, .user-menu button:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }
.user-menu-logout { color: var(--danger) !important; margin-top: 2px; }
.user-menu-logout:hover { background: var(--hover); color: var(--danger) !important; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: var(--text); color: var(--bg);
  overflow: visible; flex-shrink: 0;
  position: relative;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; }
/* red notification dot on top of the account picture */
.avatar-dot {
  position: absolute; top: -3px; right: -3px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--danger, #e5484d);
  border: 2px solid var(--bg);
  z-index: 2;
}
/* notifications item badge (unread count) inside the avatar dropdown */
.um-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 800; line-height: 18px; text-align: center;
  flex-shrink: 0;
}
/* dedicated notifications page (list itself now lives on /notifications) */
.notif-head-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 0 14px; flex-wrap: wrap;
}
.notif-head-row h1 { margin: 0; }
.notif-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  color: var(--text); text-decoration: none;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--hover); }
.notif-item.unread { background: var(--unread, rgba(229,72,77,.07)); }
.ni-ic { font-size: 14px; line-height: 1.3; }
.ni-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ni-msg { font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.ni-time { font-size: 11px; color: var(--muted); }
.ni-new {
  font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: var(--danger, #e5484d); border: 1px solid currentColor;
  border-radius: 999px; padding: 1px 6px; align-self: center; flex-shrink: 0;
}

/* ---------- modal (report dialog) ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .55); padding: 16px;
}
.modal-card {
  width: min(100%, 430px);
  background: var(--panel, var(--bg));
  border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; box-shadow: 0 20px 48px rgba(0,0,0,.35);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-x {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font-size: 22px; line-height: 1; padding: 2px 8px; border-radius: 8px;
}
.modal-x:hover { color: var(--text); background: var(--hover); }
.modal-sub { margin: 6px 0 12px; font-size: 12.5px; }
.field-label {
  display: block; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin: 10px 0 5px;
}
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.nav-email { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-toggle { padding: 5px 9px; }
.verify-pill {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); border: 1px dashed var(--border); border-radius: 999px;
  padding: 3px 9px;
}
.verify-pill:hover { color: var(--text); border-style: solid; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: transparent; color: var(--text);
  padding: 8px 14px; border-radius: 9px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit; line-height: 1.2;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .06s ease;
}
.btn:hover { background: var(--hover); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent); color: var(--accent-contrast); opacity: .88; }
.btn-ghost { border-color: transparent; }
.btn-ghost:hover { border-color: var(--border); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 8px; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -60px -200px auto -200px; height: 420px;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse 60% 70% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero-badge {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 13px;
  margin-bottom: 26px; background: var(--panel);
}
.hero h1 { font-size: 54px; margin: 0 0 16px; letter-spacing: -.03em; line-height: 1.08; font-weight: 800; }
.hero h1 .outline { color: transparent; -webkit-text-stroke: 1.6px var(--text); }
.hero p { color: var(--muted); font-size: 17px; margin: 0 auto 28px; max-width: 620px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- terminal mockup ---------- */
.term {
  max-width: 620px; margin: 44px auto 0; text-align: left;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--panel); overflow: hidden;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .7);
}
html[data-theme="light"] .term { box-shadow: 0 20px 50px -30px rgba(0, 0, 0, .25); }
.term-head {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px; border-bottom: 1px solid var(--border-soft); background: var(--panel-2);
}
.dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-soft); }
.term-title { margin-left: 8px; font-size: 12px; color: var(--faint); font-family: ui-monospace, Menlo, monospace; }
.term-body {
  margin: 0; padding: 18px 18px 20px; font-size: 13.5px; line-height: 1.75;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text); overflow-x: auto;
}
.term-body .t-dim { color: var(--faint); }

/* ---------- stats ---------- */
.stats {
  margin-top: 26px; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px; color: var(--muted);
}
.stats b { color: var(--text); font-weight: 700; }
.stats-sep { margin: 0 10px; color: var(--faint); }

/* ---------- features ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 56px 0 8px; }
.feature-card {
  border: 1px solid var(--border-soft); border-radius: var(--radius, 12px);
  background: var(--panel); padding: 20px 18px;
  transition: border-color .15s ease, transform .15s ease;
}
.feature-card:hover { border-color: var(--border); transform: translateY(-2px); }
.feature-card svg { width: 20px; height: 20px; stroke: var(--text); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 12px; }
.feature-card h3 { margin: 0 0 6px; font-size: 15px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.feature-card code { font-size: 12.5px; border: 1px solid var(--border); border-radius: 6px; padding: 1px 5px; background: var(--panel-2); }

/* ---------- search ---------- */
.search-form { display: flex; gap: 10px; max-width: 640px; margin: 0 0 16px; }
.search-form input { flex: 1; }

/* ---------- forms ---------- */
input, select, textarea {
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
  border-radius: 9px; padding: 9px 12px; font-size: 14px; font-family: inherit;
  width: 100%; outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--muted); box-shadow: 0 0 0 3px var(--ring); }
.btn:focus-visible, .sort-tab:focus-visible, .link-btn:focus-visible {
  outline: 2px solid var(--text); outline-offset: 2px;
}
::placeholder { color: var(--faint); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.field .req { color: var(--danger); }
/* fixed (non-editable) form value — Luau only */
.lang-fixed {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px;
  background: color-mix(in srgb, var(--fg) 4%, transparent);
  font-size: 13.5px; color: var(--muted);
}
.form-err {
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  color: var(--danger); border-radius: 9px; padding: 9px 12px; font-size: 13.5px;
  margin-bottom: 14px; display: none;
}

/* ---------- banner (verify email) ---------- */
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  border: 1px dashed var(--border); background: var(--panel);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 20px; font-size: 14px;
}
.banner-text { color: var(--muted); }
.banner-text b { color: var(--text); }

/* ---------- snippet list ---------- */
.list-head { display: flex; align-items: center; justify-content: space-between; margin: 40px 0 16px; }
.list-head h2 { font-size: 14px; margin: 0; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.snippet-row {
  display: flex; gap: 16px; justify-content: space-between; align-items: center;
  padding: 14px 16px; border: 1px solid var(--border-soft); border-radius: 12px;
  background: var(--panel); margin-bottom: 10px; color: var(--text);
  transition: border-color .15s ease, background .15s ease;
}
.snippet-row:hover { border-color: var(--border); background: var(--panel-2); color: var(--text); }
.row-file { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.file-name { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; font-weight: 600; }
.row-title { font-weight: 600; margin-top: 3px; }
.row-desc {
  color: var(--muted); font-size: 13.5px; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; color: var(--faint); font-size: 12.5px; flex-shrink: 0; }
.row-author { color: var(--text); font-weight: 600; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- badges ---------- */
.badge {
  display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--border); color: var(--muted); background: transparent;
}
.lang-badge { font-family: ui-monospace, Menlo, monospace; color: var(--text); }
.vis-public { border-style: solid; color: var(--text); }
.vis-unlisted { border-style: dashed; }
.vis-private { border-style: dotted; color: var(--faint); }
.game-badge { color: var(--text); }
.key-keyless { border-style: solid; color: var(--text); }
.key-key { border-style: dashed; }
.key-paid { border-style: dotted; color: var(--faint); }
.st-working { border-style: solid; color: var(--text); }
.st-patched { border-style: dashed; text-decoration: line-through; }
.st-mixed { border-style: dotted; }
.likes-count { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--muted); }

/* ---------- sort tabs & chips ---------- */
.sort-tabs, .chips { display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.chips { margin-top: -6px; }
.sort-tab, .chip {
  border: 1px solid var(--border-soft); background: transparent; color: var(--muted);
  padding: 7px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.sort-tab:hover, .chip:hover { color: var(--text); border-color: var(--border); background: var(--panel-2); }
.sort-tab.active, .chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- script cards (grid) ---------- */
.script-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.script-card {
  border: 1px solid var(--border-soft); border-radius: 12px; background: var(--panel);
  overflow: hidden; color: var(--text); display: flex; flex-direction: column;
  transition: border-color .15s ease, transform .15s ease;
}
.script-card:hover { border-color: var(--border); transform: translateY(-2px); color: var(--text); box-shadow: 0 14px 34px -22px rgba(0, 0, 0, .65); }
html[data-theme="light"] .script-card:hover { box-shadow: 0 14px 34px -24px rgba(0, 0, 0, .35); }
.script-card:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.card-thumb {
  aspect-ratio: 16/9; background: var(--panel-2);
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb-empty span {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 26px; font-weight: 700; color: var(--faint);
}
.card-body { padding: 12px 14px 13px; display: flex; flex-direction: column; gap: 8px; }
.card-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.card-badges .badge { font-size: 9.5px; padding: 1px 7px; }
.card-stats { display: flex; gap: 12px; color: var(--muted); font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.card-foot { display: flex; justify-content: space-between; color: var(--faint); font-size: 12px; }

.hero-compact { padding-top: 40px; }
.hero-compact h1 { font-size: 42px; margin-bottom: 18px; }
.hero-compact .stats { margin-top: 10px; }

/* ---------- browse section (search, filters, grid) ---------- */
.browse { margin-top: 36px; }
.browse-title { margin: 0 0 16px; font-size: 24px; letter-spacing: -.02em; }
.browse .search-form { max-width: 100%; margin: 0; }
.browse .search-form input { padding: 11px 14px; font-size: 15px; }
.browse .sort-tabs { margin-top: 14px; }

/* docs TOC */
.docs-toc { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 6px; }
.docs-toc a {
  font-size: 13px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--border-soft); border-radius: 999px; padding: 6px 13px;
}
.docs-toc a:hover { color: var(--bg); background: var(--text); border-color: var(--text); }
.docs h2 { scroll-margin-top: 74px; }

.features-below { margin: 56px 0 8px; }

/* skeleton cards shown while the first page loads */
.skel-card { pointer-events: none; }
.skel-line {
  height: 11px; border-radius: 6px;
  background: var(--border-soft);
  position: relative; overflow: hidden;
}
.skel-line.w70 { width: 70%; }
.skel-line.w50 { width: 50%; }
.skel-line.w40 { width: 40%; }
.skel-line::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 15%, var(--border) 50%, transparent 85%);
  transform: translateX(-100%);
  animation: skel-shimmer 1.3s infinite;
}
@keyframes skel-shimmer { 100% { transform: translateX(100%); } }
.skel-card .card-thumb::after { content: none; }
@media (prefers-reduced-motion: reduce) { .skel-line::after { animation: none; } }

.chip-count { opacity: .5; font-size: 11px; margin-left: 1px; }
.chip-icon { width: 17px; height: 17px; border-radius: 5px; object-fit: cover; vertical-align: -4px; margin-right: 6px; }

/* quick copy button on each card */
.copy-ls {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px; font-weight: 600; line-height: 1;
  color: var(--muted); background: transparent;
  border: 1px solid var(--border-soft); border-radius: 999px;
  padding: 4px 9px; cursor: pointer; flex-shrink: 0;
  transition: color .12s ease, border-color .12s ease;
}
.copy-ls:hover { color: var(--bg); background: var(--text); border-color: var(--text); }
.copy-ls:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* nicer empty state with a call to action */
.empty.compact { padding: 16px 0; }
.empty-cta {
  grid-column: 1 / -1;
  border: 1px dashed var(--border); border-radius: var(--radius, 12px);
  padding: 48px 20px; margin: 4px 0 12px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty-cta p { margin: 0 0 6px; max-width: 420px; }
.empty-big { font-size: 18px; font-weight: 700; color: var(--text); }

/* ---------- game categories ---------- */
.games-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.game-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  border: 1px solid var(--border-soft); border-radius: var(--radius, 12px);
  background: var(--panel); padding: 18px 12px 14px; color: var(--text);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.game-tile:hover { border-color: var(--border); transform: translateY(-2px); color: var(--text); box-shadow: 0 14px 34px -22px rgba(0, 0, 0, .65); }
.game-tile:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.game-icon {
  width: 64px; height: 64px; border-radius: 14px; overflow: hidden; flex-shrink: 0;
  background: var(--panel-2); border: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center;
}
.game-icon img { width: 100%; height: 100%; object-fit: cover; }
.game-icon-fallback { font-size: 26px; font-weight: 800; color: var(--muted); }
.game-icon.xl { width: 78px; height: 78px; border-radius: 16px; }
.game-name {
  font-size: 14px; font-weight: 700; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.game-count { font-size: 12px; color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; }

.game-hero { display: flex; align-items: center; gap: 16px; padding: 30px 0 6px; }
.game-hero-text h1 { font-size: 30px; margin: 0 0 4px; letter-spacing: -.02em; }
.game-hero-text .sub { margin: 0; }

/* ---------- snippet page layout + sidebar ---------- */
.snippet-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.snippet-main { min-width: 0; }
.side-card { margin-bottom: 14px; }
.side-card h3 {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); margin: 0 0 6px;
}
.side-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 13.5px; padding: 7px 0; border-bottom: 1px solid var(--border-soft);
}
.side-row:last-child { border-bottom: none; }
.side-row .k { color: var(--muted); flex-shrink: 0; }
.side-row .v { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-actions { display: flex; flex-direction: column; gap: 8px; }
.side-actions .btn { width: 100%; }

/* ---------- like button ---------- */
#likeBtn.liked { color: var(--text); border-color: var(--text); }

/* ---------- 6-digit code box ---------- */
.code-input-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 30px; font-weight: 700; letter-spacing: 10px; text-align: center;
}

/* ---------- avatars ---------- */
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.acct-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- script cover ---------- */
.snippet-thumb {
  width: 100%; max-height: 320px; object-fit: cover; display: block;
  border: 1px solid var(--border); border-radius: 12px; margin-bottom: 20px; background: var(--panel);
}

/* ---------- comments ---------- */
.comments { margin-top: 28px; }
.comments h2 { font-size: 16px; margin: 0 0 4px; }
.comment { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border-soft); }
.comment-main { flex: 1; min-width: 0; }
.comment-head { font-size: 13px; margin-bottom: 3px; }
.comment-body { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.link-btn { background: none; border: none; color: var(--faint); font-size: 12px; cursor: pointer; padding: 0; font-family: inherit; }
.link-btn:hover { color: var(--danger); }

/* ---------- utility classes (no inline styles in HTML) ---------- */
.btn-block { width: 100%; }
.file-input { max-width: 300px; }
.more-wrap { text-align: center; margin: 24px 0; }
.more-wrap .btn { min-width: 190px; padding: 11px 18px; border-radius: 10px; }
.mail-icon {
  width: 34px; height: 34px; stroke: var(--text); fill: none;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 14px;
}
.text-strong { color: var(--text); }
.hint { font-size: 12.5px; color: var(--faint); margin: 8px 0 0; line-height: 1.5; }

/* live Roblox game resolve preview on /new */
.game-resolve { display: flex; align-items: center; gap: 10px; margin-top: 8px; min-height: 0; font-size: 13.5px; color: var(--text); }
.game-resolve:empty { display: none; }
.game-resolve b { display: block; font-size: 13.5px; }
.game-resolve small { display: block; color: var(--faint); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; }
.game-icon.pm { width: 40px; height: 40px; border-radius: 10px; }
.game-icon.pm .game-icon-text { font-size: 17px; font-weight: 800; color: var(--muted); }
.gr-err { color: var(--danger); font-size: 13px; font-weight: 600; }
.gr-loading { color: var(--muted); font-size: 13px; }
.card-spaced { margin-bottom: 20px; }
.card-pad { padding: 6px 10px; }
.no-margin { margin: 0; }
.big-404 { font-size: 44px; margin-bottom: 4px; }
.profile-sub { margin-top: -14px; }
.text-center { text-align: center; }
.auth-wide { max-width: 480px; }
.comment-form { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.comment-form textarea { resize: vertical; min-height: 56px; }

/* ---------- docs page ---------- */
.docs { max-width: 760px; }
.docs h2 { margin-top: 34px; font-size: 19px; }
.docs h3 { font-size: 15px; margin-top: 22px; }
.docs p, .docs li { color: var(--muted); font-size: 14.5px; }
.docs p code, .docs li code {
  font-size: 12.5px; border: 1px solid var(--border); border-radius: 6px;
  padding: 1px 5px; background: var(--panel-2); color: var(--text);
}
.docs pre {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; overflow-x: auto; font-size: 13px; line-height: 1.6;
}

/* ---------- empty / loading ---------- */
.empty, .loading { padding: 44px 0; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }

/* auth page: one card, two tabs */
.auth-tabs {
  display: flex; gap: 4px; margin: 0 0 18px;
  background: var(--bg-soft); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 4px;
}
.auth-tab {
  flex: 1; text-align: center; padding: 8px 12px; border-radius: 7px;
  font-size: 13.5px; font-weight: 700; color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active { background: var(--text); color: var(--bg); }
.auth-tab.active:hover { color: var(--bg); }
.auth-tab:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* ---------- auth pages ---------- */
.auth-wrap { display: flex; justify-content: center; padding: 64px 0; }
.auth-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--border-soft); border-radius: 16px; padding: 30px; }
.auth-card h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.01em; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.auth-alt { margin-top: 18px; font-size: 14px; color: var(--muted); text-align: center; }
.auth-alt a { text-decoration: underline; }

/* ---------- pages ---------- */
.page { padding: 36px 0 60px; }
.page-title { font-size: 24px; margin: 0 0 20px; letter-spacing: -.01em; }
/* visible breadcrumb (snippet pages) */
.crumbs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted); margin: 0 0 6px;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--fg); text-decoration: underline; }
.crumbs .crumb-here { color: var(--fg); font-weight: 600; }
.card { background: var(--panel); border: 1px solid var(--border-soft); border-radius: 12px; padding: 18px; }
.card h3 { margin: 0 0 14px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ---------- editor ---------- */
.editor-grid { display: grid; grid-template-columns: 1fr 330px; gap: 20px; align-items: start; }
textarea.code-input {
  min-height: 440px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px; line-height: 1.6; resize: vertical; white-space: pre; tab-size: 2;
}
.drop-hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }

/* ---------- dashboard ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--panel); border: 1px solid var(--border-soft); border-radius: 12px; padding: 16px; }
.stat .v { font-size: 26px; font-weight: 800; font-family: ui-monospace, Menlo, monospace; }
.stat .k { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; }
.table-wrap { overflow-x: auto; }
.snip-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.snip-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.snip-table td { padding: 11px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.snip-table tr:last-child td { border-bottom: none; }
.snip-table .fname { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px; font-weight: 600; }

/* ---------- snippet view ---------- */
.snippet-head { margin-bottom: 22px; }
.snippet-head h1 { margin: 0 0 6px; font-size: 26px; word-break: break-word; letter-spacing: -.015em; }
.snippet-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; align-items: center; margin-top: 10px; }
.code-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; background: var(--panel-2); border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.code-file { display: flex; align-items: center; gap: 8px; font-family: ui-monospace, Menlo, monospace; font-size: 13.5px; font-weight: 600; }
.code-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.code-body { margin: 0; padding: 16px; overflow: auto; max-height: 72vh; font-size: 13.5px; line-height: 1.65; }
.code-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: none; padding: 0; font-size: inherit; }

/* ---------- syntax highlighting (grayscale) ---------- */
.hljs { color: var(--text); background: transparent; }
.hljs-comment, .hljs-quote { color: var(--code-com); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-doctag { color: var(--code-kw); font-weight: 700; }
.hljs-string, .hljs-regexp, .hljs-addition { color: var(--code-str); }
.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-link { color: var(--code-num); }
.hljs-title, .hljs-section, .hljs-name, .hljs-function .hljs-title { color: var(--code-fn); font-weight: 600; }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-selector-attr, .hljs-selector-class, .hljs-selector-id { color: var(--code-var); }
.hljs-built_in, .hljs-type, .hljs-class .hljs-title { color: var(--code-fn); }
.hljs-meta, .hljs-meta .hljs-keyword { color: var(--code-com); }
.hljs-emphasis { font-style: italic; } .hljs-strong { font-weight: 700; }
.hljs-deletion { color: var(--code-com); text-decoration: line-through; }
.hljs-subst { color: var(--text); }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 74px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: 340px; }
.toast {
  background: var(--panel-2); border: 1px solid var(--border); border-left: 3px solid var(--text);
  padding: 10px 14px; border-radius: 10px; font-size: 13.5px;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5); animation: slide .25s ease;
}
.toast.err { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--muted); }
.toast.out { opacity: 0; transition: opacity .3s; }

/* ---------- account handles (username / display name) ---------- */
.header-cta { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
.acct-sub { font-size: 13px; margin-bottom: 14px; line-height: 1.55; }
.acct-sub .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.opt-tag {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--faint); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px;
  vertical-align: 1px; margin-left: 4px;
}
.handle-input { text-transform: lowercase; }
.field-msg { font-size: 12.5px; margin-top: 6px; line-height: 1.4; }
.field-msg.ok { color: var(--muted); }
.field-msg.err { color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.profile-sub .handle { color: var(--text); font-weight: 700; }
.comment-author:hover { text-decoration: underline; }
.drop-hint.size-warn { color: var(--danger); }
.drop-hint.size-warn #sizeCount { color: var(--danger); font-weight: 700; }
@keyframes slide { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border-soft); margin-top: 70px; padding: 22px 0; color: var(--faint); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

h1, h2, h3 { font-weight: 700; }

@media (max-width: 820px) {
  .editor-grid { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .script-grid { grid-template-columns: repeat(2, 1fr); }
  .snippet-layout { grid-template-columns: 1fr; }
  .games-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
  .hero { padding-top: 44px; }
  .snippet-row { flex-direction: column; align-items: flex-start; }
  .row-meta { flex-direction: row; align-items: center; gap: 12px; }
  .header-inner { gap: 10px; }
  .nav-main { gap: 10px; font-size: 13px; }
  .nav-email { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .script-grid { grid-template-columns: 1fr; }
  .hero-compact h1 { font-size: 33px; }
  .browse { margin-top: 22px; }
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .game-tile { padding: 14px 10px 12px; }
  .game-icon { width: 54px; height: 54px; }
  .game-hero { padding-top: 18px; }
  .game-hero-text h1 { font-size: 23px; }
}

/* admin moderation list (dashboard) */
.mod-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.mod-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
}
.mod-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mod-note { font-size: 12.5px; }
.mod-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) {
  .mod-row { flex-direction: column; }
  .mod-actions { justify-content: flex-start; }
}

/* ---------- game picker dropdown (IDs + icons) ---------- */
.field-game { position: relative; }
.gm-wrap { position: relative; }
.gm-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--panel, var(--bg)); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 14px 34px rgba(0,0,0,.28);
  max-height: 280px; overflow: auto; padding: 4px;
}
.gm-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.gm-item:hover, .gm-item.active { background: var(--hover, rgba(127,127,127,.14)); }
.gm-item img { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; background: var(--bg-soft); }
.gm-item .gm-n { font-size: 13.5px; color: var(--text); line-height: 1.25; }
.gm-item .gm-id { font-size: 11.5px; color: var(--muted); margin-left: auto; font-family: ui-monospace, monospace; }
.gm-item.gm-clear { color: var(--muted); font-size: 12.5px; }
.gm-empty { padding: 10px 12px; color: var(--muted); font-size: 12.5px; }
