/* Launch Tab. A yellow frame holds a side menu and one big white sheet. On phones the menu
   becomes a bar along the bottom. Games sit in a mosaic with the name on each tile. */
@font-face { font-family: "Lilita One"; src: url(/fonts/lilita.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Rubik"; src: url(/fonts/rubik.woff2) format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Martian Mono"; src: url(/fonts/martian-mono.woff2) format("woff2"); font-weight: 100 800; font-display: swap; }
:root {
  --ink: #1d1a3b; --soft: #686590; --line: #e8e6f5; --wash: #f5f4fc; --white: #fff;
  --sun: #ffd028; --sun-edge: #e0a900; --sun-light: #ffe27a;
  --grape: #6a4dff; --grape-edge: #4830c4;
  --night: #1d1a3b; --night-lift: #2e2a58; --night-edge: #0f0d24;
  --arcade: #f4474d; --puzzle: #6a4dff; --idle: #0fa968; --sports: #1389e8; --platformer: #f07a0c; --other: #686590; --action: #d92f7a; --racing: #0a9fb0; --sandbox: #a8691f; --strategy: #5a8f1d;
  --display: "Lilita One", "Arial Black", system-ui, sans-serif;
  --body: "Rubik", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Martian Mono", ui-monospace, Consolas, Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--sun); }
body { margin: 0; background: var(--sun); color: var(--ink); font: 400 16px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 400; line-height: 1.05; letter-spacing: .005em; text-wrap: balance; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--grape); outline-offset: 2px; }
img { max-width: 100%; display: block; }
svg.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--soft); }
[data-cat] { --cat: var(--other); }
[data-cat="Arcade"] { --cat: var(--arcade); } [data-cat="Puzzle"] { --cat: var(--puzzle); } [data-cat="Idle"] { --cat: var(--idle); }
[data-cat="Sports"] { --cat: var(--sports); } [data-cat="Platformer"] { --cat: var(--platformer); }
[data-cat="Action"] { --cat: var(--action); } [data-cat="Racing"] { --cat: var(--racing); } [data-cat="Sandbox"] { --cat: var(--sandbox); } [data-cat="Strategy"] { --cat: var(--strategy); }

/* Frame */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 22px; overflow-y: auto; scrollbar-width: none; }
.logo { display: flex; align-items: center; gap: 10px; padding: 0 8px; text-decoration: none; font: 400 25px/1 var(--display); white-space: nowrap; }
.logo i { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--ink); flex: none; }
.logo svg { width: 22px; height: 17px; fill: var(--sun); }
.menu { display: grid; gap: 4px; }
.menu a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; text-decoration: none; font-weight: 600; }
.menu a:hover { background: var(--sun-light); }
.menu a[aria-current] { background: var(--white); box-shadow: 0 3px 0 var(--sun-edge); }
.menu a b { margin-left: auto; font-weight: 500; opacity: .6; font-variant-numeric: tabular-nums; }
.menu .dot { width: 22px; display: grid; place-items: center; }
.menu .dot::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--cat); box-shadow: 0 0 0 3px var(--white); }
#side-cats:not(:empty) { padding-top: 18px; border-top: 2px solid rgba(29, 26, 59, .12); }
.legal { margin-top: auto; padding: 0 12px; display: flex; gap: 16px; font-size: 14px; font-weight: 500; }
.legal a { text-decoration: none; opacity: .75; }
.legal a:hover { opacity: 1; text-decoration: underline; }
.sheet { min-width: 0; margin: 12px 12px 12px 0; padding: 38px clamp(22px, 3.4vw, 46px) 46px; border-radius: 34px; background: var(--white); display: grid; grid-template-columns: minmax(0, 1fr); gap: 38px; align-content: start; }
.sheet > .legal { display: none; }

