/* JumPHP playground: a night-blue arcade cabinet, yellow buttons, pixels where it helps. */
:root {
	--bg: #0b0e1f;
	--bg-2: #11162e;
	--panel: #161c3a;
	--panel-2: #1d2550;
	--line: #2b3670;
	--ink: #eef0fa;
	--muted: #a6afd6;
	--faint: #6f79a8;
	--yellow: #ffd23f;
	--pink: #ff4d8d;
	--cyan: #3fd0ff;
	--green: #4be08a;
	--red: #ff6b6b;
	--radius: 6px;
	--mono: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
	--rainbow: linear-gradient(90deg, #ff4d4d, #ff9f1c, #ffd23f, #4be08a, #3fd0ff, #7c5cff, #ff4d8d);
	color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
code, pre, kbd { font-family: var(--mono); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(26px, 4vw, 40px); }
h2 { font-size: clamp(20px, 2.6vw, 26px); }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.pixel { font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.stripe { height: 4px; background: var(--rainbow); }

/* --- header ----------------------------------------------------------------------------------------- */
.top { background: var(--bg-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { display: flex; align-items: baseline; gap: 8px; color: var(--ink); font: 800 22px var(--mono); letter-spacing: .08em; }
.logo:hover { text-decoration: none; }
.logo b { color: var(--yellow); text-shadow: 2px 2px 0 var(--pink); }
.logo small { font: 600 11px var(--mono); color: var(--muted); letter-spacing: .15em; text-transform: uppercase; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); padding: 6px 10px; border-radius: var(--radius); font-weight: 600; white-space: nowrap; }
.nav a:hover, .nav a.on { color: var(--ink); background: var(--panel); text-decoration: none; }
.search { flex: 1; min-width: 110px; max-width: 360px; margin-left: auto; }
.me { display: flex; align-items: center; gap: 8px; }
.me img { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); }
.me form { margin: 0; }
.lang { display: flex; align-items: center; gap: 4px; }
.lang a { display: flex; padding: 3px; border-radius: 4px; border: 2px solid transparent; opacity: .55; line-height: 0; }
.lang a:hover { opacity: 1; }
.lang a.on { opacity: 1; border-color: var(--line); }
.lang svg { display: block; border-radius: 2px; }
@media (max-width: 720px) {
	.top .wrap { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
	.search { order: 5; max-width: none; flex-basis: 100%; }
	.nav { order: 4; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; }
	.nav a { padding: 6px 7px; }
	.logo small { display: none; }
}

/* --- forms and buttons ------------------------------------------------------------------------------ */
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 11px; width: 100%; }
input[type=checkbox] { width: auto; }
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }
label { display: block; font-weight: 600; margin: 0 0 6px; }
label.inline { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.field { margin-bottom: 18px; }
.field .hint { font-size: 14px; color: var(--muted); margin-top: 4px; }
.btn { display: inline-flex; align-items: center; gap: 8px; font: 700 15px var(--sans); padding: 10px 18px; border-radius: var(--radius); border: 2px solid var(--line);
	background: var(--panel); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--yellow); color: #17130a; border-color: #17130a; box-shadow: 4px 4px 0 var(--pink); }
.btn.primary:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--pink); }
.btn.big { font-size: 19px; padding: 14px 28px; }
.btn.small { font-size: 13px; padding: 6px 11px; }
.btn.danger { border-color: var(--red); color: var(--red); background: transparent; }
.btn[disabled] { opacity: .5; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions form { margin: 0; }

/* --- flashes, panels, badges ------------------------------------------------------------------------ */
.flash { padding: 12px 16px; border-radius: var(--radius); margin: 16px 0; white-space: pre-line; border: 1px solid; }
.flash.success { background: #10301f; border-color: var(--green); }
.flash.error { background: #3a1420; border-color: var(--red); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 22px; }
.panel + .panel { margin-top: 18px; }
.panel h2 { font-size: 20px; }
.badge { display: inline-block; font: 700 12px var(--mono); letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: var(--panel-2); color: var(--muted); }
.badge.ready { background: #123d27; color: var(--green); }
.badge.error { background: #45121f; color: var(--red); }
.badge.creating, .badge.empty { background: #403710; color: var(--yellow); }
.chip { display: inline-block; padding: 5px 12px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 14px; }
.chip:hover, .chip.on { color: var(--ink); border-color: var(--yellow); text-decoration: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
pre.code { background: #070914; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; overflow-x: auto; font-size: 14px; white-space: pre-wrap; }
.cmd { display: flex; gap: 10px; align-items: flex-start; background: #070914; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; }
.cmd code { flex: 1; white-space: pre-wrap; word-break: break-all; font-size: 14px; }
.cmd .btn { flex: none; }

/* --- page layout ------------------------------------------------------------------------------------ */
main { flex: 1; }
.section { padding: 36px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.hero { padding: 48px 0 30px; }
.hero h1 { font-family: var(--mono); letter-spacing: .02em; max-width: 860px; }
.hero h1 em { font-style: normal; color: var(--yellow); text-shadow: 3px 3px 0 var(--pink); }
.hero p.lead { font-size: clamp(17px, 2vw, 20px); color: var(--muted); max-width: 720px; }
.steps { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); counter-reset: step; }
.steps .panel { padding: 18px; margin: 0; }
.steps .panel::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 30px; height: 30px; margin-bottom: 8px;
	border-radius: 50%; background: var(--yellow); color: #17130a; font: 800 15px var(--mono); }
.two { display: grid; gap: 24px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } }
footer.bottom { border-top: 1px solid var(--line); background: var(--bg-2); padding: 26px 0 32px; color: var(--muted); font-size: 14px; margin-top: 40px; }
footer.bottom .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
body.full footer.bottom { display: none; }

/* --- game cards ------------------------------------------------------------------------------------- */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; color: var(--ink); transition: transform .12s, border-color .12s; }
.card:hover { transform: translateY(-3px); border-color: var(--yellow); text-decoration: none; }
.thumb { aspect-ratio: 16 / 9; background: #070914; position: relative; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.thumb .placeholder { position: absolute; inset: 0; display: grid; place-items: center; font: 800 clamp(18px, 2.4vw, 26px) var(--mono); letter-spacing: .05em; padding: 12px; text-align: center;
	color: #fff; text-shadow: 3px 3px 0 rgba(0, 0, 0, .45); background: linear-gradient(135deg, hsl(var(--h) 70% 38%), hsl(calc(var(--h) + 60) 70% 22%)); }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { margin: 0; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-top: auto; padding-top: 4px; }
.card .meta img { width: 20px; height: 20px; border-radius: 50%; }
.card .cat { font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--yellow); }
.cats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.cats a { display: block; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.cats a:hover { border-color: var(--yellow); text-decoration: none; }
.cats strong { display: block; font-size: 19px; }
.cats span { color: var(--muted); font-size: 14px; }
.cats em { float: right; font: 700 13px var(--mono); font-style: normal; color: var(--yellow); }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 28px; }
.empty-state { text-align: center; padding: 40px 16px; color: var(--muted); }

/* --- a game ----------------------------------------------------------------------------------------- */
.gamebar { background: var(--bg-2); border-bottom: 1px solid var(--line); }
.gamebar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding-top: 8px; padding-bottom: 8px; max-width: none; }
.gamebar h1 { font-size: 18px; margin: 0; }
.gamebar .by { color: var(--muted); font-size: 14px; }
.gamebar .actions { margin-left: auto; gap: 6px; }
.frame { width: 100%; border: 0; display: block; background: #000; height: calc(100vh - 116px); min-height: 360px; }
.game-hero { display: grid; gap: 28px; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: center; padding: 36px 0; }
.game-hero .thumb { border-radius: 10px; border: 1px solid var(--line); }
@media (max-width: 860px) { .game-hero { grid-template-columns: 1fr; } .frame { height: calc(100vh - 150px); } }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; word-break: break-word; }

/* --- sources ---------------------------------------------------------------------------------------- */
.crumbs { font-family: var(--mono); font-size: 15px; margin: 18px 0; word-break: break-all; }
.crumbs a { color: var(--yellow); }
table.files { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.files td { padding: 8px 14px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 14px; }
table.files tr:first-child td { border-top: 0; }
table.files td.size { text-align: right; color: var(--faint); white-space: nowrap; }
pre.source { counter-reset: line; background: #070914; border: 1px solid var(--line); border-radius: 10px; padding: 12px 0; overflow-x: auto; font-size: 13.5px; line-height: 1.55; margin: 0; }
pre.source span { display: block; padding: 0 16px 0 0; white-space: pre; }
pre.source span::before { counter-increment: line; content: counter(line); display: inline-block; width: 52px; padding-right: 14px; margin-right: 12px; text-align: right; color: var(--faint); border-right: 1px solid var(--line); user-select: none; }
.preview-img { background: repeating-conic-gradient(#1a1f3c 0 25%, #12162c 0 50%) 0 0 / 16px 16px; padding: 18px; border-radius: 10px; border: 1px solid var(--line); }
.preview-img img { image-rendering: pixelated; margin: 0 auto; max-height: 70vh; }

/* --- editor ----------------------------------------------------------------------------------------- */
/* the editor fills what the header and the bar leave of the window, whatever their height */
@media (min-width: 961px) {
	body.full:has(#editor) { height: 100vh; height: 100dvh; }
	body.full:has(#editor) main { display: flex; flex-direction: column; min-height: 0; }
}
.editor { display: grid; grid-template-columns: 250px minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); flex: 1; min-height: 480px; }
.editor.no-preview { grid-template-columns: 250px minmax(0, 1fr); }
.editor.no-preview .ed-preview { display: none; }
.ed-tree { overflow: auto; border-right: 1px solid var(--line); background: var(--bg-2); font: 13px/1.4 var(--mono); padding: 6px 0; }
.ed-tree details > summary { cursor: pointer; padding: 3px 10px; color: var(--muted); list-style: none; white-space: nowrap; }
.ed-tree details > summary::-webkit-details-marker { display: none; }
.ed-tree details > summary::before { content: '▸ '; }
.ed-tree details[open] > summary::before { content: '▾ '; }
.ed-tree .children { padding-left: 12px; }
.ed-tree a { display: block; padding: 3px 10px 3px 22px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-tree a:hover { background: var(--panel); text-decoration: none; }
.ed-tree a.on { background: var(--panel-2); color: var(--yellow); }
.ed-tree a.modified::after, .ed-tree a.added::after { content: ' ●'; color: var(--yellow); }
.ed-tree a.added { color: var(--green); }
.ed-tree a.deleted { color: var(--faint); text-decoration: line-through; }
.ed-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ed-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--bg-2); font: 13px var(--mono); min-height: 44px; flex-wrap: wrap; }
.ed-head .path { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-code { flex: 1; overflow: hidden; min-height: 0; }
.ed-code .cm-editor { height: 100%; }
.ed-empty { display: grid; place-items: center; height: 100%; color: var(--muted); padding: 24px; text-align: center; }
.ed-preview { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ed-preview iframe { flex: 1; width: 100%; border: 0; background: #000; }
.ed-status { font: 12px var(--mono); color: var(--muted); }
@media (max-width: 960px) {
	.editor, .editor.no-preview { grid-template-columns: 1fr; height: auto; }
	.ed-tree { max-height: 220px; border-right: 0; border-bottom: 1px solid var(--line); }
	.ed-code { height: 60vh; flex: none; }
	.ed-preview { border-left: 0; height: 60vh; }
}
dialog { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 22px; width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(5, 6, 15, .7); }

/* --- the wall of games (/games) ------------------------------------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wall-top { width: 100%; box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 18px 16px; max-width: 1600px; margin: 0 auto; }
.wall-top h1 { margin: 0; font-size: 22px; }
.sorts { display: flex; flex-wrap: wrap; gap: 6px; }
.sorts a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 14px; }
.sorts a:hover { color: var(--ink); text-decoration: none; border-color: var(--yellow); }
.sorts a.on { background: var(--yellow); border-color: var(--yellow); color: #111; font-weight: 700; }
.wall { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); padding: 0 16px 40px; max-width: 1600px; margin: 0 auto; }
.tile { position: relative; display: block; border-radius: 8px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); color: var(--ink); transition: transform .12s, border-color .12s; }
.tile:hover, .tile:focus-visible { transform: scale(1.03); border-color: var(--yellow); text-decoration: none; z-index: 1; }
.tile .name { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 10px; }
.tile .name span { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .name small { color: var(--muted); font-size: 12px; white-space: nowrap; display: flex; gap: 6px; }
.stars-mini { color: var(--yellow); font-weight: 700; }

/* --- marks: the stars of a game --------------------------------------------------------------------- */
.rate { display: flex; align-items: center; gap: 8px; }
.rate .stars { display: inline-flex; }
.rate .stars button { background: none; border: 0; padding: 0 1px; font-size: 20px; line-height: 1; color: #4a4f6b; cursor: pointer; }
.rate .stars:hover button { color: var(--yellow); }
.rate .stars button:hover ~ button { color: #4a4f6b; }
.rate .stars button.on { color: var(--yellow); }
.rate .avg { color: var(--ink); font-weight: 700; font-size: 14px; }
.rate .avg small { color: var(--muted); font-weight: 400; }

/* --- sharing a game --------------------------------------------------------------------------------- */
.share { position: relative; display: inline-flex; }
.share > button { display: inline-flex; align-items: center; gap: 6px; }
.share-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; min-width: 190px; display: flex; flex-direction: column;
	background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 12px 30px #0009; }
.share-menu[hidden] { display: none; }
.share-menu a, .share-menu button { padding: 8px 12px; border-radius: 6px; color: var(--ink); font: inherit; font-size: 14px; text-align: left; background: none; border: 0; cursor: pointer; }
.share-menu a:hover, .share-menu button:hover { background: var(--bg-2); text-decoration: none; }

/* --- a game installed as an app: only the game --------------------------------------------------------- */
.install { position: relative; display: inline-flex; }
.install[hidden] { display: none; }
.install > button { display: inline-flex; align-items: center; gap: 6px; }
.install-help { width: 260px; }
.install-help p { margin: 6px 8px; font-size: 14px; line-height: 1.5; }
@media (display-mode: standalone), (display-mode: fullscreen) {
	body.full .stripe, body.full header.top, body.full .gamebar { display: none; }
	body.full .frame { height: 100vh; height: 100dvh; }
}

.private-list { list-style: none; margin: 8px 0; padding: 0; max-height: 240px; overflow: auto; font-size: 13px; }
.private-list li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.private-list code { word-break: break-all; }

/* --- the documentation ---------------------------------------------------------------------------------- */
.docs-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 40px; align-items: start; }
.docs-nav { position: sticky; top: 16px; font-size: 14px; }
.docs-nav h2 { font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--yellow); margin: 18px 0 6px; }
.docs-nav h2:first-child { margin-top: 0; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav li a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--muted); }
.docs-nav li a:hover { color: var(--ink); text-decoration: none; background: var(--panel); }
.docs-nav li a.on { color: var(--ink); background: var(--panel); border-left: 3px solid var(--yellow); }
.doc { max-width: 820px; line-height: 1.7; font-size: 16px; }
.doc h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.2; margin: 0 0 18px; }
.doc h2 { font-size: 22px; margin: 36px 0 10px; }
.doc { min-width: 0; }
.doc p, .doc li { color: #cfd3ea; overflow-wrap: anywhere; }
.doc code { font: 14px var(--mono); background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.doc pre { background: #070914; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; overflow-x: auto; line-height: 1.5; }
.doc pre code { background: none; border: 0; padding: 0; font-size: 13.5px; color: #e6e9ff; }
.doc table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; display: block; overflow-x: auto; }
.doc th, .doc td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc th { color: var(--yellow); font-weight: 700; }
.doc blockquote { margin: 16px 0; padding: 10px 16px; border-left: 3px solid var(--pink); background: var(--panel); border-radius: 0 8px 8px 0; }
.doc-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); }
@media (max-width: 860px) {
	.docs-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.docs-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px 14px; }
	.docs-nav h2 { width: 100%; margin: 10px 0 2px; }
	.docs-nav ul { display: flex; flex-wrap: wrap; gap: 2px; flex: 1 1 100%; min-width: 0; }
	.docs-nav li a { white-space: nowrap; }
}

/* --- what the players say: comments, the idea box, issues ------------------------------------------- */
.comments { max-width: 860px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--yellow); }
.tabs a small { color: var(--faint); font-weight: 400; }
.comment-form textarea { min-height: 100px; }
.comments > p.muted { margin-top: 14px; }
.comment-form .who { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.comment-form .who img { width: 36px; height: 36px; border-radius: 50%; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.comment-list { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.comment { display: flex; gap: 12px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.comment.pending { border-style: dashed; border-color: var(--yellow); }
.comment.resolved { opacity: .7; }
.comment .avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--panel-2); color: var(--muted); font: 700 18px var(--mono); }
.comment .avatar:hover { text-decoration: none; }
.comment .avatar img { width: 100%; height: 100%; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 14px; margin-bottom: 4px; }
.comment-body p { margin: 0 0 8px; overflow-wrap: anywhere; }
.comment-body .actions { gap: 6px; }
.comment-list.compact .comment { padding: 10px 12px; }
.comment-list.compact .avatar { width: 32px; height: 32px; font-size: 15px; }

/* --- a developer's page ------------------------------------------------------------------------------- */
.profile-head { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.profile-avatar { width: 120px; height: 120px; border-radius: 50%; border: 3px solid var(--yellow); box-shadow: 4px 4px 0 var(--pink); display: grid; place-items: center; background: var(--panel); font: 800 48px var(--mono); }
.profile-head h1 { margin-bottom: 4px; }
dl.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
dl.stats div { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; }
dl.stats dt { font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
dl.stats dd { margin: 0; font: 800 20px var(--mono); }

/* --- the studio: private notes and tasks ---------------------------------------------------------------- */
.todo-list { list-style: none; margin: 0 0 8px; padding: 0; font-size: 14px; max-height: 320px; overflow: auto; }
.todo-list li { padding: 3px 0; }
.todo-list li.done { color: var(--faint); text-decoration: line-through; }
details.note { margin-top: 8px; }
details.note summary { cursor: pointer; }
details.note pre { max-height: 400px; overflow: auto; font-size: 13px; }

/* --- a game's PHPUnit tests (studio) -------------------------------------------------------------------- */
.test-cases { list-style: none; margin: 0 0 24px; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.test-cases li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 4px 8px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 14px; }
.test-cases li:first-child { border-top: 0; }
.test-cases .mark { font-weight: 800; }
.test-cases li.passed .mark { color: var(--green); }
.test-cases li.failed .mark, .test-cases li.error .mark { color: var(--red); }
.test-cases li.skipped .mark { color: var(--faint); }
.test-cases pre { grid-column: 2; margin: 4px 0 0; font-size: 12.5px; }
.test-output { max-height: 60vh; overflow: auto; font-size: 13px; }
.films { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin: 0 0 24px; }
.film { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.film.passed { border-color: color-mix(in srgb, var(--green) 50%, var(--line)); }
.film.failed, .film.error { border-color: var(--red); }
.film-pic { display: block; background: #000; }
.film img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; image-rendering: pixelated; }
.film figcaption { padding: 8px 12px 0; font-size: 14px; }
.film figcaption small { display: block; overflow-wrap: anywhere; }
.film .mark { font-weight: 800; }
.film.passed .mark { color: var(--green); }
.film.failed .mark, .film.error .mark { color: var(--red); }
.film-ctrl { display: flex; align-items: center; gap: 8px; padding: 8px 12px 10px; }
.film-ctrl input { flex: 1; min-width: 0; }
.film-ctrl span { font-size: 12px; font-variant-numeric: tabular-nums; }
.film pre { margin: 0 12px 12px; font-size: 12px; max-height: 160px; overflow: auto; }
.shared-play { background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; max-height: 75vh; }
.shared-play iframe { display: block; width: 100%; height: 100%; border: 0; }
.shared-files { columns: 2 260px; margin: 10px 0; }
.share-url { display: flex; gap: 8px; }
.share-url input { flex: 1; min-width: 0; }
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; font-size: 17px; text-decoration: none; filter: grayscale(1); opacity: .75; }
.bell:hover, .bell.on { filter: none; opacity: 1; }
.bell-count { position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font: 700 11px/18px system-ui, sans-serif; text-align: center; }
.notes-list { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.notes-list > li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.notes-list > li:first-child { border-top: 0; }
.notes-list > li.new { box-shadow: inset 3px 0 0 var(--accent, var(--green)); }
.notes-list .who img, .notes-list .who span { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--line); font-size: 18px; }
.notes-list .head { font-size: 14px; }
.notes-list .body { white-space: pre-line; overflow-wrap: anywhere; margin: 4px 0; }
.notes-list .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.notes-list .acts form { margin: 0; }
.tabs-inline { display: flex; gap: 8px; margin: 0 0 14px; }
.film-pic { cursor: zoom-in; }
.theater { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; color: #fff; }
.theater[open] { display: flex; flex-direction: column; }
.theater::backdrop { background: #000; }
.theater-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 15px; }
.theater-head b { flex: 1; }
.theater.passed .mark { color: var(--green); }
.theater.failed .mark, .theater.error .mark { color: var(--red); }
.theater-pic { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.theater-pic img { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.theater-ctrl { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px 16px; }
.theater-ctrl input[type=range] { flex: 1; min-width: 160px; max-width: 700px; }
.theater-ctrl .count { font-variant-numeric: tabular-nums; min-width: 70px; }
.theater-ctrl select { width: auto; }
.ed-live { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.ed-live input { width: auto; margin: 0; }
.versions { list-style: none; margin: 0 0 18px; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.versions > li { padding: 12px 14px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.versions > li:first-child { border-top: 0; }
.versions > li.live { box-shadow: inset 3px 0 0 var(--green); }
.v-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; overflow-wrap: anywhere; }
.v-acts, .version-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.v-acts form, .version-bar form { margin: 0; }
.version-bar { padding: 8px 16px; background: color-mix(in srgb, var(--red) 18%, var(--panel)); border-bottom: 1px solid var(--line); font-size: 14px; }
.version-bar > span { flex: 1; min-width: 240px; }
.version-bar + .frame { height: calc(100vh - 160px); }

/* --- a game's statistics (studio/stats) ------------------------------------------------------------- */
.stat-tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); margin: 18px 0; }
.stat-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.stat-tile b { font: 700 30px/1.2 var(--mono); color: var(--ink); }
.stat-chart { margin-top: 18px; }
.bars { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 140px; border-bottom: 1px solid var(--line); padding-top: 18px; }
.bars-top { position: absolute; top: 0; left: 0; font-size: 12px; }
.bar { flex: 1; min-width: 0; height: var(--h); background: var(--cyan); border-radius: 4px 4px 0 0; position: relative; outline: none; }
.bar.zero { height: 2px; background: var(--line); }
.bar::before { content: ""; position: absolute; inset: -140px -1px 0; } /* hit area: the whole column */
.bar:hover, .bar:focus-visible { filter: brightness(1.25); }
.bar:hover::after, .bar:focus-visible::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--bg-2); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 8px; font: 12px var(--mono); z-index: 2; pointer-events: none; }
.bars-axis { display: flex; justify-content: space-between; font-size: 12px; margin-top: 4px; }
.spread { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 8px; font-size: 14px; }
.spread-bar { height: 10px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.spread-bar span { display: block; height: 100%; background: var(--yellow); border-radius: 4px; }
details.panel summary { cursor: pointer; }

/* --- the editor's console (what the game's PHP writes) ---------------------------------------------- */
.ed-console { border-top: 1px solid var(--line); background: var(--bg-2); display: flex; flex-direction: column; min-height: 0; }
.ed-console[open] { height: 42%; }
.ed-console summary { display: flex; align-items: center; gap: 8px; padding: 6px 12px; cursor: pointer; font: 600 13px var(--mono); color: var(--muted); list-style: none; }
.ed-console summary::-webkit-details-marker { display: none; }
.ed-console summary::before { content: "▸"; transition: transform .15s; }
.ed-console[open] summary::before { transform: rotate(90deg); }
.ed-console summary .btn { margin-left: auto; }
.ed-console:not([open]) summary .btn { display: none; }
.ed-console-count { background: var(--panel-2); color: var(--ink); border-radius: 99px; padding: 0 7px; font-size: 12px; }
.ed-console-count.err { background: #45121f; color: var(--red); }
.ed-console-log { flex: 1; overflow: auto; padding: 4px 12px 10px; min-height: 0; }
.ed-console-log pre { margin: 0; padding: 0; background: none; border: 0; font: 12px/1.45 var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.ed-console-log pre.err { color: var(--red); }
.ed-console-log .sep { font: 11px var(--mono); color: var(--faint); border-top: 1px dashed var(--line); margin: 6px 0 2px; padding-top: 2px; }
.ed-console-log iframe { width: 100%; height: 60vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin: 4px 0; }
