/* The community library (src/community-pages.ts): Games, Creations, Templates and VR Creations. On top of base.css and status.css,
   in the same tokens: tone-only cards, hairlines, the white pill. Signature: every item without a picture gets a cover
   drawn from its id, two hues and a pattern for its kind (a pixel grid for games, rings for creations, a layout grid for
   templates, a floor running to the horizon for VR worlds), so a shelf of new shares still looks like a gallery. */

.cm-hero { padding: var(--s-6) 0 var(--s-6); max-width: 860px; }
.cm-hero-sm { padding-bottom: var(--s-5); }
.cm-hero h1 { margin: 0 0 var(--s-4); font-size: clamp(38px, 5.6vw, 68px); line-height: 1.02; letter-spacing: -0.022em; font-weight: 500; color: var(--text); text-wrap: balance; }
.cm-hero h1 em { font-style: normal; color: var(--muted); }
.cm-lede { margin: 0; max-width: 62ch; font-size: 18px; line-height: 1.55; color: var(--body); }
.cm-acts { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }

/* tabs: one row of pills, the current one filled */
.cm-tabs { display: flex; gap: var(--s-1); overflow-x: auto; margin: 0 0 var(--s-6); padding: 4px; border-radius: var(--r-control); background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); width: max-content; max-width: 100%; scrollbar-width: none; }
.cm-tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--r-control); font-size: 14px; font-weight: 500; color: var(--body); white-space: nowrap; transition: background-color var(--t-1) var(--ease), color var(--t-1) var(--ease); }
.cm-tabs a:hover { color: var(--text); }
.cm-tabs a[aria-current] { background: var(--btn1-face); -webkit-backdrop-filter: var(--btn-glass); backdrop-filter: var(--btn-glass); color: var(--btn1-text); box-shadow: var(--btn1-ring); }
.cm-tabs a span { font-size: 12px; font-variant-numeric: tabular-nums; opacity: 0.6; }

.cm-rail { margin-bottom: var(--s-8); }
.cm-rail-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-2) var(--s-4); margin-bottom: var(--s-4); }
.cm-rail-head h2 { margin: 0; font-size: clamp(22px, 2.4vw, 28px); font-weight: 500; letter-spacing: -0.02em; color: var(--text); }
.cm-rail-head > a { font-size: 14px; color: var(--body); }
.cm-rail-head > a::after { content: " \2192"; }
.cm-rail-head > a:hover { color: var(--text); }
.cm-sub { font-size: 14px; color: var(--muted); }
.cm-sort { display: flex; gap: var(--s-1); }
.cm-sort a { padding: 6px 12px; border-radius: var(--r-control); font-size: 13.5px; color: var(--muted); }
.cm-sort a:hover { color: var(--text); }
.cm-sort a[aria-current] { color: var(--text); background: var(--raised); }

/* cards */
.cm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--s-5); margin: 0; padding: 0; list-style: none; }
.cm-grid-big { grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); }
.cm-card { min-width: 0; }
.cm-card-link { display: flex; flex-direction: column; height: 100%; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair), var(--edge); overflow: hidden; color: inherit;
  transition: box-shadow var(--t-2) var(--ease), translate var(--t-2) var(--ease); }
a.cm-card-link:hover, .cm-card-link:focus-within { box-shadow: inset 0 0 0 1px var(--line-2); translate: 0 -3px; }
a.cm-card-link:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.cm-cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--raised); }
.cm-shot { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: scale var(--t-4) var(--ease-reveal); }
a.cm-card-link:hover .cm-shot, a.cm-card-link:hover .cm-art { scale: 1.035; }
.cm-pick { position: absolute; top: 12px; left: 12px; padding: 5px 10px; border-radius: var(--r-control); font-size: 12px; font-weight: 600; color: #0a0a0a; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); }
.cm-meta { display: flex; flex-direction: column; gap: var(--s-2); flex: 1; padding: var(--s-4) var(--s-5) var(--s-5); }
.cm-meta h3 { margin: 0; font-size: 17px; font-weight: 500; line-height: 1.3; color: var(--text); letter-spacing: -0.005em; }
.cm-meta p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--body); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cm-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin-top: auto; padding-top: var(--s-2); font-size: 13px; color: var(--muted); }
.cm-remixes { margin-left: auto; font-variant-numeric: tabular-nums; }
.cm-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: var(--r-control); font-size: 12px; font-weight: 500; color: var(--text); background: var(--raised); box-shadow: inset 0 0 0 1px var(--hair-2), var(--edge); }
.cm-chip-pick { color: var(--warn); }
.cm-use { margin-top: var(--s-2); align-self: flex-start; }