/* Buttons and fields */
.btn { --edge: var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 8px 20px; border: 2px solid var(--line); border-radius: 14px; background: var(--white); color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; box-shadow: 0 4px 0 var(--edge); transition: transform .08s, box-shadow .08s, filter .12s; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--edge); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.sun { --edge: var(--sun-edge); border-color: var(--sun); background: var(--sun); }
.btn.dim { --edge: var(--night-edge); border-color: var(--night-lift); background: var(--night-lift); color: #fff; }
.btn.small { min-height: 40px; padding: 6px 15px; border-radius: 12px; font-size: 15px; box-shadow: 0 3px 0 var(--edge); }
.btn.small:active { transform: translateY(3px); }
.btn.big { min-height: 60px; padding: 12px 54px; border-radius: 18px; font: 400 26px/1 var(--display); }

/* Home */
.split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(26px, 3.4vw, 46px); align-items: start; }
.split.solo { grid-template-columns: minmax(0, 1fr); max-width: 980px; }
.col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 46px; }
.head h1, .head h2 { font-size: clamp(30px, 3vw, 40px); }
.head h1:has(.count) { white-space: nowrap; }
.lead { margin-top: -12px; font-size: 18px; color: var(--soft); }
.editor { display: flex; flex-direction: column; overflow: hidden; border-radius: 26px; background: var(--night); color: #fff; box-shadow: 0 6px 0 var(--night-edge); }
.editor header { display: flex; align-items: center; gap: 10px; padding: 12px; }
.addr { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 16px; border-radius: 14px; background: var(--night-lift); font: 500 13px/1 var(--mono); }
.addr i { width: 10px; height: 10px; border-radius: 50%; background: var(--sun); flex: none; }
.addr #count { margin-left: auto; color: #aaa6da; font-weight: 400; white-space: nowrap; }
.editor header .btn { padding: 8px 28px; font-size: 17px; font-weight: 700; }
#code { flex: 1; display: block; width: 100%; min-height: 340px; padding: 10px 24px 16px; border: 0; resize: vertical; outline-offset: -4px; background: transparent; color: #fff; font: 400 13.5px/1.75 var(--mono); tab-size: 2; white-space: pre; overflow: auto; }
#code::placeholder { color: #8d89c0; }
#code:focus-visible { outline-color: var(--sun); }
.editor footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 12px 18px; }
.save { display: flex; gap: 8px; margin-left: auto; flex: 0 1 300px; min-width: 0; }
.field { flex: 1; min-width: 0; min-height: 40px; padding: 6px 14px; border: 2px solid var(--night-lift); border-radius: 12px; background: var(--night-edge); color: #fff; }
.field::placeholder { color: #8d89c0; }
.field:focus-visible { outline-color: var(--sun); }
#status { flex-basis: 100%; padding: 0 6px; color: var(--sun); font-weight: 500; }
#status:empty { display: none; }
#status button { margin-left: 10px; padding: 4px 12px; border: 0; border-radius: 10px; background: var(--night-lift); color: #fff; font-weight: 600; }
.savedrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.savedrow h2 { font: 600 16px/1.3 var(--body); letter-spacing: 0; }
#snips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
#snips li { display: flex; align-items: center; border-radius: 999px; background: var(--wash); border: 2px solid var(--line); overflow: hidden; }
#snips button { border: 0; background: transparent; font-weight: 500; }
#snips .load { max-width: 220px; padding: 6px 4px 6px 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#snips .del { padding: 6px 12px 6px 8px; color: var(--soft); font-size: 18px; line-height: 1; }
#snips button:hover { color: var(--grape); }

.ad { display: grid; justify-items: center; gap: 6px; }
.ad iframe { display: block; max-width: 100%; border: 0; border-radius: 10px; }
.ad small { color: var(--soft); font-size: 13px; }
[id^="ad-"]:empty { display: none; }

/* Game mosaic */
.mosaic { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-auto-flow: dense; gap: 16px; }
.mosaic.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mosaic.row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.game { position: relative; display: block; aspect-ratio: 1; border-radius: 22px; background: var(--wash); text-decoration: none; box-shadow: 0 5px 0 rgba(29, 26, 59, .15); transition: transform .16s cubic-bezier(.3, 1.7, .5, 1), box-shadow .14s; }
.game .cover { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
.game img { width: 100%; height: 100%; object-fit: cover; }
.game { container-type: inline-size; }
.game.plain .cover { background: radial-gradient(120% 90% at 20% 0%, rgba(255, 255, 255, .28), transparent 60%), var(--cat); }
.game .letter { position: absolute; inset: 0; display: grid; place-items: center; padding: 6%; color: #fff; font: 400 16cqw/1.08 var(--display); text-align: center; overflow-wrap: break-word; text-shadow: 0 2px 0 rgba(29, 26, 59, .22); }
.game.plain b { display: none; }
.game .go, .game small { display: none; }
.game b { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 5px 11px 5px 9px; display: block; border-radius: 14px; background: var(--white); font-weight: 600; font-size: 14px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 0 rgba(29, 26, 59, .2); }
.game b::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; background: var(--cat); }
@media (hover: hover) { .game:hover b { white-space: normal; } }
.game:hover, .game:focus-visible { transform: translateY(-5px) rotate(-2deg) scale(1.03); box-shadow: 0 11px 0 rgba(29, 26, 59, .15); z-index: 1; }
.mosaic.three .game:first-child, .mosaic .game.big { grid-column: span 2; grid-row: span 2; border-radius: 28px; }
.mosaic.three .game:first-child b, .mosaic .game.big b { left: 12px; bottom: 12px; padding: 7px 15px 7px 12px; font-size: 18px; }

/* Games page */
.search { position: relative; flex: 1 1 280px; max-width: 420px; }
.search input { width: 100%; min-height: 52px; padding: 10px 18px 10px 50px; border: 2px solid var(--line); border-radius: 16px; background: var(--wash); font-weight: 500; }
.search input::placeholder { color: var(--soft); }
.search svg { position: absolute; left: 17px; top: 15px; }
.count { display: inline-block; margin-left: 12px; padding: 3px 12px; border-radius: 999px; background: var(--sun); font: 600 16px/1.5 var(--body); letter-spacing: 0; vertical-align: middle; }
.pills { display: none; gap: 8px; overflow-x: auto; margin: -16px -16px 0; padding: 2px 16px 8px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.chat { width: 100%; max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; min-height: calc(100dvh - 150px); }
.chat.empty { justify-content: center; gap: 22px; padding-bottom: 8vh; }
.chat { position: relative; }
.head-btns { display: flex; align-items: center; gap: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.msg-actions .by { align-self: center; margin-left: 6px; color: var(--soft); font-size: 12px; }
.chat.empty .head { position: absolute; top: 0; right: 0; }
.chat.empty .head h1, .chat.empty #new, .chat.empty .chat-log, .chat:not(.empty) .greet { display: none; }
.chat.empty .chat-form { position: static; }
.greet { color: var(--ink); text-align: center; font-size: clamp(30px, 4vw, 44px); }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 22px; padding-bottom: 28px; }
.turn { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 16px; }
.turn:last-child { min-height: calc(100dvh - 190px); }
.msg { max-width: 86%; padding: 12px 16px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.msg.user { align-self: flex-end; background: var(--grape); color: #fff; border-bottom-right-radius: 6px; }
.msg.bot { align-self: flex-start; background: var(--wash); border-bottom-left-radius: 6px; }
.msg.wait { padding: 6px 4px; background: none; font-weight: 500; }
.shimmer { width: fit-content; color: transparent; background: linear-gradient(90deg, var(--soft) 30%, #d5d3ea 50%, var(--soft) 70%) 100% 0 / 300% 100%; -webkit-background-clip: text; background-clip: text; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position: -50% 0; } }
.msg .w { animation: word .4s ease both; }
.msg .h { display: none; }
.md { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; white-space: normal; }
.md .gap { height: 6px; }
.md-h { font-weight: 700; font-size: 17px; }
.md-li { padding-left: 1.2em; text-indent: -1.2em; }
.md strong { font-weight: 700; }
.md-t { overflow-x: auto; margin: 4px 0; }
.md-t table { width: auto; border-collapse: collapse; font-size: 14px; }
.md-t th, .md-t td { padding: 6px 12px; border: 1.5px solid var(--line); text-align: left; vertical-align: top; }
.md-t th { font-weight: 700; background: rgba(106, 77, 255, .06); }
.md code { padding: 1px 5px; border-radius: 6px; background: var(--line); font: 400 13px/1.4 var(--mono); }
@keyframes word { from { opacity: 0; } }
.msg.error { background: #fde8e8; color: #9b1c1c; }
.msg pre { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--night); color: #fff; font: 400 13px/1.55 var(--mono); white-space: pre; overflow-x: auto; }
.chat-form { position: sticky; bottom: 12px; display: flex; flex-direction: column; gap: 8px; padding: 8px; border: 2px solid var(--line); border-radius: 20px; background: var(--white); }
.chat-row { display: flex; align-items: flex-end; gap: 6px; }
.attach { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--soft); cursor: pointer; }
.attach:hover { background: var(--wash); color: var(--ink); }
.attach .ic { width: 22px; height: 22px; }
#send.stop { --edge: var(--night-edge); border-color: var(--night); background: var(--night); color: #fff; }
.tray { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: flex; align-items: center; gap: 8px; max-width: 220px; padding: 4px 6px 4px 4px; border: 2px solid var(--line); border-radius: 12px; background: var(--wash); font-size: 13px; font-weight: 600; }
.chip img, .chip-pic { width: 34px; height: 34px; flex: none; border-radius: 8px; object-fit: cover; background: var(--line); }
.chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:not(:has(img)):not(:has(.chip-pic)) { padding-left: 10px; }
.chip.loading { opacity: .6; }
.chip-x { flex: none; width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--line); color: var(--ink); font-size: 11px; cursor: pointer; }
.chat-alert { margin-top: -6px; color: #9b1c1c; font-size: 14px; text-align: center; }
.msg-att { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
.msg-att img { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; background: rgba(255, 255, 255, .2); }
.file-chip { padding: 4px 10px; border-radius: 10px; background: rgba(255, 255, 255, .18); font-size: 13px; font-weight: 600; }
.msg-actions { display: flex; gap: 2px; margin-top: -6px; }
.msg-actions.mine { align-self: flex-end; }
.msg-actions.theirs { align-self: flex-start; }
.tiny { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 4px 9px; border: 0; border-radius: 9px; background: transparent; color: var(--soft); font-size: 13px; font-weight: 600; cursor: pointer; }
.tiny:hover { background: var(--wash); color: var(--ink); }
.tiny .ic { width: 16px; height: 16px; }
.tiny.icon { width: 32px; padding: 0; justify-content: center; }
.tiny.done { color: #18936f; }
@media (hover: hover) { .msg-actions { opacity: 0; transition: opacity .15s; } .turn:hover .msg-actions, .turn:focus-within .msg-actions, .turn:last-child .msg-actions.theirs { opacity: 1; } }
.chat.busy .msg-actions { visibility: hidden; }
.msg-edit { align-self: stretch; display: grid; gap: 8px; margin-left: 10%; padding: 10px; border: 2px solid var(--grape); border-radius: 18px; background: var(--white); }
.msg-edit textarea { width: 100%; padding: 6px 8px; border: 0; outline: 0; resize: vertical; background: transparent; font: inherit; }
.msg-edit-row { display: flex; justify-content: flex-end; gap: 8px; }
.code { display: grid; border-radius: 12px; overflow: hidden; background: var(--night); }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 4px 14px; background: var(--night-lift); color: #c9c6ee; font: 500 12px/1 var(--mono); text-transform: lowercase; }
.code-btns { display: flex; gap: 2px; }
.code .tiny { color: #c9c6ee; min-height: 28px; }
.code .tiny:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.code pre { border-radius: 0; }
.code pre code, .code .hljs { background: transparent; padding: 0; }
.chart { position: relative; height: 290px; padding: 12px; border-radius: 14px; background: var(--white); border: 2px solid var(--line); }
.chart:has(.chart-title) { height: 320px; padding-bottom: 40px; }
.chart.graph { height: 340px; }
.chart.graph:has(.chart-title) { height: 370px; }
.chart-title { margin-bottom: 6px; font-weight: 700; text-align: center; }
.md blockquote { margin: 2px 0; padding: 4px 0 4px 14px; border-left: 4px solid var(--grape); color: var(--soft); display: grid; gap: 4px; }
.md hr { width: 100%; border: 0; border-top: 2px solid var(--line); margin: 6px 0; }
.md a { color: var(--grape); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.md .h1 { font-size: 21px; } .md .h2 { font-size: 19px; } .md .h3, .md .h4 { font-size: 17px; }
.md-li.l1 { margin-left: 1.3em; } .md-li.l2 { margin-left: 2.6em; } .md-li.l3 { margin-left: 3.9em; }
.tex-block { overflow-x: auto; overflow-y: hidden; padding: 4px 0; text-align: center; }
.msg.user .msg-text { white-space: pre-wrap; }
.chat-form:focus-within { border-color: var(--grape); }
.chat-form textarea { flex: 1; min-width: 0; max-height: 160px; padding: 8px 10px; border: 0; outline: 0; resize: none; background: transparent; }
.chat-note { color: var(--soft); font-size: 13px; text-align: center; }
.pills button:not([data-cat]) { --cat: var(--ink); }
.pills button { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 2px solid var(--line); border-radius: 999px; background: var(--white); font-weight: 600; box-shadow: 0 3px 0 var(--line); }
.pills button::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--cat); }
.pills button[aria-pressed="true"] { border-color: var(--cat); background: var(--cat); color: #fff; box-shadow: 0 3px 0 rgba(29, 26, 59, .3); }
.pills button[aria-pressed="true"]::before { background: #fff; }
.pills span { font-weight: 400; opacity: .7; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.stack > :empty { display: none; }
.empty { padding: 30px 0; text-align: center; color: var(--soft); font-weight: 500; }

/* Game page */
body.play .shell { grid-template-columns: 76px minmax(0, 1fr); }
body.play .logo span, body.play .menu a span:not(.dot), body.play .menu a b, body.play .legal, body.play #side-cats { display: none; }
body.play .logo { padding: 0 4px; }
body.play .menu a { justify-content: center; padding: 12px 0; }
body.play .sheet { padding: 20px 22px 40px; gap: 26px; }
.playbar { display: flex; align-items: center; gap: 14px; min-width: 0; }
.playbar h1 { flex: 1; min-width: 0; font-size: 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#stage { position: relative; height: calc(100dvh - 150px); min-height: 400px; overflow: hidden; border-radius: 26px; background: #000; box-shadow: 0 6px 0 rgba(29, 26, 59, .2); }
#stage > iframe { display: block; width: 100%; height: 100%; border: 0; background: #000; }
.arena { display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.arena > #stage { flex: 1; min-width: 0; }
.ad-side { flex: none; width: 160px; position: sticky; top: 16px; }
.btn.icon { width: 44px; min-height: 40px; padding: 0; }
.btn.icon .ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn.icon .off, body.focus .btn.icon .on { display: none; }
body.focus .btn.icon .off { display: inline-flex; }
body.play.focus .shell { display: block; }
body.play.focus .side, body.play.focus .playbar h1, body.play.focus #more, body.play.focus .sheet > .legal { display: none; }
body.play.focus .sheet { margin: 0; min-height: 100vh; min-height: 100dvh; padding: 8px; gap: 8px; border-radius: 0; background: #000; }
body.play.focus .playbar { justify-content: flex-end; }
body.play.focus .arena { gap: 8px; }
body.play.focus #stage { height: calc(100dvh - 64px); min-height: 0; border-radius: 0; box-shadow: none; }
body.play.focus .ad-side { top: 8px; }
body.play.focus .ad small { display: none; }
body.play.focus .sheet:has(#ad-game.ad) #stage { height: calc(100dvh - 176px); }
.start { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 20px; overflow: hidden; background: var(--night); color: #fff; text-align: center; }
.start .wash { position: absolute; inset: -60px; width: calc(100% + 120px); max-width: none; height: calc(100% + 120px); object-fit: cover; opacity: .5; filter: blur(44px) saturate(1.5); }
.start > *:not(.wash) { position: relative; }
.start .art { width: clamp(128px, 24vh, 200px); aspect-ratio: 1; object-fit: cover; border-radius: 30px; border: 5px solid #fff; box-shadow: 0 8px 0 rgba(0, 0, 0, .3); margin-bottom: 12px; transform: rotate(-3deg); }
.start h1 { font-size: clamp(32px, 4.6vw, 54px); }
.start .muted { color: #d6d3f4; font-weight: 500; }
.start .btn { margin-top: 14px; }
#video-ad { position: absolute; inset: 0; z-index: 3; background: #000; }
#video-ad video { position: absolute; inset: 0; width: 100%; height: 100%; }
#video-ad div { position: absolute; inset: 0; }

/* Text pages */
.prose { max-width: 760px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.prose h1 { font-size: clamp(34px, 4vw, 48px); margin-bottom: 4px; }
.prose h2 { margin-top: 14px; font-size: 26px; }
.prose p { max-width: 64ch; }
.prose a:not(.btn) { color: var(--grape); font-weight: 600; }
.prose .btn { justify-self: start; }
.prose ul.names { columns: 4 170px; column-gap: 28px; padding-left: 18px; font-size: 14px; line-height: 1.7; }
.prose ul.names li { break-inside: avoid; }
.table { overflow-x: auto; border: 2px solid var(--line); border-radius: 18px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 2px solid var(--line); white-space: nowrap; }
th { background: var(--wash); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

dialog { width: min(960px, calc(100% - 32px)); height: min(680px, 90dvh); padding: 0; border: 0; border-radius: 24px; background: var(--night); color: #fff; overflow: hidden; }
dialog::backdrop { background: rgba(29, 26, 59, .7); }
dialog[open] { display: grid; grid-template-rows: auto 1fr; }
dialog > div { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 14px 20px; font-weight: 600; }
dialog iframe { width: 100%; height: 100%; border: 0; background: #fff; }

@media (max-width: 1180px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .mosaic.three { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .mosaic.three .game:first-child { grid-column: auto; grid-row: auto; border-radius: 22px; }
  .mosaic.three .game:first-child b { left: 8px; bottom: 8px; padding: 5px 11px 5px 9px; font-size: 14px; }
  .mosaic.three .game:nth-child(n+7) { display: none; }
}
@media (max-width: 860px) {
  .shell, body.play .shell { display: block; }
  .side { display: contents; }
  .logo, body.play .logo { padding: 14px 18px 12px; font-size: 23px; }
  body.play .logo span { display: inline; }
  .logo i { width: 36px; height: 36px; border-radius: 11px; }
  .logo svg { width: 20px; height: 15px; }
  #side-cats, .side .legal { display: none; }
  .chat { min-height: calc(100dvh - 230px); }
  .turn:last-child { min-height: calc(100dvh - 300px); }
  .turn { scroll-margin-top: 10px; }
  .chat-form { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .menu.main { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; gap: 0; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--white); border-top: 2px solid var(--line); }
  .menu.main a, body.play .menu.main a { flex: 1; flex-direction: column; justify-content: center; gap: 2px; padding: 6px 4px; font-size: 13px; }
  body.play .menu a span:not(.dot) { display: inline; }
  .menu.main a:hover { background: transparent; }
  .menu.main a[aria-current] { background: var(--sun); box-shadow: none; }
  .sheet, body.play .sheet { margin: 0; min-height: calc(100dvh - 62px); padding: 26px 16px calc(100px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; gap: 30px; }
  .sheet > .legal { display: flex; justify-content: center; padding-top: 6px; color: var(--soft); }
  .pills { display: flex; }
  .mosaic { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .mosaic.three, .mosaic.row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mosaic.three .game:nth-child(n+7) { display: block; }
  .game { border-radius: 18px; }
  .game b { left: 6px; bottom: 6px; max-width: calc(100% - 12px); padding: 3px 9px 3px 7px; font-size: 12.5px; }
  .game b::before { width: 7px; height: 7px; margin-right: 5px; }
  .mosaic .game.big { border-radius: 22px; }
  .mosaic .game.big b { left: 10px; bottom: 10px; font-size: 16px; padding: 5px 13px 5px 10px; }
  .editor { border-radius: 22px; }
  .editor header .btn { padding: 8px 20px; }
  .addr #count { display: none; }
  #code { min-height: 260px; padding: 8px 18px 14px; }
  .save { flex: 1 1 100%; margin-left: 0; }
  .lead { font-size: 17px; }
  body.play .sheet { padding-top: 16px; gap: 22px; }
  .playbar h1 { font-size: 24px; }
  #stage { height: calc(100dvh - 240px); min-height: 340px; border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (prefers-reduced-motion: reduce) { .shimmer { animation: none; color: var(--soft); background: none; } .msg .w { animation: none; } }
dialog.chats { width: min(520px, calc(100% - 32px)); height: auto; max-height: min(620px, 86dvh); background: var(--white); color: var(--ink); }
dialog.chats[open] { grid-template-rows: auto minmax(0, 1fr) auto; }
dialog.chats ul { list-style: none; margin: 0; padding: 0 10px; overflow-y: auto; display: grid; gap: 4px; align-content: start; }
dialog.chats li { display: flex; align-items: center; gap: 4px; }
dialog.chats .pick { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; padding: 11px 12px; border: 0; border-radius: 12px; background: none; text-align: left; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
dialog.chats .pick small { margin-left: auto; padding-left: 10px; color: var(--soft); font-weight: 400; }
dialog.chats .pick:hover, dialog.chats .pick[aria-current] { background: var(--wash); }
dialog.chats .del { flex: none; width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--soft); }
dialog.chats .del:hover { background: #fde8e8; color: #9b1c1c; }
dialog.chats footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 14px 20px; color: var(--soft); }