/* the drawn cover: the signature */
.cm-art { position: absolute; inset: 0; display: grid; place-items: center; transition: scale var(--t-4) var(--ease-reveal);
  background: radial-gradient(120% 90% at 15% 10%, hsl(var(--h1) 78% 58%), transparent 60%), radial-gradient(110% 100% at 90% 95%, hsl(var(--h2) 80% 52%), transparent 62%), hsl(var(--h1) 30% 12%); }
.cm-art::before { content: ""; position: absolute; inset: 0; opacity: 0.38; mix-blend-mode: overlay; }
.cm-art-game::before { background-image: linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px); background-size: 14px 14px; }
.cm-art-creation::before { background-image: repeating-radial-gradient(circle at 70% 40%, rgba(255,255,255,.55) 0 1px, transparent 1px 22px); }
.cm-art-vr::before { background-image: linear-gradient(rgba(255,255,255,.55) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.55) 1px, transparent 1px); background-size: 28px 28px; transform: perspective(220px) rotateX(58deg) scale(2.2); transform-origin: 50% 100%; -webkit-mask-image: linear-gradient(transparent 35%, #000); mask-image: linear-gradient(transparent 35%, #000); }
.cm-art-template::before { background-image: linear-gradient(90deg, transparent 0 32%, rgba(255,255,255,.5) 32% calc(32% + 1px), transparent 0), linear-gradient(transparent 0 26%, rgba(255,255,255,.5) 26% calc(26% + 1px), transparent 0 74%, rgba(255,255,255,.5) 74% calc(74% + 1px), transparent 0); }
/* a promoted site without a picture: its name, not initials, at a size a whole name fits */
.cm-art.cm-art-ad span { max-width: 86%; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.cm-art span { position: relative; font-size: clamp(44px, 6vw, 72px); font-weight: 600; letter-spacing: -0.025em; color: rgba(255, 255, 255, 0.94); text-shadow: 0 6px 30px rgba(0, 0, 0, 0.35); }

.cm-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-5); border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair), var(--edge); }
.cm-empty p { margin: 0; color: var(--body); }
.cm-pager { display: flex; justify-content: center; gap: var(--s-3); margin-top: var(--s-6); }

.cm-how { margin: var(--s-8) 0 var(--s-6); padding: var(--s-6); border-radius: var(--r-panel); background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair), var(--edge); }
.cm-how h2 { margin: 0 0 var(--s-5); font-size: 22px; font-weight: 500; color: var(--text); }
.cm-how ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--s-5); margin: 0; padding: 0; list-style: none; counter-reset: cm; }
.cm-how li { counter-increment: cm; font-size: 15px; line-height: 1.55; color: var(--body); }
.cm-how li::before { content: counter(cm); display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: var(--s-3); border-radius: 50%; background: var(--raised); color: var(--text); font-weight: 600; font-size: 14px; }
.cm-how strong { color: var(--text); font-weight: 500; }

/* one item: the live stage and what it is */
.cm-crumbs { display: flex; gap: var(--s-2); margin: var(--s-5) 0 var(--s-5); font-size: 14px; color: var(--muted); }
.cm-crumbs a:hover { color: var(--text); }
.cm-item { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s-6); align-items: start; margin-bottom: var(--s-8); }
@media (max-width: 980px) { .cm-item { grid-template-columns: minmax(0, 1fr); } }
.cm-stage { margin: 0; border-radius: var(--r-card); overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair), 0 30px 80px -40px rgba(0, 0, 0, 0.6); }
.cm-chrome { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.cm-chrome i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); }
.cm-chrome span { margin-left: var(--s-3); font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-frame { display: block; width: 100%; height: min(72vh, 760px); border: 0; background: #fff; }
.cm-stage figcaption { padding: 10px 14px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }
.cm-side { position: sticky; top: 88px; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-3); }
@media (max-width: 980px) { .cm-side { position: static; } }
.cm-side h1 { margin: var(--s-1) 0 0; font-size: clamp(30px, 3.4vw, 40px); line-height: 1.08; letter-spacing: -0.02em; font-weight: 500; color: var(--text); }
.cm-by, .cm-from, .cm-stat { margin: 0; font-size: 14px; color: var(--muted); }
.cm-from a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--muted); }
.cm-desc { font-size: 16px; line-height: 1.6; color: var(--body); }
.cm-desc p { margin: 0 0 var(--s-3); }
.cm-side-acts { display: flex; flex-wrap: wrap; gap: var(--s-2); width: 100%; margin-top: var(--s-2); }
.cm-side-acts .btn { flex: 1 1 auto; }
.cm-msg { margin: 0; min-height: 1.4em; font-size: 14px; color: var(--ok); }
.cm-msg:empty { min-height: 0; }
.cm-msg a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.cm-bad { color: var(--danger); }
.cm-report { width: 100%; margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.cm-report summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.cm-report summary:hover { color: var(--text); }
.cm-report form { display: grid; gap: var(--s-2); margin-top: var(--s-3); }

/* forms: share and review */
.cm-form { display: grid; gap: var(--s-2); max-width: 640px; }
.cm-form label, .cm-report label { font-size: 14px; font-weight: 500; color: var(--text); margin-top: var(--s-2); }
.cm-form label span, .cm-report label span { font-weight: 400; color: var(--muted); }
.cm-form input:not([type=radio]), .cm-form select, .cm-form textarea, .cm-report select, .cm-report textarea, .cm-q textarea, .cm-q select {
  width: 100%; min-height: 44px; padding: 10px 14px; border: 0; border-radius: 12px; font: inherit; font-size: 15px; color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair-2), var(--edge-in); }
.cm-form textarea, .cm-report textarea, .cm-q textarea { resize: vertical; }
.cm-form :focus-visible, .cm-report :focus-visible, .cm-q :focus-visible { outline: 2px solid var(--pen); outline-offset: 1px; }
.cm-form button[type=submit] { justify-self: start; margin-top: var(--s-4); }
.cm-fine { margin: var(--s-3) 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.cm-kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); margin: 0 0 var(--s-2); padding: 0; border: 0; }
@media (max-width: 760px) { .cm-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .cm-kinds { grid-template-columns: 1fr; } }
.cm-kinds legend { margin-bottom: var(--s-3); font-size: 14px; font-weight: 500; color: var(--text); }
.cm-kinds label { margin: 0; cursor: pointer; }
.cm-kinds input { position: absolute; opacity: 0; pointer-events: none; }
.cm-kinds span { display: grid; gap: 4px; height: 100%; padding: var(--s-4); border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair-2), var(--edge); font-size: 13.5px; font-weight: 400; color: var(--muted); transition: box-shadow var(--t-1) var(--ease); }
.cm-kinds strong { font-size: 15px; font-weight: 500; color: var(--text); }
.cm-kinds input:checked + span { box-shadow: inset 0 0 0 2px var(--text); }
.cm-kinds input:focus-visible + span { outline: 2px solid var(--pen); outline-offset: 2px; }
.cm-share > .cm-msg { margin-bottom: var(--s-4); color: var(--body); }
.cm-mine { margin-top: var(--s-7); max-width: 760px; }
.cm-mine h2 { font-size: 20px; font-weight: 500; margin: 0 0 var(--s-4); color: var(--text); }
.cm-mine ul, .cm-queue, .cm-q-reports { margin: 0; padding: 0; list-style: none; }
.cm-mine-item, .cm-q { display: grid; gap: var(--s-2); padding: var(--s-4) 0; border-top: 1px solid var(--line); }
.cm-mine-item > div:first-child, .cm-q-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.cm-mine-item strong, .cm-q-head strong { color: var(--text); font-weight: 500; }
.cm-status { font-size: 13px; color: var(--muted); }
.cm-st-approved .cm-status { color: var(--ok); }
.cm-st-pending .cm-status { color: var(--warn); }
.cm-st-rejected .cm-status, .cm-st-removed .cm-status { color: var(--danger); }
.cm-reason { margin: 0; font-size: 14px; color: var(--body); }
.cm-mine-acts, .cm-q-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.cm-q-acts select { width: auto; }
.cm-q-acts textarea { flex: 1 1 260px; min-height: 40px; }
.cm-q-who { margin: 0; font-size: 13px; color: var(--muted); }
.cm-q-sum { margin: 0; font-size: 15px; line-height: 1.5; color: var(--body); white-space: pre-line; }
.cm-q-reports li { font-size: 13.5px; color: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  .cm-card-link, .cm-shot, .cm-art, .cm-tabs a { transition: none; }
  a.cm-card-link:hover { translate: none; }
  a.cm-card-link:hover .cm-shot, a.cm-card-link:hover .cm-art { scale: none; }
}
